asset_finalize
Complete an upload after the bytes have been PUT, validate the file, and add the Asset to your library — optionally registering it in the same call.
Completes an upload after the bytes have been PUT to the URL from asset_create_upload, and adds the Asset to your library. The file is validated here — nothing about it is known until it lands — so a wrong type or an oversized file is rejected at this step.
Input
| Field | Type | Required | Description |
|---|---|---|---|
asset_id |
ast_* |
yes | The Asset id returned by asset_create_upload. |
advertiser_id |
acc_* |
no | Register the Asset to this advertiser in the same call. |
Output
{ asset, registration? }:
asset— the finalized Asset (nowstatus: 'ready'), shaped like anasset_listrow.registration— present only whenadvertiser_idwas given: the outcome of the inline registration.
Example
“Finalize that upload and register it to the Acme account.”
Claude calls asset_finalize({ asset_id: 'ast_…', advertiser_id: 'acc_…' }), then polls asset_get until the Registration is ready.
Errors
Finalizing refuses a file it can’t turn into a usable Asset:
not_uploaded— the bytes haven’t arrived.PUTthem to theuploadUrlfirst, then call again.too_large— larger than the provider accepts. The file is discarded; upload a smaller version.unsupported_type— not usable in ads. Discarded; use JPEG, PNG, WebP, GIF, or MP4.type_mismatch— the bytes are a different type from theContent-Typethey were uploaded with. Discarded; upload again with the real type.unreadable— the bytes are no accepted type, or the file ends before its header does. Discarded; upload an intact file of an accepted type.not_found— no such Asset in this organization.401or403— see Errors, which every tool shares. This one needsasset:write.