List segments
list_segmentsRetrieve and filter segments for a Beehiiv publication, with optional pagination, sorting, and stats expansion. Use it to inspect audience groups and their status.
Instructions
List segments. Reads account data. OAuth integrations require segments:read.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Pagination returns the results in pages. Each page contains the number of results specified by the `limit` (default: 10). If not specified, results 1-10 from page 1 will be returned. | |
| type | No | Optionally filter the results by the segment's type. | all |
| limit | No | A limit on the number of objects to be returned. The limit can range between 1 and 100, and the default is 10. | |
| expand | No | Optionally expand the response to include additional data. `stats` - Requests the most recently calculated statistics for a segment. Segment stats are recalculated once daily around 7 a.m. UTC for dynamic segments, but can be manually recalculated at any time in the dashboard. Manual and static segments only calculate once upon upload or creation. | |
| status | No | Optionally filter the results by the segment's status. | all |
| account | No | Named private account from BEEHIIV_ACCOUNTS. Defaults to BEEHIIV_DEFAULT_ACCOUNT or the first configured account. | |
| order_by | No | The field that the results are sorted by. Defaults to created `created` - The time in which the segment was first created. `last_calculated` - The time that the segment last completed calculation. Measured in seconds since the Unix epoch. | created |
| direction | No | The direction that the results are sorted in. Defaults to asc `asc` - Ascending, sorts from smallest to largest. `desc` - Descending, sorts from largest to smallest. | asc |
| publication_id | Yes | The prefixed ID of the publication object |