Appearance
Pagination
List operations return newest first, one page at a time, with a next_cursor:
json
{
"signing_requests": [ … ],
"next_cursor": "c3e9a7b1-2d4f-4a6c-8e1b-5f7d9a2c4e6b"
}Pass it back as cursor for the next page. When next_cursor is null, you have everything.
| Operation | Page size |
|---|---|
| List templates | 100 |
| List signing requests | 50 |
Treat a cursor as opaque. Don't build one yourself, and don't keep it for long. Records created after you start come before the first page, so you won't see them until you start again from the top.
js
async function allSigningRequests() {
const all = [];
let cursor = null;
do {
const url = new URL("https://tryjustdocs.com/api/v1/signing-requests");
if (cursor) url.searchParams.set("cursor", cursor);
const response = await fetch(url, { headers: { Authorization: `Bearer ${process.env.JUSTDOCS_API_KEY}` } });
const page = await response.json();
all.push(...page.signing_requests);
cursor = page.next_cursor;
} while (cursor);
return all;
}python
import os
import requests
def all_signing_requests():
headers = {"Authorization": f"Bearer {os.environ['JUSTDOCS_API_KEY']}"}
cursor, everything = None, []
while True:
params = {"cursor": cursor} if cursor else {}
page = requests.get("https://tryjustdocs.com/api/v1/signing-requests", headers=headers, params=params, timeout=30).json()
everything += page["signing_requests"]
cursor = page["next_cursor"]
if not cursor:
return everythingIn MCP, pass next_cursor as the cursor argument of list_templates or list_signing_requests.