# Update a Production Log (https://docs.pulsarml.com/v1/api-reference/production-logs/patch-production-logs-production_log_id)

Partially update a Production Log: send only the fields that change.

This is the call for correcting a miscount or a wrong time window without restating the
whole record. Changing `count`, `nominalSpeed`, `start` or `end` changes the OEE Pulsar
reports for that period, and the correction is visible in dashboards immediately.

## `PATCH /v1/production-logs/{production_log_id}`

Base URLs:
- `https://draco.prod.pulsarml.com` — Production
- `https://draco.dev.pulsarml.com` — Development (sandbox)

Authentication: send your API key in the `x-api-key` header.

### Path parameters

- `production_log_id` (string (uuid4), required) — The production log ID.

### Request body (`application/json`, required)

Type: object (`UpdateProductionLogByIdRequestV1`)

- `type` ("correct" | "defects" | "total", optional, nullable, e.g. `"correct"`) — The type of the production log (correct, defects, etc.)
- `count` (integer, optional, nullable, e.g. `1000`) — The total count of items produced during this production log
- `nominalSpeed` (number, optional, nullable, e.g. `60`) — The nominal speed of the machine during this production log (using float for speed)
- `start` (string (date-time), optional, nullable, e.g. `"2024-01-01T08:00:00"`) — The start time of the production log
- `end` (string (date-time), optional, nullable, e.g. `"2024-01-01T16:00:00"`) — The end time of the production log
- `machine` (object, optional, nullable) — The machine associated with the production log
  - `id` (integer, optional, nullable, > 0, e.g. `1`) — The id of the machine
  - `name` (string, optional, nullable, e.g. `"Machine 1"`) — The name of the machine
- `sku` (object, optional, nullable) — The SKU associated with the production log
  - `id` (string, optional, nullable, e.g. `"9ce2c6b4-a1f4-4bf2-b5c8-10436d1018cc"`) — The id of the sku
  - `name` (string, optional, nullable, e.g. `"sku 1"`) — The name of the sku
- `operator` (object, optional, nullable) — The operator involved in this production log
  - `firstName` (string, required, e.g. `"Pérez"`) — The operator's first name
  - `lastName` (string, required, e.g. `"Sánchez"`) — The operator's last name
- `workOrder` (string, optional, nullable, e.g. `"work order 1"`) — The name of the work order associated with this production log

### Responses

#### 204 — Successful Response

#### 422 — Validation Error

Type: object (`HTTPValidationError`)

- `detail` (array of object, optional)
  - `loc` (array of string | integer, required)
  - `msg` (string, required)
  - `type` (string, required)

### Example request

```bash
curl -X PATCH 'https://draco.prod.pulsarml.com/v1/production-logs/<production_log_id>' \
  -H 'x-api-key: <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "correct",
    "count": 1000,
    "nominalSpeed": 60,
    "start": "2024-01-01T08:00:00",
    "end": "2024-01-01T16:00:00",
    "workOrder": "work order 1"
  }'
```