X Enterprises
fastify-x-signwell

xsignwell.templates.getFields

Retrieve the field definitions placed on a SignWell template.

xsignwell.templates.getFields

Retrieve the field definitions (signature, date, text, etc.) placed on a SignWell template. Returns an empty array if no fields are defined.

Signature

fastify.xsignwell.templates.getFields(templateId: string): Promise<Array>

Params

NameTypeRequiredDescription
templateIdstringYesThe SignWell template ID.

Returns

An Array of field definition objects from the template, or [] if none are defined.

Throws

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

Examples

Inspect field definitions on a template

const fields = await fastify.xsignwell.templates.getFields("tmpl_abc123");
// [{ id: "customer_name", type: "text", required: true, ... }, ...]

See also


AI Context

package: "@xenterprises/fastify-xsignwell"
method: fastify.xsignwell.templates.getFields(templateId)
use-when: Inspect the field definitions (signature, text, date fields) placed on a SignWell template
returns: Array of field definition objects, or [] if none
Copyright © 2026