# Update many shifts at once

Queues the work of applying one set of changes to many shifts and returns a token
for the queued job. **Nothing has changed by the time the response comes back**,
and the token is not something you can poll - read the shifts back to confirm.
Choose the shifts with `applyTo`: `selected` acts on the ids in `selected`,
anything else acts on every shift in the event, narrowed by `filter` if one is
sent. `applyTo` is required and a request without it is a 422.
Every other field is a value to set on each shift, and takes the same shapes as on
a single update. Two suffixes change how a field is treated: `<field>:use_default`
as true drops that field from the update and leaves each shift's own value alone,
and `<field>:override` as true replaces a value a shift's template locks, for a
caller allowed to override locked fields. Shifts the caller cannot update are
skipped, as are shifts whose own validation refuses the change; neither is
reported back.
**This endpoint also accepts file uploads**, for the fields that hold one - send
the request as `multipart/form-data` with the file under the field's own name and
the rest of the fields alongside it, and the field is set to the URL the file was
stored at. The body is documented as JSON below because an operation carries one
content type and JSON is the common case; the multipart form takes the same fields.

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

## Path parameters:

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

## Header parameters:

  - `Rosterfy-Platform` (string)

## Request fields (application/json):

  - `name` (string)
    What the shift is called. Shown to people choosing shifts.

  - `timezone` (string)
    The timezone the start and end times are given in, as an IANA name such as `Australia/Melbourne`.

  - `min_demand` (integer)
    The fewest people the shift needs. Defaults to 1.

  - `max_demand` (integer)
    The most people the shift can take. Applications are refused once it is full.

  - `leader_demand` (integer)
    How many of those places are for leaders. Defaults to 0.

  - `start_timestamp` (string)
    When the shift starts, as `YYYY-MM-DD HH:MM:SS` in the shift's timezone.

  - `end_timestamp` (string)
    When the shift ends, as `YYYY-MM-DD HH:MM:SS` in the shift's timezone.

  - `is_virtual` (boolean)
    Whether the shift happens online rather than at a place.

  - `event_shift_type_id` (integer)
    The shift type, which groups shifts for reporting and for the per-type application limits an event can set.

  - `shift_status_default` (integer)
    The status a new application on this shift starts at.

  - `shift_confirmed_status_default` (integer)
    The status an application moves to when it is confirmed.

  - `shift_rejected_status_default` (integer)
    The status an application moves to when it is rejected.

  - `shift_can_withdraw_default` (boolean)
    Whether people can withdraw from the shift themselves.

  - `shift_can_withdraw_limit` (integer)
    How long before the shift starts withdrawing stops being allowed, in seconds.

  - `shift_can_confirm` (boolean)
    Whether people can confirm their own place on the shift.

  - `shift_can_confirm_limit` (integer)
    How long before the shift starts confirming stops being allowed, in seconds.

  - `shift_checked_in_status_default` (integer)
    The status an assignment moves to on check-in.

  - `shift_checked_out_status_default` (integer)
    The status an assignment moves to on check-out.

  - `address` (object)
    Where the shift happens, as an address object. Required on a create unless the shift is virtual or takes its location from a venue.

  - `address.street_address_1` (string)

  - `address.street_address_2` (string)

  - `address.street_address_3` (string)

  - `address.city` (string)

  - `address.postcode` (string)

  - `address.region` (string)

  - `address.country` (string)

  - `address.latitude` (string)

  - `address.longitude` (string)

  - `headcount_location_venue_id` (integer)
    The venue the shift happens at. Sending one takes the location from the venue instead of from `address`.

  - `certificate_id` (integer)
    A certificate awarded for attending the shift.

  - `shift_application_form_id` (integer)
    The form someone fills in when applying for this shift.

  - `allow_application_form_resubmit` (boolean)
    Whether someone can submit the application form again.

  - `shift_precheckin_form_id` (integer)
    The form filled in at pre-check-in.

  - `shift_checkin_form_id` (integer)
    The form filled in at check-in.

  - `shift_attended_form_id` (integer)
    The form filled in once the shift has been attended.

  - `shift_checkout_form_id` (integer)
    The form filled in at check-out.

  - `shift_withdraw_form_id` (integer)
    The form filled in when withdrawing.

  - `visibility_show_groups` (array)
    Only members of these groups can see the shift.

  - `visibility_hide_groups` (array)
    Members of these groups cannot see the shift.

  - `visibility_show_roleoffer` (array)
    Only people holding one of these role offers can see the shift.

  - `apps_open_timestamp` (string)
    When applications open. Before this, applying is refused.

  - `apps_close_timestamp` (string)
    When applications close. After this, applying is refused.

  - `role_offer_id` (integer)
    The role offer this shift belongs to.

  - `role_offer_address` (boolean)
    Take the shift's location from the role offer rather than from `address`.

  - `shift_precheckin_open` (integer)
    How long before the shift starts pre-check-in opens, in seconds.

  - `max_group_demand` (integer)
    How many places a single group booking can take.

  - `group_booking_ttl` (integer)
    How long a group booking is held before it lapses, in seconds.

  - `max_group_size` (integer)
    The largest group that can book onto the shift.

  - `reserved_expiry` (integer)
    How long a reserved place is held before it lapses, in seconds.

  - `self_checkin` (boolean)
    Whether people can check themselves in to the shift.

  - `self_checkin_open` (integer)
    How long before the shift starts self check-in opens, in seconds.

  - `self_checkin_close` (integer)
    How long after the shift starts self check-in closes, in seconds.

  - `self_checkout_close` (integer)
    How long after the shift ends self check-out closes, in seconds.

  - `checkin_close` (integer)
    How long after the shift ends check-in closes, in seconds.

  - `geofence_checkin_limit` (integer)
    How close to the shift's location someone has to be to check in, in metres.

  - `checkin_visible_attributes` (array)
    Which of a person's attributes are shown on the check-in screen.

  - `training_ids` (array)
    Training people must have completed before they can be placed on the shift.

  - `post_feedback_form` (integer)
    The form people fill in about the shift afterwards.

  - `shift_leader_feedback_form_id` (integer)
    The form a leader fills in about the shift.

  - `shift_enable_waitlist_default` (boolean)
    Whether people can join a waitlist once the shift is full.

  - `max_waitlist` (integer)
    How many people the waitlist holds.

  - `publish` (boolean)
    Whether the shift is visible to people who can apply for it. Ignored from a caller who cannot publish shifts.

  - `public` (boolean)
    Whether the shift can be seen without signing in, on a public event.

  - `is_cancelled` (boolean)
    Whether the shift is cancelled. Cancelling this way does not move anyone already on the shift; use the cancel endpoint for that.

  - `sort_order` (integer)
    Where the shift sits when shifts are shown in a fixed order.

  - `minimum_dob` (string)
    Latest date of birth allowed on the shift. Cannot be sent together with `minimum_age`.

  - `minimum_age` (string)
    Youngest age allowed on the shift, as `years:months`.

  - `maximum_dob` (string)
    Earliest date of birth allowed on the shift. Cannot be sent together with `maximum_age`.

  - `maximum_age` (string)
    Oldest age allowed on the shift, as `years:months`.

  - `price_excluding_tax` (number)
    What taking this shift costs the person, before tax.

  - `tax_percentage` (integer)
    Tax charged on the price, as a percentage between 0 and 100.

  - `cost_description` (string)
    Free text shown alongside the price.

  - `applyTo` (string, required)
    Send `selected` to act only on the shifts named in `selected`. Any other value acts on every shift the caller can see, narrowed by `filter` if one is sent, and narrowed to the event in the URL. Required, but the value is not checked against a list, so a typo is accepted and treated as "everything".

  - `selected` (array)
    The IDs of the shifts to update. Required in practice when `applyTo` is `selected`, but nothing validates that: omitting it still returns a queue token and the background work then does nothing.

  - `filter` (object)
    The same filter object the listing takes, used to choose the shifts to act on when `applyTo` is not `selected`.

  - `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):

  - `queue` (string)

