API tokens
List the caller’s personal API tokens
Section titled “List the caller’s personal API tokens”GET /api/v1/user/me/api-tokens
Authentication: BearerAuth.
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
200 | OK | array of PersonalAPIToken |
401 | Unauthorized | ErrorResponse |
Mint a new personal API token
Section titled “Mint a new personal API token”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.
Request body
Section titled “Request body”application/json, required: CreatePATRequest
Token metadata + scope
| Field | Type | Required | Description |
|---|---|---|---|
allowed_company_ids | array of string | No | |
allowed_permissions | array of Permission | No | |
expires_at | string | No | |
name | string | Yes | At most 100 characters. |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
201 | Created | CreatedPATResponse |
400 | Bad Request | ErrorResponse |
401 | Unauthorized | ErrorResponse |
Revoke a personal API token (idempotent)
Section titled “Revoke a personal API token (idempotent)”DELETE /api/v1/user/me/api-tokens/{id}
Authentication: BearerAuth.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Token ID |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
200 | OK | MessageResponse |
401 | Unauthorized | ErrorResponse |
404 | Not Found | ErrorResponse |
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.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Token ID |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
201 | Created | CreatedPATResponse |
401 | Unauthorized | ErrorResponse |
404 | Not Found | ErrorResponse |
Part of Crewlet. Generated from the OpenAPI document of the API, version 0.1.0.