Start a document upload
Reserves a document on a Brand. The answer gives a URL with a short life. Send the bytes to that URL, then call finalize. The bytes do not go through this API.
/context/brands/{slug}/documents/AuthorizationBearer token · headerrequiredSend 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.
slugstringrequiredapplication/jsoncontent_typestringrequiredThe type you are about to upload. Re-checked against the stored object at finalize — this is only a declaration.
filenamestringrequiredA reserved destination. PUT the bytes to uploadUrl, then call finalize with documentId. The Document does not exist for any reader until finalize succeeds.
documentIdstringrequiredPass this to the finalize call.
expiresInSecondsnumberrequiredHow long uploadUrl stays valid. Reserve again if it lapses.
uploadUrlstringrequiredA short-lived presigned URL. PUT the bytes here.
No credential, or one that does not resolve. Send an API key or a session. See the security scheme. error is unauthorized.
errorstringrequiredA stable code for the failure. This is the field to branch on. It does not change for a given failure.
unauthorizedmessagestringrequiredA sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.
The caller does not hold brand:write. error is forbidden.
errorstringrequiredA stable code for the failure. This is the field to branch on. It does not change for a given failure.
forbiddenmessagestringrequiredA sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.
No Brand with that slug. error is not_found.
errorstringrequiredA stable code for the failure. This is the field to branch on. It does not change for a given failure.
messagestringrequiredA sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.
That media type is not accepted. error is unsupported_type, and allowed names every type that is. This is the declared type; the stored object is checked again at finalize.
allowedstring[]requiredEvery media type this API accepts as a Document.
errorstringrequiredA stable code for the failure. This is the field to branch on. It does not change for a given failure.
unsupported_typemessagestringrequiredA sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.