# Assign a module to many users

Assigns the training module in the URL to a set of users at once.
**This write is queued.** The response does not contain the assignments and
does not mean they exist yet - it means the request was accepted and the work
is running in the background. The payload is a single queue field holding an
identifier for that work. There is no endpoint that resolves the identifier,
so confirm the outcome by listing the module's assigned users.
Choose the users either way round:
- Send `applyTo` as `selected` with `selected` holding the user IDs to add.
- Send any other `applyTo` value to add every user the caller can see, narrowed
by an optional `filter`, in the same form the user listing accepts.

Users already assigned to the module are skipped, so the same request can be
repeated safely. A request naming no users still succeeds and assigns nobody.
Invalid input returns a 422 before anything is queued.

Endpoint: PUT /api/v2/training/{training_id}/user
Version: 2.0.0
Security: default

## Path parameters:

  - `training_id` (integer, required)
    The ID of the training module.

## Header parameters:

  - `Rosterfy-Platform` (string)

## Request fields (application/json):

  - `applyTo` (string, required)
    Send `selected` to assign the module to the users named in selected. Any other value assigns it to every user the caller can see, narrowed by filter if one is sent.

  - `selected` (array)
    The IDs of the users to assign. Required when applyTo is `selected`, and ignored otherwise.

## Response 200 fields (application/json):

  - `queue` (string)

