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.
| Operation | Method and path |
|---|---|
| List your personal API tokens | GET /api/v1/tokens |
| Create a personal API token | POST /api/v1/tokens |
| Revoke a personal API token | DELETE /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
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | ApiTokens |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
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
| Status | Meaning | Body |
|---|---|---|
| 201 | Successful operation | CreatedToken |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | token_name_taken or token_limit | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
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
| Status | Meaning | Body |
|---|---|---|
| 204 | Successful operation | |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |