# Update a Ticket

> Change fields on a LemuTickets ticket, safely with If-Match

URL: https://docs.lemuai.com/tickets-api/tickets/update

Changes the fields you send and leaves the rest alone. To change the status, use [Transition a ticket](https://docs.lemuai.com/tickets-api/tickets/transition) instead.

**Endpoint:** `PATCH /v1/tickets/{ref}`

Needs the `tickets.write` scope in the ticket's project. Assigning a ticket to someone other than the caller also needs `tickets.assign`.

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ref` | string | Yes | The ticket key (`SUP-1042`) or id. |

## Headers

| Name | Required | Description |
|---|---|---|
| `If-Match` | No, but recommended | The `version` you last read. If the ticket changed since, nothing is saved and you get `412`. See [versions and If-Match](https://docs.lemuai.com/tickets-api/conventions#versions-and-if-match). |

## Request body

Send only the fields you want to change. Send `null` to clear a field.

| Field | Type | Description |
|---|---|---|
| `title` | string | The title. |
| `description` | string | The body of the ticket. |
| `priority` | string | `p1`, `p2`, `p3` or `p4`. |
| `severity` | string | Optional severity. |
| `type_id` | string (UUID) | Another ticket type in the same project. It must use the same workflow. |
| `assignee_user_id` | string (UUID) | The person to assign. `null` unassigns. |
| `assignee_team_id` | string (UUID) | The team to assign. |
| `requester_id` | string (UUID) | Change the requester. The account follows the new requester unless you also send `account_id`. |
| `account_id` | string (UUID) | The customer account. |
| `labels` | array of strings | **Replaces** all labels. |
| `due_at` | string (date-time) | The due date. |
| `custom_fields` | object | **Merged** into the existing values: keys you send are updated, others are kept. |
| `parent_id` | string (UUID) | Make it a sub-task of another ticket. |
| `estimate_minutes` | integer | Estimated work. |
| `story_points` | number | Story points, for task tracking projects. |
| `external_id` | string | Your own id for the ticket. |
| `restricted` | boolean | Only organization or project admins may change this. |
| `restricted_to` | object | Who else may see a restricted ticket: `{"user_ids": [...], "roles": [...]}`. Only organization or project admins may change this. |

Any other field is rejected with `422`.

**Example request:**
```bash
curl -X PATCH https://api.tickets.lemuai.com/v1/tickets/SUP-1042 \
  -H "Authorization: Bearer ltk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -H "If-Match: 4" \
  -d '{
    "priority": "p1",
    "assignee_user_id": "0e2a4c6b-8d1f-4a3e-9b5c-7d9f1a3c5e7b",
    "labels": ["refund", "escalated"],
    "custom_fields": { "refund_reference": "RF-99120" }
  }'
```

## Response

**`200`** with the updated [ticket object](https://docs.lemuai.com/tickets-api/tickets/overview). The `ETag` header holds the new `version`.
```json
{
  "id": "2f9c7e1a-5b3d-4c8e-9a6f-1d0e2b4c6a8f",
  "key": "SUP-1042",
  "title": "Refund not received for order 58213",
  "status": { "id": "5c8a1d3e-7f2b-4e6a-9b0c-d4e1f2a3b5c6", "name": "Open", "category": "open", "color": "blue" },
  "status_category": "open",
  "priority": "p1",
  "assignee": {
    "id": "0e2a4c6b-8d1f-4a3e-9b5c-7d9f1a3c5e7b",
    "name": "Arjun Mehta",
    "email": "arjun@yourcompany.com",
    "avatar_url": null
  },
  "labels": ["escalated", "refund"],
  "custom_fields": { "order_id": "58213", "refund_reference": "RF-99120" },
  "version": 5,
  "updated_at": "2026-11-25T09:41:07.220000+00:00"
}
```

The example is shortened; the response has every ticket field. A change fires the `ticket.updated` [webhook](https://docs.lemuai.com/tickets-api/webhooks) with the changed fields, and `ticket.assigned` when the assignee or team changed. The new assignee becomes a watcher.

## Errors

| Status | `code` | When |
|---|---|---|
| `403` | `missing_capability` | You assigned someone else without `tickets.assign`, or changed `restricted` without being an admin |
| `404` | `ticket_not_found` | No ticket with this key or id, or you cannot see it |
| `412` | `version_mismatch` | The ticket changed since the version in `If-Match`. `data.current_version` has the current one |
| `422` | `invalid_if_match` | `If-Match` is not a version number |
| `422` | `invalid_fields` | An unknown field was sent, or a value has the wrong type |
| `422` | `invalid_priority`, `invalid_assignee`, `invalid_team`, `invalid_type` | A value does not exist or is not allowed |
| `422` | `workflow_change` | The new type uses another workflow |
| `422` | `invalid_parent` | A ticket cannot be its own parent |
| `422` | `invalid_custom_fields` | A custom field value is wrong. See `field_errors` |
