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
| Name | Type | Required | Description |
|---|---|---|---|
templateId | string | Yes | ID of the template to update. |
params | object | Yes | Fields to update — same shape as create. |
Returns
The updated template object from the SignWell API.
Throws
[xSignwell] templates.update: templateId (string) is required— iftemplateIdis missing.[xSignwell] templates.update: params object is required— ifparamsis not an object.- Re-throws SignWell API errors with
statusCodeandsignwellErrorproperties.
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
- templates.get — fetch a template before updating
- templates.create — create a new template
- templates.delete — delete a template
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
