Create a content attachment
Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/[email protected]/webhooks/event-payloads/#content_reference) to create an attachment. The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://docs.github.com/[email protected]/apps/using-content-attachments/)" for details about content attachments. You must use an [installation access token](https://docs.github.com/[email protected]/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.
/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments- Source
github-v3-rest.json- Revision
f5f067c1e6f6- Active snapshot
85e53e3d0d65
Request
Path Parameters
- owner stringrequired
The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.
- repo stringrequired
The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.
- content_reference_id integerrequired
The `id` of the `content_reference` event.
Body Params
requiredThe body of the attachment
Example: Body of the attachment
The title of the attachment
Example: Title of the attachment
Responses
Response
The body of the attachment
Example: Body of the attachment
The ID of the attachment
Example: 21
The node_id of the content attachment
Example: MDE3OkNvbnRlbnRBdHRhY2htZW50MjE=
The title of the attachment
Example: Title of the attachment
Not modified
Forbidden
Resource not found
Gone
Preview header missing
Validation failed