API Endpoint for seats used/available? | Community
Skip to main content

API Endpoint for seats used/available?

  • February 24, 2022
  • 2 replies
  • 0 views

Carlos14

Is there an API endpoint for seats being used vs available?  we'd like  better insight so we can  manage our seats better

2 replies

CJ99
  • February 24, 2022

Not easily from the API, I'm afraid. Support has said I can always reach out and ask on Messaging to find this out/check, and they can just tell me as a workaround when I asked about this. Another option, the new admin center, tells you the correct number and what products the agent has activated, and you can copy/paste it out of there into a spreadsheet without too much trouble. That's located here, just put your own zendesk subdomain in: https://[subdomain].zendesk.com/admin/people/team/members

You can even filter in/out light agents and stuff. It's pretty nice for role management. 

For the API, I do have a workaround, but I can't provide the whole thing here because it's a lot of badly written python code, this was my first API Python project and it's not pretty. I do intend to post a guide to this someday, but this is the nuts and bolts.

I set up a python script to scrape this API endpoint and all following pages: 
https://[subdomain].zendesk.com/api/v2/users.json?role[]=admin&role[]=agent&active=true

Then, I told it to just grab the following and make a column for each:
ID    Email    Name    Last Login    Created At    Custom Role

It then converts all that stuff it gathered from JSON to a CSV file. I run the script once a month, put in a spreadsheet, and then do some processing to figure out what I need to know about seat use. I have a fairly complicated seat use situation with multiple teams and contractors, that I need to account seat use for separately, so this might be overkill for you. 
The Custom Role one is only important if you need to count light agents separately, or heavily use custom roles and want to count how many people are in each kind of role. You will need to either include some python code to convert these "role_ids" into the role names, do some spreadsheet magic, or even just find and replace swap them out. 

I should note that the above API method is only for Zendesk Support seats. Chat (specifically Chat, not Messaging, no clue about how that works at all) is not tracked on that endpoint of the API and the number of chat seats can only be determined either from the chat platform "agents" page, or from that admin page that tells you what products agents have access to. 


Carlos14
  • Author
  • November 25, 2022

Thanks for the reply CJ.  We actually use the API to store the audit /tickets/232/audits and store it to log the replies with the reply date.

v wanted to check against Zendesk reporting just to make sure we have a way to validate numbers.