---
title: "Mint a workspace-scoped org service token for CI/automation; shown once [org:write + admin; this door only]"
method: POST
path: "/preview/org/tokens"
tags: ["org"]
---

# Mint a workspace-scoped org service token for CI/automation; shown once \[org:write + admin; this door only\]

`POST /preview/org/tokens`

## Request

- Base URL: `https://autoresearch.sfcompute.com`
- URL: `https://autoresearch.sfcompute.com/preview/org/tokens`
- Auth: HTTP bearer

Mint a workspace-scoped org service token for CI/automation; shown once [org:write + admin; this door only]

## Query parameters

- `workspace` string

## Request body

- object
  - `expires_in_days` integer, nullable: Days until expiry, 1–365 (default 90); 0 = non-expiring, revoke-only.
  - `manages_workspaces` boolean, nullable: Mint a MANAGER token (docs/designs/workspace-tenancy.md W2): it may create/archive workspaces and vend strictly-narrower short-TTL single-workspace tokens - the credential a platform's backend holds to confine each end-user session to its own workspace. Only this org-admin mint path can set it; a token never mints a token as wide as itself.
  - `name` string, required: The token's name - what audit rows and /team display ("ci-deploy").
  - `org` string, nullable
  - `scopes` string[], nullable: Product scope words (the mcp_scopes vocabulary): any of `infra`, `infra:read`, `org`, `org:read` - never `operator`. Default ["infra"].
  - `workspaces` string[], nullable: Workspace slugs the token may act in, fixed at mint; the first is its default context. Default: the org's default workspace.

## Response `200`

The capability's JSON result.

- Result: The capability's result: the same object the MCP tool returns as structuredContent. Resources carry an `object` type discriminator and an immutable id; money is integer micro-dollars in `*_usd_micros` fields.
  - `object` string: The resource type, when the result is one resource.

## Other responses

- `400`: Malformed request: bad JSON, a parameter that does not parse, or a value outside its range. Code `invalid`.
- `401`: No bearer token, or one this API cannot verify. Code `unauthenticated`.
- `403`: Authenticated, but the token's scopes or the account's role do not reach this operation. The message names the scope word to request. Code `forbidden`.
- `404`: No such route. Code `not_found`; the body names the OpenAPI document.
- `422`: A well-formed request the platform declined: no such node, a cap reached, a state that forbids the move. The message says which, and what to do instead. Code `refused`.
- `429`: Over this door's per-customer budget. Wait `Retry-After` seconds. Code `rate_limited`.
- `500`: Our fault. Retry; if it persists, quote the request-id. Code `internal`.

---

[API](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api.md) · [All operations](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/revisions/f88dcb70ac6c?raw)
