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

Bulk Update Completion Criteria

Bulk-creates or updates completion criteria for one or more courses in a single request

Bulk-creates or updates completion criteria for one or more courses in a single request.

POSThttps://example.thoughtindustries.com/incoming/v2/content/completion-criteria/bulk/update

Example request — update an existing criterion's threshold

curl -X POST "https://example.thoughtindustries.com/incoming/v2/content/completion-criteria/bulk/update" \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "criteria": [
    {
      "id": "d4e5f6a7-1829-4c3d-8e4f-5a6b7c8d9e01",
      "coursePercentViewed": 95
    }
  ]
}'

Example request — create a new criterion (omit id)

curl -X POST "https://example.thoughtindustries.com/incoming/v2/content/completion-criteria/bulk/update" \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "criteria": [
    {
      "courseId": "8f2a1c34-5b6d-4e7f-9a01-2b3c4d5e6f70",
      "type": "courseAssignmentComplete",
      "courseAssignmentComplete": "b2c3d4e5-6f70-4a1b-8c2d-3e4f5a6b7c80"
    }
  ]
}'

Example request — change a criterion's type

curl -X POST "https://example.thoughtindustries.com/incoming/v2/content/completion-criteria/bulk/update" \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "criteria": [
    {
      "id": "d4e5f6a7-1829-4c3d-8e4f-5a6b7c8d9e01",
      "type": "videoPercentViewed",
      "videoPercentViewed": 90,
      "videoTopicId": "c3d4e5f6-7081-4b2c-9d3e-4f5a6b7c8d90"
    }
  ]
}'

Parameters

Requires the courses.edit permission. Omit id to create a new criterion; provide id to update an existing one. When changing type, fields belonging to the previous type are cleared automatically.

NameTypeRequiredLocationDescription
criteriaUpdateCourseCompletionCriteria[]YesbodyArray of completion criteria objects to create or update (see below).

Each object in criteria (UpdateCourseCompletionCriteria):

FieldTypeRequiredDescription
iduuidNoUUID of the criterion to update. Omit to create a new criterion.
courseIduuidRequired when creating (no id)UUID of the course the criterion applies to.
typeCourseCompletionCriteriaTypeNo (required when creating)The completion rule. One of: coursePercentViewed, articlePercentViewed, videoPercentViewed, articleTimeViewedInSeconds, courseTopicViewed, courseAssessmentPassed, courseAssignmentComplete, courseMeetingAttended, scormComplete, xApiComplete, surveyGizmoComplete, bongoAssignmentCompleted, proctoredTopicComplete.
coursePercentViewedintegerRequired when type = coursePercentViewedPercentage of course pages viewed (1–100).
articlePercentViewedintegerRequired when type = articlePercentViewedPercentage of an article viewed (1–100).
videoPercentViewedintegerRequired when type = videoPercentViewedPercentage of a video viewed (1–100). Also requires videoTopicId.
videoTopicIduuidRequired when type = videoPercentViewedVideo topic the percentage applies to.
articleTimeViewedInSecondsintegerRequired when type = articleTimeViewedInSecondsTime spent viewing an article, in seconds.
courseTopicVieweduuidRequired when type = courseTopicViewedTopic (page) that must be viewed.
courseAssessmentPasseduuidRequired when type = courseAssessmentPassedAssessment topic that must be passed.
courseAssignmentCompleteuuidRequired when type = courseAssignmentCompleteAssignment topic that must be completed.
courseMeetingAttendeduuidRequired when type = courseMeetingAttendedMeeting topic that must be attended.
scormCompleteuuidRequired when type = scormCompleteSCORM topic that must be completed.
xApiCompleteuuidRequired when type = xApiCompletexAPI topic that must be completed.
surveyGizmoCompleteuuidRequired when type = surveyGizmoCompleteSurveyGizmo/Alchemer topic that must be completed.
bongoAssignmentCompleteduuidRequired when type = bongoAssignmentCompletedBongo assignment topic that must be completed.
proctoredTopicCompleteuuidRequired when type = proctoredTopicCompleteProctored topic that must be completed.

Example response

{
  "createdCount": 0,
  "updatedCount": 0,
  "errors": [
    {
      "courseId": "00000000-0000-0000-0000-000000000000",
      "type": "coursePercentViewed",
      "error": "string",
      "record": "string"
    }
  ],
  "warnings": [
    "string"
  ]
}

Response fields

FieldTypeDescription
createdCountintegerNumber of completion criteria records created during this operation.
updatedCountintegerNumber of completion criteria records updated during this operation.
errorsBulkCompletionCriteriaError[]Array of errors encountered while processing individual criteria records.
errors.courseIduuidID of the course associated with the failed criteria record.
errors.typeCourseCompletionCriteriaTypeCompletion criteria type that failed to be created or updated (e.g., coursePercentViewed).
errors.errorstringHuman-readable message describing why the criteria record failed.
errors.recordstringSerialized representation of the criteria record that caused the error.
warningsstring[]Non-fatal warnings generated during the bulk update, such as skipped or deprecated fields.