X Enterprises
fastify-x-signwell

xsignwell.documents.get

Fetch a single SignWell document by ID.

xsignwell.documents.get

Fetch a single SignWell document by its ID. Returns the full document object including status, recipients, and timestamps.

Signature

fastify.xsignwell.documents.get(documentId: string): Promise<Object>

Params

NameTypeRequiredDescription
documentIdstringYesThe SignWell document ID.

Returns

The document object including id, name, status, recipients[], created_at, completed_at, and more.

Throws

  • [xSignwell] documents.get: documentId (string) is required — if documentId is missing.
  • Re-throws SignWell API errors with statusCode and signwellError properties.

Examples

Fetch a document by ID

const doc = await fastify.xsignwell.documents.get("doc_abc123");

console.log(doc.status);           // "sent", "completed", "declined", etc.
console.log(doc.recipients[0].id); // recipient ID for embedded signing

Realistic — poll document status

fastify.get("/contracts/:documentId/status", async (request, reply) => {
  const doc = await fastify.xsignwell.documents.get(request.params.documentId);

  const recipientStatuses = doc.recipients.map((r) => ({
    name: r.name,
    email: r.email,
    signed: r.status === "completed",
  }));

  return reply.send({
    status: doc.status,
    completed: doc.status === "completed",
    recipients: recipientStatuses,
  });
});

See also


AI Context

package: "@xenterprises/fastify-xsignwell"
method: fastify.xsignwell.documents.get(documentId)
use-when: Fetch a single SignWell document by ID to check its status, recipients, or completion details
returns: Document object with id, name, status, recipients[], created_at, completed_at
Copyright © 2026