Skip to content

Create a template

POST
/openapi/template
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 to false. Set true to 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.

The template to create. name is required.

Input model for creating a new template. Only Name is required; Text and InActive are optional.

object
name
required

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.

string
>= 1 characters
text

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.

string
nullable
inActive

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.

boolean

Example

{
"name": "Order shipped (UK)",
"text": "<p>Hi, your order is on its way and should arrive within two working days.</p>",
"inActive": false
}

The template was created 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

{
"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.