---
title: "POST /v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments"
method: POST
path: "/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments"
tags: ["courses"]
---

# POST /v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments

`POST /v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments`

Modifies attachments of student submission. Attachments may only be added to student submissions belonging to course work objects with a `workType` of `ASSIGNMENT`. 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 user is not permitted to access the requested course or course work, if the user is not permitted to modify attachments on the requested student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist.

## Path parameters

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

## Request body

- ModifyAttachmentsRequest — Request to modify the attachments of a student submission.
  - `addAttachments` Attachment[] — Attachments to add. A student submission may not have more than 20 attachments. Form attachments are not supported.
    - `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.
    - `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.
    - `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.

## Response `200`

Successful response

---

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