Skip to main content
Task sync clients authenticate with the client credentials flow. You create an API integration, keep its client ID and secret on your server, and exchange them for a short-lived bearer token. The token works on the task routes in the Workspaces API. It is not an API key: sending it as x-api-key is refused, and anywhere outside the task routes the gateway answers 403 integration_not_allowed. An integration cannot open a WebSocket.

Get a token

A successful call returns the token directly. This route is not wrapped in {"data": ...}.
Send no Authorization header on this request, and do not use HTTP Basic. The gateway rejects any bearer it cannot resolve before the token endpoint sees the call, so an Authorization header makes a valid request fail. Put the credentials in the body.

Token errors

Errors have the shape {"error": "<text>", "code": "<code>"}.

Cache the token

Every mint creates a session. A client that mints a token for each request wastes sessions and slows every call. Mint once and reuse the token until about 60 seconds before expires_in runs out.

Handle revocation

A token stops working as soon as an admin edits the integration’s scopes, disables it, deletes it or revokes a secret. Calls then answer 401: with code token_revoked when the call reaches the task service, or with an empty body when the gateway has already dropped the session (a revoked secret, a deleted integration, or a token past its hour). Treat every 401 the same way. Scope changes take up to 30 seconds to reach every service.

Scopes

Scopes are granted per Space. Space ids are upper case, so ops is stored as OPS. GET /workspaces/spaces lists only the Spaces where the integration holds a scope.

Task sync

Use the token to keep tasks in step with your system.

Errors and limits

Every error code and limit.