# Briefs & Creatives

> **TL;DR for agents:** Brief: `POST /api/briefs {name, description, …}`. Creative: `POST /api/creatives {name, subject, bodyHtml}`. AI write: `POST /api/creatives/ai-generate`. Spintax `{a|b|c}` and `{{firstName}}` work in subject + body.

## Create a brief

```bash
curl -s -X POST "https://api.live-direct-marketing.online/api/briefs" \
  -H "Authorization: Bearer $LDM_KEY" -H "Content-Type: application/json" \
  -d '{
    "name":"Engineer outreach v1",
    "description":"ICP: heads of platform engineering at SaaS 50-500 FTE",
    "valueProp":"Cut deploy queue 40% in 2 weeks"
  }'
```

## Create a creative (with spintax + variables)

```bash
curl -s -X POST "https://api.live-direct-marketing.online/api/creatives" \
  -H "Authorization: Bearer $LDM_KEY" -H "Content-Type: application/json" \
  -d '{
    "name":"Engineer intro v1",
    "subject":"{Quick|Short|Brief} {question|note} for {{firstName}}",
    "bodyHtml":"<p>Hi {{firstName}},</p><p>...</p>"
  }'
```

## AI-generate a creative from a brief

Scope: `creatives:write` + `ai:write`. Brief context is fed to the configured AI provider (see `/ai-keys`).

```bash
curl -s -X POST "https://api.live-direct-marketing.online/api/creatives/ai-generate" \
  -H "Authorization: Bearer $LDM_KEY" -H "Content-Type: application/json" \
  -d '{"briefId":"$BRIEF_ID","tone":"professional","length":"short"}'
```
