The Writer API supports pagination for list endpoints. By default, the API returns 50 results per page. See below for more information about how to paginate your API requests.
The following parameters are available for pagination in the API:
Parameter | Type | Description |
---|---|---|
limit | integer | The number of items to return per page. The default is 50. The maximum is 100. |
order | string | The order in which to return the items, based on the created_at field for the resource. The default is desc . The possible values are asc and desc . |
before | string | The ID of first object in the previous page. This parameter instructs the API to return the previous page of results. |
after | string | The ID of the last object in the next page. This parameter instructs the API to return the next page of results. |
The API returns the following pagination information in the response body:
Parameter | Type | Description |
---|---|---|
has_more | boolean | Indicates whether there are more pages of results. |
first_id | string | The ID of the first object in the collection. |
last_id | string | The ID of the last object in the collection. |
The following cURL command retrieves the two most recently created files.
The response body contains the two most recently created files, along with the pagination information:
has_more
parameter is true
, indicating that there are more files to retrievefirst_id
parameter is the ID of the first file in the collectionlast_id
parameter is the ID of the last file in the collectionTo retrieve the next page of results, you can use the after
parameter to specify the ID of the last object in the previous page.
The Python and JavaScript SDKs provide iterators that automatically handle pagination for you. See more information about pagination in the Python SDK and JavaScript SDK documentation.