Triggercategories 2 endpoints

GET /api/v2/trigger_categories/{trigger_category_id}

Returns the trigger category with the specified ID.

operationId: TriggerCategories_showById

Parameters

Name In Required Type Description
trigger_category_id path required string

The id of the trigger category to retrieve

Responses

200

The requested trigger category

404

Error

GET /api/v2/trigger_categories/{trigger_category_id}
PATCH /api/v2/trigger_categories/{trigger_category_id}

Updates the trigger category with the specified ID.

operationId: TriggerCategories_updateCategoryById

Parameters

Name In Required Type Description
trigger_category_id path required string

The id of the trigger category to update

Request Body

required
application/json
schema TriggerCategoriesUpdateCategoryByIdRequest
Property Type Required
trigger_category object optional
name string optional
position integer optional

Responses

200

The updated trigger category

400

Error

404

Error

PATCH /api/v2/trigger_categories/{trigger_category_id}

Triggers 13 endpoints

GET /api/v2/triggers

Lists all triggers for the current account.

Pagination

  • Cursor pagination (recommended)
  • Offset pagination

See Pagination.

Returns a maximum of 100 records per page.

Allowed For

  • Agents

Sideloads

The following sideloads are supported. The usage sideloads are only supported on the Support Professional or Suite Growth plan or above.

Name Will sideload
app_installation The app installation that requires each trigger, if present
permissions The permissions for each trigger
usage_1h The number of times each trigger has been used in the past hour
usage_24h The number of times each trigger has been used in the past day
usage_7d The number of times each trigger has been used in the past week
usage_30d The number of times each trigger has been used in the past thirty days
operationId: Triggers_list

Parameters

Name In Required Type Description
active query optional boolean

Filter by active triggers if true or inactive triggers if false

sort query optional string

Cursor-based pagination only. Possible values are “alphabetical”, “created_at”, “updated_at”, or “position”.

sort_by query optional string

Offset pagination only. Possible values are “alphabetical”, “created_at”, “updated_at”, “usage_1h”, “usage_24h”, or “usage_7d”. Defaults to “position”

sort_order query optional string

One of “asc” or “desc”. Defaults to “asc” for alphabetical and position sort, “desc” for all others

category_id query optional string

Filter triggers by category ID

Responses

200

Success response

GET /api/v2/triggers
POST /api/v2/triggers

Allowed For

  • Agents
operationId: Triggers_createNewTrigger

Request Body

required
application/json
schema TriggerWithCategoryRequest
Property Type Required
trigger object optional
id integer optional
url string optional
title string required
active boolean optional
actions array required
field string optional
value object optional
default boolean optional
position integer optional
raw_title string optional
conditions object required
all array optional
field string optional
value object optional
operator string optional
any array optional
field string optional
value object optional
operator string optional
created_at string optional
updated_at string optional
category_id string optional
description string optional

Responses

201

Created response

POST /api/v2/triggers
GET /api/v2/triggers/active

Lists all active triggers.

Pagination

  • Cursor pagination (recommended)
  • Offset pagination

See Pagination.

Returns a maximum of 100 records per page.

Allowed For

  • Agents

Sideloads

The following sideloads are supported:

Name Will sideload
app_installation The app installation that requires each trigger, if present
permissions The permissions for each trigger
usage_1h The number of times each trigger has been used in the past hour
usage_24h The number of times each trigger has been used in the past day
usage_7d The number of times each trigger has been used in the past week
usage_30d The number of times each trigger has been used in the past thirty days
operationId: Triggers_listActiveTriggers

Parameters

Name In Required Type Description
sort query optional string

Cursor-based pagination only. Possible values are “alphabetical”, “created_at”, “updated_at”, or “position”.

sort_by query optional string

Offset pagination only. Possible values are “alphabetical”, “created_at”, “updated_at”, “usage_1h”, “usage_24h”, or “usage_7d”. Defaults to “position”

sort_order query optional string

One of “asc” or “desc”. Defaults to “asc” for alphabetical and position sort, “desc” for all others

category_id query optional string

Filter triggers by category ID

Responses

200

Success response

GET /api/v2/triggers/active
GET /api/v2/triggers/definitions

Returns the definitions of the actions a trigger can perform and the
definitions of the conditions under which a trigger 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.

For a list of supported actions, see the Actions reference
For a list of supported conditions, see the Conditions reference

Allowed For

  • Agents
operationId: Triggers_listDefinitions

Responses

200

Success response

GET /api/v2/triggers/definitions
DELETE /api/v2/triggers/destroy_many

Deletes the triggers corresponding to the provided comma-separated list of IDs.

Allowed For

  • Agents

Request Parameters

The DELETE request takes one parameter, an ids object that lists the
triggers to delete.

Name Description
ids The IDs of the triggers to delete

Example request

{
  "ids": "25,23,27,22"
}
operationId: Triggers_bulkDelete

Parameters

Name In Required Type Description
ids query optional string

A comma separated list of trigger IDs

Responses

204

No content response

DELETE /api/v2/triggers/destroy_many
PUT /api/v2/triggers/reorder

Alters the firing order of triggers in the account. See
Reordering and sorting triggers
in the Zendesk Help Center. The firing order is set in a trigger_ids array in the request body.

You must include every trigger id in your account to reorder the triggers. If not, the endpoint will return 404 Forbidden.

Reordering triggers via the API is not permitted if you have more than one trigger category. If there is more than one
trigger category, the endpoint will return a LimitOneCategory error.

Allowed For

  • Agents
operationId: Triggers_reorderFiringOrder

Responses

200

Success response

PUT /api/v2/triggers/reorder
GET /api/v2/triggers/search

Pagination

  • Offset pagination only

See Using Offset Pagination.

Allowed For

  • Agents

Sideloads

The following sideloads are supported. For more information, see Side-loading.

Name Will sideload
app_installation The app installation that requires each trigger, if present
permissions The permissions for each trigger
usage_1h The number of times each trigger has been used in the past hour
usage_24h The number of times each trigger has been used in the past day
usage_7d The number of times each trigger has been used in the past week
usage_30d The number of times each trigger has been used in the past thirty days

Filter

Use the filter query parameter to filter a trigger search by one or more attributes. For example, the following filter argument filters triggers by the description attribute:

{
  "json": {
    "description": "Close a ticket"
  }
}
operationId: Triggers_searchGet

Parameters

Name In Required Type Description
query query optional string

Query string used to find all triggers with matching title

filter query optional object

Trigger attribute filters for the search. See Filter

active query optional boolean

Filter by active triggers if true or inactive triggers if false

sort query optional string

Cursor-based pagination only. Possible values are “alphabetical”, “created_at”, “updated_at”, or “position”.

sort_by query optional string

Offset pagination only. Possible values are “alphabetical”, “created_at”, “updated_at”, “usage_1h”, “usage_24h”, or “usage_7d”. Defaults to “position”

sort_order query optional string

One of “asc” or “desc”. Defaults to “asc” for alphabetical and position sort, “desc” for all others

include query optional string

A sideload to include in the response. See Sideloads

Responses

200

Success response

GET /api/v2/triggers/search
PUT /api/v2/triggers/update_many

Updates the position or the active status of multiple triggers. Any additional properties are ignored.

Allowed For

  • Agents

Request Parameters

The PUT request expects a triggers object that lists the triggers to update.

Each trigger may have the following properties:

Name Mandatory Description
id yes The ID of the trigger to update
position no The new position of the trigger
active no The active status of the trigger (true or false)
category_id no The ID of the new category the trigger is to be moved to

Example Request

{
  "triggers": [
    {"id": 25, "position": 3},
    {"id": 23, "position": 5},
    {"id": 27, "position": 9},
    {"id": 22, "position": 7}
  ]
}
operationId: Triggers_updateManyPositionStatus

Request Body

required
application/json
schema TriggerBulkUpdateRequest
Property Type Required
triggers array optional
id integer required
active boolean optional
position integer optional
category_id string optional

Responses

200

Success response

PUT /api/v2/triggers/update_many
DELETE /api/v2/triggers/{trigger_id}

Allowed For

  • Agents
operationId: Triggers_deleteTrigger

Parameters

Name In Required Type Description
trigger_id path optional integer

The ID of the trigger

Responses

204

No Content response

DELETE /api/v2/triggers/{trigger_id}
GET /api/v2/triggers/{trigger_id}

Allowed For

  • Agents

The Via Type value is a number instead of a text string. See Via types reference for the keys.

operationId: Triggers_showTrigger

Parameters

Name In Required Type Description
trigger_id path optional integer

The ID of the trigger

Responses

200

Success response

GET /api/v2/triggers/{trigger_id}
PUT /api/v2/triggers/{trigger_id}

Allowed For

  • Agents

Note

Updating a condition or action updates both the conditions and actions arrays,
clearing all existing values of both arrays. Include all your conditions
and actions when updating any condition or action.

operationId: Triggers_updateTrigger

Parameters

Name In Required Type Description
trigger_id path optional integer

The ID of the trigger

Request Body

required
application/json
schema TriggerWithCategoryRequest
Property Type Required
trigger object optional
id integer optional
url string optional
title string required
active boolean optional
actions array required
field string optional
value object optional
default boolean optional
position integer optional
raw_title string optional
conditions object required
all array optional
field string optional
value object optional
operator string optional
any array optional
field string optional
value object optional
operator string optional
created_at string optional
updated_at string optional
category_id string optional
description string optional

Responses

200

Success response

PUT /api/v2/triggers/{trigger_id}
GET /api/v2/triggers/{trigger_id}/revisions

List the revisions associated with a trigger. Trigger revision history is only available on Enterprise plans.

Allowed For

  • Agents

Sideloads

The following sideloads are supported:

Name Will sideload
users The user that authored each revision

Pagination

This endpoint uses cursor-based pagination. The records are ordered in
descending order by the created_at timestamp, then by id on duplicate
created_at values.

The cursor parameter is a non-human-readable argument you can use to move
forward or backward in time.

Each JSON response will contain the following attributes to help you get
more results:

  • after_url requests more recent results
  • before_url requests older results
  • after_cursor is the cursor to build the request yourself
  • before_cursor is the cursor to build the request yourself

The properties are null if no more records are available.

You can request a maximum of 1000 records using the limit parameter. If
no limit parameter is supplied, it will default to 1,000.

operationId: Triggers_listRevisions

Parameters

Name In Required Type Description
trigger_id path optional integer

The ID of the trigger

Responses

200

Success response

GET /api/v2/triggers/{trigger_id}/revisions
GET /api/v2/triggers/{trigger_id}/revisions/{trigger_revision_id}

Fetches a revision associated with a trigger. Trigger revision history is only available on Enterprise plans.

Allowed For

  • Agents

Sideloads

The following sideloads are supported:

Name Will sideload
users The user that authored each revision
operationId: Triggers_showRevision

Parameters

Name In Required Type Description
trigger_id path optional integer

The ID of the trigger

trigger_revision_id path optional integer

The ID of the revision for a particular trigger

Responses

200

Success response

GET /api/v2/triggers/{trigger_id}/revisions/{trigger_revision_id}

Userfields 10 endpoints

GET /api/v2/user_fields

Returns a list of custom user fields in your account. Fields are returned in the order that you specify in your user fields configuration in Zendesk Support. Clients should cache this resource for the duration of their API usage and map the key for each User Field to the values returned under the user_fields attribute on the User resource.

Pagination

  • Cursor pagination (recommended)
  • Offset pagination

See Pagination.

Returns a maximum of 100 records per page.

Allowed For

  • Agents
operationId: UserFields_list

Responses

200

Success response

GET /api/v2/user_fields
POST /api/v2/user_fields

Creates any of the following custom field types:

  • text (default when no “type” is specified)
  • textarea
  • checkbox
  • date
  • integer
  • decimal
  • regexp
  • dropdown
  • lookup

See About custom field types in Zendesk help.

Allowed For

  • Admins
operationId: UserFields_createField

Responses

201

Created response

POST /api/v2/user_fields
PUT /api/v2/user_fields/reorder

Allowed For

  • Admins
operationId: UserFields_reorderField

Responses

200

Success response

PUT /api/v2/user_fields/reorder
DELETE /api/v2/user_fields/{user_field_id}

Allowed for

  • Admins
operationId: UserFields_deleteField

Parameters

Name In Required Type Description
user_field_id path optional

The ID or key of the user field

Responses

204

No Content response

DELETE /api/v2/user_fields/{user_field_id}
GET /api/v2/user_fields/{user_field_id}

Allowed for

  • Agents
operationId: UserFields_showField

Parameters

Name In Required Type Description
user_field_id path optional

The ID or key of the user field

Responses

200

Success response

GET /api/v2/user_fields/{user_field_id}
PUT /api/v2/user_fields/{user_field_id}

Updating a Dropdown (Tagger) Field

Dropdown fields return an array of custom_field_options which specify the name, value and order of the list of dropdown options.
Understand the following behavior when updating a dropdown field:

  • All options must be passed on update. Options that are not passed will be removed. As a result, these values will be removed from any organizations.
  • To create a new option, pass a null id along with name and value.
  • To update an existing option, pass its id along with name and value.
  • To re-order an option, reposition it in the custom_field_options array relative to the other options.
  • To remove an option, omit it from the list of options upon update.

Example Request

curl https://{subdomain}.zendesk.com/api/v2/user_fields/{user_field_id}.json \
  -H "Content-Type: application/json" -X PUT \
  -d '{"user_field": {"custom_field_options": [{"id": 124, "name": "Option 2", "value": "option_2"}, {"id": 123, "name": "Option 1", "value": "option_1"}, {"id": 125, "name": "Option 2", "value": "option_3"}]}}' \
  -v -u {email_address}:{password}

Allowed for

  • Admins
operationId: UserFields_updateCustomFieldOptions

Parameters

Name In Required Type Description
user_field_id path optional

The ID or key of the user field

Responses

200

Success response

PUT /api/v2/user_fields/{user_field_id}
GET /api/v2/user_fields/{user_field_id}/options

Returns a list of custom user field options for the given dropdown user field.

Pagination

  • Cursor pagination (recommended)
  • Offset pagination

See Pagination.

Returns a maximum of 100 records per page.

Allowed For

  • Agents
operationId: UserFields_listOptions

Parameters

Name In Required Type Description
user_field_id path optional

The ID or key of the user field

Responses

200

Success response

GET /api/v2/user_fields/{user_field_id}/options
POST /api/v2/user_fields/{user_field_id}/options

Creates a new option or updates an existing option for the given drop-down user field.

To update an option, include the id of the option in the custom_field_option object. Example: {"custom_field_option": {"id": 10002, "name": "Pineapples", ... }. If an option exists for the given ID, the option will be updated. Otherwise, a new option will be created.

Response

Returns one of the following status codes:

  • 200 with Location: /api/v2/user_fields/{user_field_id}/options.json if the user field option already exists in the database
  • 201 with Location: /api/v2/user_fields/{user_field_id}/options.json if the user field option is new

Allowed For

  • Admins
operationId: UserFields_createOrUpdateOption

Parameters

Name In Required Type Description
user_field_id path optional

The ID or key of the user field

Responses

200

Success response

201

Created response

POST /api/v2/user_fields/{user_field_id}/options
DELETE /api/v2/user_fields/{user_field_id}/options/{user_field_option_id}

Allowed for

  • Admins
operationId: UserFields_deleteOptionById

Parameters

Name In Required Type Description
user_field_id path optional

The ID or key of the user field

user_field_option_id path optional integer

The ID of the user field option

Responses

204

No Content response

DELETE /api/v2/user_fields/{user_field_id}/options/{user_field_option_id}
GET /api/v2/user_fields/{user_field_id}/options/{user_field_option_id}

Allowed for

  • Agents
operationId: UserFields_showOptionById

Parameters

Name In Required Type Description
user_field_id path optional

The ID or key of the user field

user_field_option_id path optional integer

The ID of the user field option

Responses

200

Success response

GET /api/v2/user_fields/{user_field_id}/options/{user_field_option_id}

Useridentities 8 endpoints

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

Returns a list of identities for the given user.

Use the first endpoint if authenticating as an agent. Use the second if authenticating as an end user. End users can only list email and phone number identities.

Pagination

  • Cursor pagination (recommended)
  • Offset pagination

See Pagination.

Returns a maximum of 100 records per page.

Allowed For

  • Agents
  • Verified end users
operationId: UserIdentities_list

Parameters

Name In Required Type Description
user_id path optional integer

The id of the user

Responses

200

Success response

GET /api/v2/users/{user_id}/identities
POST /api/v2/users/{user_id}/identities

Adds an identity to a user’s profile. An agent can add an identity to any user profile.

Supported identity types:

Type Example
email { "type" : "email", "value" : "someone@example.com" }
twitter { "type" : "twitter", "value" : "screen_name" }
facebook { "type" : "facebook", "value" : "855769377321" }
google { "type" : "google", "value" : "example@gmail.com" }
agent_forwarding { "type" : "agent_forwarding", "value" : "+1 555-123-4567" }
phone_number { "type" : "phone_number", "value" : "+1 555-123-4567" }

To create an identity without sending out a verification email, include a "skip_verify_email": true property.

Allowed For

  • Agents
operationId: UserIdentities_addIdentityToUser

Parameters

Name In Required Type Description
user_id path optional integer

The id of the user

Responses

201

Created response

POST /api/v2/users/{user_id}/identities
DELETE /api/v2/users/{user_id}/identities/{user_identity_id}

Deletes the identity for a given user.
In certain cases, a phone number associated with an identity is still visible on the user profile after the identity has been deleted via API. You can remove the phone number from the user profile by updating the phone attribute of the user to an empty string. See Update User via API for details and examples.

Allowed For

  • Agents
operationId: UserIdentities_deleteIdentity

Parameters

Name In Required Type Description
user_id path optional integer

The id of the user

user_identity_id path optional integer

The ID of the user identity

Responses

204

No Content response

DELETE /api/v2/users/{user_id}/identities/{user_identity_id}
GET /api/v2/users/{user_id}/identities/{user_identity_id}

Shows the identity with the given id for a given user.

Use the first endpoint if authenticating as an agent. Use the second if authenticating as an end user. End users can only view email or phone number identity.

Allowed For

  • Agents
  • Verified end users
operationId: UserIdentities_showIdentity

Parameters

Name In Required Type Description
user_id path optional integer

The id of the user

user_identity_id path optional integer

The ID of the user identity

Responses

200

Success response

GET /api/v2/users/{user_id}/identities/{user_identity_id}
PUT /api/v2/users/{user_id}/identities/{user_identity_id}

This endpoint allows you to:

  • Set the specified identity as verified (but you cannot unverify a verified identity)
  • Update the value property of the specified identity

You can’t change an identity’s primary attribute with this endpoint. You must use the Make Identity Primary endpoint instead.

Allowed For

  • Agents
operationId: UserIdentities_updateIdentity

Parameters

Name In Required Type Description
user_id path optional integer

The id of the user

user_identity_id path optional integer

The ID of the user identity

Responses

200

Success response

PUT /api/v2/users/{user_id}/identities/{user_identity_id}
PUT /api/v2/users/{user_id}/identities/{user_identity_id}/make_primary

Sets the specified identity as primary. To change other attributes, use the Update Identity endpoint. This is a collection-level operation and the correct behavior for an API client is to subsequently reload the entire collection.

The first endpoint is the preferred option if authenticating as an agent. If authenticating as an end user, you can only use the second endpoint. In addition, an end user can only make an email identity primary if the email is verified.

Allowed For

  • Agents
  • Verified end users
operationId: UserIdentities_makePrimary

Parameters

Name In Required Type Description
user_id path optional integer

The id of the user

user_identity_id path optional integer

The ID of the user identity

Responses

200

Success response

PUT /api/v2/users/{user_id}/identities/{user_identity_id}/make_primary
PUT /api/v2/users/{user_id}/identities/{user_identity_id}/request_verification

Sends the user a verification email with a link to verify ownership of the email address.

Allowed For

  • Agents
operationId: UserIdentities_requestVerificationEmail

Parameters

Name In Required Type Description
user_id path optional integer

The id of the user

user_identity_id path optional integer

The ID of the user identity

Responses

200

Success description

PUT /api/v2/users/{user_id}/identities/{user_identity_id}/request_verification
PUT /api/v2/users/{user_id}/identities/{user_identity_id}/verify

Sets the specified identity as verified.

For security reasons, you can’t use this endpoint to update the email identity of the account owner. To verify the person’s identity, send a verification email. See Verifying the account owner’s email address in Zendesk help.

Allowed For

  • Agents
operationId: UserIdentities_verifyIdentity

Parameters

Name In Required Type Description
user_id path optional integer

The id of the user

user_identity_id path optional integer

The ID of the user identity

Responses

200

Success response

PUT /api/v2/users/{user_id}/identities/{user_identity_id}/verify

Userpasswords 3 endpoints

POST /api/v2/users/{user_id}/password

An admin can set a user’s password only if the setting is enabled in Zendesk Support under Settings > Security > Global. The setting is off by default. Only the account owner can access and change this setting.

API token authentication is not permitted on this endpoint.

Allowed For

  • Admins
operationId: UserPasswords_setNewPassword

Parameters

Name In Required Type Description
user_id path optional integer

The id of the user

Responses

200

Success description

POST /api/v2/users/{user_id}/password
PUT /api/v2/users/{user_id}/password

You can only change your own password. Nobody can change the password of another user because it requires knowing the user’s existing password. However, an admin can set a new password for another user without knowing the existing password. See Set a User’s Password above.

API token authentication is not permitted on this endpoint.

Allowed For

  • Agents
  • End Users
operationId: UserPasswords_changePassword

Parameters

Name In Required Type Description
user_id path optional integer

The id of the user

Responses

200

Success description

PUT /api/v2/users/{user_id}/password
GET /api/v2/users/{user_id}/password/requirements

Allowed For

  • Agents
  • End Users
operationId: UserPasswords_listRequirements

Parameters

Name In Required Type Description
user_id path optional integer

The id of the user

Responses

200

Success response

GET /api/v2/users/{user_id}/password/requirements

Users 14 endpoints

GET /api/v2/deleted_users

Returns deleted users, including permanently deleted users.

If the results contains permanently deleted users, the users’ properties
that normally contain personal data, such as email and phone,
are null. The name property is “Permanently Deleted User”.

Pagination

  • Cursor pagination (recommended)
  • Offset pagination

See Pagination.

Returns a maximum of 100 records per page.

Allowed For

  • Agents
operationId: Users_listDeleted

Responses

200

Success response

GET /api/v2/deleted_users
GET /api/v2/deleted_users/count

Returns an approximate count of deleted users, including permanently deleted 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, 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
operationId: Users_countDeleted

Responses

200

Success response

GET /api/v2/deleted_users/count
DELETE /api/v2/deleted_users/{deleted_user_id}

Before permanently deleting a user, you must delete the user first. See Delete User.

WARNING: Permanently deleting a user deletes all of their information. This information is not recoverable.

Permanent user deletion rate limit

You can permanently delete 700 users every 10 minutes.
The rate limiting mechanism behaves as described in
Rates Limits in the API introduction.
Zendesk recommends that you obey the Retry-After header values.

Allowed For

operationId: Users_permanentlyDelete

Parameters

Name In Required Type Description
deleted_user_id path optional integer

The ID of the deleted user

Responses

200

Success response

DELETE /api/v2/deleted_users/{deleted_user_id}
GET /api/v2/deleted_users/{deleted_user_id}

Returns users that have been deleted but not permanently yet. See Permanently Delete User.

Allowed For:

  • Agents
operationId: Users_getDeletedUser

Parameters

Name In Required Type Description
deleted_user_id path optional integer

The ID of the deleted user

Responses

200

Success response

GET /api/v2/deleted_users/{deleted_user_id}
GET /api/v2/users

Pagination

  • Cursor pagination (recommended)
  • Offset pagination

See Pagination.

Returns a maximum of 100 records per page.

Allowed For

  • Admins, Agents and Light Agents
operationId: Users_list

Parameters

Name In Required Type Description
role query optional string

Filters the results by role. Possible values are “end-user”, “agent”, or “admin”

role[] query optional string

Filters the results by more than one role using the format role[]={role}&role[]={role}

permission_set query optional integer

For custom roles which is available on the Enterprise plan and above. You can only filter by one role ID per request

external_id query optional string

List users by external id. External id has to be unique for each user under the same account.

Responses

200

Success response

GET /api/v2/users
POST /api/v2/users
operationId: Users_createNewUser

Request Body

required
application/json
schema UserRequest
Property Type Required
user object required

Responses

201

Created response

POST /api/v2/users
GET /api/v2/users/autocomplete

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
operationId: Users_autocompleteList

Parameters

Name In Required Type Description
name query required string

The name to search for the user.

field_id query optional string

The id of a lookup relationship field. The type of field is determined
by the source param

source query optional string

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

Responses

200

Success response

GET /api/v2/users/autocomplete
GET /api/v2/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
operationId: Users_countUsers

Parameters

Name In Required Type Description
role query optional string

Filters the results by role. Possible values are “end-user”, “agent”, or “admin”

role[] query optional string

Filters the results by more than one role using the format role[]={role}&role[]={role}

permission_set query optional integer

For custom roles which is available on the Enterprise plan and above. You can only filter by one role ID per request

Responses

200

Success response

GET /api/v2/users/count
POST /api/v2/users/create_many

Accepts an array of up to 100 user objects.

Note: To protect the data in your Zendesk account, bulk user imports are not enabled by default in Zendesk accounts. The account owner must contact Zendesk Customer Support to enable the imports. A 403 Forbidden
error is returned if data imports are not enabled.

Allowed For

Specifying an organization

You can assign a user to an existing organization by setting an
organization_id property in the user object.

Response

This endpoint returns a job_status JSON object and queues a background job to do the work. Use the Show Job Status endpoint to check for the job’s completion. Only a certain number of jobs can be queued or running at the same time. See Job limit for more information.

operationId: Users_createManyUsers

Request Body

required
application/json
schema UsersRequest
Property Type Required
users array required

Responses

200

Success response

POST /api/v2/users/create_many
POST /api/v2/users/create_or_update

Creates a user if the user does not already exist, or updates an existing user
identified by e-mail address or external ID.

If you don’t specify a role parameter, the new user is assigned the role of end user.

If you need to create users without sending out a verification email, include a "skip_verify_email": true property in the body.

External ID Case Sensitivity

When providing an external id to identify an existing user to update, the search for the user record is not case sensitive.

However, if an existing user is found, the system will update the user’s external id to match the case of the external id used to find the user.

Response Status Code

  • If the user exists in Zendesk, a successful request returns a 200 status code with “Location: /api/v2/users/{user_id}.json”.
  • If the user does not exist in Zendesk, a successful request returns a 201 status code with “Location: /api/v2/users/{new_user_id}.json”.

Allowed For

operationId: Users_createOrUpdateUser

Request Body

required
application/json
schema UserRequest
Property Type Required
user object required

Responses

200

Successful response, when user exits

201

Created response, when user is new

POST /api/v2/users/create_or_update
POST /api/v2/users/create_or_update_many

Accepts an array of up to 100 user objects. For each user, the user is created if it does not
already exist, or the existing user is updated.

Note: To protect the data in your Zendesk account, bulk user imports are not enabled by default in Zendesk accounts. The account owner must contact Zendesk Customer Support to enable the imports. A 403 Forbidden
error is returned if data imports are not enabled.

Each individual user object can identify an existing user by email or by external_id.

This endpoint returns a job_status JSON object and queues a background job to do the work. Use the Show Job Status endpoint to check for the job’s completion. Only a certain number of jobs can be queued or running at the same time. See Job limit for more information.

Allowed For

operationId: Users_createOrUpdateMany

Request Body

required
application/json
schema UsersRequest
Property Type Required
users array required

Responses

200

Success response

POST /api/v2/users/create_or_update_many
DELETE /api/v2/users/destroy_many

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

The request takes an ids or an external_ids query parameter.

Allowed for

Response

This endpoint returns a job_status JSON object and queues a background job to do the work. Use the Show Job Status endpoint to check for the job’s completion. Only a certain number of jobs can be queued or running at the same time. See Job limit for more information.

operationId: Users_bulkDeleteMany

Parameters

Name In Required Type Description
ids query optional string

Id of the users to delete. Comma separated

external_ids query optional string

External Id of the users to delete. Comma separated

Responses

200

Success response

DELETE /api/v2/users/destroy_many
POST /api/v2/users/logout_many

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

Allowed For:

  • Admins
operationId: Users_logoutManyUsers

Parameters

Name In Required Type Description
ids query optional string

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

Responses

202

Accepted response

POST /api/v2/users/logout_many
GET /api/v2/users/me

The endpoint returns user information and an authenticity_token.

Allowed For

  • Anonymous users

Authenticity Token

Zendesk API calls made by end users from a Zendesk help center must include authenticity_token in the X-CSRF-Token HTTP header. This helps prevent cross-site request forgery (CSRF) attacks.

For an example using an authenticity token, see the AJAX request in the Upgrading from Templating API v1 documentation.

operationId: Users_showSelfInfo

Responses

200

Success response

GET /api/v2/users/me
Load more endpoints