Assignments API

API for accessing assignment information.

An ExternalToolTagAttributes object looks like:

{
  // URL to the external tool
  "url": "http://instructure.com",
  // Whether or not there is a new tab for the external tool
  "new_tab": false,
  // the identifier for this tool_tag
  "resource_link_id": "ab81173af98b8c33e66a"
}

A LockInfo object looks like:

{
  // Asset string for the object causing the lock
  "asset_string": "assignment_4",
  // (Optional) Time at which this was/will be unlocked. Must be before the due date.
  "unlock_at": "2013-01-01T00:00:00-06:00",
  // (Optional) Time at which this was/will be locked. Must be after the due date.
  "lock_at": "2013-02-01T00:00:00-06:00",
  // (Optional) Context module causing the lock.
  "context_module": "{}",
  "manually_locked": true
}

A RubricRating object looks like:

{
  "points": 10,
  "id": "rat1",
  "description": "Full marks",
  "long_description": "Student completed the assignment flawlessly."
}

A RubricCriteria object looks like:

{
  "points": 10,
  // The id of rubric criteria.
  "id": "crit1",
  // (Optional) The id of the learning outcome this criteria uses, if any.
  "learning_outcome_id": "1234",
  // (Optional) The 3rd party vendor's GUID for the outcome this criteria references,
  // if any.
  "vendor_guid": "abdsfjasdfne3jsdfn2",
  "description": "Criterion 1",
  "long_description": "Criterion 1 more details",
  "criterion_use_range": true,
  "ratings": null
}

An AssignmentDate object looks like:

// Object representing a due date for an assignment or quiz. If the due date came
// from an assignment override, it will have an 'id' field.
{
  // (Optional, missing if 'base' is present) id of the assignment override this date
  // represents
  "id": 1,
  // (Optional, present if 'id' is missing) whether this date represents the
  // assignment's or quiz's default due date
  "base": true,
  "title": "Summer Session",
  // The due date for the assignment. Must be between the unlock date and the lock
  // date if there are lock dates
  "due_at": "2013-08-28T23:59:00-06:00",
  // The unlock date for the assignment. Must be before the due date if there is a
  // due date.
  "unlock_at": "2013-08-01T00:00:00-06:00",
  // The lock date for the assignment. Must be after the due date if there is a due
  // date.
  "lock_at": "2013-08-31T23:59:00-06:00"
}

A TurnitinSettings object looks like:

{
  "originality_report_visibility": "after_grading",
  "s_paper_check": false,
  "internet_check": false,
  "journal_check": false,
  "exclude_biblio": false,
  "exclude_quoted": false,
  "exclude_small_matches_type": "percent",
  "exclude_small_matches_value": 50
}

A NeedsGradingCount object looks like:

// Used by Assignment model
{
  // The section ID
  "section_id": "123456",
  // Number of submissions that need grading
  "needs_grading_count": 5
}

An Assignment object looks like:

{
  // the ID of the assignment
  "id": 4,
  // the name of the assignment
  "name": "some assignment",
  // the assignment description, in an HTML fragment
  "description": "<p>Do the following:</p>...",
  // The time at which this assignment was originally created
  "created_at": "2012-07-01T23:59:00-06:00",
  // The time at which this assignment was last modified in any way
  "updated_at": "2012-07-01T23:59:00-06:00",
  // the due date for the assignment. returns null if not present. NOTE: If this
  // assignment has assignment overrides, this field will be the due date as it
  // applies to the user requesting information from the API.
  "due_at": "2012-07-01T23:59:00-06:00",
  // the lock date (assignment is locked after this date). returns null if not
  // present. NOTE: If this assignment has assignment overrides, this field will be
  // the lock date as it applies to the user requesting information from the API.
  "lock_at": "2012-07-01T23:59:00-06:00",
  // the unlock date (assignment is unlocked after this date) returns null if not
  // present NOTE: If this assignment has assignment overrides, this field will be
  // the unlock date as it applies to the user requesting information from the API.
  "unlock_at": "2012-07-01T23:59:00-06:00",
  // whether this assignment has overrides
  "has_overrides": true,
  // (Optional) all dates associated with the assignment, if applicable
  "all_dates": null,
  // the ID of the course the assignment belongs to
  "course_id": 123,
  // the URL to the assignment's web page
  "html_url": "https://...",
  // the URL to download all submissions as a zip
  "submissions_download_url": "https://example.com/courses/:course_id/assignments/:id/submissions?zip=1",
  // the ID of the assignment's group
  "assignment_group_id": 2,
  // Boolean flag indicating whether the assignment requires a due date based on the
  // account level setting
  "due_date_required": true,
  // Allowed file extensions, which take effect if submission_types includes
  // 'online_upload'.
  "allowed_extensions": ["docx", "ppt"],
  // An integer indicating the maximum length an assignment's name may be
  "max_name_length": 15,
  // Boolean flag indicating whether or not Turnitin has been enabled for the
  // assignment. NOTE: This flag will not appear unless your account has the Turnitin
  // plugin available
  "turnitin_enabled": true,
  // Boolean flag indicating whether or not VeriCite has been enabled for the
  // assignment. NOTE: This flag will not appear unless your account has the VeriCite
  // plugin available
  "vericite_enabled": true,
  // Settings to pass along to turnitin to control what kinds of matches should be
  // considered. originality_report_visibility can be 'immediate', 'after_grading',
  // 'after_due_date', or 'never' exclude_small_matches_type can be null, 'percent',
  // 'words' exclude_small_matches_value: - if type is null, this will be null also -
  // if type is 'percent', this will be a number between 0 and 100 representing match
  // size to exclude as a percentage of the document size. - if type is 'words', this
  // will be number > 0 representing how many words a match must contain for it to be
  // considered NOTE: This flag will not appear unless your account has the Turnitin
  // plugin available
  "turnitin_settings": null,
  // If this is a group assignment, boolean flag indicating whether or not students
  // will be graded individually.
  "grade_group_students_individually": false,
  // (Optional) assignment's settings for external tools if submission_types include
  // 'external_tool'. Only url and new_tab are included (new_tab defaults to false). 
  // Use the 'External Tools' API if you need more information about an external
  // tool.
  "external_tool_tag_attributes": null,
  // Boolean indicating if peer reviews are required for this assignment
  "peer_reviews": false,
  // Boolean indicating peer reviews are assigned automatically. If false, the
  // teacher is expected to manually assign peer reviews.
  "automatic_peer_reviews": false,
  // Integer representing the amount of reviews each user is assigned. NOTE: This key
  // is NOT present unless you have automatic_peer_reviews set to true.
  "peer_review_count": 0,
  // String representing a date the reviews are due by. Must be a date that occurs
  // after the default due date. If blank, or date is not after the assignment's due
  // date, the assignment's due date will be used. NOTE: This key is NOT present
  // unless you have automatic_peer_reviews set to true.
  "peer_reviews_assign_at": "2012-07-01T23:59:00-06:00",
  // Boolean representing whether or not members from within the same group on a
  // group assignment can be assigned to peer review their own group's work
  "intra_group_peer_reviews": false,
  // The ID of the assignment’s group set, if this is a group assignment. For group
  // discussions, set group_category_id on the discussion topic, not the linked
  // assignment.
  "group_category_id": 1,
  // if the requesting user has grading rights, the number of submissions that need
  // grading.
  "needs_grading_count": 17,
  // if the requesting user has grading rights and the
  // 'needs_grading_count_by_section' flag is specified, the number of submissions
  // that need grading split out by section. NOTE: This key is NOT present unless you
  // pass the 'needs_grading_count_by_section' argument as true.  ANOTHER NOTE: it's
  // possible to be enrolled in multiple sections, and if a student is setup that way
  // they will show an assignment that needs grading in multiple sections
  // (effectively the count will be duplicated between sections)
  "needs_grading_count_by_section": [{"section_id":"123456","needs_grading_count":5}, {"section_id":"654321","needs_grading_count":0}],
  // the sorting order of the assignment in the group
  "position": 1,
  // (optional, present if Sync Grades to SIS feature is enabled)
  "post_to_sis": true,
  // (optional, Third Party unique identifier for Assignment)
  "integration_id": "12341234",
  // (optional, Third Party integration data for assignment)
  "integration_data": "12341234",
  // whether the assignment is muted
  "muted": null,
  // the maximum points possible for the assignment
  "points_possible": 12,
  // the types of submissions allowed for this assignment list containing one or more
  // of the following: 'discussion_topic', 'online_quiz', 'on_paper', 'none',
  // 'external_tool', 'online_text_entry', 'online_url', 'online_upload'
  // 'media_recording'
  "submission_types": ["online_text_entry"],
  // If true, the assignment has been submitted to by at least one student
  "has_submitted_submissions": true,
  // The type of grading the assignment receives; one of 'pass_fail', 'percent',
  // 'letter_grade', 'gpa_scale', 'points'
  "grading_type": "points",
  // The id of the grading standard being applied to this assignment. Valid if
  // grading_type is 'letter_grade' or 'gpa_scale'.
  "grading_standard_id": null,
  // Whether the assignment is published
  "published": true,
  // Whether the assignment's 'published' state can be changed to false. Will be
  // false if there are student submissions for the assignment.
  "unpublishable": false,
  // Whether the assignment is only visible to overrides.
  "only_visible_to_overrides": false,
  // Whether or not this is locked for the user.
  "locked_for_user": false,
  // (Optional) Information for the user about the lock. Present when locked_for_user
  // is true.
  "lock_info": null,
  // (Optional) An explanation of why this is locked for the user. Present when
  // locked_for_user is true.
  "lock_explanation": "This assignment is locked until September 1 at 12:00am",
  // (Optional) id of the associated quiz (applies only when submission_types is
  // ['online_quiz'])
  "quiz_id": 620,
  // (Optional) whether anonymous submissions are accepted (applies only to quiz
  // assignments)
  "anonymous_submissions": false,
  // (Optional) the DiscussionTopic associated with the assignment, if applicable
  "discussion_topic": null,
  // (Optional) Boolean indicating if assignment will be frozen when it is copied.
  // NOTE: This field will only be present if the AssignmentFreezer plugin is
  // available for your account.
  "freeze_on_copy": false,
  // (Optional) Boolean indicating if assignment is frozen for the calling user.
  // NOTE: This field will only be present if the AssignmentFreezer plugin is
  // available for your account.
  "frozen": false,
  // (Optional) Array of frozen attributes for the assignment. Only account
  // administrators currently have permission to change an attribute in this list.
  // Will be empty if no attributes are frozen for this assignment. Possible frozen
  // attributes are: title, description, lock_at, points_possible, grading_type,
  // submission_types, assignment_group_id, allowed_extensions, group_category_id,
  // notify_of_update, peer_reviews NOTE: This field will only be present if the
  // AssignmentFreezer plugin is available for your account.
  "frozen_attributes": ["title"],
  // (Optional) If 'submission' is included in the 'include' parameter, includes a
  // Submission object that represents the current user's (user who is requesting
  // information from the api) current submission for the assignment. See the
  // Submissions API for an example response. If the user does not have a submission,
  // this key will be absent.
  "submission": null,
  // (Optional) If true, the rubric is directly tied to grading the assignment.
  // Otherwise, it is only advisory. Included if there is an associated rubric.
  "use_rubric_for_grading": true,
  // (Optional) An object describing the basic attributes of the rubric, including
  // the point total. Included if there is an associated rubric.
  "rubric_settings": "{"points_possible"=>12}",
  // (Optional) A list of scoring criteria and ratings for each rubric criterion.
  // Included if there is an associated rubric.
  "rubric": null,
  // (Optional) If 'assignment_visibility' is included in the 'include' parameter,
  // includes an array of student IDs who can see this assignment.
  "assignment_visibility": [137, 381, 572],
  // (Optional) If 'overrides' is included in the 'include' parameter, includes an
  // array of assignment override objects.
  "overrides": null,
  // (Optional) If true, the assignment will be omitted from the student's final
  // grade
  "omit_from_final_grade": true,
  // Boolean indicating if the assignment is moderated.
  "moderated_grading": true
}

An AssignmentOverride object looks like:

{
  // the ID of the assignment override
  "id": 4,
  // the ID of the assignment the override applies to
  "assignment_id": 123,
  // the IDs of the override's target students (present if the override targets an
  // ad-hoc set of students)
  "student_ids": [1, 2, 3],
  // the ID of the override's target group (present if the override targets a group
  // and the assignment is a group assignment)
  "group_id": 2,
  // the ID of the overrides's target section (present if the override targets a
  // section)
  "course_section_id": 1,
  // the title of the override
  "title": "an assignment override",
  // the overridden due at (present if due_at is overridden)
  "due_at": "2012-07-01T23:59:00-06:00",
  // the overridden all day flag (present if due_at is overridden)
  "all_day": true,
  // the overridden all day date (present if due_at is overridden)
  "all_day_date": "2012-07-01",
  // the overridden unlock at (present if unlock_at is overridden)
  "unlock_at": "2012-07-01T23:59:00-06:00",
  // the overridden lock at, if any (present if lock_at is overridden)
  "lock_at": "2012-07-01T23:59:00-06:00"
}

Delete an assignment AssignmentsController#destroy

DELETE /api/v1/courses/:course_id/assignments/:id

Scope: url:DELETE|/api/v1/courses/:course_id/assignments/:id

Delete the given assignment.

Example Request:

curl https://<canvas>/api/v1/courses/<course_id>/assignments/<assignment_id> \
     -X DELETE \
     -H 'Authorization: Bearer <token>'
Returns a Assignment

List assignments AssignmentsApiController#index

GET /api/v1/courses/:course_id/assignments

Scope: url:GET|/api/v1/courses/:course_id/assignments

Returns the paginated list of assignments for the current context.

Request Parameters:

Parameter Type Description
include[] string

Associations to include with the assignment. The “assignment_visibility” option requires that the Differentiated Assignments course feature be turned on. If “observed_users” is passed, submissions for observed users will also be included as an array.

Allowed values: submission, assignment_visibility, all_dates, overrides, observed_users

search_term string

The partial title of the assignments to match and return.

override_assignment_dates boolean

Apply assignment overrides for each assignment, defaults to true.

needs_grading_count_by_section boolean

Split up “needs_grading_count” by sections into the “needs_grading_count_by_section” key, defaults to false

bucket string

If included, only return certain assignments depending on due date and submission status.

Allowed values: past, overdue, undated, ungraded, unsubmitted, upcoming, future

assignment_ids[] string

if set, return only assignments specified

order_by string

Determines the order of the assignments. Defaults to “position”.

Allowed values: position, name

Returns a list of Assignments

List assignments for user AssignmentsApiController#user_index

GET /api/v1/users/:user_id/courses/:course_id/assignments

Scope: url:GET|/api/v1/users/:user_id/courses/:course_id/assignments

Returns the paginated list of assignments for the specified user if the current user has rights to view. See List assignments for valid arguments.

Get a single assignment AssignmentsApiController#show

GET /api/v1/courses/:course_id/assignments/:id

Scope: url:GET|/api/v1/courses/:course_id/assignments/:id

Returns the assignment with the given id.

"observed_users" is passed, submissions for observed users will also be included.

Request Parameters:

Parameter Type Description
include[] string

Associations to include with the assignment. The “assignment_visibility” option requires that the Differentiated Assignments course feature be turned on. If

Allowed values: submission, assignment_visibility, overrides, observed_users

override_assignment_dates boolean

Apply assignment overrides to the assignment, defaults to true.

needs_grading_count_by_section boolean

Split up “needs_grading_count” by sections into the “needs_grading_count_by_section” key, defaults to false

all_dates boolean

All dates associated with the assignment, if applicable

Returns a Assignment

Create an assignment AssignmentsApiController#create

POST /api/v1/courses/:course_id/assignments

Scope: url:POST|/api/v1/courses/:course_id/assignments

Create a new assignment for this course. The assignment is created in the active state.

Request Parameters:

Parameter Type Description
assignment[name] Required string

The assignment name.

assignment[position] integer

The position of this assignment in the group when displaying assignment lists.

assignment[submission_types][] string

List of supported submission types for the assignment. Unless the assignment is allowing online submissions, the array should only have one element.

If not allowing online submissions, your options are:

"online_quiz"
"none"
"on_paper"
"discussion_topic"
"external_tool"

If you are allowing online submissions, you can have one or many allowed submission types:

"online_upload"
"online_text_entry"
"online_url"
"media_recording" (Only valid when the Kaltura plugin is enabled)

Allowed values: online_quiz, none, on_paper, discussion_topic, external_tool, online_upload, online_text_entry, online_url, media_recording

assignment[allowed_extensions][] string

Allowed extensions if submission_types includes “online_upload”

Example:

allowed_extensions: ["docx","ppt"]
assignment[turnitin_enabled] boolean

Only applies when the Turnitin plugin is enabled for a course and the submission_types array includes “online_upload”. Toggles Turnitin submissions for the assignment. Will be ignored if Turnitin is not available for the course.

assignment[vericite_enabled] boolean

Only applies when the VeriCite plugin is enabled for a course and the submission_types array includes “online_upload”. Toggles VeriCite submissions for the assignment. Will be ignored if VeriCite is not available for the course.

assignment[turnitin_settings] string

Settings to send along to turnitin. See Assignment object definition for format.

assignment[integration_data] string

Data used for SIS integrations. Requires admin-level token with the “Manage SIS” permission. JSON string required.

assignment[integration_id] string

Unique ID from third party integrations

assignment[peer_reviews] boolean

If submission_types does not include external_tool,discussion_topic, online_quiz, or on_paper, determines whether or not peer reviews will be turned on for the assignment.

assignment[automatic_peer_reviews] boolean

Whether peer reviews will be assigned automatically by Canvas or if teachers must manually assign peer reviews. Does not apply if peer reviews are not enabled.

assignment[notify_of_update] boolean

If true, Canvas will send a notification to students in the class notifying them that the content has changed.

assignment[group_category_id] integer

If present, the assignment will become a group assignment assigned to the group.

assignment[grade_group_students_individually] integer

If this is a group assignment, teachers have the options to grade students individually. If false, Canvas will apply the assignment's score to each member of the group. If true, the teacher can manually assign scores to each member of the group.

assignment[external_tool_tag_attributes] string

Hash of external tool parameters if submission_types is [“external_tool”]. See Assignment object definition for format.

assignment[points_possible] number

The maximum points possible on the assignment.

assignment[grading_type] string

The strategy used for grading the assignment. The assignment defaults to “points” if this field is omitted.

Allowed values: pass_fail, percent, letter_grade, gpa_scale, points

assignment[due_at] DateTime

The day/time the assignment is due. Must be between the lock dates if there are lock dates. Accepts times in ISO 8601 format, e.g. 2014-10-21T18:48:00Z.

assignment[lock_at] DateTime

The day/time the assignment is locked after. Must be after the due date if there is a due date. Accepts times in ISO 8601 format, e.g. 2014-10-21T18:48:00Z.

assignment[unlock_at] DateTime

The day/time the assignment is unlocked. Must be before the due date if there is a due date. Accepts times in ISO 8601 format, e.g. 2014-10-21T18:48:00Z.

assignment[description] string

The assignment's description, supports HTML.

assignment[assignment_group_id] integer

The assignment group id to put the assignment in. Defaults to the top assignment group in the course.

assignment[muted] boolean

Whether this assignment is muted. A muted assignment does not send change notifications and hides grades from students. Defaults to false.

assignment[assignment_overrides][] AssignmentOverride

List of overrides for the assignment.

assignment[only_visible_to_overrides] boolean

Whether this assignment is only visible to overrides (Only useful if 'differentiated assignments' account setting is on)

assignment[published] boolean

Whether this assignment is published. (Only useful if 'draft state' account setting is on) Unpublished assignments are not visible to students.

assignment[grading_standard_id] integer

The grading standard id to set for the course. If no value is provided for this argument the current grading_standard will be un-set from this course. This will update the grading_type for the course to 'letter_grade' unless it is already 'gpa_scale'.

assignment[omit_from_final_grade] boolean

Whether this assignment is counted towards a student's final grade.

assignment[quiz_lti] boolean

Whether this assignment should use the Quizzes 2 LTI tool. Sets the submission type to 'external_tool' and configures the external tool attributes to use the Quizzes 2 LTI tool configured for this course. Has no effect if no Quizzes 2 LTI tool is configured.

assignment[moderated_grading] boolean

Whether this assignment is moderated.

Returns a Assignment

Edit an assignment AssignmentsApiController#update

PUT /api/v1/courses/:course_id/assignments/:id

Scope: url:PUT|/api/v1/courses/:course_id/assignments/:id

Modify an existing assignment.

If the assignment [assignment_overrides] key is absent, any existing overrides are kept as is. If the assignment [assignment_overrides] key is present, existing overrides are updated or deleted (and new ones created, as necessary) to match the provided list.

Request Parameters:

Parameter Type Description
assignment[name] string

The assignment name.

assignment[position] integer

The position of this assignment in the group when displaying assignment lists.

assignment[submission_types][] string

List of supported submission types for the assignment. Unless the assignment is allowing online submissions, the array should only have one element.

If not allowing online submissions, your options are:

"online_quiz"
"none"
"on_paper"
"discussion_topic"
"external_tool"

If you are allowing online submissions, you can have one or many allowed submission types:

"online_upload"
"online_text_entry"
"online_url"
"media_recording" (Only valid when the Kaltura plugin is enabled)

Allowed values: online_quiz, none, on_paper, discussion_topic, external_tool, online_upload, online_text_entry, online_url, media_recording

assignment[allowed_extensions][] string

Allowed extensions if submission_types includes “online_upload”

Example:

allowed_extensions: ["docx","ppt"]
assignment[turnitin_enabled] boolean

Only applies when the Turnitin plugin is enabled for a course and the submission_types array includes “online_upload”. Toggles Turnitin submissions for the assignment. Will be ignored if Turnitin is not available for the course.

assignment[vericite_enabled] boolean

Only applies when the VeriCite plugin is enabled for a course and the submission_types array includes “online_upload”. Toggles VeriCite submissions for the assignment. Will be ignored if VeriCite is not available for the course.

assignment[turnitin_settings] string

Settings to send along to turnitin. See Assignment object definition for format.

assignment[integration_data] string

Data used for SIS integrations. Requires admin-level token with the “Manage SIS” permission. JSON string required.

assignment[integration_id] string

Unique ID from third party integrations

assignment[peer_reviews] boolean

If submission_types does not include external_tool,discussion_topic, online_quiz, or on_paper, determines whether or not peer reviews will be turned on for the assignment.

assignment[automatic_peer_reviews] boolean

Whether peer reviews will be assigned automatically by Canvas or if teachers must manually assign peer reviews. Does not apply if peer reviews are not enabled.

assignment[notify_of_update] boolean

If true, Canvas will send a notification to students in the class notifying them that the content has changed.

assignment[group_category_id] integer

If present, the assignment will become a group assignment assigned to the group.

assignment[grade_group_students_individually] integer

If this is a group assignment, teachers have the options to grade students individually. If false, Canvas will apply the assignment's score to each member of the group. If true, the teacher can manually assign scores to each member of the group.

assignment[external_tool_tag_attributes] string

Hash of external tool parameters if submission_types is [“external_tool”]. See Assignment object definition for format.

assignment[points_possible] number

The maximum points possible on the assignment.

assignment[grading_type] string

The strategy used for grading the assignment. The assignment defaults to “points” if this field is omitted.

Allowed values: pass_fail, percent, letter_grade, gpa_scale, points

assignment[due_at] DateTime

The day/time the assignment is due. Accepts times in ISO 8601 format, e.g. 2014-10-21T18:48:00Z.

assignment[lock_at] DateTime

The day/time the assignment is locked after. Must be after the due date if there is a due date. Accepts times in ISO 8601 format, e.g. 2014-10-21T18:48:00Z.

assignment[unlock_at] DateTime

The day/time the assignment is unlocked. Must be before the due date if there is a due date. Accepts times in ISO 8601 format, e.g. 2014-10-21T18:48:00Z.

assignment[description] string

The assignment's description, supports HTML.

assignment[assignment_group_id] integer

The assignment group id to put the assignment in. Defaults to the top assignment group in the course.

assignment[muted] boolean

Whether this assignment is muted. A muted assignment does not send change notifications and hides grades from students. Defaults to false.

assignment[assignment_overrides][] AssignmentOverride

List of overrides for the assignment.

assignment[only_visible_to_overrides] boolean

Whether this assignment is only visible to overrides (Only useful if 'differentiated assignments' account setting is on)

assignment[published] boolean

Whether this assignment is published. (Only useful if 'draft state' account setting is on) Unpublished assignments are not visible to students.

assignment[grading_standard_id] integer

The grading standard id to set for the course. If no value is provided for this argument the current grading_standard will be un-set from this course. This will update the grading_type for the course to 'letter_grade' unless it is already 'gpa_scale'.

assignment[omit_from_final_grade] boolean

Whether this assignment is counted towards a student's final grade.

assignment[moderated_grading] boolean

Whether this assignment is moderated.

Returns a Assignment

List assignment overrides AssignmentOverridesController#index

GET /api/v1/courses/:course_id/assignments/:assignment_id/overrides

Scope: url:GET|/api/v1/courses/:course_id/assignments/:assignment_id/overrides

Returns the paginated list of overrides for this assignment that target sections/groups/students visible to the current user.

Returns a list of AssignmentOverrides

Get a single assignment override AssignmentOverridesController#show

GET /api/v1/courses/:course_id/assignments/:assignment_id/overrides/:id

Scope: url:GET|/api/v1/courses/:course_id/assignments/:assignment_id/overrides/:id

Returns details of the the override with the given id.

Returns a AssignmentOverride

Redirect to the assignment override for a group AssignmentOverridesController#group_alias

GET /api/v1/groups/:group_id/assignments/:assignment_id/override

Scope: url:GET|/api/v1/groups/:group_id/assignments/:assignment_id/override

Responds with a redirect to the override for the given group, if any (404 otherwise).

Redirect to the assignment override for a section AssignmentOverridesController#section_alias

GET /api/v1/sections/:course_section_id/assignments/:assignment_id/override

Scope: url:GET|/api/v1/sections/:course_section_id/assignments/:assignment_id/override

Responds with a redirect to the override for the given section, if any (404 otherwise).

Create an assignment override AssignmentOverridesController#create

POST /api/v1/courses/:course_id/assignments/:assignment_id/overrides

Scope: url:POST|/api/v1/courses/:course_id/assignments/:assignment_id/overrides

One of student_ids, group_id, or course_section_id must be present. At most one should be present; if multiple are present only the most specific (student_ids first, then group_id, then course_section_id) is used and any others are ignored.

Request Parameters:

Parameter Type Description
assignment_override[student_ids][] integer

The IDs of the override's target students. If present, the IDs must each identify a user with an active student enrollment in the course that is not already targetted by a different adhoc override.

assignment_override[title] string

The title of the adhoc assignment override. Required if student_ids is present, ignored otherwise (the title is set to the name of the targetted group or section instead).

assignment_override[group_id] integer

The ID of the override's target group. If present, the following conditions must be met for the override to be successful:

  1. the assignment MUST be a group assignment (a group_category_id is assigned to it)

  2. the ID must identify an active group in the group set the assignment is in

  3. the ID must not be targetted by a different override

See Appendix: Group assignments for more info.

assignment_override[course_section_id] integer

The ID of the override's target section. If present, must identify an active section of the assignment's course not already targetted by a different override.

assignment_override[due_at] DateTime

The day/time the overridden assignment is due. Accepts times in ISO 8601 format, e.g. 2014-10-21T18:48:00Z. If absent, this override will not affect due date. May be present but null to indicate the override removes any previous due date.

assignment_override[unlock_at] DateTime

The day/time the overridden assignment becomes unlocked. Accepts times in ISO 8601 format, e.g. 2014-10-21T18:48:00Z. If absent, this override will not affect the unlock date. May be present but null to indicate the override removes any previous unlock date.

assignment_override[lock_at] DateTime

The day/time the overridden assignment becomes locked. Accepts times in ISO 8601 format, e.g. 2014-10-21T18:48:00Z. If absent, this override will not affect the lock date. May be present but null to indicate the override removes any previous lock date.

Example Request:

curl 'https://<canvas>/api/v1/courses/1/assignments/2/overrides.json' \
     -X POST \
     -F 'assignment_override[student_ids][]=8' \
     -F 'assignment_override[title]=Fred Flinstone' \
     -F 'assignment_override[due_at]=2012-10-08T21:00:00Z' \
     -H "Authorization: Bearer <token>"
Returns a AssignmentOverride

Update an assignment override AssignmentOverridesController#update

PUT /api/v1/courses/:course_id/assignments/:assignment_id/overrides/:id

Scope: url:PUT|/api/v1/courses/:course_id/assignments/:assignment_id/overrides/:id

All current overridden values must be supplied if they are to be retained; e.g. if due_at was overridden, but this PUT omits a value for due_at, due_at will no longer be overridden. If the override is adhoc and student_ids is not supplied, the target override set is unchanged. Target override sets cannot be changed for group or section overrides.

Request Parameters:

Parameter Type Description
assignment_override[student_ids][] integer

The IDs of the override's target students. If present, the IDs must each identify a user with an active student enrollment in the course that is not already targetted by a different adhoc override. Ignored unless the override being updated is adhoc.

assignment_override[title] string

The title of an adhoc assignment override. Ignored unless the override being updated is adhoc.

assignment_override[due_at] DateTime

The day/time the overridden assignment is due. Accepts times in ISO 8601 format, e.g. 2014-10-21T18:48:00Z. If absent, this override will not affect due date. May be present but null to indicate the override removes any previous due date.

assignment_override[unlock_at] DateTime

The day/time the overridden assignment becomes unlocked. Accepts times in ISO 8601 format, e.g. 2014-10-21T18:48:00Z. If absent, this override will not affect the unlock date. May be present but null to indicate the override removes any previous unlock date.

assignment_override[lock_at] DateTime

The day/time the overridden assignment becomes locked. Accepts times in ISO 8601 format, e.g. 2014-10-21T18:48:00Z. If absent, this override will not affect the lock date. May be present but null to indicate the override removes any previous lock date.

Example Request:

curl 'https://<canvas>/api/v1/courses/1/assignments/2/overrides/3.json' \
     -X PUT \
     -F 'assignment_override[title]=Fred Flinstone' \
     -F 'assignment_override[due_at]=2012-10-08T21:00:00Z' \
     -H "Authorization: Bearer <token>"
Returns a AssignmentOverride

Delete an assignment override AssignmentOverridesController#destroy

DELETE /api/v1/courses/:course_id/assignments/:assignment_id/overrides/:id

Scope: url:DELETE|/api/v1/courses/:course_id/assignments/:assignment_id/overrides/:id

Deletes an override and returns its former details.

Example Request:

curl 'https://<canvas>/api/v1/courses/1/assignments/2/overrides/3.json' \
     -X DELETE \
     -H "Authorization: Bearer <token>"
Returns a AssignmentOverride

Batch retrieve overrides in a course AssignmentOverridesController#batch_retrieve

GET /api/v1/courses/:course_id/assignments/overrides

Scope: url:GET|/api/v1/courses/:course_id/assignments/overrides

Returns a list of specified overrides in this course, providing they target sections/groups/students visible to the current user. Returns null elements in the list for requests that were not found.

Request Parameters:

Parameter Type Description
assignment_overrides[][id] Required string

Ids of overrides to retrieve

assignment_overrides[][assignment_id] Required string

Ids of assignments for each override

Example Request:

curl 'https://<canvas>/api/v1/courses/12/assignments/overrides.json?assignment_overrides[][id]=109&assignment_overrides[][assignment_id]=122&assignment_overrides[][id]=99&assignment_overrides[][assignment_id]=111' \
     -H "Authorization: Bearer <token>"
Returns a list of AssignmentOverrides

Batch create overrides in a course AssignmentOverridesController#batch_create

POST /api/v1/courses/:course_id/assignments/overrides

Scope: url:POST|/api/v1/courses/:course_id/assignments/overrides

Creates the specified overrides for each assignment. Handles creation in a transaction, so all records are created or none are.

One of student_ids, group_id, or course_section_id must be present. At most one should be present; if multiple are present only the most specific (student_ids first, then group_id, then course_section_id) is used and any others are ignored.

Errors are reported in an errors attribute, an array of errors corresponding to inputs. Global errors will be reported as a single element errors array

Request Parameters:

Parameter Type Description
assignment_overrides[] Required AssignmentOverride

Attributes for the new assignment overrides. See Create an assignment override for available attributes

Example Request:

curl "https://<canvas>/api/v1/courses/12/assignments/overrides.json" \
     -X POST \
     -F "assignment_overrides[][assignment_id]=109" \
     -F 'assignment_overrides[][student_ids][]=8' \
     -F "assignment_overrides[][title]=foo" \
     -F "assignment_overrides[][assignment_id]=13" \
     -F "assignment_overrides[][course_section_id]=200" \
     -F "assignment_overrides[][due_at]=2012-10-08T21:00:00Z" \
     -H "Authorization: Bearer <token>"
Returns a list of AssignmentOverrides

Batch update overrides in a course AssignmentOverridesController#batch_update

PUT /api/v1/courses/:course_id/assignments/overrides

Scope: url:PUT|/api/v1/courses/:course_id/assignments/overrides

Updates a list of specified overrides for each assignment. Handles overrides in a transaction, so either all updates are applied or none. See Update an assignment override for available attributes.

All current overridden values must be supplied if they are to be retained; e.g. if due_at was overridden, but this PUT omits a value for due_at, due_at will no longer be overridden. If the override is adhoc and student_ids is not supplied, the target override set is unchanged. Target override sets cannot be changed for group or section overrides.

Errors are reported in an errors attribute, an array of errors corresponding to inputs. Global errors will be reported as a single element errors array

Request Parameters:

Parameter Type Description
assignment_overrides[] Required AssignmentOverride

Attributes for the updated overrides.

Example Request:

curl "https://<canvas>/api/v1/courses/12/assignments/overrides.json" \
     -X PUT \
     -F "assignment_overrides[][id]=122" \
     -F "assignment_overrides[][assignment_id]=109" \
     -F "assignment_overrides[][title]=foo" \
     -F "assignment_overrides[][id]=993" \
     -F "assignment_overrides[][assignment_id]=13" \
     -F "assignment_overrides[][due_at]=2012-10-08T21:00:00Z" \
     -H "Authorization: Bearer <token>"
Returns a list of AssignmentOverrides

Appendixes

Appendix: Group assignments

The following diagram provides an example to describe the structure of group assignments. It also shows the correspondence between the fields of an assignment override API request and the resources they map to.

Group assignments structure example

The components in yellow are group sets. When creating or updating an assignment override, you will refer to the group set by the group_category_id field.

The components in green are groups. An assignment can become a group assignment iff it has a group_category_id that maps to an active group set, as well as a group_id that maps to an active, valid group. In the API, you will be specifying the group by the group_id field of the assignment_override construct.

Important: an assignment must be assigned to a group set (the group_category_id field) on creation for an override with a group_id to be effective.

See Also: