Create or Update or Delete a Canned Response

Prev Next
Post
/api/v1/canned-responses
Premium tag

To create and update canned responses, the following permissions are required:

  • save-canned-responses
  • save-all-canned-responses

To delete a canned response, the following permission is required:

  • remove-canned-responses

Changelog

Version Description
1.0.0 Added
Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Body parameters

Note:

  • To update a canned response, the _id parameter is required along with the other required parameters. This parameter is not used to create a canned response.
  • To delete a canned response, enter the _id of the canned response that you want to delete. No other parameter is required.
Example 1
{
  "shortcut": "test-canned",
  "text": "This is an example test for canned response",
  "scope": "global",
  "tags": [
    "tag1",
    "tag2"
  ]
}
object
shortcut
string Required

The shortcut to trigger the message snippet.

text
string Required

The message snippet.

scope
string Required

The scope of the canned response. It can either be global, user or department.

tags
Array of string

The tags for your canned response.

string
departmentId
string

The departmentId where the canned response belongs to. It is required if the scope is department.

_id
string

The canned response's ID.

Responses
200

OK

Success
{
  "success": true
}
object
success
boolean
400

Bad Request

Example 1
{
  "success": false,
  "error": "must have required property 'shortcut' [invalid-params]",
  "errorType": "invalid-params"
}
Example 2
{
  "success": false,
  "error": "must have required property 'scope' [invalid-params]",
  "errorType": "invalid-params"
}
Example 3
{
  "success": false,
  "error": "Shortcut provided already exists [error-invalid-shortcut]",
  "errorType": "error-invalid-shortcut",
  "details": {
    "method": "saveCannedResponse"
  }
}
object
success
boolean
error
string
errorType
string
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string
403

Forbidden

Permission Error
{
  "success": false,
  "error": "User does not have the permissions required for this action [error-unauthorized]"
}
Unauthorized
{
  "success": false,
  "error": "unauthorized"
}
object
success
boolean
error
string
Tags