X Enterprises
fastify-x-signwell

xsignwell.templates.update

Update an existing SignWell template's properties.

xsignwell.templates.update

Update an existing SignWell template by ID. Accepts the same shape of fields as templates.create.

Signature

fastify.xsignwell.templates.update(
  templateId: string,
  params: Record<string, unknown>
): Promise<Object>

Params

NameTypeRequiredDescription
templateIdstringYesID of the template to update.
paramsobjectYesFields to update — same shape as create.

Returns

The updated template object from the SignWell API.

Throws

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

Examples

Update template subject on brand change

fastify.patch("/templates/:templateId", async (request, reply) => {
  const { subject, message } = request.body;

  const updated = await fastify.xsignwell.templates.update(
    request.params.templateId,
    { subject, message }
  );

  return reply.send({ id: updated.id });
});

Update just the template name

const updated = await fastify.xsignwell.templates.update("tmpl_abc123", {
  name: "Updated NDA Template",
});

See also


AI Context

package: "@xenterprises/fastify-xsignwell"
method: fastify.xsignwell.templates.update(templateId, params)
use-when: Update an existing SignWell template's name, subject, message, or other properties
params: templateId (required), params object with same shape as create (required)
returns: The updated template object
Copyright © 2026