This document indexes all active route handlers exposed by the PaceCast web application. Every endpoint enforces row-level security and tenant isolation by checking caller identity against workspace ownership.
Client Workspaces (/api/clients)
/api/clientsLists all client workspaces owned by or shared with the authenticated user.
{
"clients": [
{
"id": "01934c2b-e104-7da5-b982-b7e61a6c4290",
"name": "NorthStar Athletics",
"currency": "USD",
"timezone": "America/New_York",
"created_at": "2026-10-14T18:24:00.000Z"
}
]
}/api/clientsCreates a new isolated client workspace.
| Parameter | Type | Description |
|---|---|---|
namerequired | string | Client/Brand name. |
currencyrequired | string | 3-letter currency code (e.g. 'USD'). |
timezonerequired | string | IANA timezone (e.g. 'UTC'). |
Campaign Diagnostics & Runs (/api/campaign-diagnostics)
/api/campaign-diagnosticsIngests Meta or Google Ads CSV files, executes pre-flight checks, and generates an analysis run with diagnostic snapshots.
| Parameter | Type | Description |
|---|---|---|
client_idrequired | UUID | Target workspace UUID. |
metaoptional | File (.csv) | Daily Meta Ads Manager CSV export. |
googleoptional | File (.csv) | Daily Google Ads CSV export. |
horizon_daysoptional | integer | 30 or 60 days. Default: 30. |
spend_modeoptional | string | 'hold', 'scale', or 'plan'. |
AI Content Drafting (/api/content-draft)
/api/content-draftSynthesizes creative recommendations into a complete video script and visual brief. Debits 3 credits from the user's credit wallet upon successful generation.
{
"recommendation": { "id": "rec_123", "hookType": "problem_agitate" },
"plannedItem": { "format": "vertical_video", "targetDuration": 15 },
"brandProfile": { "industry": "Athletic Apparel", "tone": "Direct & energetic" }
}Billing & Credit Wallets (/api/billing/credits)
/api/billing/credits/balanceReturns current available, included, purchased, and reserved credit balances for the authenticated user.
{
"plan": "growth",
"availableCredits": 240,
"includedCredits": 200,
"purchasedCredits": 40,
"reservedCredits": 0
}