# Canned Responses

Manage canned responses. Available for administrators and agents.

# Canned Response Object

Name Type Comment
id integer Unique response identifier.
user_id integer The ID of the user who created the response.
global boolean Whether a response is global (visible to everyone) or not.
name string The response name.
body string The actual response body.
created_at datetime Response creation timestamp.
updated_at datetime Response update timestamp.

# Paginate Responses

GET
/canned-responses

# Request

curl --location --request GET 'https://yoursubdomain.support-hub.io/api/canned-responses' \
--header 'Accept: aplication/json'

# Example Response

{
    "data": [
       {
          "id": 23,
          "user_id": 1,
          "global": true,
          "name": "API Created Canned Response",
          "body": "{{ticket.id}}",
          "created_at": "2019-09-25 14:49:56",
          "updated_at": "2019-09-25 14:49:56"
       },
      //...
    ],
    "links": {
        //...
    },
    "meta": {
        //...
    }
}

# Sortable Fields

created_at (default)

# Partial filters

content - filter responses that contain a provided string either within the title or the body.

# View a Response

GET
/canned-responses/{id}

# Request

curl --location --request GET 'https://yoursubdomain.support-hub.io/api/canned-responses/23' \
--header 'Accept: aplication/json'

# Example Response

{
    "data": {
      "id": 23,
      "user_id": 1,
      "global": true,
      "name": "API Created Canned Response",
      "body": "{{ticket.id}}",
      "created_at": "2019-09-25 14:49:56",
      "updated_at": "2019-09-25 14:49:56"
   }
}

# Create a Response

POST
/canned-responses

# Request

curl --location --request POST 'https://yoursubdomain.support-hub.io/api/canned-responses' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "API Created Canned Response",
  "body": "{{ticket.id}}",
  "global": true
}'

# Example Response

Status: 201 Created

{
    "data": {
      "id": 23,
      "user_id": 1,
      "global": true,
      "name": "API Created Canned Response",
      "body": "{{ticket.id}}",
      "created_at": "2019-09-25 14:49:56",
      "updated_at": "2019-09-25 14:49:56"
   }
}

# Update a Response

PATCH
/canned-responses/{id}

# Request

curl --location --request PATCH 'https://yoursubdomain.support-hub.io/api/canned-responses/23' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "API Created Canned Response - Updated"
}'

# Example Response

Status: 200 OK

{
    "data": {
      "id": 23,
      "user_id": 1,
      "global": true,
      "name": "API Created Canned Response - Updated",
      "body": "{{ticket.id}}",
      "created_at": "2019-09-25 14:49:56",
      "updated_at": "2019-09-25 14:49:56"
   }
}

# Delete a Response

DELETE
/canned-responses/{id}

# Request

curl --location --request DELETE 'https://yoursubdomain.support-hub.io/api/canned-responses/23' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'

# Example Response

Status: 200 OK

{
    "success": true
}

# Delete Multiple Responses

DELETE
/canned-responses

# Parameters

Parameter Type Required Validation
responses array Yes An array with ids of the canned responses that should be deleted.

# Request

curl --location --request DELETE 'https://yoursubdomain.support-hub.io/api/canned-responses' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
  "responses": [
    123,
    456
  ]
}'

# Example Response

Status: 200 OK

{
    "success": true
}

# Render a Response

Replace all placeholders within the canned response.

GET
/canned-responses/{canned_response_id}/placeholders/{ticket_id}

# Request

curl --location --request GET 'https://yoursubdomain.support-hub.io/api/canned-responses/123/placeholders/1100' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'

# Example Response

Status: 200 OK

{
  "data": {
    "response": "The ticket id is: <strong>1100</strong>."
  }
}