# Update a shift assignment

Moves an assignment to a new status, or records the check-in and check-out times,
break, demand, rating or note against it. Returns the assignment in the same
shape as reading it.
Every field is optional, so an empty body is a no-op that returns the assignment
unchanged. **Fields the account has not configured as attributes of an assignment
are dropped without comment** rather than rejected, so a misspelt field name
comes back as a 200 that changed nothing - read the response to confirm what
landed.
Three changes behave in ways worth knowing before you send them:
- **Making someone a leader of a shift that already has its full complement of
leaders returns a 405.** The body carries a `reference`, and a caller holding
the matching permission can repeat the request with that key in an `override`
**query parameter** - `?override[]=override_system_limits.event.shift.leader.demand` -
to raise the shift's leader demand and go ahead. Sending `override` in the JSON
body does not work.
- **On a shift belonging to a linked series, the first attempt returns a 400**
asking whether the change should apply to the later linked shifts too. Repeat
the request with `repeat` set to answer it; the `reference` in the body names
the field to send.
- Moving to a status the account treats as cancelled is refused unless the shift
itself is cancelled, and clearing `start_timestamp` while `end_timestamp` is
still set is refused. Both are a 422 naming the field.

`feedback` is kept only when the status being set is one the account treats as
not approved; sent with any other status it is discarded.
Beyond the fields listed here the endpoint also accepts the account's own
configured attributes for an assignment.
This endpoint honours the `trigger_automation` request option. It honours
`dry_run` **only for callers whose access allows it** - for anyone else the
option is ignored and the write goes ahead, with no sign in the response that a
preview was asked for. See **Request options**.

Endpoint: PUT /api/v2/event/{event_id}/shift/{shift_id}/user/{id}
Version: 2.0.0
Security: default

## Path parameters:

  - `event_id` (integer, required)
    The ID of the event.

  - `shift_id` (integer, required)
    The ID of the shift.

  - `id` (integer, required)
    The ID of the shift assignment.

## Header parameters:

  - `Rosterfy-Platform` (string)

## Request fields (application/json):

  - `event_shift_status_id` (integer)
    The status the assignment starts at, or moves to. Must be one of the account's own shift statuses; a status the account treats as cancelled is refused.

  - `is_leader` (boolean)
    Whether this person leads the shift. Setting it on a shift that already has as many leaders as it allows returns a 405 - see the description.

  - `feedback` (string)
    A note about this person's performance on the shift. Kept only when the status being set is one the account treats as not approved, and discarded otherwise.

  - `start_timestamp` (string)
    When the person checked in, as `YYYY-MM-DDTHH:MM`. Clearing it while an end time is still set is refused.

  - `end_timestamp` (string)
    When the person checked out, as `YYYY-MM-DDTHH:MM`.

  - `break` (number)
    Unpaid break taken during the shift, in minutes. Subtracted from the attended time.

  - `demand` (number)
    How many places on the shift this assignment takes up. Defaults to 1. Cannot exceed the places the shift has left.

  - `rating` (integer)
    A rating for how the person performed on this shift, 0 to 5.

  - `timesheet_status` (string)
    Where the assignment sits in timesheet approval.

  - `repeat` (boolean)
    Apply the same change to this person's assignments on every later shift linked to this one. Only meaningful on a shift that belongs to a linked series.

  - `custom_*` (string)
    A custom attribute, named by its code - custom_shirt_size, for example. The value follows the attribute's own type, so it may be a string, a number, a boolean or a list. See the custom attributes documentation.

## Response 200 fields (application/json):

  - `object` (object)

  - `object.id` (integer)

  - `object.event_shift_id` (integer)

  - `object.user_id` (integer)

  - `object.post_shift_feedback_form_completed_at` (string | null)

  - `object.precheckin_form_completed_at` (string | null)

  - `object.event_shift_status_id` (integer)

  - `object.demand` (integer)

  - `object.break` (string | null)

  - `object.start_timestamp` (string | null)

  - `object.end_timestamp` (string | null)

  - `object.cost` (string)

  - `object.cost_meta` (array)

  - `object.meta` (string | null)

  - `object.latitude` (string | null)

  - `object.longitude` (string | null)

  - `object.payment_authorization_id` (string | null)

  - `object.waitlist_notification_last_sent_at` (string | null)

  - `object.timesheet_status` (string)

  - `object.rating` (string | null)

  - `object.demand_expire` (string | null)

  - `object.deleted_at` (string | null)

  - `object.is_erased` (integer)

  - `object.created_at` (string)

  - `object.updated_at` (string)

  - `object.deleted_by` (string | null)

  - `nice` (object)

  - `nice.rrn` (string)

  - `nice.journey_step` (string)

  - `nice.journey_step_category` (string)

  - `nice.created_at` (string)

  - `nice.created_at__date` (string)

  - `nice.created_at__time` (string)

  - `nice.created_at__offset` (string)

  - `nice.created_at__offset_minutes` (integer)

  - `nice.created_at__dayofweek` (string)

  - `nice.event_shift_status_id` (string)

  - `nice.event_shift_status_id:value` (integer)

  - `nice.event_shift_status_id:array` (string)

  - `nice.payment_authorization_id` (string)

  - `nice.timesheet_status` (string)

  - `nice.timesheet_status:value` (string)

  - `nice.timesheet_status:array` (string)

  - `nice.updated_at` (string)

  - `nice.updated_at__date` (string)

  - `nice.updated_at__time` (string)

  - `nice.updated_at__offset` (string)

  - `nice.updated_at__offset_minutes` (integer)

  - `nice.updated_at__dayofweek` (string)

  - `nice.attended` (object)

  - `nice.attended.seconds` (integer)

  - `nice.attended.minutes` (integer)

  - `nice.attended.hours` (integer)

  - `nice.attended.pretty` (string)

  - `nice.attended_without_checkout` (object)

  - `nice.attended_without_checkout.seconds` (integer)

  - `nice.attended_without_checkout.minutes` (integer)

  - `nice.attended_without_checkout.hours` (integer)

  - `nice.attended_without_checkout.pretty` (string)

  - `nice.event_id` (integer)

  - `nice.event_name` (string)

  - `nice.is_event_leader` (boolean)

  - `nice.is_leader` (boolean)

  - `nice.checkin_location` (array)

  - `nice.shift_name` (string)

  - `nice.user_name` (string)

  - `nice.requires_pre_checkin` (boolean)

  - `nice.has_shift_attended_form` (boolean)

  - `nice.has_checkin_form` (boolean)

  - `nice.has_checkout_form` (boolean)

  - `nice.shift_checkin_visible_attributes` (array)

  - `nice.has_confirmed` (boolean)

  - `nice.has_rejected` (boolean)

  - `nice.has_cancelled` (boolean)

  - `relations` (object)

  - `permissions` (object)

  - `permissions.read` (boolean)

  - `permissions.update` (boolean)

  - `permissions.delete` (boolean)

  - `permissions.status_update` (boolean)

  - `permissions.precheckin` (boolean)

  - `permissions.checkin` (boolean)

  - `permissions.checkout` (boolean)

  - `permissions.submitAttendedForm` (boolean)

  - `attributes` (object)

  - `is_leader` (integer)

## Response 400 fields (application/json):

  - `message` (string)

  - `reference` (string)

## Response 405 fields (application/json):

  - `message` (string)

  - `reference` (string)

