Skip to content
AdCrunch
Esc
navigateopen⌘Jpreview

Get a document

Reads one document of a Brand. The answer has the document data and the URL to read the file from.

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

Send Authorization: Bearer <credential>. Two credentials work.

An API key (acr_…) is what a server integration uses. Create one in the AdCrunch console under Settings → API keys — see https://docs.adcrunch.dev/account/api-keys. A key is bound to the organization that was active when you created it, and it keeps acting on that organization whatever you do later. It carries the permissions of the member who created it.

A session issued by the AdCrunch sign-in flow also works, which is how the console calls this service from the browser.

Either way the organization comes from the credential. There is no organization parameter.

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

The Document.

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
401

No credential, or one that does not resolve. Send an API key or a session. 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.adcrunch.dev/context/brands/string/documents/string" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
{
  "createdAt": 0,
  "filename": "string",
  "id": "string",
  "mimeType": "string",
  "name": "string",
  "sizeBytes": 0,
  "targetId": "string",
  "targetType": "string",
  "url": "string"
}