Assign Content to a Group
Make a course, program, SCORM package, or meetup visible—or mandatory—for a Skillhabit group via the External API.
What This Is For
You already have content published in Create and a manual group (or another group id). You want the same Visibility and targets outcome as in Create—without opening the UI for every cohort change.
Who This Is For
Integration developers automating onboarding curricula or compliance assignments. Admins still publish the content in Create.
Outcome
Group members see the content in Learn. When mandatory is true, Skillhabit treats the assignment as mandatory for that target (same idea as Create).
Steps
{BASE} = https://customer-api.baloolearning.com/v1 (or your host).
1. Find the Content Id
GET {BASE}/content/all
Authorization: Bearer {your-api-credential}Or fetch one item: GET {BASE}/content/{contentId}. Note contentId and type (COURSE, PROGRAM, SCORM, or MEETUP).
2. Assign to the Group
POST {BASE}/content/targets
Authorization: Bearer {your-api-credential}
Content-Type: application/jsonOptional visibility (visible in Learn, not mandatory):
{
"contentId": "d69c7cd1-9943-4f7f-b95f-0572b3458e9c",
"contentType": "COURSE",
"targetType": "GROUP",
"targetId": "7d6b7a10-2b2a-4a30-8a2e-39ad8e4f2b11",
"mandatory": false
}Mandatory for the group (API default for mandatory is true if you omit it):
{
"contentId": "d69c7cd1-9943-4f7f-b95f-0572b3458e9c",
"contentType": "COURSE",
"targetType": "GROUP",
"targetId": "7d6b7a10-2b2a-4a30-8a2e-39ad8e4f2b11",
"mandatory": true
}Optional startTime / finishTime are epoch milliseconds for a visibility window.
3. Assign to One User Instead
Omit targetType / targetId and send userId (defaults to a USER target):
{
"contentId": "d69c7cd1-9943-4f7f-b95f-0572b3458e9c",
"contentType": "COURSE",
"userId": "7f9c2a1e-4b8d-4f6a-9c2e-1d3b5a7e9c01",
"mandatory": true
}4. List or Remove Targets
GET {BASE}/content/targets?contentId=d69c7cd1-9943-4f7f-b95f-0572b3458e9cDELETE {BASE}/content/targets
Authorization: Bearer {your-api-credential}
Content-Type: application/json{
"contentId": "d69c7cd1-9943-4f7f-b95f-0572b3458e9c",
"contentType": "COURSE",
"targetType": "GROUP",
"targetId": "7d6b7a10-2b2a-4a30-8a2e-39ad8e4f2b11"
}Full schemas: Content Targeting.
Related
- Visibility in Learn — product rules learners feel
- Enrollment and Notifications
- Sync Manual Groups
- API reference → Content Targeting