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

# Editing a ticket

> Updates ticket fields such as visitor name, contact information, line assignment, and language preference. Only include fields you want to change - omitted fields remain unchanged. Set a field to `null` to clear its value.



## OpenAPI

````yaml /api-reference/openapi.json patch /tickets/{ticketId}
openapi: 3.1.0
info:
  title: Qminder API
  version: '1.0'
  description: >-
    The Qminder API allows you to integrate queue management into your own
    applications.
servers:
  - url: https://api.qminder.com
security:
  - sec0: []
tags:
  - name: Locations
    description: Manage physical service locations
  - name: Lines
    description: Manage virtual queues within locations
  - name: Input Fields
    description: Manage custom data fields for locations
  - name: Tickets
    description: Manage visitor queue entries
  - name: Appointments
    description: Manage scheduled appointments
  - name: Users
    description: Manage user accounts and permissions
  - name: Webhooks
    description: Manage webhook subscriptions
paths:
  /tickets/{ticketId}:
    patch:
      tags:
        - Tickets
      summary: Editing a ticket
      description: >-
        Updates ticket fields such as visitor name, contact information, line
        assignment, and language preference. Only include fields you want to
        change - omitted fields remain unchanged. Set a field to `null` to clear
        its value.
      operationId: editing-a-ticket
      parameters:
        - name: ticketId
          in: path
          description: ID of the ticket to update
          schema:
            type: string
          required: true
        - name: X-Qminder-API-Version
          in: header
          description: API version. Must be set to `2020-09-01`.
          required: true
          schema:
            type: string
            enum:
              - '2020-09-01'
            default: '2020-09-01'
      requestBody:
        description: >-
          Ticket fields to update. All fields are optional - only include fields
          you want to change.
        content:
          application/json:
            schema:
              type: object
              properties:
                firstName:
                  type: string
                  description: >-
                    The visitor's first name. Must be 2-50 characters. Cannot be
                    null or empty if included.
                  minLength: 2
                  maxLength: 50
                  example: John
                lastName:
                  type: string
                  description: >-
                    The visitor's last name. Maximum 50 characters. Set to null
                    to clear.
                  maxLength: 50
                  nullable: true
                  example: Doe
                email:
                  type: string
                  format: email
                  description: >-
                    The visitor's email address. Maximum 100 characters. Set to
                    null to clear.
                  maxLength: 100
                  nullable: true
                  example: john.doe@example.com
                phoneNumber:
                  type: string
                  pattern: ^(\+)?([0-9]){5,20}$
                  description: >-
                    The visitor's phone number. 5-20 digits with optional +
                    prefix. Set to null to clear.
                  nullable: true
                  example: '+12125551234'
                line:
                  type: string
                  pattern: ^[0-9]+$
                  description: >-
                    ID of the line to move the ticket to. Must be a valid line
                    in the same location.
                  example: '12345'
                languageCode:
                  type: string
                  description: >-
                    The visitor's preferred language code (e.g., "en", "es").
                    Must be 2-5 characters.
                  minLength: 2
                  maxLength: 5
                  example: en
      responses:
        '200':
          description: Ticket updated successfully
        '400':
          description: Invalid request - validation failed
          content:
            application/json:
              examples:
                InvalidFirstName:
                  summary: First name too short
                  value:
                    statusCode: 400
                    message: First name must not be empty or blank
                InvalidPhoneNumber:
                  summary: Invalid phone number format
                  value:
                    statusCode: 400
                    errors:
                      - phoneNumber: must match "^(\+)?([0-9]){5,20}$"
        '404':
          description: Ticket or line not found
          content:
            application/json:
              examples:
                TicketNotFound:
                  summary: Ticket does not exist
                  value:
                    message: Ticket with id 123456 not found
                LineNotFound:
                  summary: Target line does not exist
                  value:
                    message: Line with id 789 not found
        '409':
          description: Conflict - line is disabled or archived
          content:
            application/json:
              examples:
                LineDisabled:
                  summary: Target line is disabled
                  value:
                    message: Line with id 789 is disabled
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: X-Qminder-REST-API-Key
      x-default: yourbusinessapikey

````