Skip to content

Templates

A template is a saved reply: a name and a body your agents insert instead of typing the same answer again, and that autoresponders send for you. Read templates to offer the same answers in your own system, or create and update them to keep Replyco’s wording in step with yours. Each change you make is recorded in Replyco’s change history, marked as coming from the API.

Field Meaning
id The template’s id.
name The name agents pick it by. Send one when you create a template.
text The body, as plain text or HTML. Replyco removes unsafe HTML, such as scripts, when it saves the body.
inActive true hides the template from everyday use without deleting it. New templates are active unless you send true.
attachmentUrls, attachments Files saved with the template in Replyco. You cannot add or change them through the API; an update leaves them as they are.

POST /openapi/template creates a template and returns it with its id. Each call creates a new one, so keep the returned id rather than creating the template again.

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

PUT /openapi/template/{id} changes only the fields you send; a field you leave out keeps its value. To retire a template, send inActive: true. An id that does not exist returns 404.

Terminal window
curl -X PUT "https://open-api.replyco.com/openapi/template/6c8e0a2c-4d6f-4a8b-9c0d-2e4f6a8b0c1d" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"inActive": true}'

Three operations list templates. Each returns active and inactive templates; check inActive before you offer one.

Operation Returns Use it when
GET /openapi/template Every template, in one response. You keep a copy of all templates.
GET /openapi/template/term The templates whose name or body contains term, ignoring case, sorted by name. Without term, every template. You search for a template by a word.
GET /openapi/template/paged One page of templates. term searches name and body the same way. You page through a large set.

For GET /openapi/template/paged:

Parameter What it does Default Limits
page The page to return. 1 Stop at the response’s pagesCount.
count Templates per page. 10 At most 100; a larger value is rejected with 400 “Max page size is 100.”
term Keeps the templates whose name or body contains the text, ignoring case. none —
Terminal window
curl "https://open-api.replyco.com/openapi/template/term?term=refund" \
-H "Authorization: Bearer $ACCESS_TOKEN"

Each operation whose path ends in /paged allows one user 15 calls a minute (see Rate limits).

Method Path Summary Scopes
GET /openapi/template Get all templates —
POST /openapi/template Create a template —
GET /openapi/template/paged Get all records with paging —
GET /openapi/template/term Search templates by term —
GET /openapi/template/{id} Get element by id —
PUT /openapi/template/{id} Update a template —
Status Meaning Returned by
400 The request is invalid (e.g. name is missing).; The request is invalid. POST /openapi/template, PUT /openapi/template/{id}
401 User is not authenticated or authorized; User is not authenticated or authorized.; Unauthorized GET /openapi/template, POST /openapi/template, GET /openapi/template/paged, GET /openapi/template/term, GET /openapi/template/{id}, PUT /openapi/template/{id}
403 User does not have permission to view templates GET /openapi/template, GET /openapi/template/term
404 No template with the given id exists. PUT /openapi/template/{id}