POST https://makelocalads.com/api/v1/campaigns
Permission: campaigns:generate
Open in LocalAds
The campaign creator in the product’s Ad Campaign studio.
Usage notes
- Guided mode (the default) requires
audience_id: a saved audience of the product, ornullfor a deliberately broad campaign. Leaving it out returns400 invalid_request, so an audience is never skipped by accident. See Audiences. - Prompt mode takes a
briefinstead: it is the whole direction, with no audience step. creative_countis any whole number from 1 to 60, so a campaign can be a single ad creative ("creative_count": 1) or anything up to 60.- Each creative costs 2 credits.
max_creditsrefuses the request with422before anything is charged if the campaign would cost more. - Send an
Idempotency-Keyso a retry after a network failure never starts and charges for a second campaign.
Quick start
The choices
A custom campaign (
blueprint_ids) splits the creatives across the ad types
as evenly as the count allows, with any remainder going to the first types:
10 across three types is 4, 3 and 3. creative_count must be at least the
number of types. Angles apply to a single recipe, so they cannot be combined with
blueprint_ids.
For a single ad creative, send a count of 1:
The original
prompt field still works: it means prompt mode with that
brief. New integrations should send
mode: "prompt" and brief.Input fields
string
required
The product the campaign is for, with
status: "ready".string
guided (the default) starts with the audience, then a recipe or ad types.
prompt takes a brief and has no audience step.string
One recipe from
GET /campaign-blueprints. Optional; without a recipe or ad
types, one is chosen for the product.array
Several ad types for a custom campaign, 1 to 60 unique recipe ids. Creatives
are split across them as evenly as the count allows, the first types taking
any remainder, so
creative_count must be at least the number of types. Not
allowed with angles.string
Required in guided mode. A saved audience of the product, from
GET /products/{product_id}/audiences, or null for a broad campaign.
Prompt mode takes no audience: omit it or send null.array
Angles for a single recipe, usually from
Recipes and angles. 1 to 10 strings, up
to 300 characters each. Not allowed with
blueprint_ids.string
Optional in guided mode, up to 2,000 characters. Required in prompt mode,
where it is the whole direction.
string
Deprecated. The original prompt-only field: sending it means prompt mode with
this brief. Use
mode: "prompt" and brief instead.string
One of
1:1, 4:5, 9:16, 16:9. Defaults to 1:1.string
One of the 42 supported languages, such as
English, Hindi, Spanish.
Defaults to the brand’s saved language, else English.integer
How many creatives to make: any whole number from 1 to 60. Send
1 for a
single ad creative. Defaults to 10. For blueprint_ids, at least the
number of ad types (the default is the multiple of the ad type count nearest
10).integer
Refuse the request with
422 credit_limit_exceeded, before anything is
charged, if it would cost more than this many credits.Complete JSON schema
Complete JSON schema
Response
LocalAds returns202 Accepted and a Location header:
Location header until status is completed, failed,
or canceled, with backoff between requests. See
Polling.
Completed creatives appear while the rest continue generating. A completed
campaign may contain an individually failed creative. Its credits are refunded
and credits_charged goes down to match. Check failed_creative_count and
each creative’s status before using the results.
Errors
See Errors and retries for the error format.