# Add many people to a shift

Queues the work of putting a set of people on one shift and returns a token for
the queued job. **Nothing is created by the time the response comes back**, and
the token is not something you can poll - confirm the outcome by listing the
shift's assignments.
Choose the people either by naming them in `selected`, or by sending
`applyTo` with a `filter` describing them. A request whose fields are the right
shape always returns a queue token, whether or not the background work then
succeeds: a person who cannot go on the shift is skipped rather than reported.
**The same action is published on two paths and they name the shift differently.**
`/event/{event_id}/shift/{shift_id}/user/mass-create` takes it from the URL, and
ignores `event_shift_id` if you send one. `/event/{event_id}/shift/user/mass-create`
takes it from `event_shift_id` instead - and reads that **only from the query
string**, as `?event_shift_id=123`. Sending it in the JSON body is not seen and
the request comes back as a 404. Prefer the first form unless you have a reason
not to.
Either way the shift has to belong to the event in the URL; a mismatch is a 404.

Endpoint: POST /api/v2/event/{event_id}/shift/user/mass-create
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):

  - `event_shift_status_id` (integer, required)
    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.

  - `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.

  - `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.

  - `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.

  - `event_shift_id` (integer)
    The shift to add people to. Read **only** on `/event/{event_id}/shift/user/mass-create`, and only from the query string - see the description. Ignored on the `/event/{event_id}/shift/{shift_id}/user/mass-create` form, which takes the shift from the URL.

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

  - `selected` (array)
    The IDs to act on. On the mass add these are user IDs; on the mass delete they are shift assignment IDs. 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` (array)
    The same filter object the listings take, used to choose the records to act on when `applyTo` is not `selected`.

  - `swap_from_shift_id` (integer)
    Move everyone selected off this shift as part of the same request.

## Response 200 fields (application/json):

  - `queue` (string)

