Ticket
With the Ticket API, you can manage inquiries from your customers. When a new ticket is submitted, your agents and customers can start a conversation within it.
Resource representation
The following table shows the list of properties in a ticket resource.
Property name | Type | Description |
---|---|---|
id | int | The unique ID of the ticket. |
project | int | The unique ID of a Desk project where the agent belongs. Desk projects have their own corresponding Sendbird application on a one-to-one basis. |
channelName | string | The name of the ticket. |
channelUrl | string | The channel URL of the ticket from Sendbird Chat platform. The value of tickets from social networks will be generated arbitrarily by Desk. |
createdAt | string | The date and time when the ticket was created, in ISO 8601 format. |
closedAt | string | The date and time when the ticket was closed, in ISO 8601 format. |
issuedAt | string | The date and time when the customer sent the first message, in ISO 8601 format. |
durationTime | int | The time in seconds taken from a customer's first message to ticket closing. |
pendingTime | int | The time in seconds taken from a customer's first message to ticket assignment. |
conversationTime | int | The time in seconds taken from a customer's first message to the last message of the conversation. |
customer | nested object | An object that contains the information of the customer. |
status2 | string | The status of the ticket. This property has been updated from the previous version status to be consistent with the ticket status on the Sendbird Dashboard. Valid values are limited to the following: |
closeStatus | string | The reason why the ticket has been closed. Valid values are limited to the following: |
recentAssignment | nested object | The detailed information about the last assignment. |
closeComment | string | The comment left for ticket closing. |
closeMessage | string | The message for ticket closing, which is sent instead of the default closing message set in Settings > Triggers of your dashboard. |
info | string | The information of a ticket such as subject and the requester given upon its creation. |
messageCount | int | The total count of the messages in the ticket. |
lastMessage | string | The last message of the ticket. |
lastMessageSender | string | The sender of the last message. Valid values are CUSTOMER, AGENT, and PLATFORM. |
lastMessageAt | string | The date and time when the last message was sent, in ISO 8601 format. |
lastUserMessageSender | string | The sender of the last text message except for the admin messages from Desk Platform. Valid values are CUSTOMER and AGENT. |
lastUserMessageAt | string | The date and time when the customer sent the last message, in ISO 8601 format. |
updatedAt | string | The date and time when the ticket information was last updated, in ISO 8601 format. |
firstAssignmentToCloseTime | int | The time in seconds taken from the first assignment of a ticket to ticket closing. |
firstResponseTime | int | The time in seconds taken from a customer’s first message to an agent’s first response. |
channelType | string | A channel type that indicates which channel the ticket belongs to. Valid values are SENDBIRD, SENDBIRD_IOS, SENDBIRD_ANDROID, SENDBIRD_JAVASCRIPT, FACEBOOK_CONVERSATION, FACEBOOK_FEED, TWITTER_STATUS, TWITTER_DIRECT_MESSAGE_EVENT, INSTAGRAM_COMMENT, and WHATSAPP_MESSAGE. |
data | string | The information related to tickets from social networks. |
lastSeenAt | int | The timestamp when the customer first read the last message in the ticket, in Unix millisecond. The value of 0 indicates the customer hasn't read the last message yet. This property is applicable for tickets from Facebook only. |
group | nested object | The group which this ticket belongs to. |
customFields[] | array | An array of key-value custom fields that indicates additional information about the ticket. This property can have up to 20 custom fields. |
customerSatisfactionScore | int | The customer satisfaction score. Valid values are 1 to 5, inclusive. |
customerSatisfactionComment | string | The feedback from a customer about the support within the ticket. |
priority | string | The priority of the ticket. Valid values are LOW, MEDIUM, HIGH, and URGENT. When it comes to ticket assignment with the auto ticket routing function, a ticket with a higher priority takes precedence over others. |
priorityValue | int | The priority value of the ticket. Valid values are 10, 20, 30, and 40, which indicate Low, Medium, High, and Urgent in the |
relatedChannel | nested object | The information of channels in Sendbird Chat platform that are related to this ticket. |
Actions
- API endpoints are relative to the base URL allocated to your application. In this page, the
/tickets
endpoint refers tohttps://desk-api-{application_id}.sendbird.com/platform/v1/tickets
.
Note: If you want to know your application ID, sign in to your dashboard, go to the Settings > Application > General, and then check the Application ID.
- It's recommended that the parameter values in API URLs be urlencoded, such as
{ticket_id}
.
List of actions
Action | HTTP request |
---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
List tickets
Retrieves a list of all tickets in the application.
HTTP request
Parameters
The following table lists the parameters that this action supports.
Optional
Parameter name | Type | Description |
---|---|---|
limit | int | Specifies the number of results to return per page. Acceptable values are 1 to 500, inclusive. (Default: 50) |
int | Specifies the number of results to skip when receiving a response. The value of | |
status2 | string | Restricts the search scope to only retrieve tickets whose status matches the specified value. You can also specify multiple |
agent | string | Specifies the unique ID of an agent to restrict the search scope to only retrieve tickets assigned to a specific agent. |
group | string | Restricts the search scope to only retrieve tickets assigned to the specified team. |
sendbird_id | string | Restricts the search scope to only retrieve tickets submitted by a customer with a specified Sendbird ID. |
q | string | Restricts the search scope to retrieve up to 100 tickets that match a specified keyword. The specified keyword is applied to the following: channel names, and customers' display names and Sendbird IDs. For example, |
assignment_status | string | Restricts the search scope to only retrieve tickets whose assignment status matches the specified value. Acceptable values are limited to the following: |
channel_url | string | Restricts the search scope to only retrieve tickets related to a specified channel URL. |
updated_since | date | Specifies a starting date that restricts the search scope to retrieve tickets that have been updated after the point, in YYYY-MM-DD format. |
start_date | date | Specifies a starting date that restricts the search scope to retrieve tickets created between start_date and end_date, in YYYY-MM-DD format. |
end_date | date | Specifies an ending date that restricts the search scope to retrieve tickets created between start_date and end_date, in YYYY-MM-DD format. |
order | string | Specifies the method to sort a list of results. Acceptable values are limited to the following: |
Response
If successful, this action returns a list of ticket resources in the response body.
List of response properties
Property name | Type | Description |
---|---|---|
count | int | The total count of tickets registered in the application. |
previous | string | The URL to retrieve the previous page in the result set. |
next | string | The URL to retrieve the next page in the result set. |
results[] | list | A list of tickets. |
View a ticket
Retrieves information on a specific ticket.
HTTP request
Parameters
The following table lists the parameters that this action supports.
Required
Parameter name | Type | Description |
---|---|---|
ticket_id | int | Specifies the unique ID of a ticket. |
Response
If successful, this action returns a ticket resource in the response body.
Create a ticket
Creates a new ticket.
HTTP request
Request body
The following table lists the properties of an HTTP request that this action supports.
Properties
Required | Type | Description |
---|---|---|
channelName | string | Specifies the title of a ticket, which will be the group channel name in Sendbird Chat platform as well. Maximum length is 100 characters. |
customerId | int | Specifies the unique ID of a customer which is different from sendbird_id in Sendbird Chat platform. This customerId can be retrieved by the Customer API's list customers action. |
Optional | Type | Description |
---|---|---|
groupKey | string | Specifies the unique key of a group for ticket assignment. The key can be a mix of lowercase letters, hyphens, underscores, or numbers. When the request doesn't include this property, the ticket is assigned to a team according to the auto ticket routing function and the assignment rule. When the request has the |
customFields | JSON string | Specifies a |
priority | string | Specifies the priority of a ticket. Acceptable values are the following: LOW, MEDIUM, HIGH, and URGENT. When it comes to ticket assignment with the auto ticket routing function, a ticket with a higher priority takes precedence over others. (Default: MEDIUM) |
relatedChannelUrls | string | Specifies a comma-separated string of one or more group channel URLs for reference, where the corresponding customer belongs. This property can have up to 3 group channel URLs. |
Response
If successful, this action returns a ticket resource in the response body.
Update a ticket
Updates a ticket's priority and URLs of the related channels.
HTTP request
Parameters
The following table lists the parameters that this action supports.
Required
Parameter name | Type | Description |
---|---|---|
ticket_id | int | Specifies the unique ID of a ticket. |
Request body
The following table lists the properties of an HTTP request that this action supports.
Optional
Property name | Type | Description |
---|---|---|
priority | string | Specifies the priority of a ticket. Valid values are the following: LOW, MEDIUM, HIGH, and URGENT. When it comes to ticket assignment with the auto ticket routing function, a ticket with a higher priority takes precedence over others. (Default: MEDIUM) |
relatedChannelUrls | string | Specifies the URLs of group channels in Sendbird Chat that are related to a ticket and where the customer belongs. Invalid URLs including URLs where the customer doesn't belong are ignored. URLs should be separate with commas, and up to three group channel URLs can be added per ticket. |
Response
If successful, this action returns a updated ticket resource in the response body.
Update custom fields of a ticket
Updates custom fields of a specific ticket.
HTTP request
Parameters
The following table lists the parameters that this action supports.
Parameters
Required | Type | Description |
---|---|---|
ticket_id | int | Specifies the unique ID of a ticket. |
Request body
The following table lists the properties of an HTTP request that this action supports.
Properties
Required | Type | Description |
---|---|---|
customFields | JSON string | Specifies a |
Response
If successful, this action returns a ticket resource with the updated custom fields in the response body.
Close a ticket
Closes a specific ticket.
HTTP request
Parameters
The following table lists the parameters that this action supports.
Required
Parameter name | Type | Description |
---|---|---|
ticket_id | int | Specifies the unique ID of a ticket. |
Request body
The following table lists the properties of an HTTP request that this action supports.
Optional
Property name | Type | Description |
---|---|---|
closeComment | string | Specifies the notes for ticket closing. |
closeMessage | string | Specifies the message for ticket closing, which is sent instead of the default closing message set in Settings > Triggers of your dashboard. |
Response
If successful, this action returns a closed ticket resource in the response body.
Transfer a ticket to an agent
Transfers a ticket to another agent and change the ticket assignee. Only active and idle tickets can be transferred. If you wish to transfer a ticket to a bot agent, it's highly recommended you check the bot's canReceiveTransferredTickets
property first.
HTTP request
Parameters
The following table lists the parameters that this action supports.
Required
Parameter name | Type | Description |
---|---|---|
ticket_id | int | Specifies the ID of a ticket to transfer. |
Request body
The following table lists the properties of an HTTP request that this action supports.
Property
Required | Type | Description |
---|---|---|
agentId | int | Specifies the ID of an agent who will be newly assigned to the ticket. |
Optional | Type | Description |
---|---|---|
note | string | Specifies the reason why the ticket is transferred. |
Response
If successful, this action returns information on the transferred tickets in the response body.
List of response properties
Property name | Type | Description |
---|---|---|
id | int | The unique ID of the ticket that has been transferred. |
transferredAt | string | The date and time when the ticket was transferred, in ISO 8601 format. |
pastAssignment | nested object | The information of the ticket's previous assignment. When a ticket is transferred through an API request, the response contains information about prior assignment, such as a former assignee of the ticket. |
currentAssignment | nested object | The information of the ticket's new assignment. When a ticket is transferred through an API request, the response contains information about new assignment, such as a current assignee of the ticket. |
note | string | The statement about why the ticket was transferred. |
Error
In the case of an error, an error object like below is returned. See the error code table for more details.
Error code | Error message | Description |
---|---|---|
deskp400105 | The agentId property is required. | The |
deskp400105 | The note property is required. | Depending on your Ticket transfer setting under Settings > Desk > General on Sendbird Dashboard, |
deskp400111 | The value of agentId should be integer. | The specified |
deskp400111 | Ticket status should be ACTIVE or IDLE. | Only active or idle tickets can be transferred. |
deskp400111 | The specified agentId is the current assignee. Enter different agentId. | The specified |
deskp400111 | The bot specified in agentId does not support ticket transfer. Check the bot settings. | Ticket transfer to bots is effective only when a bot agent's |
deskp400111 | Transfer is not supported for this ticket's channelType. | Ticket transfer to custom bots isn't possible for tickets submitted through some social media channels, such as Facebook post's comments, Instagram post's comments, and Twitter tweets. For FAQ bots, only the tickets submitted through in-app chat can be transferred to them. |
deskp400201 | The specified agent doesn’t exist. | The agent with the specified |
deskp400603 | Can't transfer. The agent already has the maximum number of active tickets. | The specified agent already has the maximum number of tickets set under Settings > Desk > Automation > Auto ticket routing on Sendbird Dashboard. |
desk500500 | An internal error has occurred. | An error occurred while processing the request. |
Reopen a closed ticket
Reopens a closed ticket. However, tickets submitted through social media channels can only be reopened on the dashboard, not through this request.
Note: Tickets that have been closed more than 20 days prior to the request can't be reopened.
HTTP request
Parameter
The following table lists the properties of an HTTP request that this action supports.
Parameter name | Type | Description |
---|---|---|
ticket_id | int | Specifies the ID of a ticket to reopen. |
Response
If successful, this action returns a ticket resource in the response body.
Transfer tickets to a group
Transfers tickets with a specific status to a specific team.
HTTP request
Request body
The following table lists the properties of an HTTP request that this action supports.
Required
Property name | Type | Description |
---|---|---|
tickets | array of integers | Specifies one or more IDs of pending tickets for transfer. Up to 100 ticket IDs can be specified. |
status | string | Specifies the status of tickets for transfer. An acceptable value is PENDING. |
groupKey | string | Specifies the unique key of a group for ticket transfer. The key can be a mix of lowercase letters, hyphens, underscores, or numbers. |
Response
If successful, this action returns information on the transferred tickets in the response body.
List of response properties
Property name | Type | Description |
---|---|---|
transferredTickets | array of integers | The unique IDs of successfully transferred tickets. |
status | string | The status of transferred tickets. The valid value is PENDING. |
Cancel assignment of a ticket
Cancels assignment of a specific ticket from an agent. When a ticket is unassigned from an agent, its status changes to Pending. Then, it is assigned to another available agent within the specified team based on the auto ticket routing function.
Note: When a ticket is unassigned from a bot, the handover message is automatically sent to a customer. You can customize your handover message using the Bot API or in Settings > Bots of your dashboard.
HTTP request
Parameters
The following table lists the parameters that this action supports.
Required
Parameter name | Type | Description |
---|---|---|
ticket_id | int | Specifies the unique ID of a ticket. |
Request body
The following table lists the properties of an HTTP request that this action supports.
Optional
Property name | Type | Description |
---|---|---|
group | int | Specifies the unique key of a group. The ticket is reassigned to this group and then changes its status to Pending. |
Response
If successful, this action returns a ticket resource with the updated custom fields in the response body.
Update CSAT data of a closed ticket
Updates a Customer Satisfaction Rating (CSAT) score and comment of a closed ticket.
HTTP request
Parameters
The following table lists the parameters that this action supports.
Required
Parameter name | Type | Description |
---|---|---|
ticket_id | int | Specifies the unique ID of a closed ticket. |
Request body
The following table lists the properties of an HTTP request that this action supports.
Properties
Required | Type | Description |
---|---|---|
score | int | Specifies a CSAT score. Acceptable values range from 1 to 5, inclusive. |
Optional | Type | Description |
---|---|---|
comment | string | Specifies a CSAT comment. |
Response
If successful, this action returns a ticket resource with the updated CSAT score and comment.
Search tickets
Searches tickets in your Sendbird application.
HTTP request
Parameters
The following table lists the parameters that this action supports.
Optional
Parameter name | Type | Description |
---|---|---|
limit | int | Specifies the number of results to return per page. Acceptable values are 1 to 500, inclusive. (Default: 50) |
int | Specifies the number of results to skip when receiving a response. The value of | |
status2 | string | Restricts the search scope to only retrieve tickets whose status matches the specified value. Acceptable values are limited to the following: |
agent | string | Specifies the unique ID of an agent to restrict the search scope to only retrieve tickets assigned to a specific agent. |
sendbird_id | string | Restricts the search scope to only retrieve tickets submitted by a customer with a specified Sendbird ID. |
assignment_status | string | Restricts the search scope to only retrieve tickets whose assignment status matches the specified value. Acceptable values are limited to the following: |
ticket_fields | object | Specifies the keys and values of ticket fields as a search filter. They should be URL encoded |
channel_url | string | Restricts the search scope to only retrieve tickets related to a specified channel URL. |
start_date | date | Specifies a starting date that restricts the search scope to retrieve tickets created between start_date and end_date, in YYYY-MM-DD format. |
end_date | date | Specifies an ending date that restricts the search scope to retrieve tickets created between start_date and end_date, in YYYY-MM-DD format. |
order | string | Specifies the method to sort a list of results. Acceptable values are limited to the following: |
Response
If successful, this action returns a list of ticket resources in the response body.
Error
In the case of an error, an error object like below is returned. See the error code table for more details.
Error code | Error message | Description |
---|---|---|
deskp400105 | start_date and end_date are required. | Either |
deskp400111 | The value of limit should be smaller than 500. | The value specified in |
deskp400111 | Invalid value for start_date or end_date. | The specified |
deskp400111 | The specified sendbird_id doesn't exist. | The user with the specified |
deskp400111 | The value of order should be id, -id, created_at, or -created_at. | The value specified in |
deskp400111 | ticket_fields should be in json format. | The specified |
deskp400111 | The specified ticket_fields doesn't exist. | The key specified in |
desk500500 | An internal error has occurred. | An error occurred while processing the request. |
Send a ticket closure confirmation
Sends a ticket closure confirmation to the customer.
HTTP request
Parameters
The following table lists the parameters that this action supports.
Required
Parameter name | Type | Description |
---|---|---|
ticket_id | int | Specifies the unique ID of a ticket. |
Response
if successful, this action returns a ticket resource in the response body.
Error
In the case of an error, an error object like below is returned. See the error code table for more details.