Assignments

Prev Next

Assignment Subscription Events

Subscription key: assignment_subscription

Events delivered to your assignment_subscription URL cover two areas: assignment lifecycle events and enrolment events.


assignment.* - Assignment Events

Fired when an assignment is created, changed, or removed. The users array contains all users affected by the action.

Event types: assignment.{event} - the suffix is determined by the source event. Common values include assignment.assigned, assignment.updated, assignment.removed.

Field Type Nullable Description
eventType string No assignment.{event}
tenantId string No Your Thrive tenant identifier
reason string Yes Reason for the assignment change, if provided
assignment object No The assignment record
assignment.id string Yes Assignment ID
assignment.audienceId string Yes Target audience ID
assignment.primaryContentId string Yes ID of the assigned content item
assignment.completionPeriod number Yes Completion period in days
assignment.recurring boolean Yes Whether this is a recurring assignment
assignment.recurrence string Yes Recurrence schedule if recurring
content object Yes The assigned content item. Omitted if no primaryContentId is present on the assignment.
content.id string No Content ID
content.title string Yes Content title. May be null if lookup failed
content.type string Yes Content type. May be null if lookup failed
content.urls string[] No Full URLs on each of your configured tenant domains
users object[] No Users affected by this assignment action
users[].id string No User ID
users[].reference string Yes External reference (e.g. HR system ID). May be null if not set
users[].email string Yes User email address. May be null if lookup failed
users[].firstName string Yes User’s first name.
users[].lastName string Yes User’s last name.
createdAt string No ISO 8601 timestamp of when the event occurred on the platform
dispatchedAt string No ISO 8601 timestamp of when this webhook was dispatched

Example payload (assignment.assigned):

{
  "eventType": "assignment.assigned",
  "tenantId": "acme-corp",
  "reason": "Mandatory compliance training",
  "assignment": {
    "id": "asgn_001",
    "audienceId": "aud_hr",
    "primaryContentId": "64a1b2c3d4e5f6789abcdef0",
    "completionPeriod": 30,
    "recurring": false,
    "recurrence": null
  },
  "content": {
    "id": "64a1b2c3d4e5f6789abcdef0",
    "title": "Health & Safety Induction",
    "type": "course",
    "urls": ["https://acme.learn.link/content/64a1b2c3d4e5f6789abcdef0"]
  },
  "users": [
    { "id": "usr_abc123", "reference": "EMP-00042", "email": "jane.smith@acme.com", "firstName": "Jane", "lastName": "Smith" },
    { "id": "usr_def456", "reference": "EMP-00043", "email": "john.doe@acme.com", "firstName": "John", "lastName": "Doe" }
  ],
  "createdAt": "2024-03-15T10:30:00.000Z",
  "dispatchedAt": "2024-03-15T10:30:01.234Z"
}

enrolment.* - Enrolment Events

Fired when users are enrolled in, or removed from, a content assignment.

Event types: enrolment.created · enrolment.users-created · enrolment.updated · enrolment.archived · enrolment.users-archived

Event When it fires
enrolment.created A new enrolment is created
enrolment.users-created Users are added to an existing enrolment
enrolment.updated An enrolment record is updated
enrolment.archived An enrolment is archived
enrolment.users-archived Users are removed from an enrolment
Field Type Nullable Description
eventType string No One of the 5 enrolment event types
tenantId string No Your Thrive tenant identifier
assignment object No The parent assignment
assignment.id string No ID of the parent assignment
users object[] Yes Absent if no users were present, otherwise an array of enriched user objects.
users[].id string No User ID
users[].reference string Yes External reference (e.g. HR system ID). May be null if not set
users[].email string Yes User email address. May be null if lookup failed
users[].firstName string Yes User’s first name. May be null if lookup failed
users[].lastName string Yes User’s last name. May be null if lookup failed
content object Yes The enrolled content. Omitted if no content ID was present in the message. If the content lookup fails, a partial object with id and urls is sent.
content.id string No Content ID
content.title string Yes Content title. May be null if lookup failed
content.type string Yes Content type. May be null if lookup failed
content.urls string[] No Full URLs on each of your configured tenant domains
createdAt string No ISO 8601 timestamp of when the event occurred on the platform
dispatchedAt string No ISO 8601 timestamp of when this webhook was dispatched

Example payload (enrolment.users-created):

{
  "eventType": "enrolment.users-created",
  "tenantId": "acme-corp",
  "assignment": {
    "id": "asgn_001"
  },
  "users": [
    { "id": "usr_abc123", "reference": "EMP-00042", "email": "jane.smith@acme.com", "firstName": "Jane", "lastName": "Smith" }
  ],
  "content": {
    "id": "64a1b2c3d4e5f6789abcdef0",
    "title": "Health & Safety Induction",
    "type": "course",
    "urls": ["https://acme.learn.link/content/64a1b2c3d4e5f6789abcdef0"]
  },
  "createdAt": "2024-03-15T10:30:00.000Z",
  "dispatchedAt": "2024-03-15T10:30:01.234Z"
}