- [HTTP request](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.courseWork/modifyAssignees#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.courseWork/modifyAssignees#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.courseWork/modifyAssignees#body.request_body)
  - [JSON representation](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.courseWork/modifyAssignees#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.courseWork/modifyAssignees#body.response_body)
- [Authorization scopes](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.courseWork/modifyAssignees#body.aspect)
- [Try it!](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.courseWork/modifyAssignees#try-it)

Modifies assignee mode and options of a coursework.

Only a teacher of the course that contains the coursework may call this method.

This method returns the following error codes:

- `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work or for [access errors](https://developers.google.com/workspace/classroom/reference/Access.Errors).
- `INVALID_ARGUMENT` if the request is malformed.
- `NOT_FOUND` if the requested course or course work does not exist.
- `FAILED_PRECONDITION` for the following [request error](https://developers.google.com/workspace/classroom/reference/Request.Errors):
  - EmptyAssignees

### HTTP request

`POST https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{id}:modifyAssignees`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `courseId` | `string` Identifier of the course. This identifier can be either the Classroom-assigned identifier or an `https://developers.google.com/workspace/classroom/reference/rest/v1/courses.aliases#CourseAlias`. |
| `id` | `string` Identifier of the coursework. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "assigneeMode": enum (`https://developers.google.com/workspace/classroom/reference/rest/v1/AssigneeMode`), "modifyIndividualStudentsOptions": { object (`https://developers.google.com/workspace/classroom/reference/rest/v1/ModifyIndividualStudentsOptions`) } } ``` |

| Fields ||
|---|---|
| `assigneeMode` | ``enum (`https://developers.google.com/workspace/classroom/reference/rest/v1/AssigneeMode`)`` Mode of the coursework describing whether it will be assigned to all students or specified individual students. |
| `modifyIndividualStudentsOptions` | ``object (`https://developers.google.com/workspace/classroom/reference/rest/v1/ModifyIndividualStudentsOptions`)`` Set which students are assigned or not assigned to the coursework. Must be specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`. |

### Response body

If successful, the response body contains an instance of `https://developers.google.com/workspace/classroom/reference/rest/v1/courses.courseWork#CourseWork`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/classroom.coursework.students`

For more information, see the [Authorization guide](https://developers.google.com/workspace/guides/configure-oauth-consent).