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

# Searching tickets



## OpenAPI

````yaml /api-reference/openapi.json get /v1/tickets/search
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:
  /v1/tickets/search:
    get:
      tags:
        - Tickets
      summary: Searching tickets
      operationId: searching-tickets
      parameters:
        - name: location
          in: query
          description: Search tickets only in the given Location.
          schema:
            type: integer
            format: int32
        - name: line
          in: query
          schema:
            type: integer
            format: int32
            default: null
        - name: status
          in: query
          description: >-
            Search tickets with only the given status. Multiple statuses can be
            searched by separating them with a comma. "NEW" will return tickets
            that are in queue, and have not been called. "CALLED" will return
            tickets that are currently being served. "SERVED" will return
            tickets that have been served. "CANCELLED_BY_CLERK" will return
            tickets that have been removed from queue.
          schema:
            type: string
        - name: caller
          in: query
          description: >-
            Search tickets that have been called by the given user ID. Both
            "CALLED" and "SERVED" tickets will be returned, unless status is
            also specified.
          schema:
            type: string
        - name: minCreated
          in: query
          description: >-
            Search tickets which have been created after the given timestamp.
            The timestamp can be in ISO 8601 format, eg "2020-05-03T00:00:00Z".
            Alternatively, the timestamp can be a Unix timestamp, eg 1588767798.
          schema:
            type: string
            format: date-time
        - name: maxCreated
          in: query
          description: >-
            Search tickets which have been created before the given timestamp.
            The timestamp can be in ISO 8601 format, eg "2020-05-03T00:00:00Z".
            Alternatively, the timestamp can be a Unix timestamp, eg 1588767798.
          schema:
            type: string
            format: date-time
        - name: minCalled
          in: query
          description: >-
            Search tickets which have been called after the given timestamp. The
            timestamp can be in ISO 8601 format, eg "2020-05-03T00:00:00Z".
            Alternatively, the timestamp can be a Unix timestamp, eg 1588767798.
          schema:
            type: string
            format: date-time
        - name: maxCalled
          in: query
          description: >-
            Search tickets which have been called before the given timestamp.
            The timestamp can be in ISO 8601 format, eg "2020-05-03T00:00:00Z".
            Alternatively, the timestamp can be a Unix timestamp, eg 1588767798.
          schema:
            type: string
            format: date-time
        - name: limit
          in: query
          description: >-
            Limit search results to the specified amount of tickets. With a
            limit of 100, only the 100 first results will be returned. The limit
            has to be between 1 and 20000.
          schema:
            type: integer
            format: int32
        - name: order
          in: query
          description: >-
            Order search results according to a ticket parameter. Order is
            specified using two words in one string, for example "id ASC". Valid
            order directions: ASC, DESC Valid ordering parameters: id, created,
            called, served
          schema:
            type: string
        - name: responseScope
          in: query
          description: >-
            Include additional data in the search results. Use multiple response
            scopes by separating them with a comma. Valid response scopes are:
            "MESSAGES" - include SMS messages with the response "INTERACTIONS" -
            include interaction data with the response "CONNECTED_TICKETS" -
            include connected tickets (other visits of the same person)
          schema:
            type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                      "statusCode": 200,
                      "data": [
                        {
                          "id": "51999102",
                          "status": "SERVED",
                          "source": "MANUAL",
                          "line": 88100,
                          "firstName": "Jane",
                          "lastName": "Doe",
                          "orderAfter": "2015-04-29T12:29:40.701Z",
                          "created": {
                            "date": "2016-04-29T12:29:40.701Z"
                          },
                          "called": {
                            "date": "2016-05-05T14:05:29Z",
                            "caller": 15144,
                            "desk": 3
                          },
                          "served": {
                            "date": "2016-05-05T14:05:34Z"
                          },
                          "assigned": {
                            "assigner": 15100,
                            "assignee": 15144
                          },
                          "extra": [
                            {
                              "title": "Notes",
                              "value": "assistance required"
                            }
                          ],
                          "labels": [
                            {
                              "value": "VIP",
                              "color": "FF00FF"
                            }
                          ],
                          "interactions": [
                            {
                              "start": "2016-05-05T14:05:29Z",
                              "end": "2016-05-05T14:05:34Z",
                              "line": 88100,
                              "user": 15144
                            }
                          ],
                          "messages": [
                            {
                              "created": {
                                "date": "2017-06-15T18:43:41Z"
                              },
                              "body": "Hello Jane! You are now in the queue. We will let you know when it's your turn.",
                              "type": "OUTGOING",
                              "status": "DELIVERED"
                            }
                          ]
                        }
                      ]
                    }
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                    default: 0
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: '51999102'
                        status:
                          type: string
                          example: SERVED
                        source:
                          type: string
                          example: MANUAL
                        line:
                          type: integer
                          example: 88100
                          default: 0
                        firstName:
                          type: string
                          example: Jane
                        lastName:
                          type: string
                          example: Doe
                        orderAfter:
                          type: string
                          example: '2015-04-29T12:29:40.701Z'
                        created:
                          type: object
                          properties:
                            date:
                              type: string
                              example: '2016-04-29T12:29:40.701Z'
                        called:
                          type: object
                          properties:
                            date:
                              type: string
                              example: '2016-05-05T14:05:29Z'
                            caller:
                              type: integer
                              example: 15144
                              default: 0
                            desk:
                              type: integer
                              example: 3
                              default: 0
                        served:
                          type: object
                          properties:
                            date:
                              type: string
                              example: '2016-05-05T14:05:34Z'
                        assigned:
                          type: object
                          properties:
                            assigner:
                              type: integer
                              example: 15100
                              default: 0
                            assignee:
                              type: integer
                              example: 15144
                              default: 0
                        extra:
                          type: array
                          items:
                            type: object
                            properties:
                              title:
                                type: string
                                example: Notes
                              value:
                                type: string
                                example: assistance required
                        labels:
                          type: array
                          items:
                            type: object
                            properties:
                              value:
                                type: string
                                example: VIP
                              color:
                                type: string
                                example: FF00FF
                        interactions:
                          type: array
                          items:
                            type: object
                            properties:
                              start:
                                type: string
                                example: '2016-05-05T14:05:29Z'
                              end:
                                type: string
                                example: '2016-05-05T14:05:34Z'
                              line:
                                type: integer
                                example: 88100
                                default: 0
                              user:
                                type: integer
                                example: 15144
                                default: 0
                        messages:
                          type: array
                          items:
                            type: object
                            properties:
                              created:
                                type: object
                                properties:
                                  date:
                                    type: string
                                    example: '2017-06-15T18:43:41Z'
                              body:
                                type: string
                                example: >-
                                  Hello Jane! You are now in the queue. We will
                                  let you know when it's your turn.
                              type:
                                type: string
                                example: OUTGOING
                              status:
                                type: string
                                example: DELIVERED
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: X-Qminder-REST-API-Key
      x-default: yourbusinessapikey

````