{% 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. Send exactly one upload_uuid or group_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"
}

To attach a complete upload group, send:

{
  "group_uuid": "b752d9fb-71ef-4c26-81b6-b31e00fa593b"
}

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. Group attachment snapshots every active member in one transaction and returns the group UUID plus the created per-file attachments. Later group changes do not affect existing attachments.

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 %}