Need to export end users + all emails (both primary and secondary emails) | The place for Zendesk users to come together and share
Skip to main content
Feedback submitted

Need to export end users + all emails (both primary and secondary emails)

Related products:Analytics
  • July 26, 2023
  • 3 replies
  • 11 views

Jake11

Need a way to export end user data, specifically: name, organization, and all associated emails to the user (both primary and secondaries).

Does anyone happen to know of a way to do this? We've enabled export and tried the list users API endpoint (recommendations from Zendesk Support), but still haven't been able to get all the secondary emails. 

3 replies

Zendesk13
  • Newcomer
  • July 27, 2023

Hi @jake11, try the following endpoint:

https://yoursubdomain.zendesk.com/api/v2/users.json?role[]=end-user&include=identities

This request's JSON output will return end-user data but also something like:

{
"users": [
{
"id": 15152098172817,
"url": "https://yoursubdomain.zendesk.com/api/v2/users/15152098172817.json",
"name": "The Customer",
"email": "customer@example.com",

(...)

"identities": [
{
"url": "https://yoursubdomain.zendesk.com/api/v2/users/15152098172817/identities/15152098175377.json",
"id": 15152098175377,
"user_id": 15152098172817,
"type": "email",
"value": "customer@example.com",
(...)
},
{
"url": "https://yoursubdomain.zendesk.com/api/v2/users/15152098172817/identities/17310769012625.json",
"id": 17310769012625,
"user_id": 15152098172817,
"type": "email",
"value": "customer1@example.com",
(...)

With this you should be able to process the data and match each user ID to its identities.

Hope this helps!


Jake11
  • Author
  • July 27, 2023

Hi @zendesk13 - Thanks for helping. Strangely, when I perform this, I don't get nearly the full list of end users we have in our instance. Is it expected to not return this information for all of our users? The results seem like a very small percentage of our overall user population we have set up. 


Zendesk13
  • Newcomer
  • July 27, 2023

@jake11 could it be due to pagination?