Create an API token
POST
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.
BearerAuthheader
AuthorizationBearer <JWT>Admin token, API token issued via /api-tokens, or an OIDC JWT access token issued by the configured OIDC provider.
application/json- body
scopes*array<>Permission scopes to grant to this token.
Items
1 <= itemsThe newly created API token.
application/json- response
token*stringThe raw API token. Only returned at creation time — store it securely.
tokenHash*stringSHA-256 hex digest of the token, used as its stable identifier.
scopes*array<>Permission scopes granted to this token.
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" ]}