Skip to content
AdCrunch
Esc
↑↓navigate↵open⌘Jpreview

Get a document

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.

GET/context/brands/{slug}/documents/{documentId}
Authorization
AuthorizationBearer token · headerrequired

Send Authorization: Bearer <credential>.

Use an API key (acr_…), from the AdCrunch console under Settings → API keys.

The credential names the organization, and no operation takes an organization parameter.

See https://docs.adcrunch.dev/api/authentication.

Path parameters
documentIdstringrequired
matches ^doc_[\s\S]{0,}$
slugstringrequired
Responses
200

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

createdAtnumberrequired

Milliseconds since the Unix epoch, UTC.

filenamestringrequired
idstringrequired
mimeTypestringrequired
namestringrequired

The display name. Falls back to the filename.

sizeBytesnumberrequired

Read off the stored object at finalize, never from the client.

targetIdstringrequired
targetTypestringrequired

What the Document is attached to. brand today.

urlstringrequired
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.

issuesobject[]required

One entry for each field that does not match.

Show properties
Array of object
instringrequired

The part of the request that holds the field.

Allowed:bodycookieheadersparamsquery
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

pathstringrequired

A JSON Pointer into that part of the request, such as /filename. An empty string is the whole part.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:invalid_request
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

401

No API key, or one that does not resolve. See the security scheme. error is unauthorized.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:unauthorized
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

403

The caller does not hold brand:read. error is forbidden.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:forbidden
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

404

No such Document on this Brand, or it has not been finalized. error is not_found.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

Request
curl -X GET "https://api.pr-701.adcrunch.dev/context/brands/string/documents/string" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
{
  "createdAt": 1790000000000,
  "filename": "acme-brand-guidelines.pdf",
  "id": "doc_5e2b41",
  "mimeType": "application/pdf",
  "name": "acme-brand-guidelines.pdf",
  "sizeBytes": 1482064,
  "targetId": "brd_6a9c33",
  "targetType": "brand",
  "url": "https://documents.adcrunch.dev/org_3a7f10/doc_5e2b41"
}