fastify-x-signwell
xsignwell.documents.list
List all SignWell documents with optional page-based pagination.
xsignwell.documents.list
List all SignWell documents with optional page-based pagination.
Signature
fastify.xsignwell.documents.list(
params?: { page?: number; limit?: number }
): Promise<Object>
Params
| Name | Type | Required | Description |
|---|---|---|---|
params.page | number | No | Page number for pagination. |
params.limit | number | No | Number of documents per page. |
Returns
A paginated response object from the SignWell API with an array of document summaries.
Throws
- Re-throws SignWell API errors with
statusCodeandsignwellErrorproperties.
Examples
First page of documents
const result = await fastify.xsignwell.documents.list({ limit: 20 });
for (const doc of result.documents) {
console.log(doc.id, doc.status);
}
Paginate through all documents
async function getAllDocuments() {
const all = [];
let page = 1;
while (true) {
const result = await fastify.xsignwell.documents.list({ page, limit: 50 });
all.push(...result.documents);
if (!result.documents.length || result.documents.length < 50) break;
page++;
}
return all;
}
See also
- documents.get — fetch a single document by ID
- documents.create — create a new document
- documents.getCompletedPdf / documents.getAuditTrail — download completed documents
- documents.send / documents.remind / documents.delete — send, remind, or delete a document
AI Context
package: "@xenterprises/fastify-xsignwell"
method: fastify.xsignwell.documents.list(params?)
use-when: List all SignWell documents with optional page-based pagination to browse or audit documents
params: page (optional), limit (optional)
returns: Paginated response with array of document summaries
