---
title: "POST /v1/courses/{courseId}/posts/{postId}/addOnAttachments"
method: POST
path: "/v1/courses/{courseId}/posts/{postId}/addOnAttachments"
tags: ["courses"]
---

# POST /v1/courses/{courseId}/posts/{postId}/addOnAttachments

`POST /v1/courses/{courseId}/posts/{postId}/addOnAttachments`

Creates an add-on attachment under a post. Requires the add-on to have permission to create new attachments on the post. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.

## Path parameters

- `courseId` string, required
- `postId` string, required

## Query parameters

- `addOnToken` string
- `itemId` string

## Request body

- AddOnAttachment — An add-on attachment on a post.
  - `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.
  - `title` string — Required. Title of this attachment. The title must be between 1 and 1000 characters.
  - `studentViewUri` EmbedUri — URI to be iframed after being populated with query parameters.
    - `uri` string — Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
  - `courseId` string — Immutable. Identifier of the course.
  - `id` string — Immutable. Classroom-assigned identifier for this attachment, unique per post.
  - `copyHistory` CopyHistory[] — Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy.
    - `postId` string — Immutable. Deprecated, use `item_id` instead.
    - `attachmentId` string — Immutable. Identifier of the attachment.
    - `courseId` string — Immutable. Identifier of the course.
    - `itemId` string — Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached.
  - `postId` string — Immutable. Deprecated, use `item_id` instead.
  - `itemId` string — Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course.
  - `maxPoints` number, double — Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback.
  - `teacherViewUri` EmbedUri — URI to be iframed after being populated with query parameters.
    - `uri` string — Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
  - `studentWorkReviewUri` EmbedUri — URI to be iframed after being populated with query parameters.
    - `uri` string — Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
  - `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.

## 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)
