Zendesk Support has three types of users: end users (your customers), agents, and administrators.

End users

End users request support through tickets. End users have access to Help Center where they can view knowledge base articles and community content, access their ticket history, and submit new tickets.

Agents

Agents work in Zendesk Support to solve tickets. Agents can be divided into multiple groups and can also belong to multiple groups. Agents don't have access to administrative configuration in Zendesk Support such as business rules or automations, but can configure their own macros and views.

Administrators

Administrators have all the abilities of agents, plus administrative abilities. Accounts on the Enterprise plan and above can configure custom roles to give agents varying degrees of administrative access.

Listing Requested Tickets and CC'ed Tickets

Use the Tickets API to list:

Listing Help Center Content by a User

Use the Help Center API to list:

JSON format

Users are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
active boolean true false false if the user has been deleted
alias string false false An alias displayed to end users
chat_only boolean true false Whether or not the user is a chat-only agent
created_at string true false The time the user was created
custom_role_id integer false false A custom role if the user is an agent on the Enterprise plan or above
default_group_id integer false false The id of the user's default group
details string false false Any details you want to store about the user, such as an address
email string false false The user's primary email address. *Writeable on create only. On update, a secondary email is added. See Email Address
external_id string false false A unique identifier from another system. The API treats the id as case insensitive. Example: "ian1" and "IAN1" are the same value.
iana_time_zone string true false The time zone for the user
id integer true false Automatically assigned when the user is created
last_login_at string true false Last time the user signed in to Zendesk Support or made an API request using an API token or basic authentication
locale string false false The user's locale. A BCP-47 compliant tag for the locale. If both "locale" and "locale_id" are present on create or update, "locale_id" is ignored and only "locale" is used.
locale_id integer false false The user's language identifier
moderator boolean false false Designates whether the user has forum moderation capabilities
name string false true The user's name
notes string false false Any notes you want to store about the user
only_private_comments boolean false false true if the user can only create private comments
organization_id integer false false The id of the user's organization. If the user has more than one organization memberships, the id of the user's default organization. If updating, see Organization ID
phone string false false The user's primary phone number. See Phone Number below
photo object false false The user's profile picture represented as an Attachment object
remote_photo_url string false false A URL pointing to the user's profile picture.
report_csv boolean true false This parameter is inert and has no effect. It may be deprecated in the future. Previously, this parameter determined whether a user could access a CSV report in a legacy Guide dashboard. This dashboard has been removed. See Announcing Guide legacy reporting upgrade to Explore
restricted_agent boolean false false If the agent has any restrictions; false for admins and unrestricted agents, true for other agents
role string false false The user's role. Possible values are "end-user", "agent", or "admin"
role_type integer true false The user's role id. 0 for a custom agent, 1 for a light agent, 2 for a chat agent, 3 for a chat agent added to the Support account as a contributor (Chat Phase 4), 4 for an admin, and 5 for a billing admin
shared boolean true false If the user is shared from a different Zendesk Support instance. Ticket sharing accounts only
shared_agent boolean true false If the user is a shared agent from a different Zendesk Support instance. Ticket sharing accounts only
shared_phone_number boolean false false Whether the phone number is shared or not. See Phone Number below
signature string false false The user's signature. Only agents and admins can have signatures
suspended boolean false false If the agent is suspended. Tickets from suspended users are also suspended, and these users cannot sign in to the end user portal
tags array false false The user's tags. Only present if your account has user tagging enabled
ticket_restriction string false false Specifies which tickets the user has access to. Possible values are: "organization", "groups", "assigned", "requested", null
time_zone string false false The user's time zone. See Time Zone
two_factor_auth_enabled boolean true false If two factor authentication is enabled
updated_at string true false The time the user was last updated
url string true false The user's API url
user_fields object false false Values of custom fields in the user's profile. See User Fields
verified boolean false false Any of the user's identities is verified. See User Identities

Email Address

You can specify a user's primary email address when you create the user. See Specifying email and verified attributes.

To update a user's primary email address, use the Make Identity Primary endpoint.

Time Zone

A time_zone name consists of a string such as "Eastern Time (US & Canada)". For a list of valid names, see the Time zone list menu on the Localization page in the Support admin interface (Admin > Account > Localization). For example, if the menu lists "(GMT+02:00) Berlin", then use "Berlin" as the time_zone name.

Request body in User API:

{ "user": {   "id":   35436,   "name": "Johnny Agent",   "time_zone": "Berlin",   ... }}

User Fields

You can use the user_fields object to set the value of one or more custom fields in the user's profile. Specify field keys as the properties to set. Example:

"user_fields": {   "membership_level": "silver",   "membership_expires": "2019-07-23T00:00:00Z" }

For more information, see User Fields and Adding custom fields to users.

Phone Number

The phone number should comply with the E.164 international telephone numbering plan. Example +15551234567. E164 numbers are international numbers with a country dial prefix, usually an area code and a subscriber number. A valid E.164 phone number must include a country calling code.

A phone number can be one of the following types:

  • A direct line linked to a single user, which is indicated by a shared_phone_number attribute of false. A direct line can be used as a user identity
  • A shared number linked to multiple users, indicated by a shared_phone_number attribute of true. A shared number can not be used as a user identity

See Understanding how phone numbers are linked to end-user profiles in the Support Help Center.

Organization ID

The organization_id property returns the id of the user's organization. If the user has more than one organization memberships, the id of the user's default organization is returned.

The field is writable. However, if you make a request to update the organization_id property, the organization_id of the request only updates the default organization for that user. Zendesk recommends using the Organization Memberships API to add or delete organizations for a user.

JSON Format for End Users

When an end user makes the request, the user is returned with the following attributes:

Name Type Read-only Mandatory Comment
id integer yes no Automatically assigned when creating users
email string no no The primary email address of this user. If the primary email address is not verified, the secondary email address is used
name string no yes The name of the user
created_at date yes no The time the user was created
locale string yes no The locale for this user
locale_id integer no no The language identifier for this user
organization_id integer no no The id of the user's organization. If the user has more than one organization memberships, the id of the user's default organization. If updating, see Organization ID
phone string no no The primary phone number of this user. See Phone Number in the Users API
shared_phone_number boolean yes no Whether the phone number is shared or not. See Phone Number in the Users API
photo Attachment no no The user's profile picture represented as an Attachment object
role string no no The role of the user. Possible values: "end-user", "agent", "admin"
time_zone string no no The time-zone of this user
updated_at date yes no The time of the last update of the user
url string yes no The API url of this user
verified boolean no no Any of the user's identities is verified. See User Identities

Responses will vary depending on the role of the client making the request. The following example is a response for an end-user role.

Example

{  "id":                    35436,  "url":                   "https://company.zendesk.com/api/v2/end_users/35436.json",  "name":                  "Johnny End User",  "created_at":            "2009-07-20T22:55:29Z",  "updated_at":            "2011-05-05T10:38:52Z",  "time_zone":             "Copenhagen",  "email":                 "[email protected]",  "phone":                 "+15551234567",  "locale":                "en-US",  "locale_id":             1,  "organization_id":       57542,  "role":                  "end-user",  "verified":              true,  "photo": {    "id":           928374,    "name":         "my_funny_profile_pic.png",    "content_url":  "https://company.zendesk.com/photos/my_funny_profile_pic.png",    "content_type": "image/png",    "size":         166144,    "thumbnails": [      {      "id":           928375,      "name":         "my_funny_profile_pic_thumb.png",      "content_url":  "https://company.zendesk.com/photos/my_funny_profile_pic_thumb.png",      "content_type": "image/png",      "size":         58298      }    ]  }}

This example is a response for an admin or agent request.

Example

{  "active": true,  "alias": "Mr. Johnny",  "created_at": "2009-07-20T22:55:29Z",  "custom_role_id": 9373643,  "details": "",  "email": "[email protected]",  "external_id": "sai989sur98w9",  "iana_time_zone": "Pacific/Pago_Pago",  "id": 35436,  "last_login_at": "2011-05-05T10:38:52Z",  "locale": "en-US",  "locale_id": 1,  "moderator": true,  "name": "Johnny Agent",  "notes": "Johnny is a nice guy!",  "only_private_comments": false,  "organization_id": 57542,  "phone": "+15551234567",  "photo": {    "content_type": "image/png",    "content_url": "https://company.zendesk.com/photos/my_funny_profile_pic.png",    "id": 928374,    "name": "my_funny_profile_pic.png",    "size": 166144,    "thumbnails": [      {        "content_type": "image/png",        "content_url": "https://company.zendesk.com/photos/my_funny_profile_pic_thumb.png",        "id": 928375,        "name": "my_funny_profile_pic_thumb.png",        "size": 58298      }    ]  },  "restricted_agent": true,  "role": "agent",  "role_type": 0,  "shared": false,  "shared_agent": false,  "signature": "Have a nice day, Johnny",  "suspended": true,  "tags": [    "enterprise",    "other_tag"  ],  "ticket_restriction": "assigned",  "time_zone": "Copenhagen",  "updated_at": "2011-05-05T10:38:52Z",  "url": "https://company.zendesk.com/api/v2/users/35436.json",  "user_fields": {    "user_date": "2012-07-23T00:00:00Z",    "user_decimal": 5.1,    "user_dropdown": "option_1"  },  "verified": true}

List Users

  • GET /api/v2/users
  • GET /api/v2/groups/{group_id}/users
  • GET /api/v2/organizations/{organization_id}/users

Pagination

  • Cursor pagination (recommended)
  • Offset pagination

See Pagination.

Returns a maximum of 100 records per page.

Allowed For

  • Admins, Agents and Light Agents

Parameters

Name Type In Required Description
external_id string Query false List users by external id. External id has to be unique for each user under the same account.
permission_set integer Query false For custom roles which is available on the Enterprise plan and above. You can only filter by one role ID per request
role string Query false Filters the results by role. Possible values are "end-user", "agent", or "admin". Allowed values are "end-user", "agent", or "admin".
role[] string Query false Filters the results by more than one role using the format role[]={role}&role[]={role}

Code Samples

cURL
# List Userscurl https://{subdomain}.zendesk.com/api/v2/users.json \   -v -u {email_address}:{password}# with role filtering# **Note**: If filtering by multiple roles in curl, make sure to include# the `-g` flag to prevent curl from interpreting the square brackets# as globbing characters. Also enclose the URL in quotes. Example:curl -g 'https://{subdomain}.zendesk.com/api/v2/users.json?role[]=admin&role[]=end-user' \ -v -u {email_address}:{password}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/users?external_id=abc&permission_set=123&role=agent&role[]=agent"	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 "username:password"
	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/users")		.newBuilder()		.addQueryParameter("external_id", "abc")		.addQueryParameter("permission_set", "123")		.addQueryParameter("role", "agent")		.addQueryParameter("role[]", "agent");
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/users',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },  params: {    'external_id': 'abc',    'permission_set': '123',    'role': 'agent',    'role[]': 'agent',  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://example.zendesk.com/api/v2/users?external_id=abc&permission_set=123&role=agent&role[]=agent"headers = {	"Content-Type": "application/json",}
response = requests.request(	"GET",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/users")uri.query = URI.encode_www_form("external_id": "abc", "permission_set": "123", "role": "agent", "role[]": "agent")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"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
{  "users": [    {      "id": 223443,      "name": "Johnny Agent"    },    {      "id": 8678530,      "name": "James A. Rosen"    }  ]}

Search Users

  • GET /api/v2/users/search

Returns an array of users who meet the search criteria.

Pagination

  • Offset pagination only

See Using Offset Pagination.

Allowed For

  • Admins, Agents and Light Agents

Parameters

Name Type In Required Description
external_id string Query false The external_id parameter does not support the search syntax. It only accepts ids.
query string Query false The query parameter supports the Zendesk search syntax for more advanced user searches. It can specify a partial or full value of any user property, including name, email address, notes, or phone. Example: query="jdoe". See the Search API.

Code Samples

cURL
curl https://{subdomain}.zendesk.com/api/v2/users/search.json?query=gil \  -v -u {email_address}:{password}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/users/search?external_id=abc124&query=jdoe"	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 "username:password"
	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/users/search")		.newBuilder()		.addQueryParameter("external_id", "abc124")		.addQueryParameter("query", "jdoe");
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/users/search',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },  params: {    'external_id': 'abc124',    'query': 'jdoe',  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://example.zendesk.com/api/v2/users/search?external_id=abc124&query=jdoe"headers = {	"Content-Type": "application/json",}
response = requests.request(	"GET",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/users/search")uri.query = URI.encode_www_form("external_id": "abc124", "query": "jdoe")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"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
{  "users": [    {      "id": 35436,      "name": "Robert Jones",      "notes": "sigil issue"    },    {      "id": 9873843,      "name": "Terry Gilliam"    }  ]}

Autocomplete Users

  • GET /api/v2/users/autocomplete?name={name}

Returns an array of users whose name starts with the value specified in the name parameter. It only returns users with no foreign identities.

Allowed For

  • Agents

Parameters

Name Type In Required Description
field_id string Query false The id of a lookup relationship field. The type of field is determined by the source param
name string Query true The name to search for the user.
source string Query false If a field_id is provided, this specifies the type of the field. For example, if the field is on a "zen:user", it references a field on a user

Code Samples

cURL
curl https://{subdomain}.zendesk.com/api/v2/users/autocomplete.json?name=gil \  -u {email_address}:{password}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/users/autocomplete?field_id=&name=gil&source="	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 "username:password"
	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/users/autocomplete")		.newBuilder()		.addQueryParameter("field_id", "")		.addQueryParameter("name", "gil")		.addQueryParameter("source", "");
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/users/autocomplete',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },  params: {    'field_id': '',    'name': 'gil',    'source': '',  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://example.zendesk.com/api/v2/users/autocomplete?field_id=&name=gil&source="headers = {	"Content-Type": "application/json",}
response = requests.request(	"GET",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/users/autocomplete")uri.query = URI.encode_www_form("field_id": "", "name": "gil", "source": "")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"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
{  "users": [    {      "id": 35436,      "name": "Robert Jones",      "notes": "sigil issue"    },    {      "id": 9873843,      "name": "Terry Gilliam"    }  ]}

Count Users

  • GET /api/v2/users/count
  • GET /api/v2/groups/{group_id}/users/count
  • GET /api/v2/organizations/{organization_id}/users/count

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

The response includes a refreshed_at property in a count object that contains a timestamp indicating when the count was last updated.

Note: When the count exceeds 100,000, the refreshed_at property may occasionally be null. This indicates that the count is being updated in the background. The count object's value property is limited to 100,000 until the update is complete.

Allowed For

  • Admins, Agents and Light Agents

Parameters

Name Type In Required Description
permission_set integer Query false For custom roles which is available on the Enterprise plan and above. You can only filter by one role ID per request
role string Query false Filters the results by role. Possible values are "end-user", "agent", or "admin". Allowed values are "end-user", "agent", or "admin".
role[] string Query false Filters the results by more than one role using the format role[]={role}&role[]={role}

Code Samples

cURL
curl https://{subdomain}.zendesk.com/api/v2/users/count.json \  -v -u {email_address}:{password}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/users/count?permission_set=123&role=agent&role[]=agent"	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 "username:password"
	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/users/count")		.newBuilder()		.addQueryParameter("permission_set", "123")		.addQueryParameter("role", "agent")		.addQueryParameter("role[]", "agent");
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/users/count',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },  params: {    'permission_set': '123',    'role': 'agent',    'role[]': 'agent',  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://example.zendesk.com/api/v2/users/count?permission_set=123&role=agent&role[]=agent"headers = {	"Content-Type": "application/json",}
response = requests.request(	"GET",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/users/count")uri.query = URI.encode_www_form("permission_set": "123", "role": "agent", "role[]": "agent")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"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 User

  • GET /api/v2/users/{user_id}

Allowed For

  • Agents

Parameters

Name Type In Required Description
user_id integer Path true The id of the user

Code Samples

cURL
curl https://{subdomain}.zendesk.com/api/v2/users/{user_id}.json \  -v -u {email_address}:{password}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/users/35436"	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 "username:password"
	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/users/35436")		.newBuilder();
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/users/35436',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://example.zendesk.com/api/v2/users/35436"headers = {	"Content-Type": "application/json",}
response = requests.request(	"GET",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/users/35436")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"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
{  "user": {    "id": 35436,    "name": "Johnny Agent"  }}

Show Many Users

  • GET /api/v2/users/show_many

Accepts a comma-separated list of up to 100 user ids or external ids.

Allowed For:

  • Agents

Parameters

Name Type In Required Description
external_ids string Query false Accepts a comma-separated list of up to 100 external ids.
ids string Query false Accepts a comma-separated list of up to 100 user ids.

Code Samples

cURL
curl https://{subdomain}.zendesk.com/api/v2/users/show_many.json?ids=345678,901234 \  -v -u {email_address}:{password}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/users/show_many?external_ids=abc%2Cdef&ids=1%2C2"	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 "username:password"
	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/users/show_many")		.newBuilder()		.addQueryParameter("external_ids", "abc,def")		.addQueryParameter("ids", "1,2");
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/users/show_many',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },  params: {    'external_ids': 'abc%2Cdef',    'ids': '1%2C2',  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://example.zendesk.com/api/v2/users/show_many?external_ids=abc%2Cdef&ids=1%2C2"headers = {	"Content-Type": "application/json",}
response = requests.request(	"GET",	url,	auth=('<username>', '<password>'),	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://example.zendesk.com/api/v2/users/show_many")uri.query = URI.encode_www_form("external_ids": "abc,def", "ids": "1,2")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")request.basic_auth "username", "password"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
{  "users": [    {      "id": 345678,      "name": "Johnny Appleseed"    },    {      "id": 901234,      "name": "Rupert Root"    }  ]}
  • GET /api/v2/users/{user_id}/related

JSON Format

The JSON returned by this endpoint includes the following properties.

Note: Depending on the user's permissions, the count results may not match the actual number of tickets returned.

Name Type Comment
assigned_tickets integer Count of assigned tickets
requested_tickets integer Count of requested tickets
ccd_tickets integer Count of collaborated tickets
organization_subscriptions integer Count of organization subscriptions

Allowed For:

  • Agents

Parameters

Name Type In Required Description
user_id integer Path true The id of the user

Code Samples

cURL
curl https://{subdomain}.zendesk.com/api/v2/users/{user_id}/related.json \  -v -u {email_address}:{password}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/users/35436/related"	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 "username:password"
	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/users/35436/related")		.newBuilder();
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", Credentials.basic("your-email", "your-password"))		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/users/35436/related',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "username:password"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);