Appearance
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
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Token name |
| expires_at | string | No | Expiration 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
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | No | Token name |
| is_active | boolean | No | Whether token is active |
| expires_at | string | No | Expiration 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 Code | Description |
|---|---|
| 401 | Unauthorized |
| 403 | Forbidden (not creator) |
| 404 | Token not found |
| 400 | Bad Request |
