Skip to main content
POST
Update metadata of a ticket

Overview

Updates metadata fields for a ticket. Metadata is a set of key-value string pairs that you can attach to a ticket for custom tracking (e.g. order IDs, priorities, tags). By default, this endpoint targets the contact’s active ticket. Set allow_closed_ticket to true to fall back to the latest closed ticket when no active ticket exists.

Authentication

Include your API key in the request headers:

Request Body

You must provide exactly one identifier: ticket_id, ai_contact_id, or contact_number.

Example Requests

By contact number

By AI contact ID (with closed ticket fallback)

By ticket ID

Responses

200 - Success

400 - Bad Request

Returned when no identifier is provided or the request body is invalid.

404 - Not Found

Returned when the contact or ticket cannot be found.

Headers

x-api-key
string
required

API key needed to authorize the request

Body

application/json
metadata
object
required
ticket_id
string<uuid>
ai_contact_id
string<uuid>
contact_number
string
allow_closed_ticket
boolean

Response

Ticket metadata updated successfully