Skip to content

API tokens

GET /api/v1/user/me/api-tokens

Authentication: BearerAuth.

StatusDescriptionBody
200OKarray of PersonalAPIToken
401UnauthorizedErrorResponse

POST /api/v1/user/me/api-tokens

The cleartext token field is returned ONCE; persist it now or rotate later. Optional allowed_company_ids and allowed_permissions attenuate the token’s reach below the caller’s full role.

Authentication: BearerAuth.

application/json, required: CreatePATRequest

Token metadata + scope

FieldTypeRequiredDescription
allowed_company_idsarray of stringNo
allowed_permissionsarray of PermissionNo
expires_atstringNo
namestringYesAt most 100 characters.
StatusDescriptionBody
201CreatedCreatedPATResponse
400Bad RequestErrorResponse
401UnauthorizedErrorResponse

DELETE /api/v1/user/me/api-tokens/{id}

Authentication: BearerAuth.

NameInTypeRequiredDescription
idpathstringYesToken ID
StatusDescriptionBody
200OKMessageResponse
401UnauthorizedErrorResponse
404Not FoundErrorResponse

Mint a replacement of the caller’s own token

Section titled “Mint a replacement of the caller’s own token”

POST /api/v1/user/me/api-tokens/{id}/rotate

Caller can only rotate their OWN tokens. Scope (companies, permissions) is preserved. The old token remains valid until explicitly revoked.

Authentication: BearerAuth.

NameInTypeRequiredDescription
idpathstringYesToken ID
StatusDescriptionBody
201CreatedCreatedPATResponse
401UnauthorizedErrorResponse
404Not FoundErrorResponse

Part of Crewlet. Generated from the OpenAPI document of the API, version 0.1.0.