API reference
Campaigns
Campaigns group posts under a brief, objective, channels, content pillars and targets, with progress stats.
Campaigns group posts under a brief, objective, channels, content pillars and targets, with progress stats.
| Method | Endpoint | Summary |
|---|---|---|
| GET | /v1/workspaces/{ws}/campaigns |
List campaigns |
| POST | /v1/workspaces/{ws}/campaigns |
Create a campaign |
| GET | /v1/campaigns/{id} |
Get a campaign |
| PATCH | /v1/campaigns/{id} |
Update a campaign |
| DELETE | /v1/campaigns/{id} |
Delete a campaign |
List campaigns#
GET/v1/workspaces/{ws}/campaigns
Archived campaigns are hidden unless ?status=archived or ?include_archived=true. ?include=stats adds post counts.
Auth: API key (Authorization: Bearer obx_live_…). Requires scope posts:read with workspace role owner / admin / editor / contributor / viewer / agent.
Path parameters
| Name | Required | Description |
|---|---|---|
ws |
yes | Workspace id (ws_…) or slug |
Query parameters
| Name | Required | Description |
|---|---|---|
status |
no | |
include_archived |
no | |
include |
no | Related data to embed. |
limit |
no | Page size (default 50, max 200). |
cursor |
no | Opaque cursor from next_cursor. |
Response 200 — List. Errors: RFC 9457 Problem with a stable code (error codes).
curl -X GET "https://api.outboxer.dev/v1/workspaces/acme/campaigns?status=pending" \
-H "Authorization: Bearer $OUTBOXER_API_KEY"const res = await fetch('https://api.outboxer.dev/v1/workspaces/acme/campaigns?status=pending', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.OUTBOXER_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).code); // RFC 9457 problem
const data = await res.json();import os, uuid, requests
res = requests.request(
"GET",
"https://api.outboxer.dev/v1/workspaces/acme/campaigns?status=pending",
headers={"Authorization": f"Bearer {os.environ['OUTBOXER_API_KEY']}"},
)
res.raise_for_status() # problem details: res.json()["code"]
data = res.json()Create a campaign#
POST/v1/workspaces/{ws}/campaigns
brief (what it is about — agents read it before drafting), objective (awareness|engagement|traffic|conversions|launch|other), status (planned|active|completed|archived), starts_on/ends_on (YYYY-MM-DD), channel_ids, labels (content pillars), targets {posts_per_week, total_posts, kpis}. Attach posts with campaign_id. Needs campaigns:write.
Auth: API key (Authorization: Bearer obx_live_…). Requires scope campaigns:write with workspace role owner / admin / editor / agent.
Path parameters
| Name | Required | Description |
|---|---|---|
ws |
yes | Workspace id (ws_…) or slug |
Headers
| Name | Required | Description |
|---|---|---|
Idempotency-Key |
no | Replays within 24 h return the original response. |
Request body
| Field | Type | Description |
|---|---|---|
name |
string | |
brief |
string | null | What the campaign is about, audience, key messages, offers. Agents read this before drafting. |
objective |
string | null | One of: "awareness", "engagement", "traffic", "conversions", "launch", "other". |
status |
string | One of: "planned", "active", "completed", "archived". |
color |
string | |
starts_on |
string | null (date) | |
ends_on |
string | null (date) | |
channel_ids |
array of string | Channels this campaign publishes to (must belong to the workspace). |
labels |
array of string | Content pillars; put them on the posts too. |
targets |
object | |
targets.posts_per_week |
integer | |
targets.total_posts |
integer | |
targets.kpis |
object |
Schema: CampaignInput
Response 201 — Campaign. Errors: RFC 9457 Problem with a stable code (error codes).
curl -X POST "https://api.outboxer.dev/v1/workspaces/acme/campaigns" \
-H "Authorization: Bearer $OUTBOXER_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "Autumn roast launch",
"brief": "Launch the autumn single origin to home brewers. Key messages: cocoa and cherry notes, limited batch.",
"objective": "launch",
"status": "active",
"starts_on": "2026-10-15",
"ends_on": "2026-10-31",
"channel_ids": [
"ch_01j9zq3k8m5v2b7x4c6n1p0rx1"
],
"labels": [
"product"
],
"targets": {
"posts_per_week": 3,
"total_posts": 8
}
}'const res = await fetch('https://api.outboxer.dev/v1/workspaces/acme/campaigns', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.OUTBOXER_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Autumn roast launch",
"brief": "Launch the autumn single origin to home brewers. Key messages: cocoa and cherry notes, limited batch.",
"objective": "launch",
"status": "active",
"starts_on": "2026-10-15",
"ends_on": "2026-10-31",
"channel_ids": [
"ch_01j9zq3k8m5v2b7x4c6n1p0rx1"
],
"labels": [
"product"
],
"targets": {
"posts_per_week": 3,
"total_posts": 8
}
}),
});
if (!res.ok) throw new Error((await res.json()).code); // RFC 9457 problem
const data = await res.json();import os, uuid, requests
res = requests.request(
"POST",
"https://api.outboxer.dev/v1/workspaces/acme/campaigns",
headers={"Authorization": f"Bearer {os.environ['OUTBOXER_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
json={
"name": "Autumn roast launch",
"brief": "Launch the autumn single origin to home brewers. Key messages: cocoa and cherry notes, limited batch.",
"objective": "launch",
"status": "active",
"starts_on": "2026-10-15",
"ends_on": "2026-10-31",
"channel_ids": [
"ch_01j9zq3k8m5v2b7x4c6n1p0rx1"
],
"labels": [
"product"
],
"targets": {
"posts_per_week": 3,
"total_posts": 8
}
},
)
res.raise_for_status() # problem details: res.json()["code"]
data = res.json()Get a campaign#
GET/v1/campaigns/{id}
Includes stats: posts by status, next scheduled time, progress toward targets.total_posts.
Auth: API key (Authorization: Bearer obx_live_…). Requires scope posts:read with workspace role owner / admin / editor / contributor / viewer / agent.
Path parameters
| Name | Required | Description |
|---|---|---|
id |
yes | Campaign id (cmp_…). |
Response 200 — Campaign. Errors: RFC 9457 Problem with a stable code (error codes).
curl -X GET "https://api.outboxer.dev/v1/campaigns/cmp_01j9zq3k8m5v2b7x4c6n1p0r9s" \
-H "Authorization: Bearer $OUTBOXER_API_KEY"const res = await fetch('https://api.outboxer.dev/v1/campaigns/cmp_01j9zq3k8m5v2b7x4c6n1p0r9s', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.OUTBOXER_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).code); // RFC 9457 problem
const data = await res.json();import os, uuid, requests
res = requests.request(
"GET",
"https://api.outboxer.dev/v1/campaigns/cmp_01j9zq3k8m5v2b7x4c6n1p0r9s",
headers={"Authorization": f"Bearer {os.environ['OUTBOXER_API_KEY']}"},
)
res.raise_for_status() # problem details: res.json()["code"]
data = res.json()Update a campaign#
PATCH/v1/campaigns/{id}
Partial update; targets merge. Archive with {status: "archived"}.
Auth: API key (Authorization: Bearer obx_live_…). Requires scope campaigns:write with workspace role owner / admin / editor / agent.
Path parameters
| Name | Required | Description |
|---|---|---|
id |
yes | Campaign id (cmp_…). |
Request body
| Field | Type | Description |
|---|---|---|
name |
string | |
brief |
string | null | What the campaign is about, audience, key messages, offers. Agents read this before drafting. |
objective |
string | null | One of: "awareness", "engagement", "traffic", "conversions", "launch", "other". |
status |
string | One of: "planned", "active", "completed", "archived". |
color |
string | |
starts_on |
string | null (date) | |
ends_on |
string | null (date) | |
channel_ids |
array of string | Channels this campaign publishes to (must belong to the workspace). |
labels |
array of string | Content pillars; put them on the posts too. |
targets |
object | |
targets.posts_per_week |
integer | |
targets.total_posts |
integer | |
targets.kpis |
object |
Schema: CampaignInput
Response 200 — Campaign. Errors: RFC 9457 Problem with a stable code (error codes).
curl -X PATCH "https://api.outboxer.dev/v1/campaigns/cmp_01j9zq3k8m5v2b7x4c6n1p0r9s" \
-H "Authorization: Bearer $OUTBOXER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "completed",
"targets": {
"total_posts": 10
}
}'const res = await fetch('https://api.outboxer.dev/v1/campaigns/cmp_01j9zq3k8m5v2b7x4c6n1p0r9s', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.OUTBOXER_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"status": "completed",
"targets": {
"total_posts": 10
}
}),
});
if (!res.ok) throw new Error((await res.json()).code); // RFC 9457 problem
const data = await res.json();import os, uuid, requests
res = requests.request(
"PATCH",
"https://api.outboxer.dev/v1/campaigns/cmp_01j9zq3k8m5v2b7x4c6n1p0r9s",
headers={"Authorization": f"Bearer {os.environ['OUTBOXER_API_KEY']}"},
json={
"status": "completed",
"targets": {
"total_posts": 10
}
},
)
res.raise_for_status() # problem details: res.json()["code"]
data = res.json()Delete a campaign#
DELETE/v1/campaigns/{id}
Posts are kept and detached. Prefer archiving.
Auth: API key (Authorization: Bearer obx_live_…). Requires scope campaigns:write with workspace role owner / admin / editor / agent.
Path parameters
| Name | Required | Description |
|---|---|---|
id |
yes | Campaign id (cmp_…). |
Response 200 — Object. Errors: RFC 9457 Problem with a stable code (error codes).
curl -X DELETE "https://api.outboxer.dev/v1/campaigns/cmp_01j9zq3k8m5v2b7x4c6n1p0r9s" \
-H "Authorization: Bearer $OUTBOXER_API_KEY"const res = await fetch('https://api.outboxer.dev/v1/campaigns/cmp_01j9zq3k8m5v2b7x4c6n1p0r9s', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.OUTBOXER_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).code); // RFC 9457 problem
const data = await res.json();import os, uuid, requests
res = requests.request(
"DELETE",
"https://api.outboxer.dev/v1/campaigns/cmp_01j9zq3k8m5v2b7x4c6n1p0r9s",
headers={"Authorization": f"Bearer {os.environ['OUTBOXER_API_KEY']}"},
)
res.raise_for_status() # problem details: res.json()["code"]
data = res.json()