Developer docs
De Pluvo API geeft je programmatische toegang tot je leeromgeving. Beheer gebruikers, groepen, trainingen, inschrijvingen en certificaten vanuit je eigen systemen.
De API is gebaseerd op GraphQL. Je bepaalt zelf welke data je opvraagt of muteert, zonder overbodige velden. Authenticatie verloopt via OAuth 2.0 met client credentials. Webhooks houden je systemen real-time op de hoogte van wijzigingen.
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
Adds one or more users as participants to a training. Supports both id and ref for trainings and users.
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
Removes one or more users 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 inidsLinkedViaObject/refsLinkedViaObject. Remove the user from the group or enrollment instead.
Add trainers
You can add users as trainers by setting role: TRAINER:
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
idandrefwork for identifying trainings and users. - The response clearly reports which users were added, already present, or failed.
- Use
sendInvites: falsefor 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
roleparameter acceptsPARTICIPANTorTRAINER.