Ir al contenido

Canned responses

Esta página aún no está disponible en tu idioma.

Canned responses are pre-written message templates that technicians can insert into ticket and lead communications. Each response specifies a delivery channel (email or SMS), an optional usage context, and, for email, a subject line.

{
"object": "canned_response",
"id": 7,
"title": "Repair complete, ready for pickup",
"body": "Hi {{customer_name}}, your device is ready for pickup. Please come by during business hours. Thank you!",
"context": "ticket",
"channel": "email",
"subject": "Your repair is complete",
"created_at": "2025-11-03T09:14:00.000Z"
}
FieldTypeDescription
idintegerCanned response ID
titlestringInternal display name (max 255 characters)
bodystringMessage body; may contain {{placeholder}} tokens (max 10,000 characters)
contextstringWhere the response is used: ticket or lead
channelstringDelivery channel: email or sms
subjectstring | nullEmail subject line (email channel only; null for SMS)
created_atstringISO-8601 creation timestamp

GET /api/v1/canned-responses

Returns canned responses sorted by most-recently-created first. Supports optional filtering by context and channel.

Scope required: canned_responses.read

ParameterTypeDescription
contextstringFilter by context: ticket or lead
channelstringFilter by channel: email or sms
limitintegerPage size, 1–100 (default: 20)
cursorstringOpaque cursor from a previous response’s next_cursor
Terminal window
curl "https://app.benchkey.com/api/v1/canned-responses?context=ticket&limit=20" \
-H "Authorization: Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa"
const res = await fetch(
"https://app.benchkey.com/api/v1/canned-responses?context=ticket&limit=20",
{ headers: { Authorization: "Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa" } }
);
const { data, has_more, next_cursor } = await res.json();
{
"object": "list",
"data": [
{
"object": "canned_response",
"id": 7,
"title": "Repair complete, ready for pickup",
"body": "Hi {{customer_name}}, your device is ready for pickup.",
"context": "ticket",
"channel": "email",
"subject": "Your repair is complete",
"created_at": "2025-11-03T09:14:00.000Z"
},
{
"object": "canned_response",
"id": 6,
"title": "Awaiting parts",
"body": "Hi {{customer_name}}, we are waiting on a part for your repair. We'll update you soon.",
"context": "ticket",
"channel": "sms",
"subject": null,
"created_at": "2025-10-28T16:42:00.000Z"
}
],
"has_more": false,
"next_cursor": null
}

See Pagination for how to page through results.


GET /api/v1/canned-responses/:id

Returns a single canned response by ID.

Scope required: canned_responses.read

Terminal window
curl "https://app.benchkey.com/api/v1/canned-responses/7" \
-H "Authorization: Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa"
const res = await fetch(
"https://app.benchkey.com/api/v1/canned-responses/7",
{ headers: { Authorization: "Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa" } }
);
const cr = await res.json();

Returns the canned response object. Returns 404 if not found.


POST /api/v1/canned-responses

Creates a new canned response.

Scope required: canned_responses.write

FieldRequiredDescription
titleyesInternal display name (max 255 characters)
bodyyesMessage body (max 10,000 characters)
contextnoticket (default) or lead
channelnoemail (default) or sms
subjectnoEmail subject line (email channel only; omit or null for SMS); whitespace-only values are normalized to null
Terminal window
curl -X POST https://app.benchkey.com/api/v1/canned-responses \
-H "Authorization: Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa" \
-H "Content-Type: application/json" \
-d '{
"title": "Repair complete, ready for pickup",
"body": "Hi {{customer_name}}, your device is ready for pickup. Please come by during business hours. Thank you!",
"context": "ticket",
"channel": "email",
"subject": "Your repair is complete"
}'
const res = await fetch("https://app.benchkey.com/api/v1/canned-responses", {
method: "POST",
headers: {
Authorization: "Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa",
"Content-Type": "application/json",
},
body: JSON.stringify({
title: "Repair complete, ready for pickup",
body: "Hi {{customer_name}}, your device is ready for pickup. Please come by during business hours. Thank you!",
context: "ticket",
channel: "email",
subject: "Your repair is complete",
}),
});
const cr = await res.json(); // HTTP 201

Returns the created canned response object with HTTP 201 Created.

{
"object": "canned_response",
"id": 7,
"title": "Repair complete, ready for pickup",
"body": "Hi {{customer_name}}, your device is ready for pickup. Please come by during business hours. Thank you!",
"context": "ticket",
"channel": "email",
"subject": "Your repair is complete",
"created_at": "2025-11-03T09:14:00.000Z"
}

PATCH /api/v1/canned-responses/:id

Updates one or more fields on an existing canned response. Only the fields you send are changed.

Scope required: canned_responses.write

Send any combination of the following fields:

FieldTypeDescription
titlestringNew display name (max 255 characters)
bodystringNew message body (max 10,000 characters)
channelstringemail or sms
subjectstring | nullEmail subject line; send null to clear it; whitespace-only values are normalized to null
Terminal window
curl -X PATCH "https://app.benchkey.com/api/v1/canned-responses/7" \
-H "Authorization: Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa" \
-H "Content-Type: application/json" \
-d '{"subject": "Your BenchKey repair is ready!"}'
const res = await fetch("https://app.benchkey.com/api/v1/canned-responses/7", {
method: "PATCH",
headers: {
Authorization: "Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa",
"Content-Type": "application/json",
},
body: JSON.stringify({ subject: "Your BenchKey repair is ready!" }),
});
const cr = await res.json();

Returns the updated canned response object. Returns 404 if not found.


DELETE /api/v1/canned-responses/:id

Permanently deletes a canned response. This action cannot be undone.

Scope required: canned_responses.write

Terminal window
curl -X DELETE "https://app.benchkey.com/api/v1/canned-responses/7" \
-H "Authorization: Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa"
const res = await fetch("https://app.benchkey.com/api/v1/canned-responses/7", {
method: "DELETE",
headers: { Authorization: "Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa" },
});
const result = await res.json();
{
"object": "canned_response",
"id": 7,
"deleted": true
}

Returns 404 if the canned response does not exist.


HTTP statusCodeMeaning
400missing_fieldA required field (title or body) is absent or empty
400invalid_id:id is not a valid positive integer, or exceeds 2,147,483,647
400invalid_queryA list filter parameter was supplied as an array or object instead of a single scalar value
400invalid_contextcontext is not ticket or lead
400invalid_channelchannel is not email or sms
400invalid_fieldA field value has the wrong type (e.g. body, title, or subject is not a string)
400invalid_titletitle is present but empty after trimming (PATCH only)
400invalid_bodybody is present but empty after trimming (PATCH only)
400title_too_longtitle exceeds 255 characters
400body_too_longbody exceeds 10,000 characters
400subject_too_longsubject exceeds 500 characters
400no_fieldsPATCH request contained no updatable fields
400invalid_cursorcursor is malformed
404not_foundCanned response not found
422create_failedThe canned response was not persisted, the upstream write failed
422update_failedThe update could not be applied
422delete_failedThe deletion could not be completed
403insufficient_scopeAPI key lacks canned_responses.read or canned_responses.write

See Errors for the full error envelope format.

Estado del sistema