> 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
    }
  ]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.vomevolunteer.com/resources/editor-4/write-operations/assign-users-to-shifts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
