Concepts
Campaigns
A brief and the ads built for it. Every batch build lands in a campaign, and the campaign opens in the StaticAds.ai editor.
A campaign groups the ads built for one effort, such as a product launch or a seasonal angle. It belongs to one brand, carries an optional markdown brief, and keeps ad and review counts. Its studio_url opens it in the StaticAds.ai editor, where your team can review, comment and fine-tune. ID prefix: cmp_. Scopes: campaigns:read / campaigns:write.
Fields
| Field | Type | Notes |
|---|---|---|
id | string | cmp_… |
brand_id, brand_name | string | |
name | string | "Fleece hoodie launch: warmth without the bulk" |
brief | string or null | Markdown: audience, insight, angle, why each ad |
studio_url | string | Opens the campaign in the editor |
ad_counts | object | total, processing, completed, failed, approved, needs_changes, rejected, unreviewed |
archived_at | string or null | |
created_at, updated_at | string |
Endpoints
| Method | Path | What it does |
|---|---|---|
POST | /v1/campaigns | Create (brand_id, name, optional brief) |
GET | /v1/campaigns | List, most recently active first. Filters: search, ids, brand_id, archived, order_by (updated_at, created_at, name), order |
GET | /v1/campaigns/{id} | Get |
PATCH | /v1/campaigns/{id} | Rename or replace the brief |
POST | /v1/campaigns/{id}/archive / unarchive | Hide from lists, or bring back. Its ads are kept |
POST | /v1/campaigns/{id}/ads | Build up to 20 ads. See Build ads in batches |
GET | /v1/campaigns/{id}/ads | The campaign's ads, newest first. Filters: status, review_status (comma lists), archived |
Create a campaign
const { data: campaign } = await sal("/v1/campaigns", {
method: "POST",
body: {
brand_id: "brand_a1b2c3d4e5f67890",
name: "Heavyweight tee: built to last",
brief: [
"**Audience:** guys who are tired of tees that shrink and twist after three washes.",
"**Insight:** reviews mention the weight and the collar holding shape.",
"**Angle:** one tee that outlasts five.",
].join("\n"),
},
});Keep related builds in one campaign; start a new one for a new effort. A campaign's ads must use products of its brand.