How can we help?

Updating Ticket Custom Fields and Tags Using the LiveAgent API v3

Overview

Both tags and custom fields (along with other ticket parameters) can be updated using the API v3 through the PUT endpoint. This allows you to programmatically modify ticket properties without using the web interface.

Endpoint

Use the following endpoint to update ticket information:

PUT /tickets/{ticketId}

Replace {ticketId} with the ID of the ticket you want to update.

Request Body Parameters

The following parameters can be included in your request body:

  • owner_contactid (string): The contact ID of the ticket owner
  • departmentid (string): The department ID to assign the ticket to
  • agentid (string): The agent ID to assign the ticket to
  • status (string): The ticket status (e.g., "N" for new)
  • subject (string): The ticket subject line
  • tags (array): An array of tag IDs to assign to the ticket
  • custom_fields (array): An array of custom field objects with code and value pairs

Example Request

Here is an example of a complete request body that updates tags and custom fields:

{
  "owner_contactid": "string",
  "departmentid": "string",
  "agentid": "string",
  "status": "N",
  "subject": "string",
  "tags": [
    "string"
  ],
  "custom_fields": [
    {
      "code": "string",
      "value": "string"
    }
  ]
}

Custom Fields Structure

Custom fields are provided as an array of objects. Each object must contain:

  • code (string): The custom field code/identifier
  • value (string): The value to set for that custom field

Tags Structure

Tags are provided as a simple array of strings. Each string represents a tag to assign to the ticket.

Notes

  • You only need to include the parameters you want to update; omitted parameters will not be modified.
  • Ensure you have the appropriate API credentials and permissions to update tickets.
  • The ticketId must be a valid ticket ID in your system.