---
title: "Read a repository attachment"
method: GET
path: "/api/repos/{owner}/{repo}/attachments/{attachment}"
tags: ["Attachments"]
---

# Read a repository attachment

`GET /api/repos/{owner}/{repo}/attachments/{attachment}`

## Request

- Base URL: `https://git.cafe`
- URL: `https://git.cafe/api/repos/{owner}/{repo}/attachments/{attachment}`
- Auth: one of:
  - none
  - API key in cookie `gc-session`
  - HTTP bearer
  - HTTP basic
  - HTTP token
  - OAuth 2
    - Authorization code: `/api/oauth/authorize`
    - Token URL: `/api/oauth/token` scopes: `repo:attachments:read`

Streams an authorized attachment without buffering it. Public repositories allow anonymous reads; supplied credentials are validated and may expand access to private resources.

## Path parameters

- `owner` string, required
- `repo` string, required
- `attachment` string, required

## Response `200`

Attachment bytes.

## Other responses

- `429`: A rate limit is exhausted. Wait Retry-After seconds; the value is a hint, so back off on a repeat 429.

---

[API](https://skmtc.dev/gitcafe/apis/git-cafe-api.md) - [All operations](https://skmtc.dev/gitcafe/apis/git-cafe-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitcafe/apis/git-cafe-api/revisions/9fa233d2986d?raw)
