Update metadata of a ticket
curl --request POST \
--url https://api.vambe.me/api/public/ticket/metadata \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"metadata": {
"order_id": "ORD-12345",
"priority": "high"
}
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({metadata: {order_id: 'ORD-12345', priority: 'high'}})
};
fetch('https://api.vambe.me/api/public/ticket/metadata', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.vambe.me/api/public/ticket/metadata"
payload = { "metadata": {
"order_id": "ORD-12345",
"priority": "high"
} }
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Tickets
Update metadata of a ticket
Updates metadata of the active ticket, or the latest closed ticket if allow_closed_ticket is true. For email contacts always provide ticket_id: their tickets are per-thread, so resolution by ai_contact_id or contact_number may return no ticket or one from a different thread.
POST
/
api
/
public
/
ticket
/
metadata
Update metadata of a ticket
curl --request POST \
--url https://api.vambe.me/api/public/ticket/metadata \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"metadata": {
"order_id": "ORD-12345",
"priority": "high"
}
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({metadata: {order_id: 'ORD-12345', priority: 'high'}})
};
fetch('https://api.vambe.me/api/public/ticket/metadata', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.vambe.me/api/public/ticket/metadata"
payload = { "metadata": {
"order_id": "ORD-12345",
"priority": "high"
} }
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)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. Setallow_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:x-api-key: your_api_key_here
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
ticket_id | string (UUID) | One of three | Directly target a ticket by its ID. |
ai_contact_id | string (UUID) | One of three | Find the ticket through a contact ID. |
contact_number | string | One of three | Find the ticket through a contact phone number (e.g. +56912345678). |
metadata | object | Yes | Key-value pairs (string: string) to set on the ticket. Merges with existing metadata. |
allow_closed_ticket | boolean | No | When true, falls back to the latest closed ticket if no active ticket exists. Defaults to false. |
You must provide exactly one identifier:ticket_id,ai_contact_id, orcontact_number.
Example Requests
By contact number
curl --request POST \
'https://api.vambe.me/api/public/ticket/metadata' \
--header 'Content-Type: application/json' \
--header 'x-api-key: your_api_key_here' \
--data-raw '{
"contact_number": "+56912345678",
"metadata": {
"order_id": "ORD-12345",
"priority": "high"
}
}'
By AI contact ID (with closed ticket fallback)
curl --request POST \
'https://api.vambe.me/api/public/ticket/metadata' \
--header 'Content-Type: application/json' \
--header 'x-api-key: your_api_key_here' \
--data-raw '{
"ai_contact_id": "df980fc8-b6db-4820-bf22-2969482d106d",
"allow_closed_ticket": true,
"metadata": {
"order_id": "ORD-12345",
"refund_reason": "damaged_product"
}
}'
By ticket ID
curl --request POST \
'https://api.vambe.me/api/public/ticket/metadata' \
--header 'Content-Type: application/json' \
--header 'x-api-key: your_api_key_here' \
--data-raw '{
"ticket_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"metadata": {
"status": "escalated"
}
}'
Responses
200 - Success
{
"status": "ok"
}
400 - Bad Request
Returned when no identifier is provided or the request body is invalid.{
"statusCode": 400,
"message": "You must provide ticket_id, ai_contact_id, or contact_number"
}
404 - Not Found
Returned when the contact or ticket cannot be found.{
"statusCode": 404,
"message": "Active ticket not found for contact"
}
Was this page helpful?
