cURL Examples
Use the Hypersave API directly with cURL or any HTTP client.
Authentication
All requests require an API key in the Authorization header:
curl https://api.hypersave.io/v1/memories \
-H "Authorization: Bearer YOUR_API_KEY"Save Content
Save Text
curl -X POST https://api.hypersave.io/v1/save \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Meeting notes from the product review session. Key decisions: Launch date moved to March 15th.",
"title": "Product Review Meeting",
"tags": ["meetings", "product"]
}'Save from URL
curl -X POST https://api.hypersave.io/v1/save \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/article",
"tags": ["research", "articles"]
}'Save with Metadata
curl -X POST https://api.hypersave.io/v1/save \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Important project update...",
"title": "Project Status",
"tags": ["project", "updates"],
"metadata": {
"project": "website-redesign",
"priority": "high",
"author": "john@example.com"
}
}'Ask Questions
Basic Question
curl -X POST https://api.hypersave.io/v1/ask \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "When is the product launch date?"
}'With Context
curl -X POST https://api.hypersave.io/v1/ask \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What decisions were made in recent meetings?",
"includeContext": true,
"limit": 5
}'Search
Semantic Search
curl -X POST https://api.hypersave.io/v1/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "machine learning best practices",
"limit": 10
}'Hybrid Search
curl -X POST https://api.hypersave.io/v1/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "TypeScript configuration",
"hybrid": true,
"threshold": 0.7
}'Filtered Search
curl -X POST https://api.hypersave.io/v1/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "budget",
"tags": ["finance"],
"after": "2024-01-01",
"limit": 20
}'List Memories
Get All Memories
curl "https://api.hypersave.io/v1/memories?limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"With Filters
curl "https://api.hypersave.io/v1/memories?tags=important,work&after=2024-01-01&limit=50" \
-H "Authorization: Bearer YOUR_API_KEY"Delete Memory
curl -X DELETE https://api.hypersave.io/v1/memory/doc_abc123 \
-H "Authorization: Bearer YOUR_API_KEY"Get Knowledge Graph
curl "https://api.hypersave.io/v1/graph?limit=50" \
-H "Authorization: Bearer YOUR_API_KEY"Get Entities
curl "https://api.hypersave.io/v1/entities?type=person&sortBy=mentions" \
-H "Authorization: Bearer YOUR_API_KEY"Get Facts
curl "https://api.hypersave.io/v1/facts?confidence=0.8" \
-H "Authorization: Bearer YOUR_API_KEY"Bulk Ingest
curl -X POST https://api.hypersave.io/v1/ingest \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{"content": "Document 1 content", "title": "Doc 1"},
{"content": "Document 2 content", "title": "Doc 2"},
{"url": "https://example.com/page"}
],
"async": true
}'Check Usage
curl "https://api.hypersave.io/v1/usage?period=month" \
-H "Authorization: Bearer YOUR_API_KEY"Get Profile
curl https://api.hypersave.io/v1/profile \
-H "Authorization: Bearer YOUR_API_KEY"Turbo Endpoints
Turbo Save (Faster)
curl -X POST https://api.hypersave.io/v1/turbo/save \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Quick note to save"
}'Turbo Ask (Faster)
curl -X POST https://api.hypersave.io/v1/turbo/ask \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What was that quick note?"
}'Using jq for Pretty Output
Use jq for pretty-printed JSON output.
curl -s https://api.hypersave.io/v1/memories \
-H "Authorization: Bearer YOUR_API_KEY" \
| jq '.'Extract specific fields:
curl -s -X POST https://api.hypersave.io/v1/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "meetings"}' \
| jq '.results[] | {title, score}'Shell Script Example
#!/bin/bash
# save-and-search.sh
API_KEY="YOUR_API_KEY"
BASE_URL="https://api.hypersave.io"
# Save content
save_content() {
curl -s -X POST "$BASE_URL/v1/save" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d "{\"content\": \"$1\", \"tags\": $2}"
}
# Search
search() {
curl -s -X POST "$BASE_URL/v1/search" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d "{\"query\": \"$1\"}"
}
# Usage
save_content "Important meeting today" '["meetings"]'
search "meeting" | jq '.results[].title'