# List lists

> **GET** `https://api.us.nylas.com/v3/lists`

Source: https://developer.nylas.com/docs/reference/api/lists/list-lists/

Returns all lists for your application.

**Authentication:** NYLAS_API_KEY

## Parameters

### Query parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | No | The maximum number of objects to return. See [Pagination](/docs/reference/api/#pagination) for more information. |
| `page_token` | string | No | A token to fetch the next page of results. Use the `next_cursor` value from the previous response. |

## Responses

### 200 - OK

- `request_id` (string) - ID of the request.
- `data` (array)
  - `id` (string) - Globally unique identifier for the list (UUID).
  - `name` (string) - A human-readable name for the list. 1–256 characters. Required on create.
  - `description` (string) - An optional description of the list's purpose.
  - `type` (string) - The kind of values the list holds and which rule condition fields it can be used with. Required on create and
immutable after creation. `domain` holds domain names (matched against `from.domain` or `recipient.domain`),
`tld` holds top-level domains (matched against `from.tld` or `recipient.tld`), and `address` holds full email
addresses (matched against `from.address` or `recipient.address`).
  - `items_count` (integer) - The number of items currently in the list. Read-only; maintained by the system.
  - `application_id` (string) - The ID of the application that owns the list. Read-only; derived from the authenticated API key.
  - `organization_id` (string) - The ID of the Nylas organization that owns the list. Read-only; derived from the authenticated API key.
  - `created_at` (integer) - When the list was created, in seconds using the Unix timestamp format.
  - `updated_at` (integer) - When the list was last updated, in seconds using the Unix timestamp format.
- `next_cursor` (string) - A token to use for paginating through results. If present, pass this value as `page_token` in the next request.

### 400 - Bad Request

- `request_id` (string) - The request ID.
- `error` (object) - The response error object.
  - `type` (string) - The error type.
  - `message` (string) - The error message.
  - `provider_error` (object) - The error from the provider.

### 401 - Unauthorized

- `request_id` (string) - The request ID.
- `error` (object) - The response error object.
  - `type` (string) - The error type.
  - `message` (string) - The error message.
  - `provider_error` (object) - The error from the provider.

### 429 - Rate Limit

- `request_id` (string) - The request ID.
- `error` (object) - The response error object.
  - `type` (string) - The error type.
  - `message` (string) - The error message.

## Code samples

### cURL

```bash
curl -X GET "https://api.us.nylas.com/v3/lists?limit=50" \
  -H "Authorization: Bearer <NYLAS_API_KEY>"

```

### Node.js SDK

```javascript
import Nylas from "nylas";

const nylas = new Nylas({
  apiKey: "<NYLAS_API_KEY>",
  apiUri: "<NYLAS_API_URI>",
});

async function listAgentLists() {
  try {
    const lists = await nylas.lists.list({
      queryParams: {
        limit: 10,
      },
    });

    console.log("Lists:", lists);
  } catch (error) {
    console.error("Error listing lists:", error);
  }
}

listAgentLists();

```

### Python SDK

```python
from nylas import Client

nylas = Client(
    "<NYLAS_API_KEY>",
    "<NYLAS_API_URI>",
)

lists = nylas.lists.list(
    query_params={
        "limit": 50,
    },
)

print(lists)

```
