Concepts
Products
Products belong to a brand and group product variants and audiences for ad generation.
A product is a thing your brand sells. Products belong to exactly one brand and group product variants (SKUs) and target audiences.
Mental model
A product is the unit of "what this ad is selling". Every image ad generation request specifies a product_id. The product's name, description, and details inform the AI copy and creative direction.
ID prefix: prod_.
Fields
| Field | Type | Description |
|---|---|---|
id | string | prod_… |
brand_id | string | Owning brand (brand_…) |
name | string | Product name |
description | string | null | Long-form description used to inform ad copy |
details | object | null | Free-form product metadata (features, benefits, USPs) |
created_at / updated_at | string | ISO timestamps |
Endpoints
| Method | Path | Purpose |
|---|---|---|
POST | /v1/products | Create a product |
GET | /v1/products | List products |
GET | /v1/products/:id | Get a product |
PATCH | /v1/products/:id | Update a product |
DELETE | /v1/products/:id | Delete a product |
Common patterns
Create a product
const response = await fetch("https://api.staticadslab.com/v1/products", {
method: "POST",
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
brand_id: "brand_YOUR_BRAND_ID",
name: "Trail Runner Pro",
description: "Lightweight trail-running shoes with carbon-plate stability.",
}),
});
const { data } = await response.json();
console.log(data.id); // prod_...curl -s -X POST https://api.staticadslab.com/v1/products \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"brand_id": "brand_YOUR_BRAND_ID",
"name": "Trail Runner Pro",
"description": "Lightweight trail-running shoes with carbon-plate stability."
}'import requests
response = requests.post(
"https://api.staticadslab.com/v1/products",
headers={"X-API-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
json={
"brand_id": "brand_YOUR_BRAND_ID",
"name": "Trail Runner Pro",
"description": "Lightweight trail-running shoes with carbon-plate stability.",
},
)
print(response.json()["data"]["id"])List a brand's products
const response = await fetch(
`https://api.staticadslab.com/v1/products?brand_id=brand_YOUR_BRAND_ID`,
{ headers: { "X-API-Key": "YOUR_API_KEY" } },
);
const { data } = await response.json();Pitfalls
- The API will reject
POST /v1/image-adswith422if theproduct_iddoesn't belong to thebrand_idyou also passed — they must be linked. - Product
descriptionis used by the AI copy generator. Vague descriptions produce vague copy. Specific descriptions produce better ads.
Related
Prompt for your agent
Read https://www.staticadslab.com/docs/resources/products.mdx and create three products under brand brand_YOUR_BRAND_ID with realistic names and descriptions.