The REST API is the same interface the demi app, the CLI and the MCP server work with. What the app can do, your integration can do too, with the same permissions.
- Base URL
https://api.godemi.com- Format
- JSON over HTTPS, paths under
/v1/ - Contract
- OpenAPI 3.1. We send you the document on request.
- Sign-in
- API key or OAuth token as a bearer token
- Real time
- Server-sent events under
/v1/stream/
First request
curl https://api.godemi.com/v1/me/profile \ -H "Authorization: Bearer <your-api-key>"Without a valid token the API answers 401. How to create a key: Sign-in and keys.
Tenants
Every request runs in exactly one tenant. An API key uses the one it was created in. Pick another tenant you are a member of with the x-demi-tenant-id header:
curl https://api.godemi.com/v1/tenants/current \ -H "Authorization: Bearer <your-api-key>" \ -H "x-demi-tenant-id: <workspace-id>"A token that spans several tenants needs the header to write. Without it the API answers 422 with the code TENANT_NOT_SELECTED.
What the API covers
- Pages and blocks: read, search, create, change, move, publish, export
- Links, files and uploads, comments, versions
- Members, org units, roles and permissions
- Agents and their runs
- Lead report orders
- Your profile: keys, second factor, sessions
- Real-time events over server-sent events
Key endpoints
/v1/me/profile/v1/docsq, page through with cursor and limit (up to 200)./v1/docs/grep/v1/docs/{id}format=ddmd returns it as Markdown./v1/docs/v1/docs/{id}/v1/agents/v1/runsGET /v1/runs/{id} shows its state./v1/stream/eventsRead and search pages
curl "https://api.godemi.com/v1/docs?q=quote&limit=20" \ -H "Authorization: Bearer <your-api-key>"curl "https://api.godemi.com/v1/docs/grep?q=lead%20time" \ -H "Authorization: Bearer <your-api-key>"curl "https://api.godemi.com/v1/docs/<page-id>?format=ddmd" \ -H "Authorization: Bearer <your-api-key>"Lists come in pages. Pass the cursor from the last answer to fetch the next one.
Real-time events
curl -N "https://api.godemi.com/v1/stream/events?docs=<page-id>" \ -H "Authorization: Bearer <your-api-key>" \ -H "Accept: text/event-stream"The connection stays open, and each event arrives as its own message. Separate several pages with commas. The CLI does the same with demi events subscribe.
Permissions and errors
The API never widens your permissions. If you cannot see a page in the app, the API will not return it either, and it refuses what you may not change. demi checks this on the server for every request.
401: the token is missing, expired or revoked.422: the request does not fit, for example a missing or contradicting tenant.
