API Reference Tokens
List all API tokens Retrieve a list of all API tokens for your account, including both team-scoped and project-scoped tokens. For each token, the response includes its name, scope, creation date, and usage statistics. The token values are not included in the response for security reasons.
Authorization Authorization
header
string
required
Enter the team access token with the Bearer prefix, e.g. "Bearer team_access_token"
Responses 200 401 429
application/json Data contains the token items
Show data properties
created_at
string
date-time
required
Timestamp when the token was created
Examples:
2025-01-01T12:00:00Z
Unique identifier of the token
Examples:
tok_2G6MJiNz71bHQGNzGwKx5cJwPFS
Examples:
Production API Key
ID of the project this token belongs to
Examples:
proj_A1cce6120E56e7Tu9ioP09Nhjk1
Access scope of the token
Available options:
projectteam
The actual token value (only returned on creation)
status
"success"
string
required
Status indicates the response status "success"
Tokens retrieved successfully
application/json Error response details
Show error properties
Code is the HTTP status code
Message is a human-readable error description
Examples:
Authentication error: invalid token or subscription inactive
type
"AuthenticationError"
string
required
Type indicates the error category
Available options:
AuthenticationError
status
"error"
string
required
Status indicates the response status "error"
Authentication error: invalid token or subscription inactive
application/json Error response details
Show error properties
Code is the HTTP status code
Message is a human-readable error description
Examples:
Rate limit exceeded
type
"TooManyRequestsError"
string
required
Type indicates the error category
Available options:
TooManyRequestsError
status
"error"
string
required
Status indicates the response status "error"
Rate limit exceeded
# List all API tokens
> Retrieve a list of all API tokens for your account, including both team-scoped and project-scoped tokens. For each token, the response includes its name, scope, creation date, and usage statistics. The token values are not included in the response for security reasons.
```json
{
"path": "/api/tokens",
"method": "get",
"schema": {
"description": "Retrieve a list of all API tokens for your account, including both team-scoped and project-scoped tokens. For each token, the response includes its name, scope, creation date, and usage statistics. The token values are not included in the response for security reasons.",
"operationId": "listTokens",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenListResponse"
}
}
},
"description": "Tokens retrieved successfully"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ResponseErrorAuthentication"
}
}
},
"description": "Authentication error: invalid token or subscription inactive"
},
"429": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ResponseErrorTooManyRequests"
}
}
},
"description": "Rate limit exceeded"
}
},
"security": [
{
"TeamAccessToken": []
}
],
"summary": "List all API tokens",
"tags": [
"Tokens"
],
"x-codeSamples": [
{
"lang": "JavaScript",
"source": "import Chunkify from '@chunkify/chunkify';\n\nconst client = new Chunkify({\n teamAccessToken: 'My Team Access Token',\n});\n\nconst tokens = await client.tokens.list();\n\nconsole.log(tokens);"
},
{
"lang": "Python",
"source": "from chunkify import Chunkify\n\nclient = Chunkify(\n team_access_token=\"My Team Access Token\",\n)\ntokens = client.tokens.list()\nprint(tokens)"
},
{
"lang": "php",
"source": "\u003c?php\n\nuse Chunkify\\Client;\n\n$client = new Client(\n teamAccessToken: 'My Team Access Token',\n);\n\n$tokens = $client-\u003etokens-\u003elist();\n\nvar_dump($tokens);"
},
{
"lang": "Go",
"source": "package main\n\nimport (\n \"context\"\n \"fmt\"\n\n \"github.com/chunkifydev/chunkify-go\"\n \"github.com/chunkifydev/chunkify-go/option\"\n)\n\nfunc main() {\n client := chunkify.NewClient(\n option.WithTeamAccessToken(\"My Team Access Token\"),\n )\n tokens, err := client.Tokens.List(context.TODO())\n if err != nil {\n panic(err.Error())\n }\n fmt.Printf(\"%+v\\n\", tokens)\n}\n"
}
]
}
}
```
```json #/components/schemas/TokenListResponse
{
"description": "Response containing the list of all tokens for a team. Including project and team tokens.",
"properties": {
"data": {
"description": "Data contains the token items",
"items": {
"$ref": "#/components/schemas/Token"
},
"type": "array"
},
"status": {
"const": "success",
"description": "Status indicates the response status \"success\"",
"type": "string"
}
},
"required": [
"data",
"status"
],
"type": "object"
}
```
```json #/components/schemas/Token
{
"properties": {
"created_at": {
"description": "Timestamp when the token was created",
"examples": [
"2025-01-01T12:00:00Z"
],
"format": "date-time",
"type": "string"
},
"id": {
"description": "Unique identifier of the token",
"examples": [
"tok_2G6MJiNz71bHQGNzGwKx5cJwPFS"
],
"type": "string"
},
"name": {
"description": "Name given to the token",
"examples": [
"Production API Key"
],
"type": "string"
},
"project_id": {
"description": "ID of the project this token belongs to",
"examples": [
"proj_A1cce6120E56e7Tu9ioP09Nhjk1"
],
"type": "string"
},
"scope": {
"$ref": "#/components/schemas/TokenScope",
"description": "Access scope of the token"
},
"token": {
"description": "The actual token value (only returned on creation)",
"examples": [
"sk_project..."
],
"type": "string"
}
},
"required": [
"id",
"name",
"project_id",
"scope",
"token",
"created_at"
],
"type": "object"
}
```
```json #/components/schemas/TokenScope
{
"enum": [
"project",
"team"
],
"type": "string"
}
```
```json #/components/schemas/ResponseErrorAuthentication
{
"description": "Error response",
"properties": {
"error": {
"description": "Error response details",
"properties": {
"code": {
"const": 401,
"description": "Code is the HTTP status code",
"examples": [
401
],
"type": "integer"
},
"message": {
"description": "Message is a human-readable error description",
"examples": [
"Authentication error: invalid token or subscription inactive"
],
"type": "string"
},
"type": {
"const": "AuthenticationError",
"description": "Type indicates the error category",
"enum": [
"AuthenticationError"
],
"type": "string"
}
},
"required": [
"type",
"code",
"message"
],
"type": "object"
},
"status": {
"const": "error",
"description": "Status indicates the response status \"error\"",
"type": "string"
}
},
"required": [
"status",
"error"
],
"type": "object"
}
```
```json #/components/schemas/ResponseErrorTooManyRequests
{
"description": "Error response",
"properties": {
"error": {
"description": "Error response details",
"properties": {
"code": {
"const": 429,
"description": "Code is the HTTP status code",
"examples": [
429
],
"type": "integer"
},
"message": {
"description": "Message is a human-readable error description",
"examples": [
"Rate limit exceeded"
],
"type": "string"
},
"type": {
"const": "TooManyRequestsError",
"description": "Type indicates the error category",
"enum": [
"TooManyRequestsError"
],
"type": "string"
}
},
"required": [
"type",
"code",
"message"
],
"type": "object"
},
"status": {
"const": "error",
"description": "Status indicates the response status \"error\"",
"type": "string"
}
},
"required": [
"status",
"error"
],
"type": "object"
}
```