Assign a training course to a group or department
PUT
/v1/training/courses/{courseId}/assignments
const url = 'https://api.varman.io/v1/training/courses/example/assignments';const options = { method: 'PUT', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"groupId":"example","department":"it","dueDate":"2027-01-31"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.varman.io/v1/training/courses/example/assignments \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "groupId": "example", "department": "it", "dueDate": "2027-01-31" }'Assigns a course to a group or a department (send exactly one of groupId and department) with an optional due date, or updates the due date. Once a course has any assignment, only members of assigned groups or departments must take it.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”courseId
required
string
Course id, e.g. sat-1
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
groupId
Group id (grp_…) that must take the course
string
department
Department that must take the course. Built-in values: admin, gov, hr, it, itsm, qms. Custom department names are also accepted; “none” is rejected.
string
Example
itdueDate
Optional due date (ISO 8601). Omit or send null for no due date.
string
Example
2027-01-31Responses
Section titled “Responses”The assignment