Start a document upload
Reserves a document on a Brand, and is the first of the three steps of an upload. The answer gives a URL with a short life. PUT the bytes to that URL with their Content-Type, then call finalize. The bytes do not go through this API. AdCrunch accepts PDF, GIF, JPEG, PNG and WebP. It refuses SVG, because a stored document is served from an adcrunch.dev host and an SVG carries script.
/context/brands/{slug}/documentsAuthorizationBearer token · headerrequiredSend 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.
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, valid for expiresInSeconds. PUT the bytes to uploadUrl, then call finalize with documentId. The URL itself gives write access: anybody holding it can write that one object until it lapses. 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.
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[]requiredOne entry for each field that does not match.
Show propertiesHide properties
objectinstringrequiredThe part of the request that holds the field.
bodycookieheadersparamsquerymessagestringrequiredA sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.
pathstringrequiredA JSON Pointer into that part of the request, such as /filename. An empty string is the whole part.
errorstringrequiredA stable code for the failure. This is the field to branch on. It does not change for a given failure.
invalid_requestmessagestringrequiredA 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 API key, or one that does not resolve. 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.