Flow

Create an API token

POST
/api-tokens

Generates a new API token owned by the authenticated caller. The token inherits the caller's flow ownership when authorizing future requests. Only a signed-in session can create tokens; a caller using an API token gets 403. The raw token value is returned only once in the response.

BearerAuth
headerAuthorizationBearer <JWT>

Admin token, API token issued via /api-tokens, or an OIDC JWT access token issued by the configured OIDC provider.

application/json
  1. body
scopes*array<>

Permission scopes to grant to this token.

Items1 <= items

Response Body

The newly created API token.

application/json
  1. response
token*string

The raw API token. Only returned at creation time — store it securely.

tokenHash*string

SHA-256 hex digest of the token, used as its stable identifier.

scopes*array<>

Permission scopes granted to this token.

Example Request
curl -X POST 'https://example.com/api/hub/api-tokens' \  -H 'Content-Type: application/json' \  -d '{  "scopes": [    "flows"  ]}'
Example Response
{  "token": "fh_a1b2c3d4e5f6...",  "tokenHash": "string",  "scopes": [    "string"  ]}