# Create a ticket

`POST https://api.cademi.com.br/api/v3/support/tickets`

Operation ID: `tickets.create` · API v3

Opens a support ticket on behalf of the specified user. The ticket is owned by that user, but its first message is attributed to the credential that made the request, not to the user.

If `user_id` or `department_id` does not reference a resource accessible with the current credentials, the request is rejected with a validation error for that field.

Required permissions: `tickets.create`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `Idempotency-Key` | header | string | yes |  |

## Request body

Content type: `application/json`, required.

| Field | Type | Required | Description |
|---|---|---|---|
| `department_id` | string or null | no |  |
| `message` | object | yes |  |
| `product_id` | string or null | no |  |
| `subject` | string | yes |  |
| `user_id` | string | yes |  |

## Responses

### 201

Returns the newly created ticket.

### 401

The credential is missing, malformed, expired, or revoked.

Body: Error.

### 403

The current credentials do not have the permission required by this operation.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

Full schema: https://cademi.dev/openapi/v3.json
