Quickstart
1. Sign up
Section titled “1. Sign up”curl -X POST https://magnusdb.dev/api/auth/signup \ -H "Content-Type: application/json" \ -d '{"orgName": "acme", "email": "you@acme.com"}'Response:
{ "apiKey": "mk_live_...", "user": {...}, "tenant": {...} }Save your apiKey — it won’t be shown again.
2. Check health
Section titled “2. Check health”curl https://magnusdb.dev/api/health \ -H "Authorization: Bearer mk_live_..."3. Run a SQL query
Section titled “3. Run a SQL query”curl -X POST https://magnusdb.dev/api/sql/query \ -H "Authorization: Bearer mk_live_..." \ -H "Content-Type: application/json" \ -d '{"sql": "SELECT 1 + 1 AS result"}'4. Insert and query a document
Section titled “4. Insert and query a document”# Insertcurl -X POST https://magnusdb.dev/api/mql/insertOne \ -H "Authorization: Bearer mk_live_..." \ -H "Content-Type: application/json" \ -d '{"collection": "notes", "document": {"title": "Hello", "tags": ["intro"]}}'
# Findcurl -X POST https://magnusdb.dev/api/mql/find \ -H "Authorization: Bearer mk_live_..." \ -H "Content-Type: application/json" \ -d '{"collection": "notes", "filter": {"tags": {"$in": ["intro"]}}}'5. Store and retrieve a KV value
Section titled “5. Store and retrieve a KV value”curl -X PUT https://magnusdb.dev/api/kv/session:abc123 \ -H "Authorization: Bearer mk_live_..." \ -H "Content-Type: application/json" \ -d '{"value": "active", "ttl": 3600}'
curl https://magnusdb.dev/api/kv/session:abc123 \ -H "Authorization: Bearer mk_live_..."6. Vector upsert and search
Section titled “6. Vector upsert and search”# Upsert a vectorcurl -X POST https://magnusdb.dev/api/vector/upsert \ -H "Authorization: Bearer mk_live_..." \ -H "Content-Type: application/json" \ -d '{"id": "doc1", "text": "Magnus is a multi-model database", "metadata": {"type": "docs"}}'
# Searchcurl -X POST https://magnusdb.dev/api/vector/query \ -H "Authorization: Bearer mk_live_..." \ -H "Content-Type: application/json" \ -d '{"query": "what is Magnus", "topK": 5}'