# Transition a Ticket

> Move a LemuTickets ticket to another status in its workflow, with an optional comment

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

Moves a ticket to another status, following the project's workflow. You can add a comment and change fields in the same request.

**Endpoint:** `POST /v1/tickets/{ref}/transitions`

Needs the `tickets.write` scope in the ticket's project.

## Path parameters

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

## Headers

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

## Request body

Send either `to_status` or `transition_id`.

| Field | Type | Required | Description |
|---|---|---|---|
| `to_status` | string | One of the two | The status to move to, by name (`Resolved`, not case sensitive) or id. |
| `transition_id` | string (UUID) | One of the two | A transition `id` from [List available transitions](https://docs.lemuai.com/tickets-api/tickets/list-transitions). |
| `comment` | string | No | A comment to add with the move. Some transitions require one. |
| `comment_visibility` | string | No | `internal` (default) for a note to your team, or `public` to reply to the requester. |
| `fields` | object | No | Ticket fields to change at the same time, with the same names as [Update a ticket](https://docs.lemuai.com/tickets-api/tickets/update), for example `{"priority": "p3"}`. |

If the transition has `required_fields`, they must already have a value or be set in `fields`. For required custom fields, set them with [Update a ticket](https://docs.lemuai.com/tickets-api/tickets/update) first.

**Example request:**
```bash
curl -X POST https://api.tickets.lemuai.com/v1/tickets/SUP-1042/transitions \
  -H "Authorization: Bearer ltk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -H "If-Match: 5" \
  -d '{
    "to_status": "Resolved",
    "comment": "Your refund of Rs 4,250 was processed today. It reaches your account in 3 to 5 working days.",
    "comment_visibility": "public"
  }'
```

## Response

**`200`** with the updated [ticket object](https://docs.lemuai.com/tickets-api/tickets/overview).
```json
{
  "id": "2f9c7e1a-5b3d-4c8e-9a6f-1d0e2b4c6a8f",
  "key": "SUP-1042",
  "title": "Refund not received for order 58213",
  "status": { "id": "7a2b3c4d-9e5f-4a6b-b7c8-d9e0f1a2b3c4", "name": "Resolved", "category": "done", "color": "green" },
  "status_category": "done",
  "priority": "p1",
  "first_response_at": "2026-11-25T10:02:18.640000+00:00",
  "resolved_at": "2026-11-25T10:02:18.640000+00:00",
  "closed_at": null,
  "version": 8,
  "updated_at": "2026-11-25T10:02:18.640000+00:00"
}
```

The example is shortened; the response has every ticket field.

Moving to a status in the `done` category sets `resolved_at` (or `closed_at` for a final status) and fires `ticket.resolved` or `ticket.closed`. Moving a done ticket back to another category reopens it: `reopened_count` goes up and `ticket.reopened` fires. Every move fires `ticket.transitioned`. See [Webhooks](https://docs.lemuai.com/tickets-api/webhooks).

### When the transition needs approval

If the transition needs approval, the ticket does not move yet. The response is the ticket in its current status, with a `notes` object:
```json
{
  "key": "SUP-1042",
  "status_category": "open",
  "notes": {
    "transition_blocked": true,
    "approval_request_id": "c7e9b1d3-5f2a-4c6e-8b0d-3f5a7c9e1b2d",
    "approval_required": {
      "status": "pending",
      "created": true,
      "approver_user_ids": ["0e2a4c6b-8d1f-4a3e-9b5c-7d9f1a3c5e7b"],
      "approver_roles": []
    }
  }
}
```

Once approved, the transition is made with the comment and fields you sent. `notes` can also appear with other information, such as how the ticket was assigned. Always check `status_category` to see where the ticket ended up.

## Errors

| Status | `code` | When |
|---|---|---|
| `403` | `transition_forbidden` | The transition is limited to certain roles, or to the assignee |
| `403` | `transition_condition` | The ticket does not meet the transition's conditions |
| `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` |
| `422` | `missing_target` | Neither `to_status` nor `transition_id` was sent |
| `422` | `invalid_status` | No status with that name or id in this ticket's workflow |
| `422` | `invalid_transition` | The ticket cannot move to that status from its current status. `data` has `from` and `to` |
| `422` | `transition_validation` | A required field or comment is missing. `field_errors` lists them |

Moving a ticket to the status it is already in does nothing and returns `200`.
