> ## 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.

# Create a ticket

> Creates a new ticket in the specified line.



## OpenAPI

````yaml /api-reference/openapi.json post /tickets
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:
    post:
      tags:
        - Tickets
      summary: Create a ticket
      description: Creates a new ticket in the specified line.
      operationId: create-ticket
      parameters:
        - 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:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - lineId
                - firstName
              properties:
                lineId:
                  type: string
                  description: ID of the line to create the ticket in.
                firstName:
                  type: string
                  minLength: 2
                  maxLength: 50
                  description: Visitor's first name (2-50 characters).
                lastName:
                  type: string
                  maxLength: 50
                  description: Visitor's last name (max 50 characters).
                phoneNumber:
                  type: string
                  pattern: ^(\+)?([0-9]){5,20}$
                  description: >-
                    Phone number with optional + prefix (5-20 digits). Example:
                    +12125551234
                email:
                  type: string
                  maxLength: 100
                  description: Visitor's email address.
                languageCode:
                  type: string
                  minLength: 2
                  maxLength: 5
                  default: en
                  description: 'Language code for the visitor (default: en).'
                source:
                  type: string
                  enum:
                    - MANUAL
                    - NAME
                    - MICROSITE
                  default: MANUAL
                  description: >-
                    Source of ticket creation. MANUAL = created by clerk, NAME =
                    iPad Sign-in, MICROSITE = Visit Planner.
                fields:
                  type: array
                  description: >-
                    Custom input fields for the ticket. See [Input Fields
                    query](/reference/queries/input-fields) to discover
                    available IDs.
                  items:
                    type: object
                    required:
                      - inputFieldId
                    properties:
                      inputFieldId:
                        type: string
                        format: uuid
                        description: UUID of the input field.
                      value:
                        type: string
                        maxLength: 500
                        description: Value for text/URL input fields (max 500 characters).
                      optionIds:
                        type: array
                        items:
                          type: string
                          format: uuid
                        description: >-
                          UUIDs of selected options for select-type input
                          fields.
                labels:
                  type: array
                  description: Labels to attach to the ticket.
                  items:
                    type: object
                    required:
                      - value
                    properties:
                      value:
                        type: string
                        description: Label text.
            example:
              lineId: '12345'
              firstName: John
              lastName: Doe
              phoneNumber: '+12125551234'
              email: john@example.com
              languageCode: en
              source: MANUAL
              fields:
                - inputFieldId: 550e8400-e29b-41d4-a716-446655440000
                  value: Consultation
              labels:
                - value: VIP
      responses:
        '201':
          description: Ticket created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Internal ticket ID.
                    example: '226859'
                  publicId:
                    type: string
                    description: Public-facing ticket ID.
                    example: A-42
              example:
                id: '226859'
                publicId: A-42
        '400':
          description: Validation error - invalid input data
        '404':
          description: Line, input fields, or language not found
        '409':
          description: Line is disabled or archived
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: X-Qminder-REST-API-Key
      x-default: yourbusinessapikey

````