> 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/sequences/write-operations/assign-users-to-sequences.md). Agents can also search and read this documentation through its [MCP server](https://docs.vomevolunteer.com/~gitbook/mcp).

# Assign users to sequences

The endpoint assigns one or more users to one or more sequences. If multiple `user_ids` are provided, multiple users are assigned. If multiple `sequence_ids` are provided, each user is assigned to each sequence.

The endpoint only accepts published sequences that belong to your institution. If an assignment already exists, it is returned as part of the response and counted under `existing_count`. If a new assignment is created, it is counted under `created_count`.

The API additionally triggers: sequence volunteer notifications to users

**Endpoint**\
`POST /api/sequences/bulk-assign/`

**Payload sample**

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

**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",
      "sequence_id": "a167ac3f-952e-417d-85e6-6d4f74306950"
    },
    {
      "id": "61a1f40d-1f5a-49f0-b3e7-34ac3f5dc6d7",
      "user_id": "de89a718-51f6-46e2-800f-56709879f179",
      "sequence_id": "a167ac3f-952e-417d-85e6-6d4f74306950"
    },
    {
      "id": "a3cc6f4c-d0ed-44e5-9a94-c2e30d540f70",
      "user_id": "5a8046f9-e698-49b7-b69f-a732ff13502b",
      "sequence_id": "a167ac3f-952e-417d-85e6-6d4f74306950"
    }
  ]
}
```
