You can use the Omnichannel Routing Queues API to create, update and delete a routing queue, which is used for routing ticket.

JSON format

Omnichannel Routing Queues are represented as JSON objects with the following properties:

NameTypeRead-onlyMandatoryDescription
created_atstringtruefalseThe time the queue was created
definitionobjectfalsefalseConditions when queue could be applied
descriptionstringfalsefalseThe description of the queue
idstringtruefalseAutomatically assigned when creating queue
namestringfalsefalseThe name of the queue
orderintegerfalsefalseThe queue-applied order
primary_groupsobjectfalsefalsePrimary group ids linked to the queue
priorityintegerfalsefalseThe queue-applied priority
secondary_groupsobjectfalsefalseSecondary group ids linked to the queue
updated_atstringtruefalseThe time of the queue's last update
urlstringtruefalseThe API URL of the queue

Example

{  "created_at": "2023-11-27T09:03:59Z",  "definition": {    "all": [      {        "field": "priority",        "operator": "is",        "value": "urgent"      }    ],    "any": []  },  "description": "Queue description",  "id": "01HG80ATNNZK1N7XRFVKX48XD6",  "name": "New queue with valid definition",  "order": 1,  "primary_groups": {    "count": 2,    "groups": [      {        "id": 6784729637757,        "name": "EWR"      },      {        "id": 5399674286077,        "name": "test"      }    ]  },  "priority": 1,  "secondary_groups": {    "count": 0,    "groups": []  },  "updated_at": "2023-11-27T09:03:59Z",  "url": "https://company.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6.json"}

List queues

  • GET /api/v2/queues
  • GET /api/v2/queues

Returns all active queues for an account.

Allowed For

  • Admins
Details

Rate limit for showing omnichannel routing queues exceeded. Please wait 1 minute and try again

Rate LimitsScopesIntervalSandboxTrialDefault
Standard1 minuteN/AN/A30

"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/queues.json \  -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/queues"	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/queues")		.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/queues',  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/queues"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/queues")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
{  "queues": [    {      "created_at": "2023-11-27T09:03:59Z",      "definition": {        "all": [          {            "field": "priority",            "operator": "is",            "value": "urgent"          }        ],        "any": []      },      "description": "Queue description",      "id": "01HG80ATNNZK1N7XRFVKX48XD6",      "name": "New queue with valid definition",      "order": 1,      "primary_groups": {        "count": 2,        "groups": [          {            "id": 6784729637757,            "name": "EW"          },          {            "id": 5399674286077,            "name": "test"          }        ]      },      "priority": 1,      "secondary_groups": {        "count": 0,        "groups": []      },      "updated_at": "2023-11-27T09:03:59Z",      "url": "https://company.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6.json"    }  ]}

Show Queue

  • GET /api/v2/queues/{queue_id}

Returns a queue for the given queue id.

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
queue_idstringPathtrueThe id of the omnichannel routing queue
Details

Rate limit for querying an omnichannel routing queue exceeded. Please wait 1 minute and try again

Rate LimitsScopesIntervalSandboxTrialDefault
Standard1 minuteN/AN/A50

"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/queues/{queue_id}.json \  -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6"	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/queues/01HG80ATNNZK1N7XRFVKX48XD6")		.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/queues/01HG80ATNNZK1N7XRFVKX48XD6',  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/queues/01HG80ATNNZK1N7XRFVKX48XD6"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/queues/01HG80ATNNZK1N7XRFVKX48XD6")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
{  "queue": {    "created_at": "2023-11-27T09:03:59Z",    "definition": {      "all": [        {          "field": "priority",          "operator": "is",          "value": "urgent"        }      ],      "any": []    },    "description": "Queue description",    "id": "01HG80ATNNZK1N7XRFVKX48XD6",    "name": "New queue with valid definition",    "order": 1,    "primary_groups": {      "count": 2,      "groups": [        {          "id": 6784729637757,          "name": "EW"        },        {          "id": 5399674286077,          "name": "test"        }      ]    },    "priority": 1,    "secondary_groups": {      "count": 0,      "groups": []    },    "updated_at": "2023-11-27T09:03:59Z",    "url": "https://company.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6.json"  }}

Create Queue

  • POST /api/v2/queues

Creates a queue. Accepts a JSON queue definition as the request body.

Allowed For

  • Admins
Details

Rate limit for creating omnichannel routing queues exceeded. Please wait 1 minute and try again

Rate LimitsScopesIntervalSandboxTrialDefault
Standard1 minuteN/AN/A50

"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/queues.json \  -H "Content-Type: application/json" \  -d '{ "queue": { "name": "New queue", "description": "Queue description", "priority": 10, "definition": {   "all": [  {    "field": "priority",    "operator": "is",    "value": "urgent"  }   ],   "any": [  {    "field": "priority",    "operator": "is",    "value": "normal"  }   ] }, "primary_groups_id": [1100002759994], "secondary_groups_id": [4398063790591] }}' \  -v -u {email_address}/token:{api_token} -X POST
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/queues"	method := "POST"	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/queues")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""""");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("POST", body)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'POST',  url: 'https://example.zendesk.com/api/v2/queues',  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/queues"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(	"POST",	url,	auth=auth,	headers=headers)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/queues")request = Net::HTTP::Post.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)

201 Created
// Status 201 Created
{  "queue": {    "created_at": "2023-11-27T09:03:59Z",    "definition": {      "all": [        {          "field": "priority",          "operator": "is",          "value": "urgent"        }      ],      "any": []    },    "description": "Queue description",    "id": "01HG80ATNNZK1N7XRFVKX48XD6",    "name": "New queue with valid definition",    "order": 1,    "primary_groups": {      "count": 2,      "groups": [        {          "id": 6784729637757,          "name": "EW"        },        {          "id": 5399674286077,          "name": "test"        }      ]    },    "priority": 1,    "secondary_groups": {      "count": 0,      "groups": []    },    "updated_at": "2023-11-27T09:03:59Z",    "url": "https://company.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6.json"  }}

Update Queue

  • PUT /api/v2/queues/{queue_id}

Updates the queue definition for a given queue id.

Allowed For

  • Admins

Parameters

NameTypeInRequiredDescription
queue_idstringPathtrueThe id of the omnichannel routing queue
Details

Rate limit for updating omnichannel routing queues exceeded. Please wait 1 minute and try again

Rate LimitsScopesIntervalSandboxTrialDefault
Standard1 minuteN/AN/A50

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

Code Samples

curl
curl -X PUT https://{subdomain}.zendesk.com/api/v2/queues/{queue_id}.json \  -H "Content-Type: application/json" \  -d '{ "queue": { "name": "New queue 2", "description": "Queue description 2", "priority": 10, "definition": {   "all": [  {    "field": "priority",    "operator": "is",    "value": "urgent"  }   ],   "any": [  {    "field": "priority",    "operator": "is",    "value": "normal"  }   ] }, "primary_groups_id": [1100002759994], "secondary_groups_id": [4398063790591] }}' \  -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6"	method := "PUT"	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/queues/01HG80ATNNZK1N7XRFVKX48XD6")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""""");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("PUT", body)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'PUT',  url: 'https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6',  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/queues/01HG80ATNNZK1N7XRFVKX48XD6"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(	"PUT",	url,	auth=auth,	headers=headers)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6")request = Net::HTTP::Put.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
{  "queue": {    "created_at": "2023-09-27T09:06:34Z",    "definition": {      "all": [        {          "field": "priority",          "operator": "is",          "value": "urgent"        }      ],      "any": []    },    "description": "Queue description 2",    "id": "01HG80ATNNZK1N7XRFVKX48XD6",    "name": "New queue 2",    "order": 1,    "primary_groups": {      "count": 1,      "groups": [        {          "id": 1100002759994,          "name": "Sales"        }      ]    },    "priority": 10,    "secondary_groups": {      "count": 1,      "groups": [        {          "id": 4398063790591,          "name": "Support"        }      ]    },    "updated_at": "2023-10-13T10:58:25Z",    "url": "https://{subdomain}.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6.json"  }}

Delete Queue

  • DELETE /api/v2/queues/{queue_id}

Deletes the queue and related records.

Allowed For

  • Admins

Parameters

NameTypeInRequiredDescription
queue_idstringPathtrueThe id of the omnichannel routing queue
Details

Rate limit for deleting omnichannel routing queues exceeded. Please wait 1 minute and try again

Rate LimitsScopesIntervalSandboxTrialDefault
Standard1 minuteN/AN/A50

"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/queues/{queue_id}.json \  -v -u {email_address}/token:{api_token} -X DELETE
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6"	method := "DELETE"	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/queues/01HG80ATNNZK1N7XRFVKX48XD6")		.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("DELETE", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'DELETE',  url: 'https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6',  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/queues/01HG80ATNNZK1N7XRFVKX48XD6"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(	"DELETE",	url,	auth=auth,	headers=headers)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6")request = Net::HTTP::Delete.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)

204 No Content
// Status 204 No Content
null

List Queue Definitions

  • GET /api/v2/queues/definitions
  • GET /api/v2/queues/definitions

Returns the definitions of the queues and the definitions of the conditions under which a queue can execute. The definition of the action includes a title ("Status"), a type ("list"), and possible values. The definition of the condition includes the same fields as well as the possible operators.

Allowed For

  • Admins
Details

Rate limit for querying queue definitions exceeded. Please wait 1 minute and try again

Rate LimitsScopesIntervalSandboxTrialDefault
Standard1 minuteN/AN/A30

"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/queues/definitions.json \  -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/queues/definitions"	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