`POST /api/workspaces/{id}/project-api-tokens` — mint a project credential (owner/admin). The response carries the `scpj_` plaintext exactly once. Audited (`api_token.mint`, `kind=project`). It is listed and revoked through the `api-tokens` routes above.
const url = 'https://example.com/api/workspaces/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/project-api-tokens';const options = { method: 'POST', headers: { cookie: 'supacloud_session=<supacloud_session>', 'Content-Type': 'application/json' }, body: '{"capabilities":["example"],"expires_at":"2026-04-15T12:00:00Z","label":"example","project_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/workspaces/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/project-api-tokens \ --header 'Content-Type: application/json' \ --cookie supacloud_session=<supacloud_session> \ --data '{ "capabilities": [ "example" ], "expires_at": "2026-04-15T12:00:00Z", "label": "example", "project_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'POST /api/workspaces/{id}/project-api-tokens — mint a project credential
(owner/admin). The response carries the scpj_ plaintext exactly once. Audited
(api_token.mint, kind=project). It is listed and revoked through the
api-tokens routes above.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Workspace ID
Request Bodyrequired
Section titled “Request Bodyrequired”Request body to mint a PROJECT credential (scpj_, #1546/#1527). The token is
bound to project_id of this workspace, carries only the listed capabilities —
one or more of the EIGHT mintable ones (project:read, artifacts:read,
artifacts:upload, artifacts:publish, artifacts:update, plus the opt-ins
artifacts:comment, artifacts:form, artifacts:share) — and always expires: an
omitted expires_at takes the policy default, a later one than the policy maximum
is refused.
object
The granted project capabilities — required, non-empty.
Expiry; must lie in the future and inside the project-credential maximum.
Human-readable label (shown in the token list).
The project of THIS workspace the credential is bound to.
Example generated
{ "capabilities": [ "example" ], "expires_at": "2026-04-15T12:00:00Z", "label": "example", "project_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Responses
Section titled “Responses”The minted project credential (plaintext shown once)
One workspace API token. token (the scmt_ plaintext) is present ONLY on
the mint response — a board row never carries it.
object
#1546 — the project capability set; empty for a scope token.
Who created the token, readable (a person’s display name or e-mail, or an automation’s name). Board rows only; absent when the creator no longer exists.
#1546 D1 - the deployment a project credential’s local client must name in its
fallback environment (SUPACLOUD_ARTIFACT_DEPLOYMENT_ID). Present only on the
project-credential mint; a listed row and a scope token omit it.
#1546 D1 - this deployment’s environment (development/stage/production),
for SUPACLOUD_ARTIFACT_ENVIRONMENT. Project-credential mint only.
The public correlation handle (also the revoke path parameter).
#1546 D1 - this deployment’s public issuer, for SUPACLOUD_ARTIFACT_ISSUER.
Project-credential mint only.
#1546 — the bound project of a project credential; null for a scope token.
The plaintext bearer — mint response only, shown exactly once.
Example generated
{ "capabilities": [ "example" ], "created_at": "2026-04-15T12:00:00Z", "created_by": "example", "deployment_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "environment": "example", "expires_at": "2026-04-15T12:00:00Z", "fingerprint": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "issuer": "example", "label": "example", "last_used_at": "2026-04-15T12:00:00Z", "project_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "revoked_at": "2026-04-15T12:00:00Z", "scopes": [ "example" ], "token": "example"}Missing label, empty/unknown/non-mintable capabilities or an expiry outside the policy
The canonical JSON body of every error response. Every AppError serializes as
this exact shape; code is the generated stable machine-readable vocabulary.
object
Present only on an MCP budget refusal (429) — the refusing layer + retry hint.
object
The refusing layer.
The layer’s budget.
Seconds until a retry can pass, or null when it never will for this session.
Calls already counted in the layer.
Machine-readable, stable error code.
Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.
object
The entitlement feature key that was hit, e.g. apps.max_count.
The plan’s limit for this key.
Where to send the user to upgrade.
Current usage (count or bytes, per the key).
Human-readable message (the server’s English text; the client may localize
by code).
Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.
object
Weighted workspace slots already held by starting/running agent runs.
The budget cap that refused.
Effective spend of the refusing budget scope (spend + in-flight reservations).
The workspace’s configured agent-concurrency cap.
The provider whose budget cap refused; absent for the workspace-wide cap.
Runner labels a fail-policy placement required and no runner offered.
Example
{ "code": "not_found"}Authentication required
The canonical JSON body of every error response. Every AppError serializes as
this exact shape; code is the generated stable machine-readable vocabulary.
object
Present only on an MCP budget refusal (429) — the refusing layer + retry hint.
object
The refusing layer.
The layer’s budget.
Seconds until a retry can pass, or null when it never will for this session.
Calls already counted in the layer.
Machine-readable, stable error code.
Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.
object
The entitlement feature key that was hit, e.g. apps.max_count.
The plan’s limit for this key.
Where to send the user to upgrade.
Current usage (count or bytes, per the key).
Human-readable message (the server’s English text; the client may localize
by code).
Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.
object
Weighted workspace slots already held by starting/running agent runs.
The budget cap that refused.
Effective spend of the refusing budget scope (spend + in-flight reservations).
The workspace’s configured agent-concurrency cap.
The provider whose budget cap refused; absent for the workspace-wide cap.
Runner labels a fail-policy placement required and no runner offered.
Example
{ "code": "not_found"}Permission denied, or project authority is not claimed/enabled on this deployment
The canonical JSON body of every error response. Every AppError serializes as
this exact shape; code is the generated stable machine-readable vocabulary.
object
Present only on an MCP budget refusal (429) — the refusing layer + retry hint.
object
The refusing layer.
The layer’s budget.
Seconds until a retry can pass, or null when it never will for this session.
Calls already counted in the layer.
Machine-readable, stable error code.
Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.
object
The entitlement feature key that was hit, e.g. apps.max_count.
The plan’s limit for this key.
Where to send the user to upgrade.
Current usage (count or bytes, per the key).
Human-readable message (the server’s English text; the client may localize
by code).
Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.
object
Weighted workspace slots already held by starting/running agent runs.
The budget cap that refused.
Effective spend of the refusing budget scope (spend + in-flight reservations).
The workspace’s configured agent-concurrency cap.
The provider whose budget cap refused; absent for the workspace-wide cap.
Runner labels a fail-policy placement required and no runner offered.
Example
{ "code": "not_found"}The project is not a live project of this workspace
The canonical JSON body of every error response. Every AppError serializes as
this exact shape; code is the generated stable machine-readable vocabulary.
object
Present only on an MCP budget refusal (429) — the refusing layer + retry hint.
object
The refusing layer.
The layer’s budget.
Seconds until a retry can pass, or null when it never will for this session.
Calls already counted in the layer.
Machine-readable, stable error code.
Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.
object
The entitlement feature key that was hit, e.g. apps.max_count.
The plan’s limit for this key.
Where to send the user to upgrade.
Current usage (count or bytes, per the key).
Human-readable message (the server’s English text; the client may localize
by code).
Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.
object
Weighted workspace slots already held by starting/running agent runs.
The budget cap that refused.
Effective spend of the refusing budget scope (spend + in-flight reservations).
The workspace’s configured agent-concurrency cap.
The provider whose budget cap refused; absent for the workspace-wide cap.
Runner labels a fail-policy placement required and no runner offered.
Example
{ "code": "not_found"}Structured server error
The canonical JSON body of every error response. Every AppError serializes as
this exact shape; code is the generated stable machine-readable vocabulary.
object
Present only on an MCP budget refusal (429) — the refusing layer + retry hint.
object
The refusing layer.
The layer’s budget.
Seconds until a retry can pass, or null when it never will for this session.
Calls already counted in the layer.
Machine-readable, stable error code.
Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.
object
The entitlement feature key that was hit, e.g. apps.max_count.
The plan’s limit for this key.
Where to send the user to upgrade.
Current usage (count or bytes, per the key).
Human-readable message (the server’s English text; the client may localize
by code).
Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.
object
Weighted workspace slots already held by starting/running agent runs.
The budget cap that refused.
Effective spend of the refusing budget scope (spend + in-flight reservations).
The workspace’s configured agent-concurrency cap.
The provider whose budget cap refused; absent for the workspace-wide cap.
Runner labels a fail-policy placement required and no runner offered.
Example
{ "code": "not_found"}