Attachments

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

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

  • Thread attachments require the thread creator.
  • Reply attachments require the reply creator.
  • Pull attachments require the pull creator or a repo maintainer.
  • Pull review attachments require the review author.

Responses and errors

  • 201 Created returns one attachment for upload_uuid, or a group wrapper with every attachment for group_uuid.
  • 204 No Content confirms a detach.
  • 403 Forbidden indicates missing write access or an archived repo.
  • 404 Not Found indicates a missing target, upload, or attachment.
  • 409 Conflict indicates a duplicate, removed upload, or read-only target.

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