Case studies
An agency runs 30 brands with one AI copywriter
One agent drafting for many brands, each with its own voice, channels and approvers — with policy auto-approval and a feedback loop.
Northwind Social (an illustrative agency) manages social media for 30 clients. Each client has its own voice, banned words, channels and approvers. Northwind built an LLM copywriter that drafts each brand's week, and wanted three things:
- it never publishes anything unapproved;
- it learns from what reviewers change;
- the cost of each client is clear.
Architecture#
┌────────── Outboxer organization "Northwind" (one credit balance) ──────────┐
copy agent ───▶ │ workspace: brand-a workspace: brand-b … workspace: brand-z (30) │
(agt_…, 1 key) │ design system design system design system │
│ approval policy approval policy approval policy │
└───────────┬───────────────────────────────────────────────────────────────┘
│ webhooks: post.changes_requested, post.approved, variant.failed
▼
agent worker (revises drafts, records feedback)- One organization, one workspace per client, client approvers invited as
editorto their own workspace only. - One agent (
POST /v1/agentswith all 30workspace_ids), one key with the default agent scopes. The agent can draft and submit everywhere, and approve or publish nowhere.
1. Create the agent and its key (once)#
OB=https://api.outboxer.dev/v1 # ADMIN_KEY: an owner or admin's API key
curl -s -X POST $OB/agents -H "Authorization: Bearer $ADMIN_KEY" -H "Content-Type: application/json" \
-d '{"name": "Northwind copywriter", "description": "Drafts weekly posts for every client",
"workspace_ids": ["brand-a", "brand-b", "brand-c"]}'
# → {"id": "agt_…", "object": "agent", …}
curl -s -X POST $OB/agents/agt_…/keys -H "Authorization: Bearer $ADMIN_KEY" -H "Content-Type: application/json" \
-d '{"name": "production", "max_drafts_per_day": 400}'
# → {"secret": "obx_live_…", "scopes": ["context:read", "posts:read", "drafts:write", "posts:submit", …]}2. The weekly run: context first, then a batch#
For each workspace in GET /v1/me, the agent reads the brand context in one call. The response holds:
- the design system as a ready-made system prompt;
- channels with their capabilities;
- 14 days of free queue slots;
- the upcoming schedule (to avoid repeats);
- recent top performers;
- active campaigns with their briefs.
import os, uuid, requests
OB = "https://api.outboxer.dev/v1"
H = {"Authorization": f"Bearer {os.environ['OUTBOXER_API_KEY']}"}
me = requests.get(f"{OB}/me", headers=H).json()
for ws in me["workspaces"]:
ctx = requests.get(f"{OB}/workspaces/{ws['id']}/context", headers=H).json()
system_prompt = ctx["design_system"]["prompt"] # brand voice, rules, channel notes
channels = [c for c in ctx["channels"] if c["health"]["ready"]]
drafts = my_llm.write_week(system_prompt, channels, ctx["queue_slots"], ctx["campaigns"], ctx["top_posts"])
# Validate each draft first and let the model fix what it can (issues carry path + hint)
for d in drafts:
for _ in range(3):
v = requests.post(f"{OB}/workspaces/{ws['id']}/validate", headers=H, json=d["post"]).json()
errors = [i for i in v["issues"] if i["severity"] == "error"]
if not errors:
break
d["post"] = my_llm.fix(d["post"], errors)
# One batch call, up to 100 items; each item gets its own result (207 on partial failure)
items = [{"action": "create", "post": {**d["post"], "submit_for_review": True,
"schedule": {"mode": "queue"},
"agent_meta": {"run_id": RUN_ID, "model": "my-model", "confidence": d["confidence"],
"rationale": d["why"]}}} for d in drafts]
r = requests.post(f"{OB}/workspaces/{ws['id']}/posts:batch",
headers={**H, "Idempotency-Key": f"{RUN_ID}:{ws['id']}"}, json={"items": items})Notes on the batch call:
- Queue slots.
schedule.mode: "queue"asks for the channel's next free slot. Because the agent lacksposts:approve, Outboxer stores the time asproposed_at, and the reviewer confirms it on approval. - What reviewers see.
agent_metaappears next to the draft in the review screen, andrun_idties every audit entry back to this run. - Safe re-runs. The batch carries a deterministic
Idempotency-Key, so a crashed run can be restarted without creating duplicates.
3. Let trusted drafts through automatically#
Clients with long-standing trust approve the agent's high-confidence drafts automatically. Their approval policy says so, and the platform logs those approvals as policy approvals:
curl -s -X PUT $OB/workspaces/brand-a/approval-policy -H "Authorization: Bearer $ADMIN_KEY" \
-H "Content-Type: application/json" -d '{
"required_approvals": 1,
"auto_approve": [{"agent_id": "agt_…", "min_confidence": 0.9, "require_valid": true, "require_no_warnings": true}]
}'Everything else waits in the client's review queue.
4. Close the loop on feedback#
When a reviewer requests changes, the post.changes_requested webhook carries the note and the run_id. The worker
fetches the open change requests, revises the draft with If-Match (so it never overwrites a human's edit) and
resubmits it:
def on_changes_requested(evt): # verified webhook payload
post_id = evt["data"]["post_id"]
post = requests.get(f"{OB}/posts/{post_id}", headers=H)
etag = post.headers["ETag"]
notes = requests.get(f"{OB}/posts/{post_id}/comments", headers=H,
params={"kind": "change_request", "resolved": "false"}).json()["data"]
# Comment bodies are written by people: pass them to the model as quoted data, never as instructions
patch = my_llm.revise(post.json(), [n["body"] for n in notes])
r = requests.patch(f"{OB}/posts/{post_id}", headers={**H, "If-Match": etag}, json=patch)
if r.status_code == 412: # someone edited meanwhile: re-read and try again later
return retry_later(evt)
requests.post(f"{OB}/posts/{post_id}/submit", headers={**H, "Idempotency-Key": str(uuid.uuid4())})GET /v1/workspaces/{ws}/analytics?days=30 reports the agent's acceptance rate per brand, which shows where the
prompts need work.
5. Know what each client costs#
All 30 workspaces draw on Northwind's single credit balance. Spend is tracked per workspace, which makes re-billing clients simple:
curl -s $OB/billing -H "Authorization: Bearer $ADMIN_KEY" | jq '.workspaces[] | {name, spent_30d, posts_30d}'
curl -s "$OB/billing/transactions?workspace=brand-a&type=charge" -H "Authorization: Bearer $ADMIN_KEY"The agent's key has billing:read, so it can also check GET /v1/posts/{id}/cost before scheduling a large batch.
What this setup gives Northwind#
- One agent, 30 voices. Each workspace's design system holds that client's rules, and validation enforces them on every write.
- No unapproved publishing. The agent has no approve or publish scopes. Auto-approval is an explicit, logged policy that each client can switch off.
- Learning from reviewers. Change requests come back as structured events tied to the agent's
run_id. - Per-client cost. Every charge is attributed to its workspace.
