Skip to content

Organization Token Management

Organization tokens are used to access organization APIs, supporting create, read, update, and delete operations.

List Tokens

Retrieve all access tokens for the current organization.

Request

http
GET /api/v2/organization/tokens/

Permissions

Only the organization creator can manage tokens.

Response

json
[
    {
        "id": "token_id",
        "name": "Token Name",
        "token": "access_token",
        "is_active": true,
        "expires_at": "2024-12-31T23:59:59Z",
        "created_at": "2024-01-08T10:00:00Z",
        "last_used_at": "2024-01-08T10:00:00Z"
    }
]

Create Token

Create a new organization access token.

Request

http
POST /api/v2/organization/tokens/

Request Parameters

FieldTypeRequiredDescription
namestringYesToken name
expires_atstringNoExpiration time (ISO 8601 format)

Request Example

json
{
    "name": "API Access Token",
    "expires_at": "2024-12-31T23:59:59Z"
}

Response

Returns the created token information, same format as list items.

Update Token

Update existing token information.

Request

http
PUT /api/v2/organization/tokens/{token_id}/

Request Parameters

FieldTypeRequiredDescription
namestringNoToken name
is_activebooleanNoWhether token is active
expires_atstringNoExpiration time

Request Example

json
{
    "name": "New Token Name",
    "is_active": false
}

Response

Returns the updated token information, same format as list items.

Delete Token

Delete the specified access token.

Request

http
DELETE /api/v2/organization/tokens/{token_id}/

Response

Successful deletion returns 204 status code with no response content.

Error Codes

Error CodeDescription
401Unauthorized
403Forbidden (not creator)
404Token not found
400Bad Request