Skip to main content
https://.thoughtindustries.com

Bulk Content Assignment

Assigns content to multiple users in a single request

Assigns content to multiple users in a single request.

POSThttps://example.thoughtindustries.com/incoming/v2/users/bulkContentAssignment

Example request — assign a course by user ID (append)

curl -X POST "https://example.thoughtindustries.com/incoming/v2/users/bulkContentAssignment" \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "users": [
    {
      "id": "3f9a2b18-7c4d-4e2a-9b1f-0c5d6e7f8a90",
      "courseIds": ["8f2a1c34-5b6d-4e7f-9a01-2b3c4d5e6f70"],
      "replaceCourseAccess": false,
      "replaceLearningPathAccess": false
    }
  ]
}'

Example request — assign courses and learning paths by email (replace existing access)

curl -X POST "https://example.thoughtindustries.com/incoming/v2/users/bulkContentAssignment" \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "users": [
    {
      "email": "[email protected]",
      "courseIds": ["8f2a1c34-5b6d-4e7f-9a01-2b3c4d5e6f70"],
      "replaceCourseAccess": true,
      "learningPathIds": ["1d9e8f70-4a3b-4c2d-8e1f-0a9b8c7d6e5f"],
      "replaceLearningPathAccess": true
    }
  ]
}'

Example request — bulk assign to multiple users (mixed identifiers)

curl -X POST "https://example.thoughtindustries.com/incoming/v2/users/bulkContentAssignment" \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "users": [
    {
      "id": "3f9a2b18-7c4d-4e2a-9b1f-0c5d6e7f8a90",
      "courseIds": ["8f2a1c34-5b6d-4e7f-9a01-2b3c4d5e6f70"],
      "replaceCourseAccess": false,
      "replaceLearningPathAccess": false
    },
    {
      "externalCustomerId": "CRM-88213",
      "learningPathIds": ["1d9e8f70-4a3b-4c2d-8e1f-0a9b8c7d6e5f"],
      "replaceCourseAccess": false,
      "replaceLearningPathAccess": true
    }
  ]
}'

Parameters

Requires the users.edit permission.

NameTypeRequiredLocationDescription
usersBulkContentAssignmentUser[]YesbodyArray of user–content assignment objects (see below).

Each object in users (BulkContentAssignmentUser):

FieldTypeRequiredDescription
iduuidOne of id / email / externalCustomerIdID of the user to assign content to.
emailstringOne of id / email / externalCustomerIdEmail of the user to assign content to.
externalCustomerIdstringOne of id / email / externalCustomerIdExternal customer ID of the user to assign content to.
courseIdsuuid[]NoCourse UUIDs to grant the user access to.
replaceCourseAccessbooleanYesIf true, replaces the user's existing course access with courseIds; if false, appends to it.
learningPathIdsuuid[]NoLearning path UUIDs to grant the user access to.
replaceLearningPathAccessbooleanYesIf true, replaces the user's existing learning path access with learningPathIds; if false, appends to it.

Example response

{
  "updatedRecordCount": 0,
  "errors": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "identifier": "string",
      "error": "string",
      "record": "string"
    }
  ]
}

Response fields

FieldTypeDescription
updatedRecordCountintegerNumber of records successfully updated.
errorsobject[]Per-record errors for entries that could not be processed.
errors.iduuidIdentifier associated with the failed record, when resolvable.
errors.identifierstringThe identifier value from the input record.
errors.errorstringHuman-readable message describing why the record failed.
errors.recordstringRaw input record associated with the failure.