Skip to content

Canned Responses

Overview

The Canned Responses API allows you to manage pre-defined quick replies for your organization.

Permissions

RoleListCreateUpdateDeleteUse
AdminYesYesYesYesYes
ManagerYesYesYesYesYes
AgentYesNoNoNoYes

List Canned Responses

Retrieve all canned responses for your organization.

Terminal window
GET /api/canned-responses

Query Parameters

ParameterTypeDescription
categorystringFilter by category (e.g., greeting, support)
searchstringSearch in name, content, and shortcut
active_onlystringSet to "true" to only return active responses

Response

{
"status": "success",
"data": {
"canned_responses": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Welcome Message",
"shortcut": "welcome",
"content": "Hello {{contact_name}}! Thank you for reaching out. How can I help you today?",
"category": "greeting",
"is_active": true,
"usage_count": 42,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"name": "Business Hours",
"shortcut": "hours",
"content": "Our business hours are Monday to Friday, 9 AM to 6 PM EST.",
"category": "support",
"is_active": true,
"usage_count": 28,
"created_at": "2024-01-15T11:00:00Z",
"updated_at": "2024-01-15T11:00:00Z"
}
]
}
}

Get Canned Response

Retrieve a single canned response by ID.

Terminal window
GET /api/canned-responses/{id}

Response

{
"status": "success",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Welcome Message",
"shortcut": "welcome",
"content": "Hello {{contact_name}}! Thank you for reaching out. How can I help you today?",
"category": "greeting",
"is_active": true,
"usage_count": 42,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}

Create Canned Response

Create a new canned response.

Terminal window
POST /api/canned-responses

Request Body

{
"name": "Welcome Message",
"shortcut": "welcome",
"content": "Hello {{contact_name}}! Thank you for reaching out. How can I help you today?",
"category": "greeting"
}

Fields

FieldTypeRequiredDescription
namestringYesDisplay name for the response
contentstringYesThe response text (supports placeholders)
shortcutstringNoQuick-access code for slash commands
categorystringNoCategory for organization

Response

{
"status": "success",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Welcome Message",
"shortcut": "welcome",
"content": "Hello {{contact_name}}! Thank you for reaching out. How can I help you today?",
"category": "greeting",
"is_active": true,
"usage_count": 0,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}

Update Canned Response

Update an existing canned response.

Terminal window
PUT /api/canned-responses/{id}

Request Body

{
"name": "Updated Welcome Message",
"shortcut": "hi",
"content": "Hi {{contact_name}}! Welcome to our support. How may I assist you?",
"category": "greeting",
"is_active": true
}

Fields

FieldTypeDescription
namestringDisplay name for the response
contentstringThe response text
shortcutstringQuick-access code
categorystringCategory for organization
is_activebooleanWhether the response is active

Delete Canned Response

Delete a canned response.

Terminal window
DELETE /api/canned-responses/{id}

Response

{
"status": "success",
"data": {
"message": "Canned response deleted"
}
}

Track Usage

Increment the usage counter for a canned response. This is typically called automatically when a response is used in chat.

Terminal window
POST /api/canned-responses/{id}/use

Response

{
"status": "success",
"data": {
"message": "Usage incremented"
}
}

Categories

The following categories are supported:

ValueLabel
greetingGreetings
supportSupport
salesSales
closingClosing
generalGeneral

Placeholders

Canned response content can include placeholders that are replaced with actual values when used:

PlaceholderDescription
{{contact_name}}Contact’s profile name
{{phone_number}}Contact’s phone number

Error Responses

400 Bad Request

{
"status": "error",
"message": "name and content are required"
}

404 Not Found

{
"status": "error",
"message": "Canned response not found"
}

409 Conflict

{
"status": "error",
"message": "Canned response with this name already exists"
}