Fundamentals
Pagination
Page through SignatureAPI list endpoints: set the page size with limit, follow the next and previous links, and fetch every page with a short loop.
All endpoints that list objects provide support for pagination.
Paginated responses return items in reverse chronological order, such that the most recently created object will be returned first on the list and the oldest will be returned last.
The result includes a links object with a previous and a next property. Do a GET to the URLs in those properties to fetch the previous or next page of results.
Diagram as text
Parts
- GET /v1/envelopes: The first request. Add limit to set the page size.
- Page 1: Newest objects. links.previous is null.
- Page 2: Reached by a GET to page 1's links.next.
- Last page: Oldest objects. links.next is null.
Connections
- GET /v1/envelopes to Page 1: returns
- Page 1 to Page 2: links.next
- Page 2 to Last page: links.next
Query parameters
The maximum number of objects to return in the response, from 1 to 20. The default is 20.
A value above 20 returns a 422 validation error. To get more results, follow the next link instead.
List endpoints also take their own filters, such as status and topic on List Envelopes.
Attributes
Paginated responses share a common structure using cursor-based pagination.
Links to fetch the next and previous page of the paginated result.
An array of objects, sorted in reverse chronological order by creation date.
Example
The first page of envelopes, two per page. links.next points to the second page, and links.previous is null because this is the first page.
Fetch every page
Request the first page, collect its data, and follow links.next until it is null. Send the API key with every request, including the ones that follow a link.
const envelopes = [];
let url = "https://api.signatureapi.com/v1/envelopes?limit=20";
while (url) {
const res = await fetch(url, { headers: { "X-API-Key": process.env.SIGNATUREAPI_KEY } });
if (!res.ok) throw new Error(`Request failed with status ${res.status}`);
const page = await res.json();
envelopes.push(...page.data);
url = page.links.next;
}import os
import requests
envelopes = []
url = "https://api.signatureapi.com/v1/envelopes?limit=20"
while url:
res = requests.get(url, headers={"X-API-Key": os.environ["SIGNATUREAPI_KEY"]})
res.raise_for_status()
page = res.json()
envelopes.extend(page["data"])
url = page["links"]["next"]Each request counts toward your rate limit. For long lists, handle 429 responses as described there.