Table: zendesk_user - Query Zendesk Users using SQL
Zendesk is a customer service software company that provides a cloud-based customer support platform improving the relationship between businesses and their customers. It offers a suite of support apps that helps improve customer service and having better customer engagement and relationships. The Users in Zendesk are the agents, administrators, or customers who can create and manage tickets.
Table Usage Guide
The zendesk_user
table provides insights into Users within Zendesk. As a customer service manager, explore user-specific details through this table, including roles, emails, and active status. Utilize it to uncover information about users, such as their roles, email addresses, and whether they are active or not.
Examples
Basic user info
Determine the active status and last login details of users to better understand their engagement with your platform. This information could be useful in identifying patterns of usage or detecting inactive users.
select id, name, email, active, last_login_atfrom zendesk_user;
select id, name, email, active, last_login_atfrom zendesk_user;
List administrators
Explore which users in your Zendesk account have administrative privileges. This is useful for auditing account access and ensuring only the appropriate users have high-level permissions.
select name, emailfrom zendesk_userwhere role = 'admin';
select name, emailfrom zendesk_userwhere role = 'admin';
Agents and admins (paid seats) who have not logged in for 30 days
Determine the agents and administrators who haven't accessed the system in the last 30 days. This could be useful in assessing user engagement levels or identifying inactive accounts for potential follow-up or account management actions.
select name, email, role, last_login_atfrom zendesk_userwhere role in ('admin', 'agent') and last_login_at < current_date - interval '30 days';
select name, email, role, last_login_atfrom zendesk_userwhere role in ('admin', 'agent') and last_login_at < date('now', '-30 days');
Number of users per organization
Explore which organizations have the most users, allowing you to understand user distribution and identify high-usage organizations. This can help in resource allocation and strategic planning.
select o.name, count(*)from zendesk_user as u, zendesk_organization as owhere u.organization_id = o.idgroup by o.id, o.nameorder by count desc;
select o.name, count(*)from zendesk_user as u, zendesk_organization as owhere u.organization_id = o.idgroup by o.id, o.nameorder by count(*) desc;
Schema for zendesk_user
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
active | boolean | False if the user has been deleted | |
alias | text | An alias displayed to end users | |
chat_only | boolean | Whether or not the user is a chat-only agent | |
created_at | timestamp with time zone | The time the user was created | |
custom_role_id | bigint | A custom role if the user is an agent on the Enterprise plan | |
default_group_id | bigint | The id of the user's default group | |
details | text | Any details you want to store about the user, such as an address | |
text | The user's primary email address. *Writeable on create only. On update, a secondary email is added. | ||
external_id | text | A unique identifier from another system. The API treats the id as case insensitive. Example: "ian1" and "Ian1" are the same user | |
id | bigint | = | Automatically assigned when the user is created |
last_login_at | timestamp with time zone | The last time the user signed in to Zendesk Support | |
locale | text | 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 | bigint | The user's language identifier | |
moderator | boolean | Designates whether the user has forum moderation capabilities | |
name | text | The user's name | |
notes | text | Any notes you want to store about the user | |
only_private_comments | boolean | true if the user can only create private comments | |
organization_id | bigint | The id of the user's organization. If the user has more than one organization memberships, the id of the user's default organization | |
phone | text | The user's primary phone number. | |
photo_content_type | text | The content type of the image. Example value: "image/png" | |
photo_content_url | text | A full URL where the attachment image file can be downloaded | |
photo_deleted | text | If true, the attachment has been deleted | |
photo_file_name | text | The name of the image file | |
photo_id | bigint | Automatically assigned when created | |
photo_inline | boolean | If true, the attachment is excluded from the attachment list and the attachment's URL can be referenced within the comment of a ticket. Default is false | |
photo_size | bigint | The size of the image file in bytes | |
photo_thumbnails | jsonb | An array of attachment objects. Note that photo thumbnails do not have thumbnails | |
report_csv | boolean | Whether or not the user can access the CSV report on the Search tab of the Reporting page in the Support admin interface. | |
restricted_agent | boolean | If the agent has any restrictions; false for admins and unrestricted agents, true for other agents | |
role | text | The user's role. Possible values are "end-user", "agent", or "admin" | |
role_type | bigint | The user's role id. 0 for custom agents, 1 for light agent, 2 for chat agent, and 3 for chat agent added to the Support account as a contributor (Chat Phase 4) | |
shared | boolean | If the user is shared from a different Zendesk Support instance. Ticket sharing accounts only | |
shared_agent | boolean | If the user is a shared agent from a different Zendesk Support instance. Ticket sharing accounts only | |
shared_phone_number | boolean | Whether the phone number is shared or not. | |
signature | text | The user's signature. Only agents and admins can have signatures | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
subdomain | text | =, !=, ~~, ~~*, !~~, !~~* | The organization subdomain name of the Zendesk instance. |
suspended | boolean | If the agent is suspended. Tickets from suspended users are also suspended, and these users cannot sign in to the end user portal | |
tags | jsonb | The user's tags. Only present if your account has user tagging enabled | |
ticket_restriction | text | Specifies which tickets the user has access to. Possible values are: "organization", "groups", "assigned", "requested", null | |
timezone | text | The user's time zone. | |
two_factor_auth_enabled | boolean | If two factor authentication is enabled | |
updated_at | timestamp with time zone | The time the user was last updated | |
url | text | The user's API url | |
user_fields | jsonb | Values of custom fields in the user's profile. | |
verified | boolean | Any of the user's identities is verified. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- zendesk
You can pass the configuration to the command with the --config
argument:
steampipe_export_zendesk --config '<your_config>' zendesk_user