fastify-x-signwell
xsignwell.templates.get
Fetch a single SignWell template by ID.
xsignwell.templates.get
Fetch a single template by its SignWell ID. Returns the full template object including name, fields, and recipient placeholders.
Signature
fastify.xsignwell.templates.get(templateId: string): Promise<Object>
Params
| Name | Type | Required | Description |
|---|---|---|---|
templateId | string | Yes | The SignWell template ID. |
Returns
The full template object including id, name, fields[], and recipients[].
Throws
[xSignwell] templates.get: templateId (string) is required— iftemplateIdis missing.- Re-throws SignWell API errors with
statusCodeandsignwellErrorproperties.
Examples
Fetch a template by ID
const template = await fastify.xsignwell.templates.get("tmpl_abc123");
console.log(template.name); // "NDA Template"
console.log(template.recipients); // [{ id: "signer_1", name: "Customer" }]
See also
- templates.getFields — extract field definitions from a template
- templates.getRecipients — extract recipient placeholders from a template
- templates.update — update a template
- templates.delete — delete a template
- documents.createFromTemplate — instantiate a document from a template
AI Context
package: "@xenterprises/fastify-xsignwell"
method: fastify.xsignwell.templates.get(templateId)
use-when: Fetch a single SignWell template by ID to inspect its name, fields, and recipients
returns: Full template object with id, name, fields[], recipients[]
