Create a template
const url = 'https://open-api.replyco.com/openapi/template';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'}, body: '{ "name": "Order shipped (UK)", "text": "<p>Hi, your order is on its way and should arrive within two working days.</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 POST \ --url https://open-api.replyco.com/openapi/template \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json-patch+json' \ --data '{ "name": "Order shipped (UK)", "text": "<p>Hi, your order is on its way and should arrive within two working days.</p>", "inActive": false }'Creates a new template for the current company and returns the saved template (including its generated id).
Templates are reusable message bodies your team can drop into replies to keep responses fast and consistent.
Request fields:
name(required) — a short, descriptive name used to find the template later.text— the body, as plain text or HTML. HTML is sanitized on save: unsafe markup (scripts, event handlers, etc.) is removed and only formatting-safe HTML is stored.inActive— optional, defaults tofalse. Settrueto create a template that is kept but hidden from everyday use.
Best practices:
- Use clear, specific names (e.g. “Refund approved — EU”) so templates are easy to search with
GET /openApi/template/term. - Reuse or update an existing template instead of creating near-duplicates.
- Keep each template focused on a single scenario.
Every create is recorded in the change log so you can see how and when a template was added.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”The template to create. name is required.
Input model for creating a new template.
Only Name is required; Text and InActive are optional.
object
A short, human-readable name for the template. Required. Use clear, descriptive names (e.g. “Order shipped — UK”) so the template is easy to find later.
The body of the template. Accepts plain text or HTML. The HTML is sanitized on save: unsafe markup (scripts, event handlers, etc.) is stripped, so only formatting-safe HTML is stored.
Whether the template is inactive. Defaults to false (active).
Set to true to create a template that is hidden from everyday use without deleting it.
Example
{ "name": "Order shipped (UK)", "text": "<p>Hi, your order is on its way and should arrive within two working days.</p>", "inActive": false}Input model for creating a new template.
Only Name is required; Text and InActive are optional.
object
A short, human-readable name for the template. Required. Use clear, descriptive names (e.g. “Order shipped — UK”) so the template is easy to find later.
Example
Order shipped — UKThe body of the template. Accepts plain text or HTML. The HTML is sanitized on save: unsafe markup (scripts, event handlers, etc.) is stripped, so only formatting-safe HTML is stored.
Example
<p>Hi {{customer}}, your order has shipped and is on its way.</p>Whether the template is inactive. Defaults to false (active).
Set to true to create a template that is hidden from everyday use without deleting it.
Example
falseInput model for creating a new template.
Only Name is required; Text and InActive are optional.
object
A short, human-readable name for the template. Required. Use clear, descriptive names (e.g. “Order shipped — UK”) so the template is easy to find later.
Example
Order shipped — UKThe body of the template. Accepts plain text or HTML. The HTML is sanitized on save: unsafe markup (scripts, event handlers, etc.) is stripped, so only formatting-safe HTML is stored.
Example
<p>Hi {{customer}}, your order has shipped and is on its way.</p>Whether the template is inactive. Defaults to false (active).
Set to true to create a template that is hidden from everyday use without deleting it.
Example
falseInput model for creating a new template.
Only Name is required; Text and InActive are optional.
object
A short, human-readable name for the template. Required. Use clear, descriptive names (e.g. “Order shipped — UK”) so the template is easy to find later.
Example
Order shipped — UKThe body of the template. Accepts plain text or HTML. The HTML is sanitized on save: unsafe markup (scripts, event handlers, etc.) is stripped, so only formatting-safe HTML is stored.
Example
<p>Hi {{customer}}, your order has shipped and is on its way.</p>Whether the template is inactive. Defaults to false (active).
Set to true to create a template that is hidden from everyday use without deleting it.
Example
falseResponses
Section titled “Responses”The template was created 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
{ "id": "6c8e0a2c-4d6f-4a8b-9c0d-2e4f6a8b0c1d", "name": "Order shipped (UK)", "text": "<p>Hi, your order is on its way and should arrive within two working days.</p>", "inActive": false}The request is invalid (e.g. name is missing).
User is not authenticated or authorized.