Articles in this section
Category / Section

How to Assign a Ticket to an Agent via API Using Email ID

2 mins read
Updated:

In today’s fast-paced customer support environment, automating ticket assignment is crucial for ensuring swift and efficient handling of requests. One of the simplest and most effective ways to assign a ticket is by using an agent’s Email ID via the REST API. This guide will walk you through the process of assigning a ticket to an agent using their Email ID and provide helpful tips to ensure smooth integration.

Agent Account: Ensure the agent has an active account in the portal with the appropriate permissions to manage tickets. The Email ID provided must already exist in the system as an agent. The system will not automatically create a new user if the email does not exist.

Assigning an Agent to a New Ticket (Create Ticket API)

To assign an agent to a newly created ticket, you can use the Create Ticket API. This API allows you to specify the agent who will be responsible for the ticket through their email ID.

In the payload for creating a ticket, use the following field:

{
  "agentEmailId": "james@example.com"
} 
Use POST /api/v1/tickets, for example:
{
  "subject": "New Support Ticket",
  "description": "The customer is facing issues with the product.",
  "agentEmailId": "james@example.com"
} 

In this example, a new ticket is created, and the agent with the email james@example.com is automatically assigned to this ticket.

Updating the Assigned Agent for an Existing Ticket (Update Field API)

If you want to update the agent for an existing ticket, you can do so using the Update Ticket API. In this case, the agent is updated by specifying the Email ID within the existing agent field. There’s no need to modify the structure of the field; you simply provide the email ID of the new agent.

For updating an agent on an existing ticket, the API payload looks like this:

{
  "fields": {
    "agentId": "james@example.com"
  }
} 
Use PUT /api/v1/tickets/{ticketId}
{
  "fields": {
    "agentId": "james@example.com"
  }
} 

In this request, the ticket with the given ticketId is updated, and the new agent with the email james@example.com is assigned to it.

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied