Finalize an uploaded Asset
Completes a reserved Asset from the object that actually landed, and promotes it to ready.
This is the only real validation point: a presigned PUT carries no policy document, so nothing could have stopped the client sending a different type — or far more bytes — than it declared. A refused upload is deleted rather than left to bill as an orphan.
Pass advertiserId to place the file in the same call. The answer is the Asset either way. A registration that could not start does not fail this call, because the file is stored and only the registration needs retrying — read GET /assets/{id} for the Registration and its state.
/assets/{id}/finalizeAuthorizationBearer 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.
idstringrequiredapplication/jsonadvertiserIdstringPlace the file in this advertiser’s library in the same call. Optional.
The stored Asset, now ready. kind, mimeType and sizeBytes are read off the stored object rather than taken from your declaration. It carries no Registration, whether or not you asked for one.
contentHashstringrequiredAdCrunch’s own hash of the stored bytes. A hint for de-duplication, never an identity, and never a provider’s hash. Empty when the store reports none.
createdAtnumberrequiredMilliseconds since the Unix epoch, UTC.
createdBystringrequiredThe user who reserved the upload.
deletedAtnumber | nullrequiredAlways null here. A deleted Asset is not answered.
durationMsnumber | nullrequiredHow long the video runs, in milliseconds, where that is known. null for an image.
filenamestringrequiredThe name the file was uploaded under. Never a lookup key.
heightnumber | nullrequiredidstringrequiredkeystringrequiredWhere the bytes are held. Read-only, and never sent by you.
kindstringrequiredRead from the stored bytes at finalize, and never from what you declared. It selects how a provider takes the file.
imagevideomimeTypestringrequiredRead from the stored object at finalize.
namestring | nullrequiredThe name a person gave this Asset, and what a provider receives at a future registration. null until somebody renames it, and the filename is the fallback.
organizationIdstringrequiredsizeBytesnumberrequiredRead from the stored object at finalize.
statusstringrequiredready once the bytes have been inspected. A pending Asset is a reservation whose bytes have not arrived, and no operation here answers one.
pendingreadyupdatedAtnumber | nullrequiredMilliseconds since the Unix epoch, UTC.
widthnumber | nullrequiredNo 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 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.
No reservation with that id in this organization. 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.
The reservation exists and no bytes have arrived. error is not_uploaded.
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.
The stored file is over the limit for its kind, whatever was declared at reservation. error is too_large, and the object has been discarded.
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.
The stored file is not an accepted type, whatever was declared at reservation. error is unsupported_type, and the object has been discarded.
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.
The request did not match this operation’s schema. This is the framework’s own shape, not the error/message one.
errorsobject[]requiredOne entry per failing field.
foundanyrequiredWhat was sent.
messagestringrequiredonstringrequiredWhich part of the request failed: body, query or params.
propertystringrequiredThe field that failed.
typestringrequiredvalidation