---
title: "PATCH /v1/courses/{courseId}/courseWork/{id}"
method: PATCH
path: "/v1/courses/{courseId}/courseWork/{id}"
tags: ["courses"]
---

# PATCH /v1/courses/{courseId}/courseWork/{id}

`PATCH /v1/courses/{courseId}/courseWork/{id}`

Updates one or more fields of a course work. See google.classroom.v1.CourseWork for details of which fields may be updated and who may change them. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the user is not permitted to make the requested modification to the student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `FAILED_PRECONDITION` if the requested course work has already been deleted. * `NOT_FOUND` if the requested course or course work does not exist.

## Path parameters

- `courseId` string, required
- `id` string, required

## Query parameters

- `updateMask` string

## Request body

- CourseWork — Course work created by a teacher for students of the course.
  - `gradeCategory` GradeCategory — Details for a grade category in a course. Coursework may have zero or one grade category, and the category may be used in computing the overall grade. See the [help center article](https://support.google.com/edu/classroom/answer/9184995) for details.
    - `id` string — ID of the grade category.
    - `weight` integer — The weight of the category average as part of overall average. A weight of 12.34% is represented as 123400 (100% is 1,000,000). The last two digits should always be zero since we use two decimal precision. Only applicable when grade calculation type is WEIGHTED_CATEGORIES.
    - `name` string — Name of the grade category.
    - `defaultGradeDenominator` integer — Default value of denominator. Only applicable when grade calculation type is TOTAL_POINTS.
  - `workType` 'COURSE_WORK_TYPE_UNSPECIFIED' | 'ASSIGNMENT' | 'SHORT_ANSWER_QUESTION' | 'MULTIPLE_CHOICE_QUESTION' — Type of this course work. The type is set when the course work is created and cannot be changed.
  - `scheduledTime` string, google-datetime — Optional timestamp when this course work is scheduled to be published.
  - `assigneeMode` 'ASSIGNEE_MODE_UNSPECIFIED' | 'ALL_STUDENTS' | 'INDIVIDUAL_STUDENTS' — Assignee mode of the coursework. If unspecified, the default value is `ALL_STUDENTS`.
  - `dueTime` TimeOfDay — Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and `google.protobuf.Timestamp`.
    - `hours` integer — Hours of a day in 24 hour format. Must be greater than or equal to 0 and typically must be less than or equal to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.
    - `minutes` integer — Minutes of an hour. Must be greater than or equal to 0 and less than or equal to 59.
    - `seconds` integer — Seconds of a minute. Must be greater than or equal to 0 and typically must be less than or equal to 59. An API may allow the value 60 if it allows leap-seconds.
    - `nanos` integer — Fractions of seconds, in nanoseconds. Must be greater than or equal to 0 and less than or equal to 999,999,999.
  - `creatorUserId` string — Identifier for the user that created the coursework. Read-only.
  - `title` string — Title of this course work. The title must be a valid UTF-8 string containing between 1 and 3000 characters.
  - `dueDate` Date — Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
    - `year` integer — Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
    - `month` integer — Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
    - `day` integer — Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
  - `id` string — Classroom-assigned identifier of this course work, unique per course. Read-only.
  - `creationTime` string, google-datetime — Timestamp when this course work was created. Read-only.
  - `submissionModificationMode` 'SUBMISSION_MODIFICATION_MODE_UNSPECIFIED' | 'MODIFIABLE_UNTIL_TURNED_IN' | 'MODIFIABLE' — Setting to determine when students are allowed to modify submissions. If unspecified, the default value is `MODIFIABLE_UNTIL_TURNED_IN`.
  - `description` string — Optional description of this course work. If set, the description must be a valid UTF-8 string containing no more than 30,000 characters.
  - `assignment` Assignment — Additional details for assignments.
    - `studentWorkFolder` DriveFolder — Representation of a Google Drive folder.
      - `id` string — Drive API resource ID.
      - `alternateLink` string — URL that can be used to access the Drive folder. Read-only.
      - `title` string — Title of the Drive folder. Read-only.
  - `gradingPeriodId` string — Identifier of the grading period associated with the coursework. * At creation, if unspecified, the grading period ID will be set based on the `dueDate` (or `scheduledTime` if no `dueDate` is set). * To indicate no association to any grading period, set this field to an empty string (""). * If specified, it must match an existing grading period ID in the course.
  - `topicId` string — Identifier for the topic that this coursework is associated with. Must match an existing topic in the course.
  - `individualStudentsOptions` IndividualStudentsOptions — Assignee details about a coursework/announcement. This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
    - `studentIds` string[] — Identifiers for the students that have access to the coursework/announcement.
  - `maxPoints` number, double — Maximum grade for this course work. If zero or unspecified, this assignment is considered ungraded. This must be a non-negative integer value.
  - `alternateLink` string — Absolute link to this course work in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only.
  - `state` 'COURSE_WORK_STATE_UNSPECIFIED' | 'PUBLISHED' | 'DRAFT' | 'DELETED' — Status of this course work. If unspecified, the default state is `DRAFT`.
  - `multipleChoiceQuestion` MultipleChoiceQuestion — Additional details for multiple-choice questions.
    - `choices` string[] — Possible choices.
  - `associatedWithDeveloper` boolean — Whether this course work item is associated with the Developer Console project making the request. See CreateCourseWork for more details. Read-only.
  - `materials` Material[] — Additional materials. CourseWork must have no more than 20 material items.
    - `driveFile` SharedDriveFile — Drive file that is used as material for course work.
      - `driveFile` DriveFile — Representation of a Google Drive file.
        - `alternateLink` string — URL that can be used to access the Drive item. Read-only.
        - `thumbnailUrl` string — URL of a thumbnail image of the Drive item. Read-only.
        - `title` string — Title of the Drive item. Read-only.
        - `id` string — Drive API resource ID.
      - `shareMode` 'UNKNOWN_SHARE_MODE' | 'VIEW' | 'EDIT' | 'STUDENT_COPY' — Mechanism by which students access the Drive item.
    - `link` Link — URL item.
      - `url` string — URL to link to. This must be a valid UTF-8 string containing between 1 and 2024 characters.
      - `thumbnailUrl` string — URL of a thumbnail image of the target URL. Read-only.
      - `title` string — Title of the target of the URL. Read-only.
    - `form` Form — Google Forms item.
      - `title` string — Title of the Form. Read-only.
      - `formUrl` string — URL of the form.
      - `thumbnailUrl` string — URL of a thumbnail image of the Form. Read-only.
      - `responseUrl` string — URL of the form responses document. Only set if responses have been recorded and only when the requesting user is an editor of the form. Read-only.
    - `notebook` NotebookLmNotebook — NotebookLM Notebook link.
      - `url` string — URL that can be used to access the Notebook.
      - `id` string — Notebook resource id.
      - `title` string — Title of the Notebook.
    - `gem` GeminiGem — Gemini Gem link.
      - `url` string — URL that can be used to access the Gem.
      - `id` string — Gems resource id.
      - `title` string — Title of the Gem.
    - `youtubeVideo` YouTubeVideo — YouTube video item.
      - `title` string — Title of the YouTube video. Read-only.
      - `alternateLink` string — URL that can be used to view the YouTube video. Read-only.
      - `thumbnailUrl` string — URL of a thumbnail image of the YouTube video. Read-only.
      - `id` string — YouTube API resource ID.
  - `updateTime` string, google-datetime — Timestamp of the most recent change to this course work. Read-only.
  - `courseId` string — Identifier of the course. Read-only.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/classroom.md) · [All operations](https://skmtc.net/google/apis/classroom/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/classroom/versions/1b98f151d40b/schema)
