> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vambe.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Update metadata of a ticket

> Updates metadata of the active ticket, or the latest closed ticket if allow_closed_ticket is true.



## OpenAPI

````yaml /openapi.json post /api/public/ticket/metadata
openapi: 3.0.0
info:
  title: Vambe AI API
  description: Vambe AI documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://api.vambe.me
    description: Production Server
security: []
tags:
  - name: Vambe AI
    description: ''
paths:
  /api/public/ticket/metadata:
    post:
      tags:
        - Ticket
      summary: Update metadata of a ticket
      description: >-
        Updates metadata of the active ticket, or the latest closed ticket if
        allow_closed_ticket is true.
      operationId: UpdateTicketPublicController_updateTicketMetadata
      parameters:
        - name: x-api-key
          in: header
          description: API key needed to authorize the request
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ticket_id:
                  format: uuid
                  type: string
                ai_contact_id:
                  format: uuid
                  type: string
                contact_number:
                  type: string
                allow_closed_ticket:
                  type: boolean
                metadata:
                  type: object
                  additionalProperties:
                    type: string
              required:
                - metadata
              example:
                contact_number: '+56912345678'
                allow_closed_ticket: true
                metadata:
                  order_id: ORD-12345
                  priority: high
      responses:
        '200':
          description: Ticket metadata updated successfully
        '400':
          description: >-
            Invalid request - provide ticket_id, ai_contact_id, or
            contact_number
        '404':
          description: Ticket not found

````