Scute reads two headers. Authorization identifies the account calling (an app key or a workspace key). X-Authorization identifies who is acting (a person's access token or an M2M token). Some endpoints need one of them, some need both.
| Credential | Format | Header | Created in |
|---|---|---|---|
| App key | scapp_... | Authorization: Bearer | Dashboard, the app's API keys page |
| Workspace key | scworks_... | Authorization: Bearer | Dashboard, Settings > Keys |
| M2M token | scm2m_... | X-Authorization: Bearer | Dashboard, the app's M2M clients page, or the API |
| Access token | JWT | X-Authorization: Bearer | Returned by a sign-in |
| Refresh token | JWT | X-Refresh-Token | Returned by a sign-in |
| Setup token | string | X-Scute-Setup-Token | Returned by a sign-in that owes a step |
| Element token | sce_... | X-Scute-Element-Token | Minted by your server with the app key |
| Task token | sct_... | Authorization: Bearer | Issued for an agent's task |
| Agent key | scak_... | Authorization: Bearer | Dashboard, the agent's Keys page |
Keys and tokens are shown in full once, when they are created or rotated. Scute stores a hash of each API key; lists show only the first and last characters.
App keys#
An app key is the server credential for one app. It works on that app only: a call naming another app returns 403 API key not authorized for this app.
Create one at control.scute.io on the app's API keys page, or with the API (see App keys). Keep it on your server.
curl https://api.scute.io/v1/$SCUTE_APP_ID/users \ -H "Authorization: Bearer $SCUTE_APP_SECRET"Rotating a key returns a new key with the same name. The old key keeps working until it is revoked, or until the end you choose with old_key_expires_in: now, 1h, 24h, 7d or 30d. A key past its end is refused as if it did not exist.
Workspace keys#
A workspace key reaches every app in its workspace and in every workspace below it (Master, MSP, client). An integrator holds one Master workspace key instead of a key per client.
Workspace owners and admins create, rename, rotate and revoke workspace keys in the dashboard under Settings > Keys. Rotation works as for app keys.
Endpoints that take an app key also take a workspace key above the app. Some workspace endpoints take only a workspace key and return 401 workspace_api_key_required for an app key.
M2M tokens#
An M2M token identifies a server or service instead of a person. It goes in X-Authorization and is used in two ways:
- With a key. On endpoints that need both headers, the key goes in Authorization and the M2M token in X-Authorization.
- On its own. The token's own calls (verify, refresh, revoke) take only the token.
A token reaches its app, the other apps in that app's workspace, and every app in the workspaces below it. A call naming an app outside that range returns 403 app_not_in_scope.
Each token has scopes:
| Scope | Allows |
|---|---|
| read | GET and HEAD calls, and authorization checks (/v1/auth/:app_id/authz/check, check-batch, filter) |
| write | Every other call |
A call the token's scopes do not cover returns 403 insufficient_scope, with details.required_scope. Create tokens in the dashboard on the app's M2M clients page or with POST /v1/apps/:app_id/m2m/token. Lifetimes are 30d, 90d or 1y; an expired token returns 401.
curl https://api.scute.io/v1/apps/$SCUTE_APP_ID/webhooks \ -H "Authorization: Bearer $SCUTE_APP_SECRET" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"Access and refresh tokens#
A sign-in returns an access token and a refresh token, both JWTs signed with the workspace's RSA key (RS256). The access token goes in X-Authorization on the signed-in person's own calls (profile, sessions, MFA). The refresh token goes in X-Refresh-Token on POST /v1/auth/:app_id/tokens/refresh.
Your server can check an access token offline with the app's JWKS. See JWKS.
A sign-in that is not finished (a second factor or a contact still to add) returns a setup token instead of a session. It goes in X-Scute-Setup-Token. See Sign-in steps.
Element, task and agent credentials#
- Element tokens let a browser page call a limited admin API without the app key. Your server mints one with the app key. See Element tokens.
- Task tokens are what an agent sends while it runs a task, on /v1/auth/:app_id/agent/*. See Task tokens.
- Agent keys connect a voice or chat platform to Scute's MCP server at /v1/mcp/auth/:app_id. See Voice and chat.
Which endpoints take which credential#
| Endpoints | Credential |
|---|---|
| Starting a sign-in, the JWKS, password reset | None |
| The signed-in person's own data under /v1/auth/:app_id | Access token |
| Users, user sessions, MFA admin, M2M token create and list | App key or workspace key |
| Webhooks, events, app keys, user fields | Key and an M2M token in X-Authorization |
| Authorization checks under /v1/auth/:app_id/authz | App key or M2M token |
| Workspace provisioning and challenges for integrators | Workspace key and an M2M token |
Authentication errors#
| Status | Body | When |
|---|---|---|
| 401 | {"error": "Not authorized"} | The key or token is missing, unknown, expired or revoked. The body does not say which. |
| 401 | error_code authentication_required | The endpoint needs X-Authorization and none was sent. |
| 403 | API key not authorized for this app | The key does not own the app in the path. |
| 403 | error_code app_not_in_scope | The M2M token's app does not reach the app in the path. |
| 403 | error_code insufficient_scope | The M2M token lacks the scope the call needs. |
| 403 | error_code workspace_access_denied | The key or token does not reach the workspace in the path. |
| 404 | error_code app_not_found | No app with the ID in the path. |
See Errors for the full error shape.