Appearance
Pagination
All of the index endpoints for bulk fetching support pagination. The paginated API methods share a structure and accept at least the limit parameter. Making a request without specifying limit will use a default page size of 50.
The response of a paginated API method represents a single page, with the page length being set by the limit parameter. By default, most endpoints will use reverse chronological order (newest objects first). Some endpoints allow for sort, order, and filter parameters. See each endpoint for more details on which parameters they support and the values they accept.
All paginated endpoints use a cursor-based pagination system. You will make your first request to the endpoint with the parameters you want to use. The response will contain the first page of results, and and a next URL that you can use to fetch the next page of results. The next URL contains only the cursor parameter, which is an encoded string that contains the parameters you used in your original request and the place from which the next page of results starts. You only need to include the cursor parameter in subsequent requests, any other parameters supplied in subsequent requests will be ignored in favor of the parameters used in your original request. This is to ensure consistency of the result set when paging through large datasets.
The data property will contain an array of objects. Each one of those objects will have some attributes that are unique to the object type. Some objects will only include a subset of attributes in paginated endpoints and you will need to make a request to the object's urls.details property to retrieve the full details of the object. The urls property may contain other keys with links to query for other related objects as well.
Parameters
| Name | Optional | Default | Description |
|---|---|---|---|
| limit | optional | 50 | The limit of the number of objects returned in a single page, between 1 and 100. |
| cursor | required on subsequent requests | N/A | An encoded string that contains the parameters you used in your original request and the place from which the next page of results starts. |
Page response format
| Name | Type | Description |
|---|---|---|
| object | string | Value is 'array'. A string describing the object type returned |
| has_more | boolean | Whether there are more pages of results available. |
| next | string | The URL to request the next page of results. If not set, this is the last page of results. |
| limit | number | The limit parameter used in the request |
| size | number | The number of elements inside of data |
| data | array | An array containing the response objects for the requested page of results |
Example response
json
{
"object": "array",
"has_more": true,
"next": "/v1/campaigns?cursor=eyJzb3J0IjoibmFtZSIsIm9yZGVyIjoiY...",
"limit": 5,
"size": 5,
"data": [
{
"object": "campaign",
"id": "e76d4cb7-e1e7-4579-ab24-7967377bfdd7",
"name": "Weekly Newsletter",
"status": "active",
"emails_count": 6,
"urls": {
"details": "/v1/campaigns/e76d4cb7-e1e7-4579-ab24-7967377bfdd7",
"emails": "/v1/campaigns/e76d4cb7-e1e7-4579-ab24-7967377bfdd7/emails",
},
},
{...},
{...},
{...},
{...},
],
}