Upload and register a creative

Hand the agent a file, and it uploads it, adds it to your library, and places it in an ad account — end to end.

This recipe walks the full creative-in flow: the agent takes a local file, uploads it to AdCrunch, finalizes it into an Asset, and registers it to one of your ad accounts — all from one prompt. Background: Bring your own creative.

The prompt

Take ~/creatives/summer-launch.mp4, add it to our AdCrunch library, and register it to the Acme ad account.

What the agent does

  1. Finds the account. It calls list_advertisers, matches “Acme”, and keeps the acc_… id.
  2. Reserves the Asset. asset_create_upload({ filename: 'summer-launch.mp4' }) returns an assetId and a short-lived uploadUrl.
  3. Uploads the bytes. The agent PUTs the file straight to uploadUrl from its own runtime — the video never passes through the chat.
  4. Finalizes and registers in one call. asset_finalize({ asset_id, advertiser_id }) validates the file, adds it to your library, and kicks off the registration.
  5. Polls until ready. It calls asset_get and watches the Registration go from running to ready. For a video this can take a few minutes.

The agent reports back the Asset id and the advertiser it’s now available in.

Reuse the same Asset across accounts

An Asset belongs to your organization, not to one account. To place the same video in a second advertiser, the agent skips the upload entirely and just calls asset_register with the existing asset_id — no re-upload.

If registration fails, don't re-upload

A failed Registration means the placement failed, not the upload. The Asset is stored; the agent should retry asset_register, not start over.

What it doesn’t do

Registering makes the creative available in the account — it doesn’t build an ad or spend money. Assembling it into a live ad is a separate step.