Tickets are the means through which your end users (customers) communicate with agents in Zendesk Support. Tickets can originate from a number of channels, including email, Help Center, chat, phone call, X (formerly Twitter), Facebook, or the API. All tickets have a core set of properties.

Tickets and Requests

Zendesk has both a Tickets API and a Requests API. A ticket is an agent's perspective on a ticket. A request is an end user's perspective on a ticket. End users can only see public comments and certain fields of a ticket. Therefore, use the Requests API to let end users view, update, and create tickets. Use the Tickets API described in the rest of this document to let agents and admins manage tickets.

Requesters and submitters

Every ticket has a requester and submitter. The user who is asking for support through a ticket is the requester. For most businesses that use Zendesk Support, the requester is a customer, but requesters can also be agents in your Zendesk Support instance.

The submitter is the user who created a ticket. By default, the requester of a ticket is the submitter. For example, if your customer emails your support address, this creates a ticket with the customer as both the requester and submitter. The requester will also appear as the author of the ticket's first comment.

However, a support agent can also create a ticket on behalf of a customer. If an agent creates a ticket through the web interface, the agent is set as the submitter. This can be accomplished equivalently through the API by passing the agent's user ID as the submitter_id when creating a ticket. In this case, the agent, who is the submitter, becomes the author of the ticket's first comment and the ticket shows that the agent created the ticket "on behalf of" the customer.

If you want to include placeholders in the first comment, create the ticket as an agent, not on behalf of an end user. Placeholders only work in comments if the comment is created by an agent. If an end user tries to enter a placeholder in a comment, it's treated as a static string and is displayed as such in the ticket.

The submitter is always the first comment author

In the description above, we see that a ticket's first comment author can differ depending on who created the ticket. In both examples, whomever is the submitter becomes the first comment author. This will hold true for all tickets created in Zendesk Support with one exception.

Exception: If the ticket is created as a follow-up ticket (i.e., if the ticket is created using via_followup_source_id), then any submitter_id attribute is ignored. The API sets whoever created the follow-up ticket (for the API, always the authenticated user) as the first comment author.

Description and first comment

When creating a ticket, use the comment property to set the ticket description, which is also the first comment. Example:

{"ticket": {"subject": "My printer is on fire!", "comment": {"body": "The smoke is very colorful."}}}

Important: Do not use the description property to set the first comment. The property is for reading purposes only. While it's possible to use the property to set the first comment, the functionality has limitations and is provided to support existing implementations.

Subject

When tickets are created within the Agent Workspace, a subject is required. However, tickets can be created via the API or email without a subject. If a ticket doesn't have a subject, the text of the first comment is populated as the ticket's subject the first time the ticket is updated in the Agent Workspace.

Groups and assignees

Tickets in Zendesk Support can be passed to a group of agents unassigned, or to a specific agent in a specific group. A ticket can only be assigned to one assignee at a time.

Collaborators

Aside from the requester, a ticket can include other people in its communication, known as collaborators or cc's. Collaborators receive email notifications when tickets are updated. Collaborators can be either end users or agents.

Custom ticket statuses

If your account has activated custom ticket statuses, the status property contains the ticket's status category. An id for the custom ticket status is available in the custom_status_id property.

To get a human-readable label for a ticket's custom status, sideload custom_statuses in a GET request. Example:

GET /api/v2/tickets.json?include=custom_statuses
Response:{  "ticket": {    "id": 35436,    "custom_status_id": 123,    "status": "open",    ...  },  "custom_statuses": [    {      "id": 123,      "status_category": "open",      "agent_label": "Open",      "end_user_label": "Open",      ...    }  ]}

For more information about custom ticket statuses and status categories, see Creating custom ticket statuses.

JSON format

Tickets are represented as JSON objects with the following properties:

NameTypeRead-onlyMandatoryDescription
allow_attachmentsbooleantruefalsePermission for agents to add add attachments to a comment. Defaults to true
allow_channelbackbooleantruefalseIs false if channelback is disabled, true otherwise. Only applicable for channels framework ticket
assignee_emailstringfalsefalseWrite only. The email address of the agent to assign the ticket to
assignee_idintegerfalsefalseThe agent currently assigned to the ticket
attribute_value_idsarrayfalsefalseWrite only. An array of the IDs of attribute values to be associated with the ticket
brand_idintegerfalsefalseThe id of the brand this ticket is associated with. See Setting up multiple brands
collaborator_idsarrayfalsefalseThe ids of users currently CC'ed on the ticket
collaboratorsarrayfalsefalsePOST requests only. Users to add as cc's when creating a ticket. See Setting Collaborators
commentobjectfalsefalseWrite only. An object that adds a comment to the ticket. See Ticket comments. To include an attachment with the comment, see Attaching files. A ticket can contain up to 5000 comments in total, including both public and private comments. Once this limit is reached, any additional attempts to add comments results in a 422 error. The ticket can still be updated in other ways, provided that no new comments are added.
created_atstringtruefalseWhen this record was created
custom_fieldsarrayfalsefalseCustom fields for the ticket. See Setting custom field values
custom_status_idintegerfalsefalseThe custom ticket status id of the ticket. See custom ticket statuses
descriptionstringtruefalseRead-only first comment on the ticket. When creating a ticket, use comment to set the description. See Description and first comment
due_atstringfalsefalseIf this is a ticket of type "task" it has a due date. Due date format uses ISO 8601 format
email_cc_idsarrayfalsefalseThe ids of agents or end users currently CC'ed on the ticket. See CCs and followers resources in the Support Help Center
email_ccsobjectfalsefalseWrite only. An array of objects that represent agent or end users email CCs to add or delete from the ticket. See Setting email CCs
external_idstringfalsefalseAn id you can use to link Zendesk Support tickets to local records
follower_idsarrayfalsefalseThe ids of agents currently following the ticket. See CCs and followers resources
followersobjectfalsefalseWrite only. An array of objects that represent agent followers to add or delete from the ticket. See Setting followers
followup_idsarraytruefalseThe ids of the followups created from this ticket. Ids are only visible once the ticket is closed
forum_topic_idintegertruefalseThe topic in the Zendesk Web portal this ticket originated from, if any. The Web portal is deprecated
from_messaging_channelbooleantruefalseIf true, the ticket's via type is a messaging channel.
generated_timestampintegertruefalseA Unix timestamp that represents the most accurate reading of when this record was last updated. It is updated for all ticket updates, including system updates
group_idintegerfalsefalseThe group this ticket is assigned to
has_incidentsbooleantruefalseIs true if a ticket is a problem type and has one or more incidents linked to it. Otherwise, the value is false.
idintegertruefalseAutomatically assigned when the ticket is created
is_publicbooleantruefalseIs true if any comments are public, false otherwise
macro_idintegerfalsefalseWrite only. A macro ID to be recorded in the ticket audit
macro_idsarrayfalsefalsePOST requests only. List of macro IDs to be recorded in the ticket audit
metadataobjectfalsefalseWrite only. Metadata for the audit. In the audit object, the data is specified in the custom property of the metadata object. See Setting Metadata
organization_idintegerfalsefalseThe organization of the requester. You can only specify the ID of an organization associated with the requester. See Organization Memberships
prioritystringfalsefalseThe urgency with which the ticket should be addressed. Allowed values are "urgent", "high", "normal", or "low".
problem_idintegerfalsefalseFor tickets of type "incident", the ID of the problem the incident is linked to
raw_subjectstringfalsefalseThe dynamic content placeholder, if present, or the "subject" value, if not. See Dynamic Content Items
recipientstringfalsefalseThe original recipient e-mail address of the ticket. Notification emails for the ticket are sent from this address
requesterobjectfalsefalseWrite only. See Creating a ticket with a new requester
requester_idintegerfalsetrueThe user who requested this ticket
safe_updatebooleanfalsefalseWrite only. Optional boolean. When true and an update_stamp date is included, protects against ticket update collisions and returns a message to let you know if one occurs. See Protecting against ticket update collisions. A value of false has the same effect as true. Omit the property to force the updates to not be safe
satisfaction_ratingobjecttruefalseThe satisfaction rating of the ticket, if it exists, or the state of satisfaction, "offered" or "unoffered". The value is null for plan types that don't support CSAT
sharing_agreement_idsarrayfalsefalseThe ids of the sharing agreements used for this ticket
statusstringfalsefalseThe state of the ticket. If your account has activated custom ticket statuses, this is the ticket's status category. See custom ticket statuses. Allowed values are "new", "open", "pending", "hold", "solved", or "closed".
subjectstringfalsefalseThe value of the subject field for this ticket. See Subject
submitter_idintegerfalsefalseThe user who submitted the ticket. The submitter always becomes the author of the first comment on the ticket
tagsarrayfalsefalseThe array of tags applied to this ticket. Unless otherwise specified, the set tag behavior is used, which overwrites and replaces existing tags
ticket_form_idintegerfalsefalseEnterprise only. The id of the ticket form to render for the ticket
typestringfalsefalseThe type of this ticket. Allowed values are "problem", "incident", "question", or "task".
updated_atstringtruefalseWhen this record last got updated. It is updated only if the update generates a ticket event
updated_stampstringfalsefalseWrite only. Datetime of last update received from API. See the safe_update property
urlstringtruefalseThe API url of this ticket
viaobjectfalsefalseFor more information, see the Via object reference
via_followup_source_idintegerfalsefalsePOST requests only. The id of a closed ticket when creating a follow-up ticket. See Creating a follow-up ticket
via_idintegerfalsefalseWrite only. For more information, see the Via object reference
voice_commentobjectfalsefalseWrite only. See Creating voicemail ticket

You can also include a comment_count property in the JSON objects returned by GET requests by sideloading it. Example:

GET /api/v2/tickets.json?include=comment_count

Example

{  "assignee_id": 235323,  "collaborator_ids": [    35334,    234  ],  "created_at": "2009-07-20T22:55:29Z",  "custom_fields": [    {      "id": 27642,      "value": "745"    },    {      "id": 27648,      "value": "yes"    }  ],  "custom_status_id": 123,  "description": "The fire is very colorful.",  "due_at": null,  "external_id": "ahg35h3jh",  "follower_ids": [    35334,    234  ],  "from_messaging_channel": false,  "generated_timestamp": 1304553600,  "group_id": 98738,  "has_incidents": false,  "id": 35436,  "organization_id": 509974,  "priority": "high",  "problem_id": 9873764,  "raw_subject": "{{dc.printer_on_fire}}",  "recipient": "[email protected]",  "requester_id": 20978392,  "satisfaction_rating": {    "comment": "Great support!",    "id": 1234,    "score": "good"  },  "sharing_agreement_ids": [    84432  ],  "status": "open",  "subject": "Help, my printer is on fire!",  "submitter_id": 76872,  "tags": [    "enterprise",    "other_tag"  ],  "type": "incident",  "updated_at": "2011-05-05T10:38:52Z",  "url": "https://company.zendesk.com/api/v2/tickets/35436.json",  "via": {    "channel": "web"  }}

List Tickets

  • GET /api/v2/tickets
  • GET /api/v2/organizations/{organization_id}/tickets
  • GET /api/v2/users/{user_id}/tickets/requested
  • GET /api/v2/users/{user_id}/tickets/ccd
  • GET /api/v2/users/{user_id}/tickets/followed
  • GET /api/v2/users/{user_id}/tickets/assigned
  • GET /api/v2/tickets/recent

ccd lists tickets that the specified user is cc'd on.

followed lists tickets that the specified user is following.

recent lists tickets that the requesting agent recently viewed in the agent interface, not recently created or updated tickets (unless by the agent recently in the agent interface).

To get a list of all tickets in your account, use the Incremental Ticket Export, Cursor Based or Incremental Ticket Export, Time Based endpoint.

For more filter options, use the Search API.

You can also sideload related records with the tickets. See Side-Loading.

Archived tickets are not included in the following endpoint responses. See About archived tickets in the Zendesk help.

  • GET /api/v2/tickets
  • GET /api/v2/organizations/{organization_id}/tickets
  • GET /api/v2/tickets/recent

If an agent with restricted access to tickets makes a request to the api/v2/tickets endpoint, the endpoint returns only the tickets the agent can access. For information on agents with restricted access to tickets, see Creating custom roles and assigning agents. In addition, the restricted agent's request includes up to 10,000 tickets where the agent is a CC or follower.

Allowed for

  • Agents

Pagination

  • Cursor pagination (recommended)
  • Offset pagination

See Pagination.

Returns a maximum of 100 records per page.

Sorting

By default, tickets are sorted by id from smallest to largest.

When using cursor pagination, use the following parameter to change the sort order:

NameTypeRequiredComments
sortstringnoPossible values are "updated_at", "id", "status" (ascending order) or "-updated_at", "-id", "-status" (descending order)

When using offset pagination, use the following parameters to change the sort order:

NameTypeRequiredComments
sort_bystringnoPossible values are "assignee", "assignee.name", "created_at", "group", "id", "requester", "requester.name", "status", "subject", "updated_at"
sort_orderstringnoOne of asc, desc. Defaults to asc

When sorting by creation date, the first ticket listed may not be the absolute oldest ticket in your account due to ticket archiving.

The query parameter is not supported for this endpoint. Use the Search API to narrow your results with query.

Parameters

NameTypeInRequiredDescription
external_idstringQueryfalseLists tickets by external id. External ids don't have to be unique for each ticket. As a result, the request may return multiple tickets with the same external id.

Limits

This endpoint has its own rate limit that is different from the account wide rate limit. When calls are made to this endpoint, this limit will be consumed and you will get a 429 Too Many Requests response code if the allocation is exhausted.

Headers

API responses include usage limit information in the headers for this endpoint.

Zendesk-RateLimit-tickets-index: total={number}; remaining={number}; resets={number}
Zendesk-RateLimit-tickets-index-pagination: total={number}; remaining={number}; resets={number}
Zendesk-RateLimit-tickets-index-deep-pagination: total={number}; remaining={number}; resets={number}

Within this header, “Total” signifies the initial allocation, “Remaining” indicates the remaining allowance for the current interval, and “Resets” denotes the wait time in seconds before the limit refreshes. You can see the Total, and Interval values in the below table.

Details

This is the limit definition for the List Tickets endpoint

Rate LimitsScopesIntervalSandboxTrialDefault
StandardAccount1 minute100100N/A
With High Volume API Add OnAccount1 minute300300N/A

"Default" applies to all Zendesk suite and support plans. Please refer to the general account limits for more information.

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/tickets.json \  -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/tickets?external_id="	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/tickets")		.newBuilder()		.addQueryParameter("external_id", "");String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/tickets',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"  },  params: {    'external_id': '',  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsfrom requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/tickets?external_id="headers = {	"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(	"GET",	url,	auth=auth,	headers=headers)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/tickets")uri.query = URI.encode_www_form("external_id": "")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "tickets": [    {      "assignee_id": 235323,      "collaborator_ids": [        35334,        234      ],      "created_at": "2009-07-20T22:55:29Z",      "custom_fields": [        {          "id": 27642,          "value": "745"        },        {          "id": 27648,          "value": "yes"        }      ],      "custom_status_id": 123,      "description": "The fire is very colorful.",      "due_at": null,      "external_id": "ahg35h3jh",      "follower_ids": [        35334,        234      ],      "from_messaging_channel": false,      "generated_timestamp": 1304553600,      "group_id": 98738,      "has_incidents": false,      "id": 35436,      "organization_id": 509974,      "priority": "high",      "problem_id": 9873764,      "raw_subject": "{{dc.printer_on_fire}}",      "recipient": "[email protected]",      "requester_id": 20978392,      "satisfaction_rating": {        "comment": "Great support!",        "id": 1234,        "score": "good"      },      "sharing_agreement_ids": [        84432      ],      "status": "open",      "subject": "Help, my printer is on fire!",      "submitter_id": 76872,      "tags": [        "enterprise",        "other_tag"      ],      "type": "incident",      "updated_at": "2011-05-05T10:38:52Z",      "url": "https://company.zendesk.com/api/v2/tickets/35436.json",      "via": {        "channel": "web"      }    }  ]}

Count Tickets

  • GET /api/v2/tickets/count
  • GET /api/v2/organizations/{organization_id}/tickets/count
  • GET /api/v2/users/{user_id}/tickets/ccd/count
  • GET /api/v2/users/{user_id}/tickets/assigned/count

Returns an approximate count of tickets in the account. If the count exceeds 100,000, it is updated every 24 hours.

ccd lists tickets that the specified user is cc'd on.

The count[refreshed_at] property is a timestamp that indicates when the count was last updated.

Note: When the count exceeds 100,000, count[refreshed_at] may occasionally be null. This indicates that the count is being updated in the background, and count[value] is limited to 100,000 until the update is complete.

Allowed For

  • Agents

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/tickets/count.json \  -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/tickets/count"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/tickets/count")		.newBuilder();String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/tickets/count',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsfrom requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/tickets/count"headers = {	"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(	"GET",	url,	auth=auth,	headers=headers)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/tickets/count")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "count": {    "refreshed_at": "2020-04-06T02:18:17Z",    "value": 102  }}

Show Ticket

  • GET /api/v2/tickets/{ticket_id}

Returns a number of ticket properties though not the ticket comments. To get the comments, use List Comments

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
ticket_idintegerPathtrueThe ID of the ticket

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/tickets/{ticket_id}.json \  -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/tickets/123456"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/tickets/123456")		.newBuilder();String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/tickets/123456',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsfrom requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/tickets/123456"headers = {	"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(	"GET",	url,	auth=auth,	headers=headers)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/tickets/123456")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "ticket": {    "assignee_id": 235323,    "collaborator_ids": [      35334,      234    ],    "created_at": "2009-07-20T22:55:29Z",    "custom_fields": [      {        "id": 27642,        "value": "745"      },      {        "id": 27648,        "value": "yes"      }    ],    "custom_status_id": 123,    "description": "The fire is very colorful.",    "due_at": null,    "external_id": "ahg35h3jh",    "follower_ids": [      35334,      234    ],    "from_messaging_channel": false,    "generated_timestamp": 1304553600,    "group_id": 98738,    "has_incidents": false,    "id": 35436,    "organization_id": 509974,    "priority": "high",    "problem_id": 9873764,    "raw_subject": "{{dc.printer_on_fire}}",    "recipient": "[email protected]",    "requester_id": 20978392,    "satisfaction_rating": {      "comment": "Great support!",      "id": 1234,      "score": "good"    },    "sharing_agreement_ids": [      84432    ],    "status": "open",    "subject": "Help, my printer is on fire!",    "submitter_id": 76872,    "tags": [      "enterprise",      "other_tag"    ],    "type": "incident",    "updated_at": "2011-05-05T10:38:52Z",    "url": "https://company.zendesk.com/api/v2/tickets/35436.json",    "via": {      "channel": "web"    }  }}

Show Multiple Tickets

  • GET /api/v2/tickets/show_many?ids={ids}

Accepts a comma-separated list of ticket ids to return.

This endpoint will return up to 100 tickets records.

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
idsstringQuerytrueComma-separated list of ticket ids

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/tickets/show_many.json?ids=1,2,3 \  -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/tickets/show_many?ids=35436%2C35437"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/tickets/show_many")		.newBuilder()		.addQueryParameter("ids", "35436,35437");String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/tickets/show_many',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"  },  params: {    'ids': '35436%2C35437',  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsfrom requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/tickets/show_many?ids=35436%2C35437"headers = {	"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(	"GET",	url,	auth=auth,	headers=headers)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/tickets/show_many")uri.query = URI.encode_www_form("ids": "35436,35437")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "tickets": [    {      "assignee_id": 235323,      "collaborator_ids": [        35334,        234      ],      "created_at": "2009-07-20T22:55:29Z",      "custom_fields": [        {          "id": 27642,          "value": "745"        },        {          "id": 27648,          "value": "yes"        }      ],      "custom_status_id": 123,      "description": "The fire is very colorful.",      "due_at": null,      "external_id": "ahg35h3jh",      "follower_ids": [        35334,        234      ],      "from_messaging_channel": false,      "generated_timestamp": 1304553600,      "group_id": 98738,      "has_incidents": false,      "id": 35436,      "organization_id": 509974,      "priority": "high",      "problem_id": 9873764,      "raw_subject": "{{dc.printer_on_fire}}",      "recipient": "[email protected]",      "requester_id": 20978392,      "satisfaction_rating": {        "comment": "Great support!",        "id": 1234,        "score": "good"      },      "sharing_agreement_ids": [        84432      ],      "status": "open",      "subject": "Help, my printer is on fire!",      "submitter_id": 76872,      "tags": [        "enterprise",        "other_tag"      ],      "type": "incident",      "updated_at": "2011-05-05T10:38:52Z",      "url": "https://company.zendesk.com/api/v2/tickets/35436.json",      "via": {        "channel": "web"      }    }  ]}

Create Ticket