cirrux

API

Cirrux has a public HTTP API for building on top of your workspace. Requests and responses are JSON, served under the base URL https://api.cirrux.info/public_api. Every endpoint below is versioned under /v1.

Authentication

Bearer tokens & scopes

Authenticate every request with a bearer token in the Authorization header. Tokens carry scopes that gate what each endpoint can do.

Authorization: Bearer <access-token>
Content-Type: application/json

Two kinds of token exist: workspace API keys (created by a workspace admin) and user-scoped OAuth access tokens (issued to an app acting on behalf of a signed-in user). Every endpoint except GET /v1/user/profile and GET /v1/workspace/storage acts on a specific user’s data (mail, Drive, Calendar, Documents, contacts), so it needs a user-scoped OAuth token and answers a workspace API key with 403 forbidden. Today a workspace API key can only read the workspace profile and storage.

The available scopes are:

FieldTypeRequiredDescription
user.profilescopenoRead the signed-in user’s profile.
email.readscopenoRead mailboxes, threads and messages.
email.writescopenoChange mail: labels, read and flag state, moves, drafts, and a mailbox’s labels and filters.
email.sendscopenoSend a draft.
drive.readscopenoList, read and download Drive files and folders, read sharing settings, thumbnails and the changes feed.
drive.createscopenoCreate folders and upload files.
drive.updatescopenoRename, move, recolor and restore files and folders, replace a file’s contents, and create or revoke public links.
drive.deletescopenoTrash and permanently delete files and folders.
calendar.readscopenoRead calendars and the events on them.
calendar.writescopenoCreate, change and delete calendar events.
contacts.readscopenoRead addressbooks and contacts.
contacts.writescopenoCreate, change and delete contacts.
docs.readscopenoList and read Cirrux Docs documents.
docs.commentscopenoComment on documents, suggest changes, and withdraw your own suggestions.
docs.writescopenoCreate, edit, rename, trash and restore documents, attach files, and accept or reject suggestions.

Errors

Error responses

Errors return a non-2xx status and a JSON body with a machine-readable error code and a human error_description. Some errors add extra fields (for example max_size). The API is rate limited to 600 requests per minute per token, and to 60 requests per minute per IP address for requests that carry no bearer token. A 429 carries Retry-After (in seconds) and X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers.

{
  "error": "insufficient_scope",
  "error_description": "Required scope: drive.update"
}
StatuserrorWhen
400invalid_jsonThe request body is not valid JSON.
400invalid_bodyThe request body is JSON but not an object.
401invalid_requestThe Authorization header is missing or malformed, or the API key or access token is unknown, expired or revoked.
403forbiddenThe endpoint requires a user-scoped OAuth token.
403insufficient_scopeThe token is missing the scope the endpoint requires.
404not_foundThe resource does not exist or is not visible to you.
422invalid_uuidAn identifier in the path, query string or body is not a valid UUID.
429rate_limitedToo many requests. Wait for Retry-After seconds.

Per-resource error codes (e.g. name_taken, file_too_large, sync_token_invalid) are documented alongside each endpoint.

Reference

The API also has endpoints for mail (mailboxes, threads, emails, labels, filters, drafts, attachments and search) and for addressbooks and contacts, under the scopes listed above. They do not have reference pages here yet. The Cirrux CLI is built on them.