Before you start
You need:- an API key with
campaigns:generate - a product in LocalAds
- enough credits for every requested creative
Start a campaign
prompt is required and can contain up to 2,000 characters. Describe the
audience, angle, offer, visual tone, or other direction that should shape the
campaign.
language defaults to English. creative_count defaults to 10 and can be
3, 5, 10, 15, 20, 25, or 30.
For production integrations, you can optionally include an Idempotency-Key
header. Reuse the same key when retrying the same request after a network
failure:
202 Accepted and a Location header:
Retrieve the creatives
Poll the URL in theLocation response header:
completed, failed, or canceled.
Use backoff between requests rather than polling continuously.
A completed campaign may contain an individually failed creative. Check
failed_creative_count and the status of each creative before using the
results.
Not enough credits
When the organization cannot reserve all requested creatives, LocalAds returns422 Unprocessable Entity without creating the campaign: