Overview
While the standard way to give users access to a training is through Offers and Enrollments, you can also add participants directly to a training. This is useful for:
- Bulk-assigning users to trainings via an integration
- Adding users to mandatory trainings without a registration flow
- Managing trainer assignments
Add participants to a training
mutation {
addUsersToTraining(
trainingRef: "safety-2024"
userRefs: ["EMP-001", "EMP-002", "EMP-003"]
sendInvites: false
role: PARTICIPANT
) {
addedIds
addedRefs
alreadyAddedIds
alreadyAddedRefs
failedIds
failedRefs
}
}
Parameters
| Parameter | Type | Description |
|---|
trainingId | UUID | Training UUID (use this OR trainingRef) |
trainingRef | String | Training external ref (use this OR trainingId) |
userIds | [UUID!] | User UUIDs (use this OR userRefs) |
userRefs | [String!] | User external refs (use this OR userIds) |
sendInvites | Boolean | Send notification to users (default: true) |
role | TrainingRole | PARTICIPANT (default) or TRAINER |
Remove participants from a training
mutation {
removeUsersFromTraining(
trainingRef: "safety-2024"
userRefs: ["EMP-003"]
) {
removedIds
removedRefs
alreadyRemovedIds
alreadyRemovedRefs
idsLinkedViaObject
refsLinkedViaObject
failedIds
failedRefs
}
}
Users who are linked to the training via a group or offer enrollment cannot be removed directly. These are returned in idsLinkedViaObject / refsLinkedViaObject. Remove the user from the group or enrollment instead.
Add trainers
mutation {
addUsersToTraining(
trainingId: "uuid-here"
userIds: ["trainer-uuid"]
role: TRAINER
) {
addedIds
failedIds
}
}
When to use direct assignment vs. enrollment
| Scenario | Recommended approach |
|---|
| Users register themselves | Use Offers & Enrollments |
| Admin assigns users one by one | Use Offers & Enrollments |
| Bulk-assign users from HRM system | Use addUsersToTraining (simpler) |
| Mandatory training for all users | Use addUsersToTraining (no registration needed) |
| Track attendance and enrollment status | Use Offers & Enrollments (more control) |
| Assign trainer to a learning journey | Use addUsersToTraining with role: TRAINER |
Notes
- Both
id and ref work for identifying trainings and users. - The response clearly reports which users were added, already present, or failed.
- Use
sendInvites: false for bulk operations to avoid notification spam. - Users added directly can always be removed directly. Users added via groups or enrollments must be removed through those mechanisms.
- The
role parameter accepts PARTICIPANT or TRAINER.