Skip to main content

Want to clarify the exact permissions required to access the /api/v2/agents endpoint via API to get all users/agents’ information.

We're encountering a 403 Forbidden error as shown below when attempting to retrieve agent data, even though the API credentials appear valid.

session.get(' https://<mycompany>.freshservice.com/api/v2/agents').text
'{"code":"access_denied","message":"You are not authorized to perform this action."}'

 

Which specific role or permission must be assigned to the user associated with the API key? Any guidance or documentation would be greatly appreciated.

It may not be the role it may be the key is incorrect, have you confirmed that the key works with other lower permission GET like seeing a ticket, to confim that’s right first. 

#MadeThatMistakeBefore


We checked these endpoints with the API key and they are working well:

  • /api/v2/agents/me
  • /api/v2/assets
  • /api/v2/tickets

So the API key should be valid?


I use an API key for a Service Account that has Account Admin and a custom FreshWorks Admin role.


Thanks! Do we have to use Admin role? Could I just assign some permissions as our IT refuses to assign an admin role to an account.


Its the admin role and “view agents”


The request is to clarify permissions needed for the /api/v2/agents endpoint to access all users/agents' info via API. A 403 Forbidden error shows up despite valid API credentials.


Thanks! Do we have to use Admin role? Could I just assign some permissions as our IT refuses to assign an admin role to an account.

You can view the permissions that an admin role gives and then create a new role that has the same permissions as that of admin role (just disable the account management and play god radio button as shown below) .

Also just ensure if the API key is enabled under agent profile > permissions