# Update a ticket

`PATCH https://api.cademi.com.br/api/v3/support/tickets/{ticket_id}`

Operation ID: `tickets.update` · API v3

Updates the subject or support department of a ticket, or closes and reopens it through `status`.

Changing `status` requires the `tickets.close` permission in addition to `tickets.update`.

Send the `ETag` returned by the retrieve operation in the `If-Match` header to avoid overwriting a newer version.

Required permissions: `tickets.update`, `tickets.close`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `ticket_id` | path | string | yes |  |
| `If-Match` | header | string | no |  |

## Request body

Content type: `application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `department_id` | string or null | no |  |
| `status` | string, one of `open`, `closed` | no |  |
| `subject` | string | no |  |

## Responses

### 200

Returns the updated 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.

### 404

The ticket was not found or is not accessible with the current credentials.

Body: Error.

### 412

The resource has changed since the supplied revision was retrieved.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

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