Put an image or a video on an ad
direct_media_attachAttach local images or videos to an existing ad by uploading media, creating a creative, and updating the ad in one flow. Existing headlines and texts are preserved, and the ad is read back to confirm the result.
Instructions
Attach local images or videos to an existing ad, doing the whole chain rather than one call.
A video takes three steps: uploading it puts it in the media library and nothing else, a creative has to be made from it, and only then can it go on the ad. Every step reports success on its own, which is why this is one tool.
Updating an ad also means resending its headlines and texts unchanged — the account requires them even when only a video changes, although the documentation does not say so. This tool reads the ad first and does that for you, and it never sends the legacy field that would collapse the ad to a single headline.
It reads the ad back afterwards and shows the headline count.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ad_id | Yes | the ad to attach to | |
| images | No | objects with path, and optionally type (REGULAR, WIDE, FIXED_IMAGE, AUTO) and name | |
| videos | No | objects with path, and optionally name | |
| confirmation | No | the exact phrase the refusal asks for |