> For the complete documentation index, see [llms.txt](https://docs.vomevolunteer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vomevolunteer.com/resources/editor-4/write-operations/assign-users-to-shifts.md).

# Assign users to shifts

The endpoint assigns one or more users to one or more shifts. If multiple user\_ids are provided, multiple users are assigned. If multiple shift\_ids are provided, each user is assigned to each shift.

If notify\_user is true, the API additionally triggers:

* shift approval notifications to users

#### Endpoint

`POST /api/shifts/bulk-assign/`

#### Payload sample

```json
{
  "user_ids": [
    "06d9d2da-e99d-4c9a-9f95-c9acd55e9ee1",
    "de89a718-51f6-46e2-800f-56709879f179",
    "5a8046f9-e698-49b7-b69f-a732ff13502b"
  ],
  "shift_ids": [
    "a167ac3f-952e-417d-85e6-6d4f74306950"
  ],
  "notify_user": true
}
```

#### Response sample

```json
{
  "assignment_count": 3,
  "created_count": 3,
  "existing_count": 0,
  "enrollments": [
    {
      "id": "3b4e9461-8b34-4d5b-9c3d-48f6f85f0f01",
      "user_id": "06d9d2da-e99d-4c9a-9f95-c9acd55e9ee1",
      "shift_id": "a167ac3f-952e-417d-85e6-6d4f74306950",
      "created": true
    },
    {
      "id": "61a1f40d-1f5a-49f0-b3e7-34ac3f5dc6d7",
      "user_id": "de89a718-51f6-46e2-800f-56709879f179",
      "shift_id": "a167ac3f-952e-417d-85e6-6d4f74306950",
      "created": true
    },
    {
      "id": "a3cc6f4c-d0ed-44e5-9a94-c2e30d540f70",
      "user_id": "5a8046f9-e698-49b7-b69f-a732ff13502b",
      "shift_id": "a167ac3f-9528-417d-85e6-6d4f74306950",
      "created": true
    }
  ]
}
```
