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.
Request
- Base URL: https://api.adcrunch.dev
- URL: https://api.adcrunch.dev/assets/{id}/finalize
- Auth: HTTP bearer
Path parameters
The Asset the reservation made.
Request body
Example request
{
"advertiserId": "acc_1203456789012345"
}Response
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.
Example response
{
"contentHash": "9d2f41b7c6e8a35014f7b2d9c3e6a810",
"createdAt": 1790000000000,
"createdBy": "usr_2e5b84",
"deletedAt": null,
"durationMs": 15000,
"filename": "spring-sale.mp4",
"height": 1920,
"id": "ast_7c1e9a",
"key": "org_3a7f10/ast_7c1e9a",
"kind": "video",
"mimeType": "video/mp4",
"name": null,
"organizationId": "org_3a7f10",
"sizeBytes": 24117248,
"status": "ready",
"updatedAt": 1790000120000,
"width": 1080
}Changes
No recorded changes to this operation across all 1 revision of this API.