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. That starts the same Registration as POST /assets/{id}/registrations, and it starts one only — the Registration settles later. 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>.
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.
idstringrequiredapplication/jsonadvertiserIdstringPlace the file in this advertiser’s library in the same call. Optional — send no body to store the file alone.
The stored Asset, now ready. sizeBytes is read off the stored object. mimeType and kind are the declared type, verified against the stored bytes. width, height and durationMs are read from the header of the file. 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, read from the header of the file at finalize. null for an image. For a video, null when the file does not state it, or for an Asset uploaded before AdCrunch read it.
filenamestringrequiredThe name the file was uploaded under. Never a lookup key.
heightnumber | nullrequiredThe height in pixels as the file is displayed, with its rotation applied, read from the header of the file at finalize. null when the file does not state it, or for an Asset uploaded before AdCrunch read it.
idstringrequiredkeystringrequiredWhere the bytes are held. Read-only, and never sent by you.
kindstringrequiredFollows from mimeType, so the stored bytes verify it at finalize. It selects how a provider takes the file.
imagevideomimeTypestringrequiredThe Content-Type the file was uploaded with, verified against the stored bytes 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 | nullrequiredThe width in pixels as the file is displayed, with its rotation applied, read from the header of the file at finalize. null when the file does not state it, or for an Asset uploaded before AdCrunch read it.
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.
No Asset with that id in this organization. A deleted one answers this too. 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.
AdCrunch refused the stored file and deleted it. error names why:
unsupported_type: the file was uploaded with aContent-Typethat AdCrunch does not accept.type_mismatch: the bytes are an accepted type, but not theContent-Typethe file was uploaded with. PUT it again with its real type.unreadable: the bytes are no accepted type, or the file ends before its header does.
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.