# Add an operator to the current shift (https://docs.pulsarml.com/v1/api-reference/realtime/post-realtime-machine_id-operator)

Assign an operator to the shift the machine is running at the moment of the call.

Both fields are required: `operatorId` and `start`, the moment the assignment begins. Use
it for clock-in at a terminal. This writes to the live shift and takes effect immediately.

## `POST /v1/realtime/{machine_id}/operator`

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

- `machine_id` (integer, required) — The machine ID.

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

Type: object (`AddOperatorToCurrentShiftRequestV1`)

- `operatorId` (integer, required, e.g. `1`) — The id of the operator to add to the machine's current shift.
- `start` (string (date-time), required, e.g. `"2024-01-01T08:00:00"`) — The start time of the operator assignment within the current shift.

### 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 POST 'https://draco.prod.pulsarml.com/v1/realtime/<machine_id>/operator' \
  -H 'x-api-key: <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
    "operatorId": 1,
    "start": "2024-01-01T08:00:00"
  }'
```