Skip to main content

API tokens

Personal API tokens. Creating, listing and revoking tokens needs a signed-in browser session; the token then acts as you on the routes that accept it.

OperationMethod and path
List your personal API tokensGET /api/v1/tokens
Create a personal API tokenPOST /api/v1/tokens
Revoke a personal API tokenDELETE /api/v1/tokens/{id}

List your personal API tokens​

GET /api/v1/tokens

Your live tokens, newest first; never the token itself. Needs a signed-in session.

Sign-in: A signed-in browser session only; an API token is refused with 403 session_required.

Responses

StatusMeaningBody
200Successful operationApiTokens
400Invalid request or unsupported protocolError
401Authentication requiredError
403Origin, ownership or role deniedError
404Record not foundError
409Bootstrap closed, idempotency route conflict or deleted conversationError
413Request body limit exceededError
429Rate or capacity limit reachedError
503Database unavailable or gateway restartingError
504I/O deadline exceededError

Create a personal API token​

POST /api/v1/tokens

The token (tqa_pat_ followed by 43 base64url characters) is returned once and stored only hashed. It acts as you until it expires (1 to 365 days, required) or is revoked. At most 50 live tokens; a live name is unique (409 token_name_taken, 409 token_limit). Needs a signed-in session.

Sign-in: A signed-in browser session only; an API token is refused with 403 session_required.

Request body

application/json: NewToken

Responses

StatusMeaningBody
201Successful operationCreatedToken
400Invalid request or unsupported protocolError
401Authentication requiredError
403Origin, ownership or role deniedError
404Record not foundError
409token_name_taken or token_limitError
413Request body limit exceededError
429Rate or capacity limit reachedError
503Database unavailable or gateway restartingError
504I/O deadline exceededError

Revoke a personal API token​

DELETE /api/v1/tokens/{id}

Revokes one of your tokens at once; another user's or an unknown token is 404. Needs a signed-in session.

Sign-in: A signed-in browser session only; an API token is refused with 403 session_required.

Responses

StatusMeaningBody
204Successful operation
400Invalid request or unsupported protocolError
401Authentication requiredError
403Origin, ownership or role deniedError
404Record not foundError
409Bootstrap closed, idempotency route conflict or deleted conversationError
413Request body limit exceededError
429Rate or capacity limit reachedError
503Database unavailable or gateway restartingError
504I/O deadline exceededError