Auto-replies API
List, create, update and delete basic auto-replies, the keyword replies that answer customers instantly.
Basic auto-replies answer a customer's message automatically when it matches a keyword, for example sending your opening hours when someone writes "timing". In the app they're under Automation › Basic Replies (see Basic replies). In the API they're called canned replies.
The API creates and updates text replies. Make image and audio replies in the app.
The auto-reply object#
{
"uuid": "de6fe115-4c30-4c8d-9245-6ae31c1c820f",
"name": "Opening hours",
"trigger": "hours,timing,open",
"match_criteria": "contains",
"metadata": "{\"type\":\"text\",\"data\":{\"text\":\"Hi {first_name}, we're open every day from 7am to 10pm.\"}}",
"created_at": "2026-10-03 14:20:11",
"updated_at": "03 Oct 2026 6:20 PM"
}| Field | Description |
|---|---|
uuid | The reply's ID. |
name | A name for your team. Customers don't see it. |
trigger | The keywords, separated by commas. |
match_criteria | exact match or contains (see below). |
metadata | A JSON string. type is text, image or audio; for text, data.text is the reply. |
updated_at | Formatted for display, in your platform's date format. |
How matching works#
exact match: the customer's whole message has to be one of the keywords. Capital letters don't matter for English, soHoursmatcheshours.contains: the reply is sent when the message contains a keyword as a word.hoursmatches "What are your hours?". A keyword made of several words matches if the message contains any one of them, so keepcontainskeywords to single words.- Separate several keywords with commas:
hours,timing,open. Any one of them triggers the reply.
Personalize the reply#
Put these in the reply text and ZAPGEN fills them in for each customer: {first_name}, {last_name}, {full_name}, {email}, {phone}, {organization_name}, {full_address}, {street}, {city}, {state}, {zip_code} and {country}. Custom fields work too: write the field name in lowercase with underscores instead of spaces, for example {membership_level} for a field called "Membership level".
List auto-replies#
https://app.zapgen.ae/api/canned-replies| Name | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number, from 1. |
per_page | integer | No | Replies per page, 1–100. Default 10. |
curl "https://app.zapgen.ae/api/canned-replies?per_page=100" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"const res = await fetch('https://app.zapgen.ae/api/canned-replies?per_page=100', {
headers: { Authorization: 'Bearer YOUR_API_KEY', Accept: 'application/json' }
});
const { data: replies } = await res.json();$ch = curl_init('https://app.zapgen.ae/api/canned-replies?per_page=100');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Accept: application/json'],
]);
$replies = json_decode(curl_exec($ch), true)['data'];import requests
res = requests.get(
"https://app.zapgen.ae/api/canned-replies",
headers={"Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json"},
params={"per_page": 100},
)
replies = res.json()["data"]The response is a paginated list of auto-reply objects in data.
Create an auto-reply#
https://app.zapgen.ae/api/canned-replies| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | A name for your team. |
trigger | string | Yes | Keywords, separated by commas. |
match_criteria | string | Yes | exact match or contains. |
response_type | string | Yes | text. |
response | string | Yes | The reply text. Can use placeholders. |
curl -X POST https://app.zapgen.ae/api/canned-replies \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "Opening hours",
"trigger": "hours,timing,open",
"match_criteria": "contains",
"response_type": "text",
"response": "Hi {first_name}, we are open every day from 7am to 10pm."
}'const res = await fetch('https://app.zapgen.ae/api/canned-replies', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
Accept: 'application/json'
},
body: JSON.stringify({
name: 'Opening hours',
trigger: 'hours,timing,open',
match_criteria: 'contains',
response_type: 'text',
response: 'Hi {first_name}, we are open every day from 7am to 10pm.'
})
});
const { id } = await res.json();$ch = curl_init('https://app.zapgen.ae/api/canned-replies');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json',
'Accept: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Opening hours',
'trigger' => 'hours,timing,open',
'match_criteria' => 'contains',
'response_type' => 'text',
'response' => 'Hi {first_name}, we are open every day from 7am to 10pm.',
]),
]);
$replyUuid = json_decode(curl_exec($ch), true)['id'];import requests
res = requests.post(
"https://app.zapgen.ae/api/canned-replies",
headers={"Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json"},
json={
"name": "Opening hours",
"trigger": "hours,timing,open",
"match_criteria": "contains",
"response_type": "text",
"response": "Hi {first_name}, we are open every day from 7am to 10pm.",
},
)
reply_uuid = res.json()["id"]{
"statusCode": 200,
"id": "de6fe115-4c30-4c8d-9245-6ae31c1c820f",
"message": "Request processed successfully"
}The reply is live as soon as it's created: there's no on/off switch.
Update an auto-reply#
https://app.zapgen.ae/api/canned-replies/{uuid}Takes the same fields as creating one, and all of them are required, so send the full reply each time.
curl -X PUT https://app.zapgen.ae/api/canned-replies/de6fe115-4c30-4c8d-9245-6ae31c1c820f \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "Opening hours",
"trigger": "hours,timing,open",
"match_criteria": "contains",
"response_type": "text",
"response": "Hi {first_name}, during Ramadan we are open from 8pm to 2am."
}'const uuid = 'de6fe115-4c30-4c8d-9245-6ae31c1c820f';
await fetch(`https://app.zapgen.ae/api/canned-replies/${uuid}`, {
method: 'PUT',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
Accept: 'application/json'
},
body: JSON.stringify({
name: 'Opening hours',
trigger: 'hours,timing,open',
match_criteria: 'contains',
response_type: 'text',
response: 'Hi {first_name}, during Ramadan we are open from 8pm to 2am.'
})
});$uuid = 'de6fe115-4c30-4c8d-9245-6ae31c1c820f';
$ch = curl_init("https://app.zapgen.ae/api/canned-replies/$uuid");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json',
'Accept: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Opening hours',
'trigger' => 'hours,timing,open',
'match_criteria' => 'contains',
'response_type' => 'text',
'response' => 'Hi {first_name}, during Ramadan we are open from 8pm to 2am.',
]),
]);
$result = json_decode(curl_exec($ch), true);import requests
uuid = "de6fe115-4c30-4c8d-9245-6ae31c1c820f"
requests.put(
f"https://app.zapgen.ae/api/canned-replies/{uuid}",
headers={"Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json"},
json={
"name": "Opening hours",
"trigger": "hours,timing,open",
"match_criteria": "contains",
"response_type": "text",
"response": "Hi {first_name}, during Ramadan we are open from 8pm to 2am.",
},
)The response is the same as for creating one. An unknown uuid returns 404 with Canned reply not found.
Delete an auto-reply#
https://app.zapgen.ae/api/canned-replies/{uuid}curl -X DELETE https://app.zapgen.ae/api/canned-replies/de6fe115-4c30-4c8d-9245-6ae31c1c820f \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"const uuid = 'de6fe115-4c30-4c8d-9245-6ae31c1c820f';
await fetch(`https://app.zapgen.ae/api/canned-replies/${uuid}`, {
method: 'DELETE',
headers: { Authorization: 'Bearer YOUR_API_KEY', Accept: 'application/json' }
});$uuid = 'de6fe115-4c30-4c8d-9245-6ae31c1c820f';
$ch = curl_init("https://app.zapgen.ae/api/canned-replies/$uuid");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Accept: application/json'],
]);
$result = json_decode(curl_exec($ch), true);import requests
uuid = "de6fe115-4c30-4c8d-9245-6ae31c1c820f"
requests.delete(
f"https://app.zapgen.ae/api/canned-replies/{uuid}",
headers={"Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json"},
){
"statusCode": 200,
"id": "de6fe115-4c30-4c8d-9245-6ae31c1c820f",
"message": "Request processed successfully"
}An unknown or already deleted uuid returns 404 with Canned reply not found.
Errors#
| Status | When |
|---|---|
400 | A field is missing, or match_criteria or response_type isn't one of the allowed values. |
401 | The API key is missing or wrong. |
403 | Your subscription has ended. Creating and updating stops; listing and deleting still work. |
404 | No auto-reply with that uuid in your organization. |
Changes send autoreply.created, autoreply.updated and autoreply.deleted webhooks.