# ticket.created: a support ticket was opened (/api-reference/webhooks/onTicketCreated)

## Webhook ticketCreated

Operation ID: `onTicketCreated`
ticket.created: a support ticket was opened
Sent to webhook endpoints subscribed to this event (or to every event).

### Parameters

| Name | In | Required | Description |
|---|---|---|---|
| `webhook-id` | header | no | The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only. |
| `webhook-timestamp` | header | no | When this attempt was sent, Unix seconds. Webhook endpoints only. |
| `webhook-signature` | header | no | Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only. |
| `X-Webhook-Id` | header | no | Same on every retry of this delivery (the event id for webhook endpoints). |
| `X-Webhook-Event` | header | no | The event type, for example `call.completed`. |
| `X-Signature-SHA256` | header | no | Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old. |

### Request body

`application/json` (required)

```json
{
  "properties": {
    "apiVersion": {
      "const": "v1",
      "type": "string"
    },
    "createdAt": {
      "description": "When the event happened, ISO 8601 UTC.",
      "format": "date-time",
      "type": "string"
    },
    "data": {
      "additionalProperties": true,
      "description": "`category`, `team`, `tags` and `mergedInto` appear only when the ticket has them. Some changes add extra keys describing the change.",
      "properties": {
        "assignedToUserId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "assignees": {
          "items": {
            "properties": {
              "email": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "userId": {
                "format": "uuid",
                "type": "string"
              }
            },
            "type": "object"
          },
          "type": "array"
        },
        "category": {
          "properties": {
            "id": {
              "format": "uuid",
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "type": "object"
        },
        "closedAt": {
          "anyOf": [
            {
              "description": "ISO 8601 timestamp, UTC.",
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "csatAt": {
          "anyOf": [
            {
              "description": "ISO 8601 timestamp, UTC.",
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "csatScore": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "dueAt": {
          "anyOf": [
            {
              "description": "ISO 8601 timestamp, UTC.",
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "firstResponseAt": {
          "anyOf": [
            {
              "description": "ISO 8601 timestamp, UTC.",
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "leadId": {
          "format": "uuid",
          "type": "string"
        },
        "merchantId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "mergedInto": {
          "properties": {
            "id": {
              "format": "uuid",
              "type": "string"
            },
            "ref": {
              "type": "string"
            }
          },
          "type": "object"
        },
        "previousStatus": {
          "description": "Only on ticket.reopened.",
          "type": "string"
        },
        "priority": {
          "type": "string"
        },
        "reopenedBy": {
          "description": "Only on ticket.reopened.",
          "type": "string"
        },
        "resolvedAt": {
          "anyOf": [
            {
              "description": "ISO 8601 timestamp, UTC.",
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "source": {
          "type": "string"
        },
        "sourceCallId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "type": "string"
        },
        "subject": {
          "type": "string"
        },
        "tags": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "team": {
          "properties": {
            "id": {
              "format": "uuid",
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "type": "object"
        },
        "ticketId": {
          "format": "uuid",
          "type": "string"
        },
        "ticketRef": {
          "description": "Short reference shown to the customer.",
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "version": {
          "type": "integer"
        }
      },
      "required": [
        "ticketId",
        "leadId",
        "status"
      ],
      "type": "object"
    },
    "id": {
      "description": "Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.",
      "type": "string"
    },
    "type": {
      "const": "ticket.created",
      "type": "string"
    }
  },
  "required": [
    "id",
    "type",
    "apiVersion",
    "createdAt",
    "data"
  ],
  "type": "object"
}
```

### Responses

#### 2XX Received. Anything else is retried.
