{% extends "docs/base.html" %} {% block docs_content %}

Attachments

Attach an existing repo upload to a thread, reply, pull, or pull review.

File uploads Attachments OpenAPI JSON
Attachment requests only link uploads that already exist in the same repo. Create the upload first with the file upload API, then send its upload_uuid. Attachment endpoints do not accept file bytes.

Attach

POST /api/v1/teams/{team_slug}/repos/{repo_slug}/threads/{number}/attachments
POST /api/v1/teams/{team_slug}/repos/{repo_slug}/threads/{number}/replies/{reply_number}/attachments
POST /api/v1/teams/{team_slug}/repos/{repo_slug}/pulls/{number}/attachments
POST /api/v1/teams/{team_slug}/repos/{repo_slug}/pulls/{number}/reviews/{review_uuid}/attachments

POST /api/v1/users/{username}/repos/{repo_slug}/threads/{number}/attachments
POST /api/v1/users/{username}/repos/{repo_slug}/threads/{number}/replies/{reply_number}/attachments
POST /api/v1/users/{username}/repos/{repo_slug}/pulls/{number}/attachments
POST /api/v1/users/{username}/repos/{repo_slug}/pulls/{number}/reviews/{review_uuid}/attachments

Send a JSON body containing the existing upload UUID:

{
  "upload_uuid": "93dc0846-f01f-46a5-83b1-782bef8d7229"
}

The upload must be active and belong to the target repo. A closed pull can receive an attachment; a merged pull, removed thread or reply, and removed pull review cannot.

Detach

Append /{upload_uuid} to any attach endpoint and send DELETE.

DELETE /api/v1/teams/{team_slug}/repos/{repo_slug}/threads/{number}/attachments/{upload_uuid}
DELETE /api/v1/users/{username}/repos/{repo_slug}/pulls/{number}/reviews/{review_uuid}/attachments/{upload_uuid}

Detaching remains available after the upload or target is removed and after a pull is merged. The user who created the attachment can always detach it.

Permissions

Responses and errors

Successful attach and detach operations emit attachment-created and attachment-deleted events with repo and target scopes.

{% endblock %}