---
title: "Get an attachment"
method: GET
path: "/api/attachments/*path"
tags: ["Attachments"]
---

# Get an attachment

`GET /api/attachments/*path`

## Request

- Base URL: `https://api.engram.page`
- URL: `https://api.engram.page/api/attachments/*path`
- Auth: HTTP bearer

Returns metadata + base64 content by default. Pass `?raw=1` to stream the raw bytes instead; the metadata then rides in `x-engram-content-hash`, `x-engram-mime-type`, `x-engram-mtime` and `x-engram-updated-at` response headers.

## Path parameters

- `path` string, required

## Query parameters

- `raw` string

## Response `200`

Attachment

- AttachmentWithContent
  - `content_base64` string, required: Base64-encoded file bytes.
  - `content_hash` string, nullable: Opaque content fingerprint — see AttachmentMeta.content_hash.
  - `created_at` string, date-time, nullable
  - `id` string, uuid, nullable
  - `mime_type` string, nullable
  - `mtime` number, float
  - `path` string, required
  - `size_bytes` integer
  - `updated_at` string, date-time, nullable

## Other responses

- `404`: No such attachment
- `500`: Fetch error
- `502`: Storage fetch failed

---

[API](https://skmtc.dev/engram/apis/engram-api.md) · [All operations](https://skmtc.dev/engram/apis/engram-api/llms.txt) · [OpenAPI document](https://skmtc.dev/engram/apis/engram-api/revisions/8c4c2eec29dc?raw)
