> For the complete documentation index, see [llms.txt](https://developerdocs.instructure.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developerdocs.instructure.com/services/canvas/data-services/live-events/event-format/canvas/file.data_service_canvas_submission.md).

# Submission

## submission\_comment\_created <a href="#submission_comment_created" id="submission_comment_created"></a>

**Definition:** The event is emitted anytime an end user or API request comments on a submission.

**Trigger:** Triggered when a new comment is added to a submission.

### Payload Example:

```json
{
  "metadata": {
    "client_ip": "93.184.216.34",
    "context_account_id": "21070000000000079",
    "context_id": "21070000000000565",
    "context_role": "TeacherEnrollment",
    "context_sis_source_id": "2017.100.101.101-1",
    "context_type": "Course",
    "event_name": "submission_comment_created",
    "event_time": "2019-11-01T19:11:13.216Z",
    "hostname": "oxana.instructure.com",
    "http_method": "POST",
    "producer": "canvas",
    "referrer": "https://oxana.instructure.com/courses/565/gradebook/speed_grader?assignment_id=2974715&student_id=1740548",
    "request_id": "1dd9dc6f-2fb0-4c19-a6c5-7ee1bf3ed295",
    "root_account_id": "21070000000000001",
    "root_account_lti_guid": "VicYj3cu5BIFpoZhDVU4DZumnlBrWi1grgJEzADs.oxana.instructure.com",
    "root_account_uuid": "VicYj3cu5BIFpoZhDVU4DZumnlBrWi1grgJEzADs",
    "session_id": "ef686f8ed684abf78cbfa1f6a58112b5",
    "time_zone": "America/Los_Angeles",
    "url": "https://oxana.instructure.com/courses/410200/assignments/3964323/submissions/986036.text",
    "user_account_id": "21070000000000001",
    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
    "user_id": "21070000000012345",
    "user_login": "oxana@example.com",
    "user_sis_id": "456-T45"
  },
  "body": {
    "attachment_ids": [
      "54417187",
      "54417188"
    ],
    "body": "See the attached files",
    "created_at": "2019-11-01T19:11:13.216Z",
    "submission_comment_id": "19811981",
    "submission_id": "9987654",
    "user_id": "12345"
  }
}
```

### Event Body Schema

| Field                       | Description                                                                                            |
| --------------------------- | ------------------------------------------------------------------------------------------------------ |
| **attachment\_ids**         | Array of Canvas ids (as strings) of attachments for this comment.                                      |
| **body**                    | The text of the comment. NOTE: This field will be truncated to only include the first 8192 characters. |
| **created\_at**             | The timestamp when the comment was created.                                                            |
| **submission\_comment\_id** | The Canvas id of the new comment.                                                                      |
| **submission\_id**          | The Canvas id of the new submission.                                                                   |
| **user\_id**                | The Canvas id of the user who authored the comment.                                                    |

## submission\_created <a href="#submission_created" id="submission_created"></a>

**Definition:** The event is emitted anytime an end user or API request submits or re-submits an assignment. This applies to assignments and new quizzes, not classic quizzes. Use quiz\_submitted for classic quiz submissions.

**Trigger:** Triggered when an assignment or new quizzes submission gets updated and has not yet been submitted.

### Payload Example:

```json
{
  "metadata": {
    "client_ip": "93.184.216.34",
    "event_name": "submission_created",
    "event_time": "2019-11-01T19:11:21.419Z",
    "hostname": "oxana.instructure.com",
    "http_method": "POST",
    "producer": "canvas",
    "referrer": null,
    "request_id": "1dd9dc6f-2fb0-4c19-a6c5-7ee1bf3ed295",
    "root_account_id": "21070000000000001",
    "root_account_lti_guid": "VicYj3cu5BIFpoZhDVU4DZumnlBrWi1grgJEzADs.oxana.instructure.com",
    "root_account_uuid": "VicYj3cu5BIFpoZhDVU4DZumnlBrWi1grgJEzADs",
    "session_id": "ef686f8ed684abf78cbfa1f6a58112b5",
    "url": "https://oxana.instructure.com/api/lti/v1/tools/453919/grade_passback",
    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
  },
  "body": {
    "assignment_id": "21070000001234012",
    "attempt": 12,
    "body": "Test Submission Data",
    "grade": "Missing",
    "graded_at": "2019-11-01T19:11:21.419Z",
    "group_id": "120123",
    "late": false,
    "lti_assignment_id": "a1b2c3c4-z9x8-a1s2-q5w6-p9o8i7u6y5t6",
    "lti_user_id": "a1b2c3c4z9x8a1s2q5w6p9o8i7u6y5t6a2s3d4f5",
    "missing": false,
    "score": 99.5,
    "submission_id": "21070000012345567",
    "submission_type": "online_text_entry",
    "submitted_at": "2019-11-01T19:11:21.419Z",
    "updated_at": "2019-11-01T19:11:21.419Z",
    "url": "https://test.submission.net",
    "user_id": "21070000000014012",
    "workflow_state": "submitted"
  }
}
```

### Event Body Schema

| Field                   | Description                                                                                                                                                |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **assignment\_id**      | The Canvas id of the assignment being submitted.                                                                                                           |
| **attempt**             | This is the submission attempt number.                                                                                                                     |
| **body**                | The content of the submission, if it was submitted directly in a text field. NOTE: This field will be truncated to only include the first 8192 characters. |
| **grade**               | The grade for the submission, translated into the assignment grading scheme (so a letter grade, for example)                                               |
| **graded\_at**          | The timestamp when the assignment was graded, if it was graded.                                                                                            |
| **group\_id**           | The submissions’s group ID if the assignment is a group assignment.                                                                                        |
| **late**                | Whether the submission was made after the applicable due date.                                                                                             |
| **lti\_assignment\_id** | The LTI assignment guid of the submission's assignment                                                                                                     |
| **lti\_user\_id**       | The Lti id of the user associated with the submission.                                                                                                     |
| **missing**             | Whether the submission is missing, which generally means past-due and not yet submitted.                                                                   |
| **score**               | The raw score                                                                                                                                              |
| **submission\_id**      | The Canvas id of the new submission.                                                                                                                       |
| **submission\_type**    | The types of submission (basic\_lti\_launch, discussion\_topic, media\_recording, online\_quiz, online\_text\_entry, online\_upload, online\_url)          |
| **submitted\_at**       | The timestamp when the assignment was submitted.                                                                                                           |
| **workflow\_state**     | The state of the submission: normally 'submitted' or 'pending\_review'.                                                                                    |
| **updated\_at**         | The time at which this assignment was last modified in any way                                                                                             |
| **url**                 | The URL of the submission (for 'online\_url' submissions)                                                                                                  |
| **user\_id**            | The Canvas id of the user associated with the submission.                                                                                                  |

## submission\_custom\_grade\_status <a href="#submission_custom_grade_status" id="submission_custom_grade_status"></a>

**Definition:** The event gets emitted when a custom status is removed or applied to a student's submission.

**Trigger:** Triggered when a custom status is applied or removed from a student's submission.

### Payload Example:

```json
{
  "metadata": {
    "root_account_uuid": "44fJ44GgJ29gJBsl43JLKgljsBIOTsbnKT48932g",
    "root_account_id": "10000000000001",
    "root_account_lti_guid": "794d72b707af6ea82cfe3d5d473f16888a8366c7.canvas.docker",
    "user_login": "oxana@instructure.com",
    "user_account_id": "10000000000002",
    "user_sis_id": null,
    "user_id": "21070000000000001",
    "time_zone": "America/Denver",
    "context_type": "Course",
    "context_id": "21070000000000002",
    "context_sis_source_id": "194387",
    "context_account_id": "21070000000000003",
    "context_role": "TeacherEnrollment",
    "request_id": "98e1b771-fe22-4481-8264-d523dadb16b1",
    "session_id": "242872453a9d69f7ccddeb4788d22506",
    "hostname": "oxana.instructure.com",
    "http_method": "POST",
    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
    "client_ip": "93.184.216.34",
    "url": "http://oxana.instructure.com/courses/2/gradebook/update_submission",
    "referrer": "http://oxana.instructure.com/courses/2/gradebook/speed_grader?assignment_id=39&student_id=2",
    "producer": "canvas",
    "event_name": "submission_custom_grade_status",
    "event_time": "2019-12-11T16:26:34.552Z"
  },
  "body": {
    "assignment_id": "11",
    "submission_id": "100",
    "user_id": "2",
    "course_id": "2",
    "submission_status": "Completed",
    "submission_status_id": "2",
    "old_submission_status": "Incomplete",
    "old_submission_status_id": "1",
    "updated_at": "2019-12-11T16:26:34Z"
  }
}
```

### Event Body Schema

| Field                           | Description                                                                   |
| ------------------------------- | ----------------------------------------------------------------------------- |
| **assignment\_id**              | The Canvas ID of the assignment.                                              |
| **submission\_id**              | The Canvas ID of the submission\_id.                                          |
| **user\_id**                    | The Canvas user ID of the student.                                            |
| **course\_id**                  | The Canvas ID of the course.                                                  |
| **submission\_status**          | The new custom status name applied to a user's submission                     |
| **submission\_status\_id**      | The new custom status ID applied to a user's submission                       |
| **old\_submission\_status**     | The previous custom status name applied to a user's submission, if applicable |
| **old\_submission\_status\_id** | The previous custom status ID applied to a user's submission, if applicable   |
| **updated\_at**                 | The time when the custom status was applied.                                  |

## submission\_updated <a href="#submission_updated" id="submission_updated"></a>

**Definition:** The event is emitted anytime an end user or API request modifies a submitted assignment or when a Teacher grades an assignment.

**Trigger:** Triggered when a submission gets updated.

### Payload Example:

```json
{
  "metadata": {
    "client_ip": "93.184.216.34",
    "context_account_id": "21070000000000079",
    "context_id": "21070000000000565",
    "context_role": "TeacherEnrollment",
    "context_sis_source_id": "2017.100.101.101-1",
    "context_type": "Course",
    "event_name": "submission_updated",
    "event_time": "2019-11-01T19:11:11.325Z",
    "hostname": "oxana.instructure.com",
    "http_method": "POST",
    "producer": "canvas",
    "referrer": "https://oxana.instructure.com/courses/1465707/gradebook/speed_grader?assignment_id=21868751&student_id=8026013",
    "request_id": "1dd9dc6f-2fb0-4c19-a6c5-7ee1bf3ed295",
    "root_account_id": "21070000000000001",
    "root_account_lti_guid": "VicYj3cu5BIFpoZhDVU4DZumnlBrWi1grgJEzADs.oxana.instructure.com",
    "root_account_uuid": "VicYj3cu5BIFpoZhDVU4DZumnlBrWi1grgJEzADs",
    "session_id": "ef686f8ed684abf78cbfa1f6a58112b5",
    "time_zone": "America/Los_Angeles",
    "url": "https://oxana.instructure.com/courses/2176632/gradebook/update_submission",
    "user_account_id": "21070000000000001",
    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
    "user_id": "21070000000000001",
    "user_login": "oxana@example.com",
    "user_sis_id": "456-T45"
  },
  "body": {
    "assignment_id": "21070000000000396",
    "attempt": 1,
    "body": "user: 47, quiz: 78, score: 0.0, time: 2018-10-09 21:29:57 +0000",
    "grade": "S",
    "graded_at": "2018-10-09T21:29:57Z",
    "group_id": "120120",
    "late": false,
    "lti_assignment_id": "f7d76a11-95be-485b-8827-dbe8fdca3332",
    "lti_user_id": null,
    "missing": false,
    "score": 99.5,
    "submission_id": "21070000000011176",
    "submission_type": "online_quiz",
    "submitted_at": "2018-10-09T21:29:57Z",
    "updated_at": "2018-10-09T21:29:57Z",
    "url": null,
    "user_id": "21070000000000047",
    "workflow_state": "submitted"
  }
}
```

### Event Body Schema

| Field                   | Description                                                                                                                                                |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **assignment\_id**      | The Canvas id of the assignment being submitted.                                                                                                           |
| **attempt**             | This is the submission attempt number.                                                                                                                     |
| **body**                | The content of the submission, if it was submitted directly in a text field. NOTE: This field will be truncated to only include the first 8192 characters. |
| **grade**               | The grade for the submission, translated into the assignment grading scheme (so a letter grade, for example)                                               |
| **graded\_at**          | The timestamp when the assignment was graded, if it was graded.                                                                                            |
| **group\_id**           | The submissions’s group ID if the assignment is a group assignment.                                                                                        |
| **late**                | Whether the submission was made after the applicable due date.                                                                                             |
| **lti\_assignment\_id** | The LTI assignment guid of the submission's assignment                                                                                                     |
| **lti\_user\_id**       | The Lti id of the user associated with the submission.                                                                                                     |
| **missing**             | Whether the submission is missing, which generally means past-due and not yet submitted.                                                                   |
| **score**               | The raw score                                                                                                                                              |
| **submission\_id**      | The Canvas id of the new submission.                                                                                                                       |
| **submission\_type**    | The types of submission (online\_text\_entry, online\_url, online\_upload, media\_recording)                                                               |
| **submitted\_at**       | The timestamp when the assignment was submitted.                                                                                                           |
| **workflow\_state**     | The state of the submission, such as 'submitted' or 'graded'.                                                                                              |
| **updated\_at**         | The time at which this assignment was last modified in any way                                                                                             |
| **url**                 | The URL of the submission (for 'online\_url' submissions)                                                                                                  |
| **user\_id**            | The Canvas id of the user associated with the submission.                                                                                                  |

Note: Timestamps will be in ISO8601 format, including an offset. Be sure to take that into account when parsing, since it’s unspecified which offset timestamps will use, and the offset may even change between different timestamps within a single event.

***

This documentation is generated directly from the Canvas LMS source code, available [on Github](https://github.com/instructure/canvas-lms).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developerdocs.instructure.com/services/canvas/data-services/live-events/event-format/canvas/file.data_service_canvas_submission.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
