Zendesk Talk Phone Number Formatting using API



  • Andrew Dietrich
    Zendesk Team Member

    Hi Brian,

    This might be a little tricky because you can't directly use the users endpoint to update an identity, such as a phone number. You need to use the update identities endpoint, which can only be used once you have a user ID.

    There also is no bulk update identity endpoint for this, so you would need to update one user at a time. You could want to built a script that does the following:

    1. Finds the user IDs of your 6800 users, likely using the list users endpoint: https://developer.zendesk.com/rest_api/docs/core/users#list-users 

    2. Hit the user identity endpoint for each user, which will list their phone number's identity: https://developer.zendesk.com/rest_api/docs/core/user_identities#list-identities 

    3. Update the phone number identity with the new format: https://developer.zendesk.com/rest_api/docs/core/user_identities#update-identity 


    You could alternatively add the corrected phone number as a secondary identity rather than replacing the one they already have. That would cut out step 2 of the process and just allow you to use the create identity endpoint instead of the update identity endpoint. That would prevent new users getting created, although each user updated this way would look a little redundant.

    I do apologize that there isn't a less clunky way to do this right now. If you have any further questions on this please let me know.


Please sign in to leave a comment.

Powered by Zendesk