API Reference
All tenant API requests require an X-API-Key header. Create an API key from your dashboard. Project is implicit from the key — never in the URL.
Authentication
/v1/auth/signupCreate a new end-user account.
{
"email": "user@example.com",
"password": "min8chars"
}Returns user + session_token (mms_...).
/v1/auth/loginAuthenticate an existing user.
{ "email": "...", "password": "..." }/v1/auth/logoutInvalidate a session. Send the session token as Authorization: Bearer mms_....
/v1/auth/meGet the current user. Requires Authorization: Bearer mms_.... Sessions expire 30 days after sign-in; an expired session gets 401.
/v1/auth/usersCreate a verified, passwordless user from your server. Requires a plain API key (scoped and session tokens get 403). id is optional (A-Z a-z 0-9 _ -, max 128); otherwise a UUID is generated. A later magic-link sign-in for the same email signs in as this user.
{ "email": "user@example.com", "id": "optional-id" }
→ 201 { "user": { "id", "email", "email_verified": true, "created_at" } }409 if the email or id is already taken.
/v1/auth/magic-linkStart a passwordless sign-in. With "deliver": "return" the token comes back to your server so you can email your own link; otherwise the service sends the email. Pass X-End-User-IP when calling from your server so rate limits apply per user.
{ "email": "user@example.com", "deliver": "return" }
→ { "token": "...", "expires_in": 900 }/v1/auth/verify?token=xVerify a magic link token. Returns user + session token.
Documents
/v1/collections/{name}/documentsCreate a document. Body is any JSON object. Optionally include an id field; otherwise one is auto-generated.
/v1/collections/{name}/documents/{id}Get a single document by ID.
/v1/collections/{name}/documents/{id}Replace a document entirely. Add ?upsert=true to create it if missing instead of returning 404.
/v1/collections/{name}/documents/{id}Merge fields into a document. Set a field to null to delete it. Add ?upsert=true to create it if missing; concurrent upserts to different fields never overwrite each other.
PATCH ...?upsert=true { "done": true }
→ { "id": "...", "status": "patched", "created": true }/v1/collections/{name}/documents/{id}Delete a document.
Query
/v1/collections/{name}/query{
"filter": {
"status": "active",
"age": { "$gte": 21 }
},
"sort": [{ "field": "created_at", "order": "desc" }],
"limit": 20,
"start_after": "lastDocId"
}Operators: $eq, $ne, $gt, $gte, $lt, $lte, $in (max 30), $prefix.
Inequality filters work on one field only. Pagination is cursor-based via start_after.
Collections
/v1/collectionsList all collections in the project.
Scoped Tokens
/v1/tokensMint a scoped JWT. Requires API key auth (not a scoped token).
{
"scope": {
"todos": { "user_id": "abc123" },
"*": {}
},
"ttl": 3600
}Scope maps collection names to required field filters. Use * for wildcard. Max TTL: 24 hours.
Authentication Model
X-API-Key: mm_... — Identifies the project. Always required.
Authorization: Bearer mms_... — End-user session token (optional, identifies user). Expires after 30 days.
Authorization: Bearer <jwt> — Scoped token (alternative to session, restricts data access).