---
title: "Get a document"
method: GET
path: "/context/brands/{slug}/documents/{documentId}"
tags: ["Documents"]
---

# Get a document

`GET /context/brands/{slug}/documents/{documentId}`

## Request

- Base URL: `https://api.adcrunch.dev`
- URL: `https://api.adcrunch.dev/context/brands/{slug}/documents/{documentId}`
- Auth: HTTP bearer

Reads one document of a Brand. The answer has the document data and the URL to read the file from. The bytes never come back in the body: fetch `url` for them. A reservation whose bytes never arrived answers `404`, because there is no file behind it.

## Path parameters

- `documentId` string, required
- `slug` string, required

## Response `200`

The Document. `url` is public: anybody holding it can read the file.

- object
  - `createdAt` number, required: Milliseconds since the Unix epoch, UTC.
  - `filename` string, required
  - `id` string, required
  - `mimeType` string, required
  - `name` string, required: The display name. Falls back to the filename.
  - `sizeBytes` number, required: Read off the stored object at finalize, never from the client.
  - `targetId` string, required
  - `targetType` string, required: What the Document is attached to. `brand` today.
  - `url` string, required

## Other responses

- `400`: The request does not match the schema of this operation: a field is missing or has the wrong type, or the body is not valid JSON. `error` is `invalid_request`, and `issues` names each field. Nothing was changed.
- `401`: No API key, or one that does not resolve. See the security scheme. `error` is `unauthorized`.
- `402`: The organization has no active subscription. An owner subscribes at `paywallUrl`. `error` is `organization_unentitled`.
- `403`: The caller does not hold `brand:read`. `error` is `forbidden`.
- `404`: No such Document on this Brand, or it has not been finalized. `error` is `not_found`.

---

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