Add a saved reply
const url = 'https://api.threadkite.app/v1/saved-replies';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","subject":"example","body":"example","bodyHtml":"example","locationId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","inboxId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","visibility":"personal"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.threadkite.app/v1/saved-replies \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "subject": "example", "body": "example", "bodyHtml": "example", "locationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "inboxId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "visibility": "personal" }'Anyone with a Full seat can add personal replies; shared replies need the inbox settings permission. API keys add shared replies.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Merge fields such as {{contact.firstName}} are filled in
The reply formatted, as HTML with merge fields. When given, body is made from it (its plain text); null removes the formatting
Share it with one inbox only (shared replies); null for the whole organisation
shared when left out. Shared replies need the inbox settings permission (and are what API keys create); anyone with a Full seat can keep personal ones
Responses
Section titled “Responses”object
The plain text (what texts and previews show), with merge fields
The reply formatted (bold, lists, links), as HTML with the same merge fields; null when it has no formatting. Email sends it; WhatsApp gets its own formatting from it
A shared reply offered in this inbox only (to the people who can see it); null for the whole organisation or a personal reply
personal: only its owner sees it; shared: the whole organisation, or one inbox (inboxId)
The person a personal reply belongs to (null when shared)
You can change or delete it
Automations (and old out-of-hours rules still on) that send it; it cannot be deleted or made personal while in use
Example
{ "name": "Still available", "body": "Hi {{contact.firstName}}, yes, the {{item.title}} is still available.", "bodyHtml": "<p>Hi {{contact.firstName}}, yes, the <strong>{{item.title}}</strong> is still available.</p>", "visibility": "personal"}object
Stable machine-readable reason
With code invalid: every problem with the request, by field (message is the first)
object
Dotted path inside the item, e.g. attributes.price.amountMinor
Example
{ "statusCode": 403, "code": "forbidden", "message": "You do not have permission to do that.", "errors": [ { "message": "Enter the make" } ]}Missing or invalid API key
object
Stable machine-readable reason
With code invalid: every problem with the request, by field (message is the first)
object
Dotted path inside the item, e.g. attributes.price.amountMinor
Example
{ "statusCode": 403, "code": "forbidden", "message": "You do not have permission to do that.", "errors": [ { "message": "Enter the make" } ]}The organisation is on the Free plan (code upgrade_required)
object
Stable machine-readable reason
The feature that needs Pro
Where to upgrade or pay, in the web app
Example
{ "statusCode": 402, "code": "upgrade_required", "message": "Connections are part of Pro. Upgrade to connect texts, calls and more.", "feature": "extraSeats", "upgradePath": "/settings/billing"}The key does not have the scope (or the person the permission)
object
Stable machine-readable reason
With code invalid: every problem with the request, by field (message is the first)
object
Dotted path inside the item, e.g. attributes.price.amountMinor
Example
{ "statusCode": 403, "code": "forbidden", "message": "You do not have permission to do that.", "errors": [ { "message": "Enter the make" } ]}Rate limit reached
object
Stable machine-readable reason
Seconds until another request will be accepted
Example
{ "statusCode": 429, "code": "rate_limited", "message": "Too many requests. Each key can make 120 requests a minute; try again in 12 seconds.", "retryAfter": 12}