Update a template
const url = 'https://open-api.replyco.com/openapi/template/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'}, body: '{ "name": "Order shipped — UK (v2)", "text": "<p>Hi {{customer}}, your order has shipped.</p>", "inActive": false }'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://open-api.replyco.com/openapi/template/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json-patch+json' \ --data '{ "name": "Order shipped — UK (v2)", "text": "<p>Hi {{customer}}, your order has shipped.</p>", "inActive": false }'Updates an existing template by id and returns the saved template.
Partial update: only the fields you send are changed. Any field you leave out (null) keeps its current value, so you can change just the name, just the body, or just the active state without resending the whole template. Attachments and other internal links are never modified by this endpoint.
Request fields:
name— new name, or omit to keep the current one.text— new body (plain text or HTML; sanitized on save), or omit to keep the current one.inActive—trueto retire the template,falseto re-activate it, or omit to keep the current state.
Best practices:
- To retire a template, set
inActive: truerather than deleting it — this preserves history and any links. - Fetch the current template with
GET /openApi/template/{id}first if you want to review it before changing.
Every update is recorded in the change log so you can see how and when a template was edited.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The id of the template to update.
Request Body
Section titled “Request Body”The fields to change. Omitted fields are left unchanged.
Input model for updating an existing template. This is a partial update: only the fields you send are changed — any field left out (null) keeps its current value. Attachments and other internal links are never affected by this endpoint.
object
New name for the template. Leave out (null) to keep the current name.
Example
Order shipped — UK (v2)New body for the template (plain text or HTML). Leave out (null) to keep the current body. When provided, the HTML is sanitized on save: unsafe markup (scripts, event handlers, etc.) is stripped.
Example
<p>Hi {{customer}}, your order has shipped.</p>New active/inactive state. Leave out (null) to keep the current state;
set true to retire the template or false to re-activate it.
Example
falseInput model for updating an existing template. This is a partial update: only the fields you send are changed — any field left out (null) keeps its current value. Attachments and other internal links are never affected by this endpoint.
object
New name for the template. Leave out (null) to keep the current name.
Example
Order shipped — UK (v2)New body for the template (plain text or HTML). Leave out (null) to keep the current body. When provided, the HTML is sanitized on save: unsafe markup (scripts, event handlers, etc.) is stripped.
Example
<p>Hi {{customer}}, your order has shipped.</p>New active/inactive state. Leave out (null) to keep the current state;
set true to retire the template or false to re-activate it.
Example
falseInput model for updating an existing template. This is a partial update: only the fields you send are changed — any field left out (null) keeps its current value. Attachments and other internal links are never affected by this endpoint.
object
New name for the template. Leave out (null) to keep the current name.
Example
Order shipped — UK (v2)New body for the template (plain text or HTML). Leave out (null) to keep the current body. When provided, the HTML is sanitized on save: unsafe markup (scripts, event handlers, etc.) is stripped.
Example
<p>Hi {{customer}}, your order has shipped.</p>New active/inactive state. Leave out (null) to keep the current state;
set true to retire the template or false to re-activate it.
Example
falseInput model for updating an existing template. This is a partial update: only the fields you send are changed — any field left out (null) keeps its current value. Attachments and other internal links are never affected by this endpoint.
object
New name for the template. Leave out (null) to keep the current name.
Example
Order shipped — UK (v2)New body for the template (plain text or HTML). Leave out (null) to keep the current body. When provided, the HTML is sanitized on save: unsafe markup (scripts, event handlers, etc.) is stripped.
Example
<p>Hi {{customer}}, your order has shipped.</p>New active/inactive state. Leave out (null) to keep the current state;
set true to retire the template or false to re-activate it.
Example
falseResponses
Section titled “Responses”The template was updated and is returned.
object
Template name
Text\Html body
Saved attachments urls in json format(leave them empty for create request)
Shows if tempalte is inactive
Pass here attachments to save them with template
object
Path of a file already stored by Replyco, exactly as returned by a previous API response. Provide either ‘url’ or ‘data’ for each attachment. A URL is stored as given and is never downloaded, so an external address will not produce a working attachment
Required. The name of the file including its extension (e.g., “invoice.pdf”, “image.jpg”). The extension decides whether the integration accepts the file, so it must be present
Base64 encoded content of a new file to upload. Provide either ‘data’ or ‘url’. Size and file type limits apply and depend on the integration the ticket belongs to
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "text": "example", "attachmentUrls": "example", "inActive": true, "attachments": [ { "url": "example", "fileName": "example", "data": "example" } ]}The request is invalid.
User is not authenticated or authorized.
No template with the given id exists.