Enroll learner
Add a course or other content to an existing learner's Access tab.
POST https://cotlet.dev/api/v1/thought-industries/contents/{content_id}/learner/enroll
Opens the learner profile, goes to the Access tab and clicks Add Content for the content_id. The content then shows in the learner's access widget on their dashboard, and the Content Actions Log records an enrollment with the source manager_course_enrollment. Adding content the learner already has is refused. Check seats with get_course first. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| learner string required | string | Learner email or learner_id from list_learners. |
| content_id string required | string | Course or other content ID from list_courses. |
Request
curl -X POST https://cotlet.dev/api/v1/thought-industries/contents/4b1c2d3e-6a7b-4c8d-9e0f-1a2b3c4d5e6f/learner/enroll \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"learner":"priya.nair@example.com"}' result = client.call("thought-industries", "enroll_learner", {"learner":"priya.nair@example.com","content_id":"4b1c2d3e-6a7b-4c8d-9e0f-1a2b3c4d5e6f"}) const result = await cotlet.call('thought-industries', 'enroll_learner', {"learner":"priya.nair@example.com","content_id":"4b1c2d3e-6a7b-4c8d-9e0f-1a2b3c4d5e6f"}); cotlet call thought-industries enroll_learner --data '{"learner":"priya.nair@example.com","content_id":"4b1c2d3e-6a7b-4c8d-9e0f-1a2b3c4d5e6f"}' Example response
{
"learner_id": "3f9a2b18-7c4d-4e2a-9b1f-0c5d6e7f8a90",
"content_id": "4b1c2d3e-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"title": "Safety basics",
"status": "enrolled"
}