/v1/openapi.json; every endpoint is in the API reference tab.
Authentication
SendAuthorization: Bearer <token>. Two kinds of token:
Getting an OAuth token for your app
Getting an OAuth token for your app
Soma’s authorization server follows the MCP authorization spec. Discover it from
GET /.well-known/oauth-protected-resource/v1, which points at /.well-known/oauth-authorization-server. Register your app with a Client ID Metadata Document (your client_id is the https URL of your metadata) or through Dynamic Client Registration (POST /oauth/register), then run the authorization-code flow with PKCE (S256) and resource=https://staging.soma.evarist.com/v1. Ask for knowledge:read knowledge:write to create workspaces and add documents. Access tokens last one hour; refresh tokens rotate.401 with a WWW-Authenticate header pointing at the metadata above. A read-only token used for a write gets 403 with type insufficient_scope.
Errors
Every error has the same shape:Pagination
Lists return{ "data": [...], "has_more": true, "next_cursor": "..." }. Pass cursor=<next_cursor> to get the next page, and limit to size them.
Long operations
- Uploads return a job (
202); follow it withGET /v1/jobs/{job_id}untilstatusisdone. - Ask takes 10 to 120 seconds; stream its progress with
"stream": true. See Ask.
Limits
- Ask: 60 questions per hour per user or key.
- Uploads: 20 files per request, 100 MB per file.