Skip to content

Update a template

PUT
/openapi/template/{id}
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 — true to retire the template, false to re-activate it, or omit to keep the current state.

Best practices:

  • To retire a template, set inActive: true rather 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.

id
required
string format: uuid

The id of the template to update.

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
name

New name for the template. Leave out (null) to keep the current name.

string
nullable

Example

Order shipped — UK (v2)
text

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.

string
nullable

Example

<p>Hi {{customer}}, your order has shipped.</p>
inActive

New active/inactive state. Leave out (null) to keep the current state; set true to retire the template or false to re-activate it.

boolean
nullable

Example

false

The template was updated and is returned.

Media typeapplication/json
object
id
string format: uuid
name

Template name

string
nullable
text

Text\Html body

string
nullable
attachmentUrls

Saved attachments urls in json format(leave them empty for create request)

string
nullable
inActive

Shows if tempalte is inactive

boolean
attachments

Pass here attachments to save them with template

Array<object>
nullable
object
url

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

string
nullable
fileName

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

string
nullable
data

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

string format: byte
nullable
fileFormat
string
nullable
mimeType
string
nullable

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.