# List subscribers

URL: https://docs.hanzo.ai/docs/openapi/marketing/get-marketing-lists-by-id-subscribers

> Returns a page of one list's subscribers, newest first unless asked otherwise.

`GET /v1/marketing/lists/{id}/subscribers`

> [Marketing →](https://docs.hanzo.ai/docs/openapi/marketing) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                            |
| ------------- | ---------------------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/marketing/lists/{id}/subscribers` |
| **Method**    | `GET`                                                      |
| **Operation** | `get_marketing_lists_by_id_subscribers`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`                     |

Returns a page of one list's subscribers, newest first unless asked
otherwise. Every filter (status, tag, source, ref, consent basis, a prefix of
the address or name, a custom field's value, ranges of when they joined and
confirmed, and whether they opened or clicked since a time) walks an index of
its own, so a page costs the same on a list of ten rows or ten million.
Continue with next.

## Request

21 fields.

| Field             | In    | Type    | Required | Description                                                                                                          |
| ----------------- | ----- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------- |
| `id`              | path  | string  | yes      | ID is the list, by id or slug, from the path.                                                                        |
| `status`          | query | string  | —        | Status is one status or several, comma-separated: pending, subscribed, unsubscribed, bounced, complained, cleaned.   |
| `tag`             | query | string  | —        | Tag keeps subscribers carrying this tag.                                                                             |
| `source`          | query | string  | —        | Source keeps subscribers that came from this kind of source: form, page, api, import or commerce.                    |
| `ref`             | query | string  | —        | Ref keeps subscribers from one source instance: a form id, a page, an import batch id.                               |
| `basis`           | query | string  | —        | Basis keeps subscribers by the consent basis recorded for them: explicit, legitimate\_interest or unverified.        |
| `q`               | query | string  | —        | Q keeps subscribers whose address or name begins with it, case-insensitively.                                        |
| `field`           | query | string  | —        | Field names a custom field, and Value keeps subscribers whose value for it is exactly this.                          |
| `value`           | query | string  | —        | Value is the custom field's value Field keeps.                                                                       |
| `createdAfter`    | query | integer | —        | CreatedAfter and CreatedBefore bound when the subscriber joined the list, unix seconds, inclusive.                   |
| `createdBefore`   | query | integer | —        | CreatedBefore is the upper bound of CreatedAfter's range.                                                            |
| `confirmedAfter`  | query | integer | —        | ConfirmedAfter and ConfirmedBefore bound when the subscription was confirmed, unix seconds, inclusive.               |
| `confirmedBefore` | query | integer | —        | ConfirmedBefore is the upper bound of ConfirmedAfter's range.                                                        |
| `openedAfter`     | query | integer | —        | OpenedAfter keeps subscribers who opened a broadcast at or after this time.                                          |
| `notOpenedSince`  | query | integer | —        | NotOpenedSince keeps subscribers who have opened nothing since this time, including those who never opened anything. |
| `clickedAfter`    | query | integer | —        | ClickedAfter keeps subscribers who clicked a link at or after this time.                                             |
| `segment`         | query | string  | —        | Segment applies a saved segment of the list; the filter fields narrow it further.                                    |
| `sort`            | query | string  | —        | Sort is created (the default), email, name, confirmed or opened.                                                     |
| `order`           | query | string  | —        | Order is desc (the default) or asc.                                                                                  |
| `cursor`          | query | string  | —        | Cursor continues from where the previous page ended.                                                                 |
| `limit`           | query | integer | —        | Limit is the page size, 50 by default and at most 500.                                                               |

## Response

| Status    | Body                     | Meaning |
| --------- | ------------------------ | ------- |
| `200`     | marketing.SubscriberPage | ok      |
| `default` | problem-details          | refused |

`200` body — 33 fields.

| Field                     | In   | Type                    | Always | Description                                                                                                         |
| ------------------------- | ---- | ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------- |
| `data`                    | body | marketing.Subscriber\[] | —      | Data is the page.                                                                                                   |
| `data[].clicks`           | body | integer (int64)         | —      | Clicks counts the clicks reported.                                                                                  |
| `data[].confirmedAt`      | body | integer (int64)         | —      | ConfirmedAt is when the subscription was confirmed or, for one that needed no confirmation, began; 0 while pending. |
| `data[].consent`          | body | marketing.Consent       | —      |                                                                                                                     |
| `data[].consent.at`       | body | integer (int64)         | —      | At is when it was given, unix seconds; for an import, the date the file carried when it carried one.                |
| `data[].consent.basis`    | body | string                  | —      | Basis is explicit, legitimate\_interest or unverified.                                                              |
| `data[].consent.dnt`      | body | boolean                 | —      | DNT records that the request carried Do Not Track (DNT: 1).                                                         |
| `data[].consent.gpc`      | body | boolean                 | —      | GPC records that the request carried Global Privacy Control (Sec-GPC: 1).                                           |
| `data[].consent.ip`       | body | string                  | —      | IP is the network address it was given from, when it was given here.                                                |
| `data[].consent.language` | body | string                  | —      | Language is the language it was asked in.                                                                           |
| `data[].consent.method`   | body | string                  | —      | Method is how it was given: double\_opt\_in, single\_opt\_in, import, api, preferences or commerce.                 |
| `data[].consent.page`     | body | string                  | —      | Page is the form or page it was given on.                                                                           |
| `data[].createdAt`        | body | integer (int64)         | —      | CreatedAt is when the row was created, unix seconds.                                                                |
| `data[].email`            | body | string                  | —      | Email is the address, lower-cased and trimmed; one row per address per list.                                        |
| `data[].fields`           | body | object                  | —      | Fields are the values of the org's custom fields, by key.                                                           |
| `data[].fields.*`         | body | string                  | —      |                                                                                                                     |
| `data[].id`               | body | integer (int64)         | —      | ID is the subscriber's id within the org.                                                                           |
| `data[].language`         | body | string                  | —      | Language is the subscriber's language, a BCP 47 tag.                                                                |
| `data[].lastClickAt`      | body | integer (int64)         | —      | LastClickAt is the last click the email plane reported.                                                             |
| `data[].lastOpenAt`       | body | integer (int64)         | —      | LastOpenAt is the last open the email plane reported.                                                               |
| `data[].lastSentAt`       | body | integer (int64)         | —      | LastSentAt is the last broadcast sent to them.                                                                      |
| `data[].list`             | body | string                  | —      | List is the list's id.                                                                                              |
| `data[].name`             | body | string                  | —      | Name is the person's name, as given.                                                                                |
| `data[].opens`            | body | integer (int64)         | —      | Opens counts the opens reported.                                                                                    |
| `data[].person`           | body | string                  | —      | Person is the CRM person the address is: the key the event stream, the CRM and Insights join on.                    |
| `data[].ref`              | body | string                  | —      | Ref is that place: a form id, a page, an import batch id.                                                           |
| `data[].source`           | body | string                  | —      | Source is the kind of place the membership came from: form, page, api, import or commerce.                          |
| `data[].status`           | body | string                  | —      | Status is pending, subscribed, unsubscribed, bounced, complained or cleaned.                                        |
| `data[].tags`             | body | string\[]               | —      | Tags label the subscriber; each at most 64 characters.                                                              |
| `data[].unsubscribedAt`   | body | integer (int64)         | —      | UnsubscribedAt is when the subscriber left; 0 while they have not.                                                  |
| `data[].updatedAt`        | body | integer (int64)         | —      | UpdatedAt is the last change, unix seconds.                                                                         |
| `next`                    | body | string                  | —      | Next continues the walk; empty when this is the last page.                                                          |
| `total`                   | body | integer (int64)         | —      | Total is how many subscribers match, when the list knows without reading them: the whole list or a set of statuses. |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo marketing lists subscribers list <id>
```

**SDK**

**.ts**

```ts
import { Configuration, MarketingApi } from 'hanzoai';

const api = new MarketingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getMarketingListsByIdSubscribers({ id: 'id' });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import MarketingApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = MarketingApi(client).get_marketing_lists_by_id_subscribers(id='id')
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.MarketingAPI.GetMarketingListsByIdSubscribers(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, marketing_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = marketing_api::get_marketing_lists_by_id_subscribers(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.MarketingApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new MarketingApi(client).getMarketingListsByIdSubscribers();
```

The method above is the one at the current release of the document. `hanzoai@8.5.914` (npm) and `hanzoai@8.5.914` (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. [SDKs →](https://docs.hanzo.ai/docs/sdks)

**HTTP**

```bash
curl https://api.hanzo.ai/v1/marketing/lists/<id>/subscribers \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **marketing** through the `marketing` tool, which names its 82 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_marketing_audiences"
         }
       }
     }'
```

---

[Marketing API](https://docs.hanzo.ai/docs/openapi/marketing) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
