Users
Represents the users in the account, including agents, admins, and end users.
Table-Specific Information
Select
The following queries are processed server-side while other filters are processed client-side within the provider.SELECT * FROM Users WHERE Id = '123'
SELECT * FROM Users WHERE Id IN ('123', '456')
SELECT * FROM Users WHERE GroupId = '123'
SELECT * FROM Users WHERE OrganizationId = '123'
SELECT * FROM Users WHERE Role = 'agent'
SELECT * FROM Users WHERE PermissionSet = 'RoleId'
Insert
The Name column is required to insert. This operation is allowed for logged-in users with the "agent" role, with restrictions on certain actions.
INSERT INTO Users (Name, Email) VALUES ('Roger Wilco', '[email protected]')
To insert many users, see "Batch Processing" for an example.
The Role parameter only accepts three possible values: "end-user", "agent", or "admin". To create agents with a specific role (including the built-in "light-agent" role), set Role to "agent". Then, add a new parameter called "custom_role_id" and give it the actual desired role Id from your Zendesk Support account.
INSERT INTO Users (Name, Email, Role, CustomRoleId) VALUES ('Roger Wilco', '[email protected]', 'agent', '123456')
The user can also be added to a named organization.
INSERT INTO Users (Name, Email, Organization) VALUES ('Roger Wilco', '[email protected]', 'VIP Customers')
Update
You must specify the Id of the user to update. All fields that are not readonly are optional. This operation is allowed for logged-in users with the "agent" role, with restrictions on certain actions. Agents can only update end users, while administrators can update end users, agents, and administrators.
UPDATE Users SET Name = 'Roger Wilco II' WHERE Id = '123'
To make the same change to multiple users, use the following SQL statement:
UPDATE Users SET OrganizationId = '1' WHERE Id IN ('123', '456')
To make different changes to many users, see "Batch Processing" for an example.
Delete
You must specify the Id of the user to delete it. This operation is allowed for logged-in users with the "agent" role, with restrictions on certain actions.
DELETE FROM Users WHERE Id = '123'
You can delete multiple tickets simultaneously by providing their Ids:
DELETE FROM Users WHERE Id IN ('123', '456')
Columns
| Name | Type | ReadOnly | References | Description |
| Id [KEY] | Long | True |
The Id of the user, automatically assigned when it is created. | |
| String | False |
The primary email address of the user. Writeable on create only. On update, a secondary email is added. | ||
| Name | String | False |
The name of the user. | |
| Role | String | False |
The role of the user. Possible values are end-user, agent, or admin. | |
| Active | Boolean | True |
Indicates whether the user is active. Set to false when the user is deleted. | |
| OrganizationId | Long | False |
The Id of the organization the user is associated with. | |
| Alias | String | False |
An alias displayed to end users. | |
| Verified | Boolean | False |
Indicates whether the user's identity has been verified. | |
| ChatOnly | Boolean | True |
Indicates whether the user is a chat-only agent. | |
| CreatedAt | Datetime | True |
The date and time when the user was created. | |
| UpdatedAt | Datetime | True |
The date and time when the user was last updated. | |
| CustomRoleId | Long | False |
A custom role if the user is an agent on the Enterprise plan. | |
| RoleType | String | True |
The role Id of the user. 0 for custom agents, 1 for light agents, and 2 for chat agents. | |
| DefaultGroupId | Long | False |
The Id of the user's default group. Can only be set on create, not on update. | |
| Details | String | False |
Any details to store about the user, such as an address. | |
| ExternalId | String | False |
A unique identifier from another system. | |
| LastLoginAt | Datetime | True |
The date and time when the user last signed in. | |
| Locale | String | True |
The locale of the user. | |
| LocaleId | Long | False |
The language identifier of the user. | |
| Moderator | Boolean | False |
Indicates whether the user has forum moderation capabilities. | |
| Notes | String | False |
Any notes to store about the user. | |
| OnlyPrivateComments | Boolean | False |
Indicates whether the user can only create private comments. | |
| Phone | String | False |
The primary phone number of the user. | |
| Photo | String | True |
The user's profile photo attachment. | |
| PhotoThumbnails | String | True |
The thumbnails of the user's profile photo. | |
| PhotoInline | Boolean | True |
Indicates whether the attachment is excluded from the attachment list and its URL can be referenced within a ticket comment. Default is false. | |
| RestrictedAgent | Boolean | False |
Indicates whether the agent has any restrictions. False for admins and unrestricted agents, true for other agents. | |
| Shared | Boolean | True |
Indicates whether the user is shared from a different support instance. Ticket sharing accounts only. | |
| SharedAgent | Boolean | True |
Indicates whether the user is a shared agent from a different support instance. Ticket sharing accounts only. | |
| Signature | String | False |
The signature of the user. Only agents and admins can have signatures. | |
| Suspended | Boolean | False |
Indicates whether the agent is suspended. Tickets from suspended users are also suspended, and these users cannot sign in to the end user portal. | |
| Tags | String | False |
The tags of the user. Only present if the account has user tagging enabled. | |
| TicketRestriction | String | False |
Specifies which tickets the user has access to. Possible values are: organization, groups, assigned, requested, null. | |
| TimeZone | String | False |
The time zone of the user. | |
| TwoFactorAuthEnabled | Boolean | True |
Indicates whether two-factor authentication is enabled. | |
| Url | String | False |
The API URL of the user. | |
| PermissionSet | String | False |
Used for custom roles in the Enterprise plan. Only one role Id can be filtered per request. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer more granular control over the data returned from the data source.
| Name | Type | Description |
| Organization | String |
The name of the organization the user is associated with. |
| GroupName | String | |
| GroupId | String |
The name of the group the user belongs to. |