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

# Issue a Queue ticket

> Issues one ticket idempotently for an allowed Location and service. Refused while an Edge holds Queue authority.



## OpenAPI

````yaml /api/openapi.yaml post /api/public/v1/queue/tickets
openapi: 3.1.0
info:
  title: Layarva Public API
  version: 1.0.0
  description: >-
    Implemented Queue and prayer-schedule public endpoints. Dashboard server
    actions are not public APIs.
servers:
  - url: https://app.layarva.com
security: []
paths:
  /api/public/v1/queue/tickets:
    post:
      tags:
        - Queue
      summary: Issue a Queue ticket
      description: >-
        Issues one ticket idempotently for an allowed Location and service.
        Refused while an Edge holds Queue authority.
      operationId: issueQueueTicket
      parameters:
        - $ref: '#/components/parameters/RequestTimestamp'
        - $ref: '#/components/parameters/RequestNonce'
        - $ref: '#/components/parameters/IdempotencyKey'
        - $ref: '#/components/parameters/CorrelationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IssueTicketRequest'
      responses:
        '201':
          description: Ticket issued
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/QueueTicket'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          description: Replay, idempotency, or Edge-authority conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '413':
          description: Request exceeds 16 KB
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: Request validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - queueBearer: []
components:
  parameters:
    RequestTimestamp:
      name: X-Request-Timestamp
      in: header
      required: true
      description: Current UTC ISO-8601 time, within five minutes.
      schema:
        type: string
        format: date-time
    RequestNonce:
      name: X-Request-Nonce
      in: header
      required: true
      description: Unique 12–160 character value for this mutation.
      schema:
        type: string
        minLength: 12
        maxLength: 160
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      schema:
        type: string
        maxLength: 160
    CorrelationId:
      name: X-Correlation-ID
      in: header
      required: false
      schema:
        type: string
        maxLength: 120
        pattern: ^[A-Za-z0-9_.:-]+$
  schemas:
    IssueTicketRequest:
      type: object
      required:
        - locationId
        - serviceId
      properties:
        locationId:
          type: string
          maxLength: 160
        serviceId:
          type: string
          maxLength: 160
        externalReference:
          type: string
          maxLength: 255
    QueueTicket:
      type: object
      properties:
        id:
          type: string
        ticketId:
          type: string
        ticketNumber:
          type: string
        status:
          type: string
        source:
          type: string
        queueUnitId:
          type: string
        locationId:
          type: string
        serviceId:
          type: string
        externalReference:
          anyOf:
            - type: string
            - type: 'null'
        createdAt:
          type: string
          format: date-time
        calledAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        servingAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        completedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
    ErrorEnvelope:
      type: object
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: Credential scope or Queue Unit prevents the operation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    RateLimited:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    queueBearer:
      type: http
      scheme: bearer
      bearerFormat: Queue API key

````