Import and invite learners
Create learners in bulk, give them content and optionally send invites.
POST https://cotlet.dev/api/v1/thought-industries/learners
Runs Users > Learners > gear icon > Bulk Import Learners for you. Each learner needs first_name, last_name and email. All content_ids are given to every learner in the batch: courses, webinars, articles and single SCO content. One call takes up to 1,000 learners. The app queues the import, so enrollments show up a few minutes later in list_content_actions. A learner who already exists gets no invite, and content access can only be removed one learner at a time afterwards. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| learners array required | array | Objects with first_name, last_name and email, up to 1,000. |
| content_ids array | array | Content IDs from list_courses that every learner in the batch gets. |
| send_invite boolean | boolean | Send an email invitation to new learners. Default: false. |
| invite_message string | string | Message added to the invitation email. |
Request
curl -X POST https://cotlet.dev/api/v1/thought-industries/learners \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"learners":[{"first_name":"Priya","last_name":"Nair","email":"priya.nair@example.com"},{"first_name":"Tom","last_name":"Becker","email":"tom.becker@example.com"}],"content_ids":["8f2a1c34-5b6d-4e7f-9a01-2b3c4d5e6f70"],"send_invite":true,"invite_message":"Welcome to Northwind Academy. Start with Onboarding 101."}' result = client.call("thought-industries", "import_learners", {"learners":[{"first_name":"Priya","last_name":"Nair","email":"priya.nair@example.com"},{"first_name":"Tom","last_name":"Becker","email":"tom.becker@example.com"}],"content_ids":["8f2a1c34-5b6d-4e7f-9a01-2b3c4d5e6f70"],"send_invite":True,"invite_message":"Welcome to Northwind Academy. Start with Onboarding 101."}) const result = await cotlet.call('thought-industries', 'import_learners', {"learners":[{"first_name":"Priya","last_name":"Nair","email":"priya.nair@example.com"},{"first_name":"Tom","last_name":"Becker","email":"tom.becker@example.com"}],"content_ids":["8f2a1c34-5b6d-4e7f-9a01-2b3c4d5e6f70"],"send_invite":true,"invite_message":"Welcome to Northwind Academy. Start with Onboarding 101."}); cotlet call thought-industries import_learners --data '{"learners":[{"first_name":"Priya","last_name":"Nair","email":"priya.nair@example.com"},{"first_name":"Tom","last_name":"Becker","email":"tom.becker@example.com"}],"content_ids":["8f2a1c34-5b6d-4e7f-9a01-2b3c4d5e6f70"],"send_invite":true,"invite_message":"Welcome to Northwind Academy. Start with Onboarding 101."}' Example response
{
"status": "queued",
"learners": 2,
"content": [
"Onboarding 101"
],
"invites": "sent"
}