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

# Tickets

> Qminder's backend sends HTTP requests to registered URLs every time a Ticket is created, called, served, re-called or changed.

### Ticket created

This HTTP request is sent to the registered URL every time a Ticket was created in Qminder.

<CodeGroup>
  ```bash bash theme={null}
  POST /webhooks HTTP/1.1
  X-Qminder-Signature: SIGNATURE
  Content-Type: application/json

  {
    "type": "ticket_created",
    "data": {
      "id": "123456789",
      "status": "NEW",
      "source": "MANUAL",
      "line": 37338,
      "firstName": "Jane",
      "lastName": "Eyre",
      "phoneNumber": 12125551234,
      "created": {
        "date": "2020-05-15T00:15:24Z"
      },
      "extra": [
        {
          "title": "First time visitor?",
          "value": "Yes"
        }
      ]
    }
  }
  ```
</CodeGroup>

This HTTP request includes the following data fields in its request body:

| Field name  | Data type         | Description                                                                                                            |
| ----------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------- |
| **type**    | "ticket\_created" | Always "ticket\_created" for the Ticket Created event                                                                  |
| **data.id** | string            | The ID of the ticket that was created                                                                                  |
| ...         | Ticket            | Other data fields come from the Ticket data model. [Read more about the Ticket data model.](/reference/tickets#fields) |

### Ticket called

This HTTP request is sent to the registered URL every time a Ticket was called in Qminder.

<CodeGroup>
  ```bash bash theme={null}
  POST /webhooks HTTP/1.1
  X-Qminder-Signature: SIGNATURE
  Content-Type: application/json

  {
    "type": "ticket_called",
    "data": {
      "id": "123456789",
      "status": "CALLED",
      "source": "MANUAL",
      "line": 37338,
      "firstName": "Jane",
      "lastName": "Eyre",
      "phoneNumber": 12125551234,
      "created": {
        "date": "2020-05-15T00:15:24Z"
      },
      "called": {
        "date": "2016-02-18T10:43:04Z",
        "caller": 14267,
        "desk": 3
      },
      "extra": [
        {
          "title": "First time visitor?",
          "value": "Yes"
        }
      ]
    }
  }
  ```
</CodeGroup>

This HTTP request includes the following data fields in its request body:

| Field name  | Data type        | Description                                                                                                            |
| ----------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------- |
| **type**    | "ticket\_called" | Always "ticket\_called" for the Ticket Called event                                                                    |
| **data.id** | string           | The ID of the ticket that was created                                                                                  |
| ...         | Ticket           | Other data fields come from the Ticket data model. [Read more about the Ticket data model.](/reference/tickets#fields) |

### Ticket re-called

This HTTP request is sent to the registered URL every time a Ticket was called again in Qminder.

<CodeGroup>
  ```bash bash theme={null}
  POST /webhooks HTTP/1.1
  X-Qminder-Signature: SIGNATURE
  Content-Type: application/json

  {
    "type": "ticket_created",
    "data": {
      "id": "123456789",
      "status": "CALLED",
      "source": "MANUAL",
      "line": 37338,
      "firstName": "Jane",
      "lastName": "Eyre",
      "phoneNumber": 12125551234,
      "created": {
        "date": "2020-05-15T00:15:24Z"
      },
      "called": {
        "date": "2016-02-18T10:43:04Z",
        "caller": 14267,
        "desk": 3
      },
      "extra": [
        {
          "title": "First time visitor?",
          "value": "Yes"
        }
      ]
    }
  }
  ```
</CodeGroup>

This HTTP request includes the following data fields in its request body:

| Field name  | Data type          | Description                                                                                                            |
| ----------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| **type**    | "ticket\_recalled" | Always "ticket\_recalled" for the Ticket Re-called event                                                               |
| **data.id** | string             | The ID of the ticket that was created                                                                                  |
| ...         | Ticket             | Other data fields come from the Ticket data model. [Read more about the Ticket data model.](/reference/tickets#fields) |

### Ticket removed from queue

This HTTP request is sent to the registered URL every time a Ticket was removed from the queue in Qminder.

<CodeGroup>
  ```bash bash theme={null}
  POST /webhooks HTTP/1.1
  X-Qminder-Signature: SIGNATURE
  Content-Type: application/json

  {
    "type": "ticket_cancelled",
    "data": {
      "id": "123456789",
      "status": "CANCELLED_BY_CLERK",
      "source": "MANUAL",
      "line": 37338,
      "firstName": "Jane",
      "lastName": "Eyre",
      "phoneNumber": 12125551234,
      "created": {
        "date": "2020-05-15T00:15:24Z"
      },
      "extra": [
        {
          "title": "First time visitor?",
          "value": "Yes"
        }
      ]
    }
  }
  ```
</CodeGroup>

This HTTP request includes the following data fields in its request body:

| Field name  | Data type           | Description                                                                                                            |
| ----------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| **type**    | "ticket\_cancelled" | Always "ticket\_cancelled" for the Ticket Removed event                                                                |
| **data.id** | string              | The ID of the ticket that was created                                                                                  |
| ...         | Ticket              | Other data fields come from the Ticket data model. [Read more about the Ticket data model.](/reference/tickets#fields) |

### Ticket served

This HTTP request is sent to the registered URL every time a Ticket was served in Qminder.

<CodeGroup>
  ```bash bash theme={null}
  POST /webhooks HTTP/1.1
  X-Qminder-Signature: SIGNATURE
  Content-Type: application/json

  {
    "type": "ticket_served",
    "data": {
      "id": "123456789",
      "status": "SERVED",
      "source": "MANUAL",
      "line": 37338,
      "firstName": "Jane",
      "lastName": "Eyre",
      "phoneNumber": 12125551234,
      "created": {
        "date": "2020-05-15T00:15:24Z"
      },
      "called": {
        "date": "2016-02-18T10:43:04Z",
        "caller": 14267,
        "desk": 3
      },
      "served": {
        "date": "2016-02-18T10:53:19Z"
      },
      "extra": [
        {
          "title": "First time visitor?",
          "value": "Yes"
        }
      ]
    }
  }
  ```
</CodeGroup>

This HTTP request includes the following data fields in its request body:

| Field name  | Data type        | Description                                                                                                            |
| ----------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------- |
| **type**    | "ticket\_served" | Always "ticket\_served" for the Ticket Served event                                                                    |
| **data.id** | string           | The ID of the ticket that was created                                                                                  |
| ...         | Ticket           | Other data fields come from the Ticket data model. [Read more about the Ticket data model.](/reference/tickets#fields) |

### Ticket changed

This HTTP request is sent to the registered URL every time a Ticket's information was changed in Qminder.

<CodeGroup>
  ```bash bash theme={null}
  POST /webhooks HTTP/1.1
  X-Qminder-Signature: SIGNATURE
  Content-Type: application/json

  {
    "type": "ticket_changed",
    "data": {
      "id": "123456789",
      "status": "NEW",
      "source": "MANUAL",
      "line": 37338,
      "firstName": "Jane",
      "lastName": "Eyre",
      "phoneNumber": 12125551234,
      "created": {
        "date": "2020-05-15T00:15:24Z"
      },
      "extra": [
        {
          "title": "First time visitor?",
          "value": "No"
        }
      ]
    }
  }
  ```
</CodeGroup>

This HTTP request includes the following data fields in its request body:

| Field name  | Data type         | Description                                                                                                            |
| ----------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------- |
| **type**    | "ticket\_changed" | Always "ticket\_changed" for the Ticket Changed event                                                                  |
| **data.id** | string            | The ID of the ticket that was created                                                                                  |
| ...         | Ticket            | Other data fields come from the Ticket data model. [Read more about the Ticket data model.](/reference/tickets#fields) |
