It's possible to delete an agent, using their email address, in Freshdesk using custom actions in a Torii workflow.
Requirements
- Create a Freshdesk API key: https://support.freshdesk.com/support/solutions/articles/215517-how-to-find-your-api-key
Custom Action Configuration
We'll first make a call to lookup the agent's Freshdesk ID and store that result using response mapping. We can then use that stored result as a personalization token to delete the agent.
List All Agents
Method: GET
URL: https://{domain}.freshdesk.com/api/v2/agents
Query Parameters:
- email: @Trigger.User.Email
Response Mapping:
- freshdesk-agent-id: [0].id
Delete Agent
Method: DELETE
URL: https://{domain}.freshdesk.com/api/v2/agents/@Action Custom action-Get Freshdesk agent id.response.freshdesk-agent-id
Headers
Parameter | Variable Mapping |
---|---|
Content-Type | application/json |
Accept | */* |
Authorization | Token token=[SecretsVault.PagerDutyAPIToken] |
Notes
The value for the Basic header must be encoded in Base 64 before being stored in the Secrets Vault.