# List all tokens

Launch stage: GA

`GET /api/2.0/token-management/tokens`

`GET /api/2.0/preview/token-management/tokens`

Lists all tokens associated with the specified workspace or user.

API scopes: authentication

## Query parameters

- `created_by_id` (int64, optional)
  User ID of the user that created the token.
- `created_by_username` (string, optional)
  Username of the user that created the token.

## Returns

Returns a list of AdminTokenInfo objects.

## Response

```json
{
  "token_infos": [
    {
      "token_id": "5684c955822ac792a51ae2aeb80190f13457bab3e2e2934c133a08b38454816c",
      "creation_time": 1580265020299,
      "expiry_time": 1580265020299,
      "comment": "This is for the ABC department automation scripts.",
      "created_by_id": 202480738464078,
      "created_by_username": "jsmith@example.com",
      "owner_id": 202480738464078,
      "workspace_id": 5750939285643220,
      "last_used_day": 1710374400000,
      "scopes": [
        "string"
      ]
    }
  ]
}
```

