Reserve an Asset and mint an upload URL
Reserves an Asset and returns a presigned PUT URL to upload the bytes to. The URL is valid for one hour, and expiresAt says when it stops being accepted.
The client uploads directly to storage — the bytes never pass through this worker, because Cloudflare rejects over-limit request bodies at the proxy before any code runs. Call POST /assets/{id}/finalize once the upload completes.
The URL is the credential: anyone holding it can write that one key until it expires. Nothing is known about the file until finalize inspects what actually landed, so size and type cannot be enforced here.
The reserved Asset stays pending until finalize. No read, rename or list answers a pending Asset, and a reservation nobody finalizes is swept a day later, together with whatever landed under it.
/assets/uploadsAuthorizationBearer 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.
application/jsonfilenamestringrequiredThe name of the file you are about to send. Shown until somebody renames the Asset, and never used to look one up.
The reservation. Send the bytes to uploadUrl, then finalize assetId.
assetIdstringrequiredThe Asset this reservation made. Finalize it with this id.
expiresAtnumberrequiredWhen the upload URL stops being accepted.
uploadUrlstringrequiredPUT the bytes here, directly. The URL is the credential: anybody holding it can write that one object until it expires.
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 asset: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.
AdCrunch could not write the reservation. error is reservation_failed. Nothing was reserved, so send the request again.
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.