> ## Documentation Index
> Fetch the complete documentation index at: https://docs.akua.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# List API tokens

Returns metadata for your own API tokens. Full token values are never shown after creation.

`GET https://api.akua.dev/v1/api_tokens`

## Authorizations

- `Authorization: Bearer <token>` (BearerAuth): Bearer token for the authenticated caller.

## Query Parameters

- `cursor` (string): Pagination cursor from a previous response's `next_cursor`.
- `limit` (integer, default 50): Items per page (1-100, default 50). Required range: `1 <= x <= 100`. Example: `50`.

## Response

### 200: Your API tokens, newest first

`application/json`: `ApiTokenList`

- `data` (object[], required)
  - `id` (string, required): API token ID. Required string length: `3 - 54`. Example: `"tok_3k9x2mfq8a1b7c4d5e6f"`.
  - `name` (string, required): Required string length: `1 - 100`. Example: `"My CLI token"`.
  - `prefix` (string, required): The first 12 characters of the token, for recognizing it. Never the secret. Example: `"sk_akua_a3B2"`.
  - `workspace_id` (string | null, required): The only Workspace the token may act in. Omitted or null: every Workspace the person may use. Required string length: `2 - 53`. Example: `"ws_j572abc123def4"`.
  - `roles` (string[] | null, required): A ceiling of IAM roles: the token may do only what one of these roles includes, and only what the person may. Omitted or null: the rights of the person. Required array length: `1 - 16 elements`. Example: `["roles/viewer"]`.
  - `created_at` (integer, required): Unix timestamp (seconds). Required range: `x >= 0`.
  - `last_used_at` (integer | null, required): Unix timestamp (seconds) of last use, or null if never used. Required range: `x >= 0`.
  - `expires_at` (integer | null, required): Unix timestamp (seconds) when the token expires, or null if never. Required range: `x >= 0`.
- `has_more` (boolean, required): True if more items exist after this page.
- `next_cursor` (string | null, required): Opaque cursor for the next page, or null if no more pages.

### 400: The request is malformed.

`application/json`: `ApiBadRequest`

- `_tag` (enum<string>, required): Available options: `"Validation"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 401: Missing, invalid or expired credential.

`application/json`: `ApiUnauthorized`

- `_tag` (enum<string>, required): Available options: `"Unauthorized"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 403: The credential may not act in this workspace.

`application/json`: `ApiForbidden`

- `_tag` (enum<string>, required): Available options: `"Forbidden"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

## Example request

```bash
curl --request GET \
  --url 'https://api.akua.dev/v1/api_tokens' \
  --header 'Authorization: Bearer <token>'
```

## Example response

`200` `application/json`

```json
{
  "data": [
    {
      "id": "tok_3k9x2mfq8a1b7c4d5e6f",
      "name": "My CLI token",
      "prefix": "sk_akua_a3B2",
      "workspace_id": "ws_j572abc123def4",
      "roles": [
        "roles/viewer"
      ],
      "created_at": 123,
      "last_used_at": 123,
      "expires_at": 123
    }
  ],
  "has_more": true,
  "next_cursor": "<string>"
}
```
