*REST API › Endpoint reference › Operations › Repair tickets*

# Update a repair ticket

> Changes the header of the repair ticket and, if you send `lines`, REPLACES the whole set of lines: send all of them or none.

A `closed` ticket is read-only and is rejected; in a `partially_converted` or `fully_invoiced` one, the lines already converted to a purchase or an invoice are locked and changes to them are ignored. Behind the `incidence` add-on. Returns the full repair ticket, the same projection as its GET.

`PATCH /api/v1/repair-tickets/{ticketId}` — scope `repair-tickets:write`

Scope: `repair-tickets:write` · 120/min · Strict tenancy · Add-on (402) · Idempotency-Key · If-Match · MCP: `filmo_repair_tickets_update`

## Authorizations

Bearer API key with the scope below. `repair-tickets:write`

## Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | No | Unique identifier of the request, chosen by the client (a UUID works). Between 1 and 255 characters: an empty header is rejected with 400 `validation_error`, because the client would believe itself protected. Repeating the same key with the SAME body within 24 h returns the stored response without executing again, with the `Idempotent-Replay: true` header. With a DIFFERENT body it returns 422. It is the safe way to retry after a network timeout. |
| `If-Match` | string | No | Optimistic locking: the `ETag` you read from the resource (or `*`). If the resource changed since, the write is rejected with `412 precondition_failed` before doing anything; read it again and retry. Without the header the write always proceeds. |

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `ticketId` | string | Yes | Repair ticket identifier. |

## Body

Body schema: `RepairTicketUpdateBody`

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | string<date-time> | No | New date, in ISO 8601 with offset. |
| `status` | string | No | New repair ticket status. `draft`, `sent`, `partially_converted`, `fully_invoiced`, `closed` |
| `contactId` | string | No | New client; null unlinks it. |
| `orderId` | string | No | New order; null unlinks it. |
| `projectId` | string | No | New project; null unlinks it. |
| `lines` | object[] | No | COMPLETE set of lines, which replaces the current one. Omit it to leave them untouched. |
| `lines.id` | string | No | Existing line being modified. Omit it for a new line. |
| `lines.description` | string | Yes | What needs to be repaired. |
| `lines.diagnosis` | string | No | Technical diagnosis. |
| `lines.entityType` | string | No | Type of element being repaired: item, space or kit. null or omitted for a free line. `item`, `space`, `kit` |
| `lines.entityId` | string | No | Element being repaired. |
| `lines.serializedItemId` | string | No | Specific physical unit, when a serialized item is repaired. |
| `lines.incidentId` | string | No | Incident that originates this line. |
| `lines.quantity` | number | No | Affected units. Defaults to 1. |
| `lines.unitPrice` | string | No | Net unit price quoted to the client, as a decimal string. |
| `lines.notes` | string | No | Line notes. |
| `notes` | string | No | New notes; null clears them. |

## Request examples

*Update a repair ticket*

**cURL**

```bash
curl https://app.filmo.io/api/v1/repair-tickets/tick_8f2a1c \
  --request PATCH \
  --header "Authorization: Bearer $FILMO_API_KEY" \
  --header "Idempotency-Key: $(uuidgen 2>/dev/null || cat /proc/sys/kernel/random/uuid)" \
  --header 'Content-Type: application/json' \
  --data '{
  "status": "closed",
  "notes": "Reparado en taller propio y devuelto al pool"
}'
```

**Node.js**

```javascript
fetch('https://app.filmo.io/api/v1/repair-tickets/tick_8f2a1c', {
  method: 'PATCH',
  headers: {
    Authorization: 'Bearer YOUR_FILMO_API_KEY',
    'Idempotency-Key': crypto.randomUUID(),
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    status: 'closed',
    notes: 'Reparado en taller propio y devuelto al pool'
  })
})
```

**Python**

```python
import uuid
import requests

requests.patch(
    "https://app.filmo.io/api/v1/repair-tickets/tick_8f2a1c",
    headers={
      "Authorization": "Bearer YOUR_FILMO_API_KEY",
      "Idempotency-Key": str(uuid.uuid4()),
      "Content-Type": "application/json"
    },
    json={
      "status": "closed",
      "notes": "Reparado en taller propio y devuelto al pool"
    }
)
```

## Response

Response schema: `RepairTicketDetailDto`

| Status | Description |
| --- | --- |
| 200 | Successful response. |
| 400 | Invalid request (validation_error): malformed query or body. `errors[]` lists every offending field with its stable code. |
| 401 | Authentication failed (unauthorized, api_key_invalid, api_key_revoked, api_key_expired, api_key_owner_inactive, api_key_owner_not_admin). |
| 402 | Add-on required (addon_required): the account plan does not include the add-on this operation needs; `requiredAddon` names it. |
| 403 | Not allowed (insufficient_scope: the API key does not have the required scope, named in `requiredScope`; forbidden: the owner of the key lacks the permission the operation requires). `insufficient_scope` is answered before the request counts against the rate limit, so it carries no `RateLimit-*` headers; `forbidden` does. |
| 404 | Resource not found (not_found): it does not exist or is outside the scope of the API key. |
| 409 | Conflict (conflict): the current state of the resource prevents the operation, a request with that Idempotency-Key is already in progress, or another conditional write (`If-Match`) held the resource for more than five seconds. `errors[0].code` says which: `in_progress` and `lock_timeout` are solved by retrying; `invalid_state` is not, because the state of the resource forbids the operation. |
| 412 | Precondition failed (precondition_failed): the `If-Match` entity tag does not match the current representation. Read the resource again and retry. |
| 422 | Idempotency-Key reused (idempotency_key_reused): the same key was used before with a different body. Change the key. |
| 429 | Rate limit exceeded (rate_limited): retry after `Retry-After` seconds; `RateLimit-*` says which quota ran out. |
| 500 | Internal error (internal_error). |

**200**

| Name | Type | Description |
| --- | --- | --- |
| `data` | object | Detail of a repair ticket, with its lines. |
| `data.id` | string | Unique ticket identifier. |
| `data.number` | string | Ticket number, for example "RT-2026-0001". |
| `data.date` | string<date-time> | Issue date in ISO 8601 UTC. |
| `data.status` | string | Status of the ticket in its lifecycle. `draft`, `sent`, `partially_converted`, `fully_invoiced`, `closed` |
| `data.orderId` | string | Identifier of the order it comes from; null if it was created standalone. |
| `data.orderNumber` | string | Number of the order it comes from; null if it was created standalone. |
| `data.contactId` | string | Identifier of the responsible client; null if none has been assigned. |
| `data.contactName` | string | Name of the responsible client; null if not resolved. |
| `data.subTotal` | string | Sum of the lines before taxes, as a decimal string "1234.50". |
| `data.taxTotal` | string | Tax total, as a decimal string "1234.50". |
| `data.total` | string | Total including taxes, as a decimal string "1234.50". |
| `data.totalLines` | integer | Number of lines in the ticket. |
| `data.notes` | string | General remarks; null if it has none. |
| `data.createdAt` | string<date-time> | Creation date in ISO 8601 UTC. |
| `data.updatedAt` | string<date-time> | Last modification date in ISO 8601 UTC. |
| `data.projectId` | string | Identifier of the associated project; null if it has none. |
| `data.lines` | object[] | Ticket lines. |
| `data.lines.id` | string | Unique line identifier. |
| `data.lines.entityType` | string | Type of element being repaired: item, serializedItem (a specific unit), space or kit; null for a free line (a service, a charge). `item`, `serializedItem`, `space`, `kit` |
| `data.lines.entityId` | string | Identifier of the element being repaired; null if it is a free line. |
| `data.lines.entityName` | string | Name of the element being repaired; null if not resolved. |
| `data.lines.description` | string | What needs to be repaired. |
| `data.lines.diagnosis` | string | Technical diagnosis; null if none has been recorded. |
| `data.lines.quantity` | number | Affected units; null if not applicable. |
| `data.lines.unitPrice` | string | NET unit price quoted to the client, as a decimal string "1234.50". It is not the repair cost: that one is not published. null if the line has no price. |
| `data.lines.incidentId` | string | Identifier of the incident that originated this line; null if it does not come from one. |
| `data.lines.notes` | string | Line notes; null if it has none. |
| `data.sourceIncidentIds` | string[] | Identifiers of the incidents that originated the ticket. |
| `data.customFields` | object<string, any> | Custom field values by custom field identifier; the definitions are in `/api/v1/custom-fields`. |
| `meta` | object | Additional information about the response. |
| `meta.warnings` | object[] | Lifecycle warnings; present only when the operation is deprecated. |
| `meta.warnings.code` | string | Stable warning code. `deprecated` |
| `meta.warnings.message` | string | For people: what is deprecated, until when, and what to use. |
| `meta.warnings.sunset` | string | Day (YYYY-MM-DD) the operation stops being served. |
| `meta.warnings.replacement` | string | `operationId` of the operation to use instead, or null if there is none. |
| `meta.warnings.link` | string | Where the deprecation is documented (the changelog). |

*Example response · 200*

```json
{
  "data": {
    "id": "repair_ticket_9f3a2b",
    "number": "2026-0001",
    "date": "2026-09-01T08:00:00.000Z",
    "status": "draft",
    "orderId": "order_9f3a2b",
    "orderNumber": "2026-0001",
    "contactId": "contact_9f3a2b",
    "contactName": "Example contact name",
    "subTotal": "120.00",
    "taxTotal": "120.00",
    "total": "120.00",
    "totalLines": 1,
    "notes": "Example text.",
    "createdAt": "2026-09-01T08:00:00.000Z",
    "updatedAt": "2026-09-01T08:00:00.000Z",
    "projectId": "project_9f3a2b",
    "lines": [
      {
        "id": "line_9f3a2b",
        "entityType": "item",
        "entityId": "entity_9f3a2b",
        "entityName": "Example entity name",
        "description": "Example text.",
        "diagnosis": "Example diagnosis",
        "quantity": 1,
        "unitPrice": "120.00",
        "incidentId": "incident_9f3a2b",
        "notes": "Example text."
      }
    ],
    "sourceIncidentIds": [
      "source_incident_9f3a2b"
    ],
    "customFields": {
      "example": "example"
    }
  }
}
```

## Errors

| Status | Codes | Meaning |
| --- | --- | --- |
| 400 | `validation_error` | Malformed query or body. `errors[]` lists every offending field with its stable code. |
| 402 | `addon_required` | The account plan does not include the add-on this operation needs; `requiredAddon` names it. |
| 404 | `not_found` | It does not exist or is outside the scope of the API key. |
| 409 | `conflict` | The current state of the resource prevents the operation, a request with that Idempotency-Key is already in progress, or another conditional write (`If-Match`) held the resource for more than five seconds. `errors[0].code` says which: `in_progress` and `lock_timeout` are solved by retrying; `invalid_state` is not, because the state of the resource forbids the operation. |
| 412 | `precondition_failed` | The `If-Match` entity tag does not match the current representation. Read the resource again and retry. |
| 422 | `idempotency_key_reused` | The same key was used before with a different body. Change the key. |

## Deprecation

This operation is not deprecated. Deprecations are announced with a Deprecation header and a sunset date.

---

Canonical URL: https://docs.filmo.io/rest-api/endpoint-reference/repair-tickets/update-a-repair-ticket  
Last updated: 2026-10-25