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

# client.projects.listAllTokens()

> List live project-scoped tokens.

Return a page of tokens that have not expired or been revoked, newest first. Only IDs and metadata are returned. Requires an API key or signed-in user.

The `listAll*` variant yields items across every page. The other variant returns one page with pagination metadata. See [Pagination](https://docs.platform.toloka.ai/docs/sdk/pagination.md).

## Signature

Method signatures on `client.projects`:

```ts theme={null}
listAllTokens(args: {
  projectId: string;
  limit?: number;
  offset?: number;
}): AsyncGenerator<ScopedTokenSummary>;

listTokens(args: {
  projectId: string;
  limit?: number;
  offset?: number;
}): Promise<{ tokens: ScopedTokenSummary[]; pagination: Pagination }>;
```

## Parameters

### listAllTokens()

**projectId** `string` *required*

Project ID with prefix `pp.`.

**limit** `number` (default: 20)

Maximum number of results to return; defaults to 20.

**offset** `number` (default: 0)

Number of results to skip before this page; defaults to 0.

### listTokens()

**projectId** `string` *required*

Project ID with prefix `pp.`.

**limit** `number` (default: 20)

Maximum number of results to return; defaults to 20.

**offset** `number` (default: 0)

Number of results to skip before this page; defaults to 0.

## Returns

### listAllTokens() result

`AsyncGenerator<ScopedTokenSummary>`

Yields one item at a time. The fields below describe each yielded item.

**id** `string` *required*

Public token ID with prefix `pst.`, used to revoke the token.

**userId** `string` *required*

The user the token acts as.

**projectIds** `ProjectId[]` *required*

Projects the token can act in.

**permissions** `string[]` *required*

Granted permissions, written as `resource:operation` strings.

**createdAt** `string` *required*

Time the token was created, as an ISO 8601 timestamp.

**expiresAt** `string` *required*

Time the token expires, as an ISO 8601 timestamp.

### listTokens() result

`Promise<{ tokens: ScopedTokenSummary[]; pagination: Pagination }>`

**tokens** `ScopedTokenSummary[]` *required*

Live scoped tokens in this page.

**Fields**

**id** `string` *required*

Public token ID with prefix `pst.`, used to revoke the token.

**userId** `string` *required*

The user the token acts as.

**projectIds** `ProjectId[]` *required*

Projects the token can act in.

See the [HTTP endpoint](https://docs.platform.toloka.ai/docs/api-reference/projects/list-project-tokens.md) for the complete schema.

**permissions** `string[]` *required*

Granted permissions, written as `resource:operation` strings.

See the [HTTP endpoint](https://docs.platform.toloka.ai/docs/api-reference/projects/list-project-tokens.md) for the complete schema.

**createdAt** `string` *required*

Time the token was created, as an ISO 8601 timestamp.

**expiresAt** `string` *required*

Time the token expires, as an ISO 8601 timestamp.

**pagination** `Pagination` *required*

Pagination information for this page.

**Fields**

**total** `number` *required*

Total number of matching results.

**limit** `number` *required*

Maximum number of results requested for this page.

**offset** `number` *required*

Number of results skipped before this page.

**hasMore** `boolean` *required*

Whether more matching results follow this page.

## Errors

HTTP errors throw [`PotatoApiError`](https://docs.platform.toloka.ai/docs/sdk/errors). The endpoint documents these error responses:

| Status | Description |
| - | - |
| 404 | Project not found |
| 429 | Rate limit exceeded |

HTTP endpoint: [`GET /projects/{projectId}/tokens`](https://docs.platform.toloka.ai/docs/api-reference/projects/list-project-tokens).

```ts listAllTokens() theme={null}
import { createClient } from "@toloka-platform/sdk";

const client = createClient({
  baseUrl: "https://platform.toloka.ai",
  apiKey: process.env.TOLOKA_API_KEY!,
});

for await (const item of client.projects.listAllTokens({
  projectId: "pp.019a0000-0000-7000-8000-000000000001"
})) {
  console.log(item);
}
```

```ts listTokens() theme={null}
import { createClient } from "@toloka-platform/sdk";

const client = createClient({
  baseUrl: "https://platform.toloka.ai",
  apiKey: process.env.TOLOKA_API_KEY!,
});

const page = await client.projects.listTokens({
  projectId: "pp.019a0000-0000-7000-8000-000000000001"
});
console.log(page);
```

```json listAllTokens() yielded item theme={null}
{
  "id": "pst.019a0000-0000-7000-8000-000000000001",
  "userId": "<string>",
  "projectIds": [
    "pp.019a0000-0000-7000-8000-000000000001"
  ],
  "permissions": [
    "<string>"
  ],
  "createdAt": "2026-01-01T00:00:00Z",
  "expiresAt": "2026-01-01T00:00:00Z"
}
```

```json listTokens() theme={null}
{
  "tokens": [
    {
      "id": "pst.019a0000-0000-7000-8000-000000000001",
      "userId": "<string>",
      "projectIds": [
        "pp.019a0000-0000-7000-8000-000000000001"
      ],
      "permissions": [
        "<string>"
      ],
      "createdAt": "2026-01-01T00:00:00Z",
      "expiresAt": "2026-01-01T00:00:00Z"
    }
  ],
  "pagination": {
    "total": 42,
    "limit": 20,
    "offset": 0,
    "hasMore": true
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.