Unable to Reply to a Ticket on Behalf of Another Agent via API

Hi Team,

I’m trying to create a ticket reply on behalf of an agent by using their agent ID in the user_id field. However, I’m getting the following error:

“message”: “You are not authorized to perform this action.”

According to the Freshdesk API documentation, we should be able to use an agent’s ID when making API requests if we authenticate using that agent’s API key. While this works when using the agent’s own key, it fails when using an admin API key to create replies on behalf of other agents.

Is there any workaround or alternative solution to achieve this? Any guidance would be greatly appreciated!

For reference, I came across a similar discussion here: Unable to create notes or ticket on behalf of another agent.

Thanks in advance!

Hi @Raviraj and @Thakur_Ganeshsingh ,

Could you please share your thoughts on this? Your insights would be really helpful.

Thanks,
Anish

Hi Anish,

This error you’re receiving is related to the user’s role trying to indicate in the response.
When the user has an Admin or accountadmin role, it’s not possible to add replies or notes using their ID in API calls with tokens from other users. This is a limitation of the tool to ensure the correct use of the administrator account.

If you still need the response to be linked to the administrator user, the API call must be made using that user’s API token.

Hey @Anish, @danilofogaca,

That may be the answer - I am not even sure, if it is allowed for supervisor role to add replies in their name.

@Anish - Did you test for an agent with just agent role?

Best
Tom