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
{"data": ...}.
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 beforeexpires_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 answer401: 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.