API reference
API overview
The base URL, how to authenticate, the shape of every answer, and the list of operations.
Base URL#
Every path in this reference starts with /v1, after the host: https://api.cirrusmail.example/v1. The host is a placeholder until the product is live. Against a local copy of the API it is http://localhost:8090/v1. Requests and answers are JSON, over HTTPS in production.
Authentication#
Send an API key as a bearer token: Authorization: Bearer cirrus_live_…. Each operation says which scope the key needs. See Authentication and API keys.
Operations#
These 9 operations are everything an API key can call. The document they come from also describes the dashboard's own routes; those use a signed-in session, are not part of the developer API and are not listed here.
The shape of every answer#
- One thing comes back as
{ "data": { … } }. - A long list comes back with a
paginationmember. See Pagination. - A short list, bounded by what it describes, comes back whole as
{ "data": [ … ] }with nopagination. - Every error is
{ "error": { "code", "message", … } }. See Errors.
{
"data": [ … ],
"pagination": { "has_more": true, "next_cursor": "…" }
}Every timestamp is RFC 3339 in UTC and ends in Z, never an offset. A request body must be one JSON object; a field the operation does not accept is rejected, not ignored.
Answers every operation can give#
These are not repeated on each operation.
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_json | The body is not one JSON object, or has a field the endpoint does not accept. |
| 413 | body_too_large | The body is larger than 1 MB. |
| 404 | not_found | No such route, or no such resource. An ID in a path that is not a valid UUID is a 404 too. |
| 405 | method_not_allowed | The route exists but not for this method. |
| 500 | internal_error | Something went wrong on the server. |