HTTP API Reference
Core
| Method | Endpoint | Description |
|---|---|---|
| GET | / | Server info |
| GET | /health | Health check |
| POST | /db/query | Execute Cypher: { query, params?, database? } |
| POST | /db/uuid | Reserve a UUID for 5 minutes (editor/admin) |
| POST | /db/import/cypher | Import a Cypher script (admin/editor) |
| GET | /db/{name}/schema | Get database schema |
| GET | /db/{name}/graph | Get full graph data |
| POST | /graphql | GraphQL endpoint |
| ANY | /functions/v1/{name} | Invoke a stored edge function |
Authentication
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/login | Login, returns JWT tokens |
| POST | /auth/refresh | Refresh access token |
| POST | /auth/register | Register new user |
| POST | /auth/change-password | Change password |
| GET | /auth/verify | Verify email via token query param |
| POST | /auth/resend-verification | Resend the verification email |
| POST | /auth/verify-code | Verify email with the short code from the email |
| POST | /auth/otp/request | Request a 6-digit OTP for an email |
| POST | /auth/otp/verify | Verify OTP, returns JWT tokens |
| GET | /.well-known/jwks.json | JWKS public keys |
Service Accounts (admin)
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/service-accounts | Create service account |
| GET | /auth/service-accounts | List service accounts |
| GET | /auth/service-accounts/{id} | Get one |
| PATCH | /auth/service-accounts/{id} | Update name / roles |
| DELETE | /auth/service-accounts/{id} | Delete account (revokes all keys) |
| POST | /auth/service-accounts/{id}/keys | Mint a new API key (plaintext returned once) |
| GET | /auth/service-accounts/{id}/keys | List keys for an account |
| DELETE | /auth/service-accounts/{id}/keys/{key_id} | Revoke an API key |
Apps & Projects
| Method | Endpoint | Description |
|---|---|---|
| POST | /apps | Create app (server admin) - { slug, name } |
| GET | /apps | Apps the caller is a member of (server admin: all) |
| GET | /apps/{id|slug} | App detail incl. the caller's privilege |
| PATCH | /apps/{id} | Rename / enable / disable (app admin) |
| DELETE | /apps/{id} | Delete app and cascade its schema (server admin) |
| GET | /apps/{id}/members | List members |
| PUT | /apps/{id}/members/{user} | Add or update a member - { privilege } (app admin) |
| DELETE | /apps/{id}/members/{user} | Remove a member (app admin) |
| GET | /apps/{id}/labels | Labels bound to the app schema |
| PUT | /apps/{id}/labels/{label} | Bind a label (editor+) |
| DELETE | /apps/{id}/labels/{label} | Unbind a label (app admin) |
| GET | /apps/{id}/settings | Scopable settings with effective value and source |
| PUT | /apps/{id}/settings | Set overrides - { key: value, ... } (app admin) |
| DELETE | /apps/{id}/settings/{key} | Remove an override (app admin) |
| GET | /apps/{id}/email-templates | Templates and whether each is customised |
| GET | /apps/{id}/email-templates/{name} | One template (effective parts) |
| PUT | /apps/{id}/email-templates/{name} | Override subject / html / text (app admin) |
| DELETE | /apps/{id}/email-templates/{name} | Revert to the server default (app admin) |
| POST | /apps/{id}/email-templates/{name}/preview | Render with sample values |
| GET | /apps/{id}/export | Full JSON backup of the app (app admin) |
| POST | /apps/import?slug=… | Restore a backup as a NEW app (server admin) |
Scope any request to an app with the X-Anvil-App: <id|slug> header. See Apps & Projects.
System Settings (admin)
| Method | Endpoint | Description |
|---|---|---|
| GET | /system/settings | List all runtime settings |
| GET | /system/settings/{key} | Get one setting |
| PUT | /system/settings/{key} | Update one (hot-reload, no restart) |
| DELETE | /system/settings/{key} | Reset to file / env / default |
Document Store
| Method | Endpoint | Description |
|---|---|---|
| GET | /docs | List collections |
| POST | /docs/{collection} | Create collection |
| DELETE | /docs/{collection} | Drop collection |
| GET | /docs/{collection}/{id} | Get document |
| PUT | /docs/{collection}/{id} | Upsert document |
| DELETE | /docs/{collection}/{id} | Delete document |
| POST | /docs/{collection}/query | Query with filters |
| POST | /docs/{collection}/batch | Batch operations |
| GET | /docs/{collection}/scan | Paginated scan |
Cypher equivalents: SHOW COLLECTIONS (name, schema, id, document count), CREATE COLLECTION <name>, DROP COLLECTION <name>. Dropping a collection frees its name for reuse in any schema.
Admin
| Method | Endpoint | Description |
|---|---|---|
| GET | /admin/stats | Server statistics |
| GET | /admin/users | List users |
| GET | /admin/roles | List roles |
| GET | /admin/events | Query event log |
| GET | /admin/slow-queries | Recent slow queries |
| GET | /admin/query-stats | Query frequency analytics |