Loopwise Docs
Webhooks

Assignment Webhooks

Detailed information about assignment and submission webhook events including assignment.created, assignment.updated, submission.submitted, submission.returned and submission.completed.

assignment.created

The assignment.created event is triggered when a teacher creates a new assignment in a course.

Event Properties

PropertyTypeDescription
idstringUnique identifier for the assignment (UUID)
namestringName of the assignment
descriptionstringDescription of the assignment
publishedbooleanIndicates whether the assignment is published
due_atstringDue date of the assignment (may be absent)
created_atstringTimestamp when the assignment was created
updated_atstringTimestamp when the assignment was last updated
courseobjectThe course this assignment belongs to (id, name, slug)

Example Payload

All timestamps are in ISO 8601 format and include a timezone offset (e.g. +08:00). Properties with empty values are omitted from the payload.

{
  "type": "assignment.created",
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Week 1 Homework",
    "description": "Complete the exercises from chapter 1.",
    "published": true,
    "due_at": "2024-03-28T13:45:30+08:00",
    "created_at": "2024-03-21T13:45:30+08:00",
    "updated_at": "2024-03-21T13:45:30+08:00",
    "course": {
      "id": "660e8400-e29b-41d4-a716-446655440111",
      "name": "Introduction to Programming",
      "slug": "intro-to-programming"
    }
  }
}

assignment.updated

The assignment.updated event is triggered when an existing assignment is modified. The payload shape is identical to assignment.created.

{
  "type": "assignment.updated",
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Week 1 Homework (extended deadline)",
    "description": "Complete the exercises from chapter 1.",
    "published": true,
    "due_at": "2024-04-04T13:45:30+08:00",
    "created_at": "2024-03-21T13:45:30+08:00",
    "updated_at": "2024-03-25T09:00:00+08:00",
    "course": {
      "id": "660e8400-e29b-41d4-a716-446655440111",
      "name": "Introduction to Programming",
      "slug": "intro-to-programming"
    }
  }
}

submission.submitted

The submission.submitted event is triggered when a student submits their work for an assignment.

A submission that was returned by the teacher can be re-submitted, so you may receive multiple submission.submitted events for the same submission id. Use submitted_at to distinguish attempts.

A teacher can also undo a returned or completed grading action, which moves the submission back to the submitted state without emitting a webhook event. If your integration mirrors submission states, treat the event stream as eventually consistent and reconcile periodically via the Admin API.

Submission events are delivered asynchronously with independent retries, so they may arrive out of order, and the data payload reflects the submission at delivery time — data.state can differ from the event type if the submission changed in between. Treat data.state and the timestamps (submitted_at, checked_at, updated_at) as authoritative rather than the arrival order.

Event Properties

PropertyTypeDescription
idstringUnique identifier for the submission (UUID)
statestringCurrent state of the submission (submitted)
titlestringTitle of the submission
contentstringText content of the submission
submitted_atstringTimestamp when the student submitted
checked_atstringTimestamp when grading was completed (absent until completed)
created_atstringTimestamp when the submission was created
updated_atstringTimestamp when the submission was last updated
assignmentobjectThe assignment being submitted to (id, name, course_id)
studentobjectThe submitting student (id, name, email)

Example Payload

{
  "type": "submission.submitted",
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "state": "submitted",
    "title": "My Week 1 Homework",
    "content": "Here is my answer to the exercises...",
    "submitted_at": "2024-03-22T10:30:00+08:00",
    "created_at": "2024-03-22T10:29:00+08:00",
    "updated_at": "2024-03-22T10:30:00+08:00",
    "assignment": {
      "id": "660e8400-e29b-41d4-a716-446655440111",
      "name": "Week 1 Homework",
      "course_id": "770e8400-e29b-41d4-a716-446655440222"
    },
    "student": {
      "id": "880e8400-e29b-41d4-a716-446655440333",
      "name": "Test Student",
      "email": "student@example.com"
    }
  }
}

submission.returned

The submission.returned event is triggered when a teacher returns a submission to the student for revision. In addition to all submission.submitted properties, the payload may include the current rating.

Additional Properties

PropertyTypeDescription
rateobjectThe rating given by the teacher (score, comment); absent if not rated

Example Payload

{
  "type": "submission.returned",
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "state": "returned",
    "title": "My Week 1 Homework",
    "content": "Here is my answer to the exercises...",
    "submitted_at": "2024-03-22T10:30:00+08:00",
    "created_at": "2024-03-22T10:29:00+08:00",
    "updated_at": "2024-03-23T08:00:00+08:00",
    "assignment": {
      "id": "660e8400-e29b-41d4-a716-446655440111",
      "name": "Week 1 Homework",
      "course_id": "770e8400-e29b-41d4-a716-446655440222"
    },
    "student": {
      "id": "880e8400-e29b-41d4-a716-446655440333",
      "name": "Test Student",
      "email": "student@example.com"
    },
    "rate": {
      "score": 2.5,
      "comment": "Please revise question 3 and resubmit."
    }
  }
}

submission.completed

The submission.completed event is triggered when a teacher finishes grading a submission. In addition to all submission.submitted properties, the payload may include the rating and the grader.

Additional Properties

PropertyTypeDescription
rateobjectThe rating given by the teacher (score, comment); absent if not rated
graderobjectThe teacher who graded the submission (id, name); absent if not graded

Example Payload

{
  "type": "submission.completed",
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "state": "checked",
    "title": "My Week 1 Homework",
    "content": "Here is my answer to the exercises...",
    "submitted_at": "2024-03-22T10:30:00+08:00",
    "checked_at": "2024-03-24T15:00:00+08:00",
    "created_at": "2024-03-22T10:29:00+08:00",
    "updated_at": "2024-03-24T15:00:00+08:00",
    "assignment": {
      "id": "660e8400-e29b-41d4-a716-446655440111",
      "name": "Week 1 Homework",
      "course_id": "770e8400-e29b-41d4-a716-446655440222"
    },
    "student": {
      "id": "880e8400-e29b-41d4-a716-446655440333",
      "name": "Test Student",
      "email": "student@example.com"
    },
    "rate": {
      "score": 4.5,
      "comment": "Great work!"
    },
    "grader": {
      "id": "990e8400-e29b-41d4-a716-446655440444",
      "name": "Test Teacher"
    }
  }
}

On this page