{"openapi":"3.1.0","info":{"title":"MadeThis API","description":"Business primitives — money, email, outbound, ads, hosting, domains — for builders who bring their own coding agent. Generated from convex/api/registry.ts; do not edit by hand.","version":"0.1.0"},"servers":[{"url":"https://api.madethis.com/v1"}],"security":[],"paths":{"/ads":{"get":{"operationId":"get_ads","summary":"Ad budget and every campaign, newest first","tags":["Ads"],"security":[{"apiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Campaigns to return, 1-100 (default 20)","schema":{"type":"integer"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"budget":{"type":"object","properties":{"status":{"type":"string","enum":["active","paused","exhausted"]},"dailyBudgetCents":{"type":"integer"},"metaDailyBudgetCents":{"type":"integer"},"currentCycleSpendCents":{"type":"integer"},"weeklyCapCents":{"type":"integer"},"billingCycleStart":{"type":"number"},"billingCycleDays":{"type":"integer"},"prepaidCreditCents":{"type":"integer"},"availablePrepaidCents":{"type":"integer"},"fundingHoldReason":{"type":"string","nullable":true},"prepaidRefundShortfallCents":{"type":"integer"},"settlementInFlight":{"type":"boolean"},"metaBudgetSyncStatus":{"type":"string","enum":["pending","synced","failed"],"nullable":true}},"required":["status","dailyBudgetCents","metaDailyBudgetCents","currentCycleSpendCents","weeklyCapCents","billingCycleStart","billingCycleDays","prepaidCreditCents","availablePrepaidCents","fundingHoldReason","prepaidRefundShortfallCents","settlementInFlight","metaBudgetSyncStatus"],"additionalProperties":false,"nullable":true},"campaigns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"metaCampaignId":{"type":"string"},"destinationUrl":{"type":"string","nullable":true},"reviewFeedback":{"type":"string","nullable":true},"metrics":{"type":"object","properties":{"spendCents":{"type":"integer"},"impressions":{"type":"integer"},"reach":{"type":"integer"},"clicks":{"type":"integer"},"cpc":{"type":"number"},"ctr":{"type":"number"}},"required":["spendCents","impressions","reach","clicks","cpc","ctr"],"additionalProperties":false,"nullable":true},"lastSyncedAt":{"type":"number","nullable":true},"activatedAt":{"type":"number","nullable":true},"createdAt":{"type":"number"},"headline":{"type":"string","nullable":true},"primaryText":{"type":"string","nullable":true},"ctaType":{"type":"string","nullable":true},"audienceDescription":{"type":"string","nullable":true}},"required":["id","status","metaCampaignId","destinationUrl","reviewFeedback","metrics","lastSyncedAt","activatedAt","createdAt","headline","primaryText","ctaType","audienceDescription"],"additionalProperties":false}},"publishReadiness":{"type":"object","properties":{"ready":{"type":"boolean"},"blockedReason":{"type":"string","nullable":true},"goalPlanApproved":{"type":"boolean"}},"required":["ready","blockedReason","goalPlanApproved"],"additionalProperties":false}},"required":["budget","campaigns","publishReadiness"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ads/{id}/budget":{"patch":{"operationId":"patch_ads_by_id_budget","summary":"Change the daily ad budget (business-level; increases are spend-gated)","tags":["Ads"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dailyBudgetCents":{"type":"integer","exclusiveMinimum":true,"minimum":0,"maximum":50000},"expectedCurrentDailyBudgetCents":{"type":"integer","minimum":0,"maximum":100000000}},"required":["dailyBudgetCents","expectedCurrentDailyBudgetCents"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"campaignId":{"type":"string"},"scope":{"type":"string","enum":["business_daily_budget"]},"changed":{"type":"boolean"},"direction":{"type":"string","enum":["increase","decrease","unchanged"]},"dailyBudgetCents":{"type":"integer"},"metaDailyBudgetCents":{"type":"integer"},"weeklyCapCents":{"type":"integer"},"metaBudgetSyncStatus":{"type":"string"}},"required":["campaignId","scope","changed","direction","dailyBudgetCents","metaDailyBudgetCents","weeklyCapCents","metaBudgetSyncStatus"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"202":{"description":"Parked by the business's spend policy (kind: ad_budget_change). NOTHING has been spent, published or sent. Confirm with POST /v1/confirmations/{id}/confirm — or reject it — before the expiry; the original call is replayed exactly once.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["status","confirmation_id","expires_at"],"properties":{"status":{"type":"string","enum":["pending_confirmation"]},"confirmation_id":{"type":"string"},"summary":{"type":"string","description":"One line an owner can decide from."},"amountCents":{"type":["integer","null"],"description":"Cents this call would spend; null when not knowable up front, which always confirms."},"reason":{"type":"string"},"expires_at":{"type":"number"}}},"hint":{"type":"string"},"next_action":{"type":"string"}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ads/{id}/insights":{"get":{"operationId":"get_ads_by_id_insights","summary":"Performance for one campaign (checkpointed, lags Meta ~30m)","tags":["Ads"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"metaCampaignId":{"type":"string"},"destinationUrl":{"type":"string","nullable":true},"reviewFeedback":{"type":"string","nullable":true},"headline":{"type":"string","nullable":true},"metrics":{"type":"object","properties":{"spendCents":{"type":"integer"},"impressions":{"type":"integer"},"reach":{"type":"integer"},"clicks":{"type":"integer"},"cpc":{"type":"number"},"ctr":{"type":"number"},"cpm":{"type":"integer"}},"required":["spendCents","impressions","reach","clicks","cpc","ctr","cpm"],"additionalProperties":false,"nullable":true},"lastSyncedAt":{"type":"number","nullable":true},"activatedAt":{"type":"number","nullable":true},"createdAt":{"type":"number"},"cycle":{"type":"object","properties":{"currentCycleSpendCents":{"type":"integer"},"weeklyCapCents":{"type":"integer"},"billingCycleStart":{"type":"number"}},"required":["currentCycleSpendCents","weeklyCapCents","billingCycleStart"],"additionalProperties":false,"nullable":true}},"required":["id","status","metaCampaignId","destinationUrl","reviewFeedback","headline","metrics","lastSyncedAt","activatedAt","createdAt","cycle"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ads/{id}/pause":{"post":{"operationId":"post_ads_by_id_pause","summary":"Pause a campaign - never gated, always available","tags":["Ads"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"paused":{"type":"boolean"}},"required":["id","status","paused"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ads/interests":{"post":{"operationId":"post_ads_interests","summary":"Resolve interest names against Meta's targeting catalog","tags":["Ads"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"names":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"minItems":1,"maxItems":12}},"required":["names"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"query":{"type":"string"},"matches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"audienceSize":{"type":"number","nullable":true},"exact":{"type":"boolean"}},"required":["id","name","audienceSize","exact"],"additionalProperties":false}},"error":{"type":"string","nullable":true}},"required":["query","matches","error"],"additionalProperties":false}}},"required":["results"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ads/publish":{"post":{"operationId":"post_ads_publish","summary":"Create and launch a Meta campaign (async; spend-policy gated)","tags":["Ads"],"security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique per intent, 1–128 printable ASCII characters. Reuse the SAME value on a retry: the request replays instead of running twice.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"creativeStorageId":{"type":"string","minLength":1,"maxLength":128},"headline":{"type":"string","minLength":1,"maxLength":27},"primaryText":{"type":"string","minLength":1,"maxLength":125},"ctaType":{"type":"string","enum":["LEARN_MORE","SHOP_NOW","SIGN_UP","WATCH_MORE","GET_OFFER"]},"audienceDescription":{"type":"string","minLength":1,"maxLength":300},"dailyBudgetCents":{"type":"integer","exclusiveMinimum":true,"minimum":0,"maximum":50000},"targeting":{"type":"object","properties":{"geo_locations":{"type":"object","additionalProperties":{}},"excluded_geo_locations":{"type":"object","additionalProperties":{}},"age_min":{"type":"integer","minimum":13,"maximum":65},"age_max":{"type":"integer","minimum":13,"maximum":65},"genders":{"type":"array","items":{"anyOf":[{"type":"number","enum":[1]},{"type":"number","enum":[2]}]},"minItems":1,"maxItems":2},"locales":{"type":"array","items":{"type":"integer"},"minItems":1,"maxItems":20},"interests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":32},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["name"],"additionalProperties":false},"maxItems":25}},"required":["geo_locations"],"additionalProperties":false}},"required":["creativeStorageId","headline","primaryText","ctaType","audienceDescription","dailyBudgetCents","targeting"],"additionalProperties":false}}}},"responses":{"202":{"description":"Success envelope. Or, when the business's spend policy parks the call: Parked by the business's spend policy (kind: ad_publish). NOTHING has been spent, published or sent. Confirm with POST /v1/confirmations/{id}/confirm — or reject it — before the expiry; the original call is replayed exactly once.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["publishing","queued"]},"dispatchBlockedReason":{"type":"string","nullable":true},"proposalId":{"type":"string"},"taskId":{"type":"string"},"dailyBudgetCents":{"type":"integer"},"metaDailyBudgetCents":{"type":"integer"},"committedCents":{"type":"integer"},"commitmentDays":{"type":"integer"},"destinationUrl":{"type":"string"}},"required":["status","dispatchBlockedReason","proposalId","taskId","dailyBudgetCents","metaDailyBudgetCents","committedCents","commitmentDays","destinationUrl"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}},{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["status","confirmation_id","expires_at"],"properties":{"status":{"type":"string","enum":["pending_confirmation"]},"confirmation_id":{"type":"string"},"summary":{"type":"string","description":"One line an owner can decide from."},"amountCents":{"type":["integer","null"],"description":"Cents this call would spend; null when not knowable up front, which always confirms."},"reason":{"type":"string"},"expires_at":{"type":"number"}}},"hint":{"type":"string"},"next_action":{"type":"string"}}}]}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-idempotency":"Honors the Idempotency-Key header on POST."}},"/business":{"get":{"operationId":"get_business","summary":"Get the authenticated business","tags":["Business"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"state":{"type":"string"},"accessMode":{"type":"string","enum":["managed","headless"]},"hosting":{"type":"string","enum":["platform","external"]},"createdAt":{"type":"number"},"payouts":{"type":"object","properties":{"connectStatus":{"type":"string","nullable":true},"connectAccountExists":{"type":"boolean"},"chargesEnabled":{"type":"boolean"},"payoutsEnabled":{"type":"boolean"}},"required":["connectStatus","connectAccountExists","chargesEnabled","payoutsEnabled"],"additionalProperties":false},"revenue":{"type":"object","properties":{"grossCents":{"type":"integer"},"feesCents":{"type":"integer"},"netCents":{"type":"integer"},"payoutsCents":{"type":"integer"}},"required":["grossCents","feesCents","netCents","payoutsCents"],"additionalProperties":false},"customDomain":{"type":"string","nullable":true},"customDomainStatus":{"type":"string","nullable":true},"checkoutReturnUrls":{"type":"object","properties":{"successUrl":{"type":"string","nullable":true},"cancelUrl":{"type":"string","nullable":true}},"required":["successUrl","cancelUrl"],"additionalProperties":false},"spendPolicy":{"type":"object","properties":{"autoApproveUnderCents":{"type":"integer"}},"required":["autoApproveUnderCents"],"additionalProperties":false,"nullable":true}},"required":["id","name","slug","state","accessMode","hosting","createdAt","payouts","revenue","customDomain","customDomainStatus","checkoutReturnUrls","spendPolicy"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"patch_business","summary":"Set checkout return URLs and the unattended-spend policy","tags":["Business"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"checkoutReturnUrls":{"type":"object","properties":{"successUrl":{"type":"string","maxLength":2000,"nullable":true},"cancelUrl":{"type":"string","maxLength":2000,"nullable":true}},"additionalProperties":false},"spendPolicy":{"type":"object","properties":{"autoApproveUnderCents":{"type":"integer","minimum":0,"maximum":100000000,"nullable":true}},"additionalProperties":false,"nullable":true}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"checkoutReturnUrls":{"type":"object","properties":{"successUrl":{"type":"string","nullable":true},"cancelUrl":{"type":"string","nullable":true}},"required":["successUrl","cancelUrl"],"additionalProperties":false},"spendPolicy":{"type":"object","properties":{"autoApproveUnderCents":{"type":"number","nullable":true}},"required":["autoApproveUnderCents"],"additionalProperties":false,"nullable":true}},"required":["checkoutReturnUrls","spendPolicy"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/checkout-links":{"post":{"operationId":"post_checkout_links","summary":"Get a shareable checkout URL for an active product","tags":["Money"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"productId":{"type":"string","minLength":1,"maxLength":64}},"required":["productId"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"productId":{"type":"string"},"productName":{"type":"string"},"priceAmountCents":{"type":"integer"},"currency":{"type":"string"}},"required":["url","productId","productName","priceAmountCents","currency"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/cli-auth/poll":{"post":{"operationId":"post_cli_auth_poll","summary":"Poll a CLI login pairing for the minted key","tags":["Auth"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":4,"maxLength":16},"client_secret":{"type":"string","minLength":16,"maxLength":256}},"required":["code","client_secret"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["approved","pending","denied"]},"api_key":{"type":"string"}},"required":["status"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/cli-auth/start":{"post":{"operationId":"post_cli_auth_start","summary":"Begin a CLI login pairing","tags":["Auth"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_secret_hash":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["client_secret_hash"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"code":{"type":"string"},"verify_url":{"type":"string"},"expires_in_seconds":{"type":"integer"}},"required":["code","verify_url","expires_in_seconds"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/confirmations":{"get":{"operationId":"get_confirmations","summary":"List actions waiting on your confirmation","tags":["Confirmations"],"security":[{"apiKey":[]}],"parameters":[{"name":"status","in":"query","required":false,"description":"Filter by status","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size, 1-100 (default 20)","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"Opaque nextCursor from a previous page (URL-encode it)","schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"route":{"type":"string"},"summary":{"type":"string"},"amountCents":{"type":"number","nullable":true},"status":{"type":"string","enum":["pending","executing","executed","rejected","expired","failed"]},"createdAt":{"type":"number"},"expiresAt":{"type":"number"},"resolvedAt":{"type":"number","nullable":true},"error":{"type":"string","nullable":true}},"required":["id","kind","route","summary","amountCents","status","createdAt","expiresAt","resolvedAt","error"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true}},"required":["confirmations","nextCursor"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/confirmations/{id}":{"get":{"operationId":"get_confirmations_by_id","summary":"Get one confirmation, including its stored result once it has executed","tags":["Confirmations"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"route":{"type":"string"},"summary":{"type":"string"},"amountCents":{"type":"number","nullable":true},"status":{"type":"string","enum":["pending","executing","executed","rejected","expired","failed"]},"createdAt":{"type":"number"},"expiresAt":{"type":"number"},"resolvedAt":{"type":"number","nullable":true},"error":{"type":"string","nullable":true},"result":{"nullable":true}},"required":["id","kind","route","summary","amountCents","status","createdAt","expiresAt","resolvedAt","error"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/confirmations/{id}/confirm":{"post":{"operationId":"post_confirmations_by_id_confirm","summary":"Confirm a parked action — executes it exactly once","tags":["Confirmations"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The parked route's own success envelope, replayed. The STATUS mirrors that route too — 201 for a sequence enrolment, 202 for an ad publish — and is 200 when replaying a confirmation that had already executed. Treat any 2xx as success and read `data` per the variant.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"anyOf":[{"type":"object","properties":{"sequenceId":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"requested":{"type":"integer"},"added":{"type":"integer"},"skipped":{"type":"array","items":{"type":"object","properties":{"leadId":{"type":"string"},"reason":{"type":"string"}},"required":["leadId","reason"],"additionalProperties":false}},"totalLeads":{"type":"integer"},"outbound":{"type":"object","properties":{"configured":{"type":"boolean"},"domain":{"type":"string","nullable":true},"inboxCount":{"type":"integer"},"warmupStatus":{"type":"string","nullable":true},"dailySendCapacity":{"type":"integer"},"sendable":{"type":"boolean"}},"required":["configured","domain","inboxCount","warmupStatus","dailySendCapacity","sendable"],"additionalProperties":false}},"required":["sequenceId","status","requested","added","skipped","totalLeads","outbound"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"previousStatus":{"type":"string","enum":["draft","active","paused","archived"]},"totalLeads":{"type":"integer"},"outbound":{"type":"object","properties":{"configured":{"type":"boolean"},"domain":{"type":"string","nullable":true},"inboxCount":{"type":"integer"},"warmupStatus":{"type":"string","nullable":true},"dailySendCapacity":{"type":"integer"},"sendable":{"type":"boolean"}},"required":["configured","domain","inboxCount","warmupStatus","dailySendCapacity","sendable"],"additionalProperties":false}},"required":["id","status","previousStatus"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_approval","rejected","draft","scheduled","processing","review","retrying","published","partially_published","failed","deleted"]},"platforms":{"type":"array","items":{"type":"string"}},"scheduledAt":{"type":"number"},"content":{"type":"object","properties":{"title":{"type":"string","nullable":true},"text":{"type":"string","nullable":true},"link":{"type":"string","nullable":true},"mediaUrls":{"type":"array","items":{"type":"string"}}},"required":["title","text","link","mediaUrls"],"additionalProperties":false},"results":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"status":{"type":"string"},"permalink":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"retryable":{"type":"boolean","nullable":true}},"required":["platform","status","permalink","error","retryable"],"additionalProperties":false}},"error":{"type":"string","nullable":true},"canCancel":{"type":"boolean"},"canRetry":{"type":"boolean"},"terminalAt":{"type":"number","nullable":true},"createdAt":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","state","platforms","scheduledAt","content","results","error","canCancel","canRetry","terminalAt","createdAt","updatedAt"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["publishing","queued"]},"dispatchBlockedReason":{"type":"string","nullable":true},"proposalId":{"type":"string"},"taskId":{"type":"string"},"dailyBudgetCents":{"type":"integer"},"metaDailyBudgetCents":{"type":"integer"},"committedCents":{"type":"integer"},"commitmentDays":{"type":"integer"},"destinationUrl":{"type":"string"}},"required":["status","dispatchBlockedReason","proposalId","taskId","dailyBudgetCents","metaDailyBudgetCents","committedCents","commitmentDays","destinationUrl"],"additionalProperties":false},{"type":"object","properties":{"campaignId":{"type":"string"},"scope":{"type":"string","enum":["business_daily_budget"]},"changed":{"type":"boolean"},"direction":{"type":"string","enum":["increase","decrease","unchanged"]},"dailyBudgetCents":{"type":"integer"},"metaDailyBudgetCents":{"type":"integer"},"weeklyCapCents":{"type":"integer"},"metaBudgetSyncStatus":{"type":"string"}},"required":["campaignId","scope","changed","direction","dailyBudgetCents","metaDailyBudgetCents","weeklyCapCents","metaBudgetSyncStatus"],"additionalProperties":false}]},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"201":{"description":"The parked route's own success envelope, replayed. The STATUS mirrors that route too — 201 for a sequence enrolment, 202 for an ad publish — and is 200 when replaying a confirmation that had already executed. Treat any 2xx as success and read `data` per the variant.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"anyOf":[{"type":"object","properties":{"sequenceId":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"requested":{"type":"integer"},"added":{"type":"integer"},"skipped":{"type":"array","items":{"type":"object","properties":{"leadId":{"type":"string"},"reason":{"type":"string"}},"required":["leadId","reason"],"additionalProperties":false}},"totalLeads":{"type":"integer"},"outbound":{"type":"object","properties":{"configured":{"type":"boolean"},"domain":{"type":"string","nullable":true},"inboxCount":{"type":"integer"},"warmupStatus":{"type":"string","nullable":true},"dailySendCapacity":{"type":"integer"},"sendable":{"type":"boolean"}},"required":["configured","domain","inboxCount","warmupStatus","dailySendCapacity","sendable"],"additionalProperties":false}},"required":["sequenceId","status","requested","added","skipped","totalLeads","outbound"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"previousStatus":{"type":"string","enum":["draft","active","paused","archived"]},"totalLeads":{"type":"integer"},"outbound":{"type":"object","properties":{"configured":{"type":"boolean"},"domain":{"type":"string","nullable":true},"inboxCount":{"type":"integer"},"warmupStatus":{"type":"string","nullable":true},"dailySendCapacity":{"type":"integer"},"sendable":{"type":"boolean"}},"required":["configured","domain","inboxCount","warmupStatus","dailySendCapacity","sendable"],"additionalProperties":false}},"required":["id","status","previousStatus"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_approval","rejected","draft","scheduled","processing","review","retrying","published","partially_published","failed","deleted"]},"platforms":{"type":"array","items":{"type":"string"}},"scheduledAt":{"type":"number"},"content":{"type":"object","properties":{"title":{"type":"string","nullable":true},"text":{"type":"string","nullable":true},"link":{"type":"string","nullable":true},"mediaUrls":{"type":"array","items":{"type":"string"}}},"required":["title","text","link","mediaUrls"],"additionalProperties":false},"results":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"status":{"type":"string"},"permalink":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"retryable":{"type":"boolean","nullable":true}},"required":["platform","status","permalink","error","retryable"],"additionalProperties":false}},"error":{"type":"string","nullable":true},"canCancel":{"type":"boolean"},"canRetry":{"type":"boolean"},"terminalAt":{"type":"number","nullable":true},"createdAt":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","state","platforms","scheduledAt","content","results","error","canCancel","canRetry","terminalAt","createdAt","updatedAt"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["publishing","queued"]},"dispatchBlockedReason":{"type":"string","nullable":true},"proposalId":{"type":"string"},"taskId":{"type":"string"},"dailyBudgetCents":{"type":"integer"},"metaDailyBudgetCents":{"type":"integer"},"committedCents":{"type":"integer"},"commitmentDays":{"type":"integer"},"destinationUrl":{"type":"string"}},"required":["status","dispatchBlockedReason","proposalId","taskId","dailyBudgetCents","metaDailyBudgetCents","committedCents","commitmentDays","destinationUrl"],"additionalProperties":false},{"type":"object","properties":{"campaignId":{"type":"string"},"scope":{"type":"string","enum":["business_daily_budget"]},"changed":{"type":"boolean"},"direction":{"type":"string","enum":["increase","decrease","unchanged"]},"dailyBudgetCents":{"type":"integer"},"metaDailyBudgetCents":{"type":"integer"},"weeklyCapCents":{"type":"integer"},"metaBudgetSyncStatus":{"type":"string"}},"required":["campaignId","scope","changed","direction","dailyBudgetCents","metaDailyBudgetCents","weeklyCapCents","metaBudgetSyncStatus"],"additionalProperties":false}]},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"202":{"description":"The parked route's own success envelope, replayed. The STATUS mirrors that route too — 201 for a sequence enrolment, 202 for an ad publish — and is 200 when replaying a confirmation that had already executed. Treat any 2xx as success and read `data` per the variant.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"anyOf":[{"type":"object","properties":{"sequenceId":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"requested":{"type":"integer"},"added":{"type":"integer"},"skipped":{"type":"array","items":{"type":"object","properties":{"leadId":{"type":"string"},"reason":{"type":"string"}},"required":["leadId","reason"],"additionalProperties":false}},"totalLeads":{"type":"integer"},"outbound":{"type":"object","properties":{"configured":{"type":"boolean"},"domain":{"type":"string","nullable":true},"inboxCount":{"type":"integer"},"warmupStatus":{"type":"string","nullable":true},"dailySendCapacity":{"type":"integer"},"sendable":{"type":"boolean"}},"required":["configured","domain","inboxCount","warmupStatus","dailySendCapacity","sendable"],"additionalProperties":false}},"required":["sequenceId","status","requested","added","skipped","totalLeads","outbound"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"previousStatus":{"type":"string","enum":["draft","active","paused","archived"]},"totalLeads":{"type":"integer"},"outbound":{"type":"object","properties":{"configured":{"type":"boolean"},"domain":{"type":"string","nullable":true},"inboxCount":{"type":"integer"},"warmupStatus":{"type":"string","nullable":true},"dailySendCapacity":{"type":"integer"},"sendable":{"type":"boolean"}},"required":["configured","domain","inboxCount","warmupStatus","dailySendCapacity","sendable"],"additionalProperties":false}},"required":["id","status","previousStatus"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_approval","rejected","draft","scheduled","processing","review","retrying","published","partially_published","failed","deleted"]},"platforms":{"type":"array","items":{"type":"string"}},"scheduledAt":{"type":"number"},"content":{"type":"object","properties":{"title":{"type":"string","nullable":true},"text":{"type":"string","nullable":true},"link":{"type":"string","nullable":true},"mediaUrls":{"type":"array","items":{"type":"string"}}},"required":["title","text","link","mediaUrls"],"additionalProperties":false},"results":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"status":{"type":"string"},"permalink":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"retryable":{"type":"boolean","nullable":true}},"required":["platform","status","permalink","error","retryable"],"additionalProperties":false}},"error":{"type":"string","nullable":true},"canCancel":{"type":"boolean"},"canRetry":{"type":"boolean"},"terminalAt":{"type":"number","nullable":true},"createdAt":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","state","platforms","scheduledAt","content","results","error","canCancel","canRetry","terminalAt","createdAt","updatedAt"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["publishing","queued"]},"dispatchBlockedReason":{"type":"string","nullable":true},"proposalId":{"type":"string"},"taskId":{"type":"string"},"dailyBudgetCents":{"type":"integer"},"metaDailyBudgetCents":{"type":"integer"},"committedCents":{"type":"integer"},"commitmentDays":{"type":"integer"},"destinationUrl":{"type":"string"}},"required":["status","dispatchBlockedReason","proposalId","taskId","dailyBudgetCents","metaDailyBudgetCents","committedCents","commitmentDays","destinationUrl"],"additionalProperties":false},{"type":"object","properties":{"campaignId":{"type":"string"},"scope":{"type":"string","enum":["business_daily_budget"]},"changed":{"type":"boolean"},"direction":{"type":"string","enum":["increase","decrease","unchanged"]},"dailyBudgetCents":{"type":"integer"},"metaDailyBudgetCents":{"type":"integer"},"weeklyCapCents":{"type":"integer"},"metaBudgetSyncStatus":{"type":"string"}},"required":["campaignId","scope","changed","direction","dailyBudgetCents","metaDailyBudgetCents","weeklyCapCents","metaBudgetSyncStatus"],"additionalProperties":false}]},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/confirmations/{id}/reject":{"post":{"operationId":"post_confirmations_by_id_reject","summary":"Reject a parked action — it will never execute","tags":["Confirmations"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["rejected"]}},"required":["id","status"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains":{"get":{"operationId":"get_domains","summary":"List registered domains and the DNS records still required","tags":["Domains"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"domains":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"kind":{"type":"string","enum":["apex","subdomain"]},"status":{"type":"string","enum":["pending","verified"]},"verified":{"type":"boolean"},"verificationToken":{"type":"string"},"requiredRecords":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["TXT"]},"name":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer"},"purpose":{"type":"string"}},"required":["type","name","value","ttl","purpose"],"additionalProperties":false}},"missingRecords":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["TXT"]},"name":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer"},"purpose":{"type":"string"}},"required":["type","name","value","ttl","purpose"],"additionalProperties":false}},"createdAt":{"type":"number"},"verifiedAt":{"type":"number","nullable":true},"lastCheckedAt":{"type":"number","nullable":true},"lastCheckReason":{"type":"string","nullable":true},"lastCheckDetail":{"type":"string","nullable":true},"checkCount":{"type":"integer"}},"required":["id","domain","kind","status","verified","verificationToken","requiredRecords","missingRecords","createdAt","verifiedAt","lastCheckedAt","lastCheckReason","lastCheckDetail","checkCount"],"additionalProperties":false}},"checkoutReturnUrls":{"type":"object","properties":{"successUrl":{"type":"string","nullable":true},"successUrlOnVerifiedDomain":{"type":"boolean","nullable":true},"cancelUrl":{"type":"string","nullable":true},"cancelUrlOnVerifiedDomain":{"type":"boolean","nullable":true}},"required":["successUrl","successUrlOnVerifiedDomain","cancelUrl","cancelUrlOnVerifiedDomain"],"additionalProperties":false},"managedCustomDomain":{"type":"string","nullable":true},"managedCustomDomainStatus":{"type":"string","nullable":true},"limit":{"type":"integer"}},"required":["domains","checkoutReturnUrls","managedCustomDomain","managedCustomDomainStatus","limit"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"post_domains","summary":"Register a domain you host yourself; returns its verification record","tags":["Domains"],"security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique per intent, 1–128 printable ASCII characters. Reuse the SAME value on a retry: the request replays instead of running twice.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","minLength":3,"maxLength":253}},"required":["domain"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"kind":{"type":"string","enum":["apex","subdomain"]},"status":{"type":"string","enum":["pending","verified"]},"verified":{"type":"boolean"},"verificationToken":{"type":"string"},"requiredRecords":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["TXT"]},"name":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer"},"purpose":{"type":"string"}},"required":["type","name","value","ttl","purpose"],"additionalProperties":false}},"missingRecords":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["TXT"]},"name":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer"},"purpose":{"type":"string"}},"required":["type","name","value","ttl","purpose"],"additionalProperties":false}},"createdAt":{"type":"number"},"verifiedAt":{"type":"number","nullable":true},"lastCheckedAt":{"type":"number","nullable":true},"lastCheckReason":{"type":"string","nullable":true},"lastCheckDetail":{"type":"string","nullable":true},"checkCount":{"type":"integer"}},"required":["id","domain","kind","status","verified","verificationToken","requiredRecords","missingRecords","createdAt","verifiedAt","lastCheckedAt","lastCheckReason","lastCheckDetail","checkCount"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"kind":{"type":"string","enum":["apex","subdomain"]},"status":{"type":"string","enum":["pending","verified"]},"verified":{"type":"boolean"},"verificationToken":{"type":"string"},"requiredRecords":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["TXT"]},"name":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer"},"purpose":{"type":"string"}},"required":["type","name","value","ttl","purpose"],"additionalProperties":false}},"missingRecords":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["TXT"]},"name":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer"},"purpose":{"type":"string"}},"required":["type","name","value","ttl","purpose"],"additionalProperties":false}},"createdAt":{"type":"number"},"verifiedAt":{"type":"number","nullable":true},"lastCheckedAt":{"type":"number","nullable":true},"lastCheckReason":{"type":"string","nullable":true},"lastCheckDetail":{"type":"string","nullable":true},"checkCount":{"type":"integer"}},"required":["id","domain","kind","status","verified","verificationToken","requiredRecords","missingRecords","createdAt","verifiedAt","lastCheckedAt","lastCheckReason","lastCheckDetail","checkCount"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-idempotency":"Honors the Idempotency-Key header on POST."}},"/domains/{id}":{"delete":{"operationId":"delete_domains_by_id","summary":"Unregister a domain (DNS is left untouched)","tags":["Domains"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","domain","deleted"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains/{id}/verify":{"post":{"operationId":"post_domains_by_id_verify","summary":"Check DNS now and verify ownership","tags":["Domains"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"kind":{"type":"string","enum":["apex","subdomain"]},"status":{"type":"string","enum":["pending","verified"]},"verified":{"type":"boolean"},"verificationToken":{"type":"string"},"requiredRecords":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["TXT"]},"name":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer"},"purpose":{"type":"string"}},"required":["type","name","value","ttl","purpose"],"additionalProperties":false}},"missingRecords":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["TXT"]},"name":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer"},"purpose":{"type":"string"}},"required":["type","name","value","ttl","purpose"],"additionalProperties":false}},"createdAt":{"type":"number"},"verifiedAt":{"type":"number","nullable":true},"lastCheckedAt":{"type":"number","nullable":true},"lastCheckReason":{"type":"string","nullable":true},"lastCheckDetail":{"type":"string","nullable":true},"checkCount":{"type":"integer"}},"required":["id","domain","kind","status","verified","verificationToken","requiredRecords","missingRecords","createdAt","verifiedAt","lastCheckedAt","lastCheckReason","lastCheckDetail","checkCount"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/email/inbox":{"get":{"operationId":"get_email_inbox","summary":"Inbox address and provisioning status","tags":["Email"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["active","provisioning","none"]},"address":{"type":"string","nullable":true},"inboxId":{"type":"string","nullable":true},"domain":{"type":"string","nullable":true},"pendingDomain":{"type":"string","nullable":true},"provider":{"type":"string","enum":["agentmail"]}},"required":["status","address","inboxId","domain","pendingDomain","provider"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"post_email_inbox","summary":"Provision the business inbox (idempotent; still provisioning while DNS verifies)","tags":["Email"],"security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique per intent, 1–128 printable ASCII characters. Reuse the SAME value on a retry: the request replays instead of running twice.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subdomain":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["active","provisioning","none"]},"address":{"type":"string","nullable":true},"inboxId":{"type":"string","nullable":true},"domain":{"type":"string","nullable":true},"pendingDomain":{"type":"string","nullable":true},"provider":{"type":"string","enum":["agentmail"]}},"required":["status","address","inboxId","domain","pendingDomain","provider"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["active","provisioning","none"]},"address":{"type":"string","nullable":true},"inboxId":{"type":"string","nullable":true},"domain":{"type":"string","nullable":true},"pendingDomain":{"type":"string","nullable":true},"provider":{"type":"string","enum":["agentmail"]}},"required":["status","address","inboxId","domain","pendingDomain","provider"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"202":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["active","provisioning","none"]},"address":{"type":"string","nullable":true},"inboxId":{"type":"string","nullable":true},"domain":{"type":"string","nullable":true},"pendingDomain":{"type":"string","nullable":true},"provider":{"type":"string","enum":["agentmail"]}},"required":["status","address","inboxId","domain","pendingDomain","provider"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-idempotency":"Honors the Idempotency-Key header on POST."}},"/email/send":{"post":{"operationId":"post_email_send","summary":"Send an email from the business inbox (per-inbox daily cap)","tags":["Email"],"security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique per intent, 1–128 printable ASCII characters. Reuse the SAME value on a retry: the request replays instead of running twice.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"array","items":{"type":"string","minLength":3,"maxLength":320},"minItems":1,"maxItems":10},"cc":{"type":"array","items":{"type":"string","minLength":3,"maxLength":320},"maxItems":20},"bcc":{"type":"array","items":{"type":"string","minLength":3,"maxLength":320},"maxItems":20},"replyTo":{"type":"string","minLength":3,"maxLength":320},"subject":{"type":"string","minLength":1,"maxLength":200},"textBody":{"type":"string","maxLength":100000},"htmlBody":{"type":"string","maxLength":200000}},"required":["to","subject"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["sent"]},"providerMessageId":{"type":"string"},"from":{"type":"string","nullable":true},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"sentAt":{"type":"number"},"dailyCap":{"type":"object","properties":{"limit":{"type":"integer"},"used":{"type":"integer"},"remaining":{"type":"integer"}},"required":["limit","used","remaining"],"additionalProperties":false}},"required":["id","status","providerMessageId","from","to","cc","bcc","subject","sentAt","dailyCap"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["sent"]},"providerMessageId":{"type":"string"},"from":{"type":"string","nullable":true},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"sentAt":{"type":"number"},"dailyCap":{"type":"object","properties":{"limit":{"type":"integer"},"used":{"type":"integer"},"remaining":{"type":"integer"}},"required":["limit","used","remaining"],"additionalProperties":false}},"required":["id","status","providerMessageId","from","to","cc","bcc","subject","sentAt","dailyCap"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-idempotency":"Honors the Idempotency-Key header on POST."}},"/email/threads":{"get":{"operationId":"get_email_threads","summary":"List email threads, newest first","tags":["Email"],"security":[{"apiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, 1-100 (default 20)","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"Opaque nextCursor from a previous page (URL-encode it)","schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"threads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string"},"counterparty":{"type":"string"},"messageCount":{"type":"integer"},"unreadCount":{"type":"integer"},"lastMessageAt":{"type":"number"},"lastDirection":{"type":"string","enum":["inbound","outbound"]},"lastPreview":{"type":"string"}},"required":["id","subject","counterparty","messageCount","unreadCount","lastMessageAt","lastDirection","lastPreview"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true}},"required":["threads","nextCursor"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/email/threads/{id}":{"get":{"operationId":"get_email_threads_by_id","summary":"Get one thread with its messages, oldest first","tags":["Email"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string"},"counterparty":{"type":"string"},"messageCount":{"type":"integer"},"unreadCount":{"type":"integer"},"lastMessageAt":{"type":"number"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"status":{"type":"string","enum":["draft","sent","scheduled","received","failed"]},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"replyTo":{"type":"string","nullable":true},"subject":{"type":"string"},"textBody":{"type":"string","nullable":true},"htmlBody":{"type":"string","nullable":true},"providerMessageId":{"type":"string","nullable":true},"isRead":{"type":"boolean"},"sentAt":{"type":"number","nullable":true},"receivedAt":{"type":"number","nullable":true},"createdAt":{"type":"number"}},"required":["id","direction","status","from","to","cc","bcc","replyTo","subject","textBody","htmlBody","providerMessageId","isRead","sentAt","receivedAt","createdAt"],"additionalProperties":false}}},"required":["id","subject","counterparty","messageCount","unreadCount","lastMessageAt","messages"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/files":{"post":{"operationId":"post_files","summary":"Get a signed URL to upload a product deliverable","tags":["Files"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":255},"mimeType":{"type":"string","maxLength":255},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["sha256"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"uploadUrl":{"type":"string"},"uploadTicket":{"type":"string"},"method":{"type":"string","enum":["POST"]},"maxBytes":{"type":"integer"},"expiresInSeconds":{"type":"integer"},"allowedTypes":{"type":"string"}},"required":["uploadUrl","uploadTicket","method","maxBytes","expiresInSeconds","allowedTypes"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/files/complete":{"post":{"operationId":"post_files_complete","summary":"Register an uploaded file and get its permanent fileUrl","tags":["Files"],"security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique per intent, 1–128 printable ASCII characters. Reuse the SAME value on a retry: the request replays instead of running twice.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"storageId":{"type":"string","minLength":1,"maxLength":128},"uploadTicket":{"type":"string","minLength":1,"maxLength":128},"fileName":{"type":"string","minLength":1,"maxLength":255},"mimeType":{"type":"string","maxLength":255}},"required":["storageId","uploadTicket","fileName"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"fileId":{"type":"string"},"storageId":{"type":"string"},"fileName":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer"},"fileUrl":{"type":"string"}},"required":["fileId","storageId","fileName","mimeType","sizeBytes","fileUrl"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"fileId":{"type":"string"},"storageId":{"type":"string"},"fileName":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer"},"fileUrl":{"type":"string"}},"required":["fileId","storageId","fileName","mimeType","sizeBytes","fileUrl"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-idempotency":"Honors the Idempotency-Key header on POST."}},"/leads":{"get":{"operationId":"get_leads","summary":"List leads, newest first","tags":["Leads"],"security":[{"apiKey":[]}],"parameters":[{"name":"status","in":"query","required":false,"description":"Filter by lead status","schema":{"type":"string"}},{"name":"source","in":"query","required":false,"description":"apollo | manual | import (filters within a page)","schema":{"type":"string"}},{"name":"unenrolled","in":"query","required":false,"description":"\"true\" = only leads not in a sequence (filters within a page)","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size, 1-100 (default 20)","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"Opaque nextCursor from a previous page (URL-encode it)","schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"leads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fullName":{"type":"string"},"email":{"type":"string"},"jobTitle":{"type":"string","nullable":true},"companyName":{"type":"string","nullable":true},"companyDomain":{"type":"string","nullable":true},"linkedinUrl":{"type":"string","nullable":true},"location":{"type":"string","nullable":true},"status":{"type":"string","enum":["sourced","verified","sequence_created","active","replied","booked","not_interested","unsubscribed","bounced","exhausted"]},"source":{"type":"string","enum":["apollo","manual","import"]},"emailVerified":{"type":"boolean"},"optedOut":{"type":"boolean"},"sequenceId":{"type":"string","nullable":true},"currentStep":{"type":"integer","nullable":true},"nextStepAt":{"type":"number","nullable":true},"createdAt":{"type":"number"}},"required":["id","fullName","email","jobTitle","companyName","companyDomain","linkedinUrl","location","status","source","emailVerified","optedOut","sequenceId","currentStep","nextStepAt","createdAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true}},"required":["leads","nextCursor"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/leads/import":{"post":{"operationId":"post_leads_import","summary":"Import your own lead list (per-row rejections, deduped)","tags":["Leads"],"security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique per intent, 1–128 printable ASCII characters. Reuse the SAME value on a retry: the request replays instead of running twice.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leads":{"type":"array","items":{},"minItems":1,"maxItems":500}},"required":["leads"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"received":{"type":"integer"},"accepted":{"type":"integer"},"inserted":{"type":"integer"},"duplicates":{"type":"integer"},"rejected":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"email":{"type":"string","nullable":true},"reason":{"type":"string","enum":["not_an_object","missing_email","invalid_email","duplicate_in_batch","field_too_long","batch_limit_exceeded"]},"message":{"type":"string"}},"required":["index","email","reason","message"],"additionalProperties":false}},"leads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"}},"required":["id","email","status"],"additionalProperties":false}}},"required":["received","accepted","inserted","duplicates","rejected","leads"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"received":{"type":"integer"},"accepted":{"type":"integer"},"inserted":{"type":"integer"},"duplicates":{"type":"integer"},"rejected":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"email":{"type":"string","nullable":true},"reason":{"type":"string","enum":["not_an_object","missing_email","invalid_email","duplicate_in_batch","field_too_long","batch_limit_exceeded"]},"message":{"type":"string"}},"required":["index","email","reason","message"],"additionalProperties":false}},"leads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"}},"required":["id","email","status"],"additionalProperties":false}}},"required":["received","accepted","inserted","duplicates","rejected","leads"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-idempotency":"Honors the Idempotency-Key header on POST."}},"/leads/search":{"post":{"operationId":"post_leads_search","summary":"Search for leads matching an ICP (billed per Apollo enrichment)","tags":["Leads"],"security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique per intent, 1–128 printable ASCII characters. Reuse the SAME value on a retry: the request replays instead of running twice.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jobTitles":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"maxItems":20},"industries":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"maxItems":20},"locations":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"maxItems":20},"companySizeMin":{"type":"integer","minimum":1,"maximum":1000000},"companySizeMax":{"type":"integer","minimum":1,"maximum":1000000},"limit":{"type":"integer","minimum":1,"maximum":100,"default":25}},"additionalProperties":false}}}},"responses":{"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"totalFound":{"type":"integer"},"withVerifiedEmail":{"type":"integer"},"inserted":{"type":"integer"},"duplicates":{"type":"integer"},"leads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"fullName":{"type":"string"},"email":{"type":"string"},"jobTitle":{"type":"string","nullable":true},"companyName":{"type":"string","nullable":true},"companyDomain":{"type":"string","nullable":true},"location":{"type":"string","nullable":true},"linkedinUrl":{"type":"string","nullable":true}},"required":["id","fullName","email","jobTitle","companyName","companyDomain","location","linkedinUrl"],"additionalProperties":false}}},"required":["totalFound","withVerifiedEmail","inserted","duplicates","leads"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-idempotency":"Honors the Idempotency-Key header on POST."}},"/orders":{"get":{"operationId":"get_orders","summary":"List orders, newest first","tags":["Money"],"security":[{"apiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, 1-100 (default 20)","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"Opaque nextCursor from a previous page (URL-encode it)","schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"orders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"productId":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"productId":{"type":"string"},"productName":{"type":"string","nullable":true},"quantity":{"type":"integer"},"unitAmountCents":{"type":"integer","nullable":true}},"required":["productId","productName","quantity","unitAmountCents"],"additionalProperties":false},"nullable":true},"amountCents":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string"},"fulfillmentStatus":{"type":"string"},"customerEmail":{"type":"string","nullable":true},"customerName":{"type":"string","nullable":true},"shippingAddress":{"nullable":true},"fulfillmentError":{"type":"string","nullable":true},"deliveryError":{"type":"string","nullable":true},"downloadUrl":{"type":"string","nullable":true},"shipping":{"type":"object","properties":{"carrier":{"type":"string","nullable":true},"trackingNumber":{"type":"string","nullable":true},"shippedAt":{"type":"number","nullable":true}},"required":["carrier","trackingNumber","shippedAt"],"additionalProperties":false,"nullable":true},"createdAt":{"type":"number"}},"required":["id","productId","items","amountCents","currency","status","customerEmail","customerName","fulfillmentError","deliveryError","downloadUrl","shipping","createdAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true}},"required":["orders","nextCursor"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}":{"get":{"operationId":"get_orders_by_id","summary":"Get one order","tags":["Money"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"productId":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"productId":{"type":"string"},"productName":{"type":"string","nullable":true},"quantity":{"type":"integer"},"unitAmountCents":{"type":"integer","nullable":true}},"required":["productId","productName","quantity","unitAmountCents"],"additionalProperties":false},"nullable":true},"amountCents":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string"},"fulfillmentStatus":{"type":"string"},"customerEmail":{"type":"string","nullable":true},"customerName":{"type":"string","nullable":true},"shippingAddress":{"nullable":true},"fulfillmentError":{"type":"string","nullable":true},"deliveryError":{"type":"string","nullable":true},"downloadUrl":{"type":"string","nullable":true},"shipping":{"type":"object","properties":{"carrier":{"type":"string","nullable":true},"trackingNumber":{"type":"string","nullable":true},"shippedAt":{"type":"number","nullable":true}},"required":["carrier","trackingNumber","shippedAt"],"additionalProperties":false,"nullable":true},"createdAt":{"type":"number"}},"required":["id","productId","items","amountCents","currency","status","customerEmail","customerName","fulfillmentError","deliveryError","downloadUrl","shipping","createdAt"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}/refund":{"post":{"operationId":"post_orders_by_id_refund","summary":"Refund an order, fully or partially (Idempotency-Key required)","tags":["Money"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per intent, 1–128 printable ASCII characters. Reuse the SAME value on a retry: the request replays instead of running twice. Required on this route.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amountCents":{"type":"integer","exclusiveMinimum":true,"minimum":0,"maximum":100000000},"reason":{"type":"string","enum":["duplicate","fraudulent","requested_by_customer"]},"note":{"type":"string","maxLength":500}},"additionalProperties":false}}}},"responses":{"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"orderId":{"type":"string"},"refundId":{"type":"string"},"status":{"type":"string"},"amountCents":{"type":"integer"},"currency":{"type":"string"},"orderAmountCents":{"type":"integer"},"previouslyRefundedCents":{"type":"integer"},"remainingRefundableCents":{"type":"integer"},"reversedTransfer":{"type":"boolean"},"createdAt":{"type":"number"},"replayed":{"type":"boolean"}},"required":["orderId","refundId","status","amountCents","currency","orderAmountCents","previouslyRefundedCents","remainingRefundableCents","reversedTransfer","createdAt"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-idempotency":"Honors the Idempotency-Key header on POST."}},"/orders/{id}/ship":{"post":{"operationId":"post_orders_by_id_ship","summary":"Mark a physical order shipped, with optional tracking","tags":["Orders"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique per intent, 1–128 printable ASCII characters. Reuse the SAME value on a retry: the request replays instead of running twice.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"carrier":{"type":"string","maxLength":100},"trackingNumber":{"type":"string","maxLength":200},"note":{"type":"string","maxLength":500}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"orderId":{"type":"string"},"fulfillmentStatus":{"type":"string"},"carrier":{"type":"string","nullable":true},"trackingNumber":{"type":"string","nullable":true},"shippedAt":{"type":"number"},"replayed":{"type":"boolean"}},"required":["orderId","fulfillmentStatus","carrier","trackingNumber","shippedAt"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-idempotency":"Honors the Idempotency-Key header on POST."}},"/payouts":{"get":{"operationId":"get_payouts","summary":"Payout status and onboarding eligibility (Stripe Connect)","tags":["Money"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"connected":{"type":"boolean"},"connectStatus":{"type":"string","nullable":true},"chargesEnabled":{"type":"boolean"},"payoutsEnabled":{"type":"boolean"},"onboarding":{"type":"object","properties":{"available":{"type":"boolean"},"thresholdCents":{"type":"integer"},"unpaidRevenueCents":{"type":"integer"},"remainingCents":{"type":"integer"},"blockedReason":{"type":"string","nullable":true}},"required":["available","thresholdCents","unpaidRevenueCents","remainingCents","blockedReason"],"additionalProperties":false},"revenue":{"type":"object","properties":{"grossCents":{"type":"integer"},"feesCents":{"type":"integer"},"netCents":{"type":"integer"},"payoutsCents":{"type":"integer"}},"required":["grossCents","feesCents","netCents","payoutsCents"],"additionalProperties":false}},"required":["connected","connectStatus","chargesEnabled","payoutsEnabled","onboarding","revenue"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/payouts/onboarding-link":{"post":{"operationId":"post_payouts_onboarding_link","summary":"Start Stripe Connect payout onboarding","tags":["Money"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"returnUrl":{"type":"string","maxLength":2000},"refreshUrl":{"type":"string","maxLength":2000}},"additionalProperties":false}}}},"responses":{"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"accountId":{"type":"string"},"connectStatus":{"type":"string","nullable":true},"expiresAt":{"type":"integer"},"applicationFeeBps":{"type":"integer"},"returnUrl":{"type":"string"},"refreshUrl":{"type":"string"}},"required":["url","accountId","connectStatus","expiresAt","applicationFeeBps","returnUrl","refreshUrl"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products":{"get":{"operationId":"get_products","summary":"List products","tags":["Products"],"security":[{"apiKey":[]}],"parameters":[{"name":"status","in":"query","required":false,"description":"Filter: draft | active | archived","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100 (default 20)","schema":{"type":"integer"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["draft","active","archived"]},"pricingModel":{"type":"string","enum":["one_time","recurring"]},"priceAmountCents":{"type":"integer"},"currency":{"type":"string"},"recurringInterval":{"type":"string","enum":["day","week","month","year"],"nullable":true},"recurringIntervalCount":{"type":"integer","nullable":true},"productType":{"type":"string","nullable":true},"externalReference":{"type":"string","nullable":true},"inventoryQuantity":{"type":"integer","nullable":true},"deliveryType":{"type":"string","enum":["file","link","license_key"],"nullable":true},"fileUrl":{"type":"string","nullable":true},"imageUrl":{"type":"string","nullable":true},"requiresShipping":{"type":"boolean"},"stripeSyncStatus":{"type":"string","nullable":true},"createdAt":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","name","description","status","pricingModel","priceAmountCents","currency","recurringInterval","recurringIntervalCount","productType","externalReference","inventoryQuantity","deliveryType","fileUrl","imageUrl","requiresShipping","stripeSyncStatus","createdAt"],"additionalProperties":false}}},"required":["products"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"post_products","summary":"Create a product (syncs to Stripe when active)","tags":["Products"],"security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique per intent, 1–128 printable ASCII characters. Reuse the SAME value on a retry: the request replays instead of running twice.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":5000},"priceAmountCents":{"type":"integer","minimum":0,"maximum":100000000},"currency":{"type":"string","pattern":"^[a-zA-Z]{3}$","default":"usd"},"pricingModel":{"type":"string","enum":["one_time","recurring"],"default":"one_time"},"recurringInterval":{"type":"string","enum":["day","week","month","year"]},"recurringIntervalCount":{"type":"integer","minimum":1,"maximum":365},"productType":{"type":"string","maxLength":100},"externalReference":{"type":"string","minLength":1,"maxLength":200},"inventoryQuantity":{"type":"integer","minimum":0,"maximum":1000000000},"deliveryType":{"type":"string","enum":["file","link","license_key"]},"fileUrl":{"type":"string","format":"uri","maxLength":2000},"imageUrl":{"type":"string","format":"uri","maxLength":2000},"requiresShipping":{"type":"boolean"},"status":{"type":"string","enum":["draft","active"],"default":"active"}},"required":["name","priceAmountCents"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["draft","active","archived"]},"pricingModel":{"type":"string","enum":["one_time","recurring"]},"priceAmountCents":{"type":"integer"},"currency":{"type":"string"},"recurringInterval":{"type":"string","enum":["day","week","month","year"],"nullable":true},"recurringIntervalCount":{"type":"integer","nullable":true},"productType":{"type":"string","nullable":true},"externalReference":{"type":"string","nullable":true},"inventoryQuantity":{"type":"integer","nullable":true},"deliveryType":{"type":"string","enum":["file","link","license_key"],"nullable":true},"fileUrl":{"type":"string","nullable":true},"imageUrl":{"type":"string","nullable":true},"requiresShipping":{"type":"boolean"},"stripeSyncStatus":{"type":"string","nullable":true},"createdAt":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","name","description","status","pricingModel","priceAmountCents","currency","recurringInterval","recurringIntervalCount","productType","externalReference","inventoryQuantity","deliveryType","fileUrl","imageUrl","requiresShipping","stripeSyncStatus","createdAt"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-idempotency":"Honors the Idempotency-Key header on POST."}},"/products/{id}":{"get":{"operationId":"get_products_by_id","summary":"Get one product","tags":["Products"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["draft","active","archived"]},"pricingModel":{"type":"string","enum":["one_time","recurring"]},"priceAmountCents":{"type":"integer"},"currency":{"type":"string"},"recurringInterval":{"type":"string","enum":["day","week","month","year"],"nullable":true},"recurringIntervalCount":{"type":"integer","nullable":true},"productType":{"type":"string","nullable":true},"externalReference":{"type":"string","nullable":true},"inventoryQuantity":{"type":"integer","nullable":true},"deliveryType":{"type":"string","enum":["file","link","license_key"],"nullable":true},"fileUrl":{"type":"string","nullable":true},"imageUrl":{"type":"string","nullable":true},"requiresShipping":{"type":"boolean"},"stripeSyncStatus":{"type":"string","nullable":true},"createdAt":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","name","description","status","pricingModel","priceAmountCents","currency","recurringInterval","recurringIntervalCount","productType","externalReference","inventoryQuantity","deliveryType","fileUrl","imageUrl","requiresShipping","stripeSyncStatus","createdAt"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"patch_products_by_id","summary":"Update a product (status archived = retire)","tags":["Products"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":5000},"priceAmountCents":{"type":"integer","minimum":0,"maximum":100000000},"currency":{"type":"string","pattern":"^[a-zA-Z]{3}$"},"pricingModel":{"type":"string","enum":["one_time","recurring"]},"recurringInterval":{"type":"string","enum":["day","week","month","year"]},"recurringIntervalCount":{"type":"integer","minimum":1,"maximum":365},"productType":{"type":"string","maxLength":100},"externalReference":{"type":"string","minLength":1,"maxLength":200},"inventoryQuantity":{"type":"integer","minimum":0,"maximum":1000000000},"deliveryType":{"type":"string","enum":["file","link","license_key"]},"fileUrl":{"type":"string","format":"uri","maxLength":2000},"imageUrl":{"type":"string","format":"uri","maxLength":2000},"requiresShipping":{"type":"boolean"},"status":{"type":"string","enum":["draft","active","archived"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["draft","active","archived"]},"pricingModel":{"type":"string","enum":["one_time","recurring"]},"priceAmountCents":{"type":"integer"},"currency":{"type":"string"},"recurringInterval":{"type":"string","enum":["day","week","month","year"],"nullable":true},"recurringIntervalCount":{"type":"integer","nullable":true},"productType":{"type":"string","nullable":true},"externalReference":{"type":"string","nullable":true},"inventoryQuantity":{"type":"integer","nullable":true},"deliveryType":{"type":"string","enum":["file","link","license_key"],"nullable":true},"fileUrl":{"type":"string","nullable":true},"imageUrl":{"type":"string","nullable":true},"requiresShipping":{"type":"boolean"},"stripeSyncStatus":{"type":"string","nullable":true},"createdAt":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","name","description","status","pricingModel","priceAmountCents","currency","recurringInterval","recurringIntervalCount","productType","externalReference","inventoryQuantity","deliveryType","fileUrl","imageUrl","requiresShipping","stripeSyncStatus","createdAt"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sequences":{"get":{"operationId":"get_sequences","summary":"List sequences with send/reply/booked stats and outreach readiness","tags":["Leads"],"security":[{"apiKey":[]}],"parameters":[{"name":"status","in":"query","required":false,"description":"draft | active | paused | archived","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size, 1-200 (default 50)","schema":{"type":"integer"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"sequences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icpDescription":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"stepCount":{"type":"integer"},"tone":{"type":"string","nullable":true},"valueProps":{"type":"array","items":{"type":"string"}},"totalLeads":{"type":"integer"},"totalSent":{"type":"integer"},"totalReplied":{"type":"integer"},"totalBooked":{"type":"integer"},"createdAt":{"type":"number"}},"required":["id","name","icpDescription","status","stepCount","tone","valueProps","totalLeads","totalSent","totalReplied","totalBooked","createdAt"],"additionalProperties":false}},"totals":{"type":"object","properties":{"sequences":{"type":"integer"},"leads":{"type":"integer"},"sent":{"type":"integer"},"replied":{"type":"integer"},"booked":{"type":"integer"}},"required":["sequences","leads","sent","replied","booked"],"additionalProperties":false},"outbound":{"type":"object","properties":{"configured":{"type":"boolean"},"domain":{"type":"string","nullable":true},"inboxCount":{"type":"integer"},"warmupStatus":{"type":"string","nullable":true},"dailySendCapacity":{"type":"integer"},"sendable":{"type":"boolean"}},"required":["configured","domain","inboxCount","warmupStatus","dailySendCapacity","sendable"],"additionalProperties":false}},"required":["sequences","totals","outbound"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"post_sequences","summary":"Create a cold-email sequence (draft - sends nothing until leads are enrolled)","tags":["Leads"],"security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique per intent, 1–128 printable ASCII characters. Reuse the SAME value on a retry: the request replays instead of running twice.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"icpDescription":{"type":"string","minLength":1,"maxLength":2000},"steps":{"type":"array","items":{"type":"object","properties":{"delayDays":{"type":"integer","minimum":0,"maximum":365},"subject":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":20000}},"required":["delayDays","subject","body"],"additionalProperties":false},"minItems":1,"maxItems":10},"tone":{"type":"string","maxLength":100},"valueProps":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":10}},"required":["name","icpDescription","steps"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icpDescription":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"stepCount":{"type":"integer"},"tone":{"type":"string","nullable":true},"valueProps":{"type":"array","items":{"type":"string"}},"totalLeads":{"type":"integer"},"totalSent":{"type":"integer"},"totalReplied":{"type":"integer"},"totalBooked":{"type":"integer"},"createdAt":{"type":"number"},"steps":{"type":"array","items":{"type":"object","properties":{"stepNumber":{"type":"integer"},"delayDays":{"type":"integer"},"subject":{"type":"string"},"body":{"type":"string"}},"required":["stepNumber","delayDays","subject","body"],"additionalProperties":false}}},"required":["id","name","icpDescription","status","stepCount","tone","valueProps","totalLeads","totalSent","totalReplied","totalBooked","createdAt","steps"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-idempotency":"Honors the Idempotency-Key header on POST."}},"/sequences/{id}/cancel":{"post":{"operationId":"post_sequences_by_id_cancel","summary":"Cancel a sequence permanently (leads marked exhausted)","tags":["Leads"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"previousStatus":{"type":"string","enum":["draft","active","paused","archived"]},"totalLeads":{"type":"integer"},"outbound":{"type":"object","properties":{"configured":{"type":"boolean"},"domain":{"type":"string","nullable":true},"inboxCount":{"type":"integer"},"warmupStatus":{"type":"string","nullable":true},"dailySendCapacity":{"type":"integer"},"sendable":{"type":"boolean"}},"required":["configured","domain","inboxCount","warmupStatus","dailySendCapacity","sendable"],"additionalProperties":false}},"required":["id","status","previousStatus"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sequences/{id}/leads":{"post":{"operationId":"post_sequences_by_id_leads","summary":"Enrol leads and start sending (held for confirmation)","tags":["Leads"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique per intent, 1–128 printable ASCII characters. Reuse the SAME value on a retry: the request replays instead of running twice.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"minItems":1,"maxItems":500}},"required":["leadIds"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"sequenceId":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"requested":{"type":"integer"},"added":{"type":"integer"},"skipped":{"type":"array","items":{"type":"object","properties":{"leadId":{"type":"string"},"reason":{"type":"string"}},"required":["leadId","reason"],"additionalProperties":false}},"totalLeads":{"type":"integer"},"outbound":{"type":"object","properties":{"configured":{"type":"boolean"},"domain":{"type":"string","nullable":true},"inboxCount":{"type":"integer"},"warmupStatus":{"type":"string","nullable":true},"dailySendCapacity":{"type":"integer"},"sendable":{"type":"boolean"}},"required":["configured","domain","inboxCount","warmupStatus","dailySendCapacity","sendable"],"additionalProperties":false}},"required":["sequenceId","status","requested","added","skipped","totalLeads","outbound"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"202":{"description":"Parked by the business's spend policy (kind: outbound_sequence_send). NOTHING has been spent, published or sent. Confirm with POST /v1/confirmations/{id}/confirm — or reject it — before the expiry; the original call is replayed exactly once.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["status","confirmation_id","expires_at"],"properties":{"status":{"type":"string","enum":["pending_confirmation"]},"confirmation_id":{"type":"string"},"summary":{"type":"string","description":"One line an owner can decide from."},"amountCents":{"type":["integer","null"],"description":"Cents this call would spend; null when not knowable up front, which always confirms."},"reason":{"type":"string"},"expires_at":{"type":"number"}}},"hint":{"type":"string"},"next_action":{"type":"string"}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-idempotency":"Honors the Idempotency-Key header on POST."}},"/sequences/{id}/pause":{"post":{"operationId":"post_sequences_by_id_pause","summary":"Pause a sequence (mid-sequence leads keep their place)","tags":["Leads"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"previousStatus":{"type":"string","enum":["draft","active","paused","archived"]},"totalLeads":{"type":"integer"},"outbound":{"type":"object","properties":{"configured":{"type":"boolean"},"domain":{"type":"string","nullable":true},"inboxCount":{"type":"integer"},"warmupStatus":{"type":"string","nullable":true},"dailySendCapacity":{"type":"integer"},"sendable":{"type":"boolean"}},"required":["configured","domain","inboxCount","warmupStatus","dailySendCapacity","sendable"],"additionalProperties":false}},"required":["id","status","previousStatus"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sequences/{id}/resume":{"post":{"operationId":"post_sequences_by_id_resume","summary":"Resume a paused sequence (held for confirmation)","tags":["Leads"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"previousStatus":{"type":"string","enum":["draft","active","paused","archived"]},"totalLeads":{"type":"integer"},"outbound":{"type":"object","properties":{"configured":{"type":"boolean"},"domain":{"type":"string","nullable":true},"inboxCount":{"type":"integer"},"warmupStatus":{"type":"string","nullable":true},"dailySendCapacity":{"type":"integer"},"sendable":{"type":"boolean"}},"required":["configured","domain","inboxCount","warmupStatus","dailySendCapacity","sendable"],"additionalProperties":false}},"required":["id","status","previousStatus"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"202":{"description":"Parked by the business's spend policy (kind: outbound_sequence_send). NOTHING has been spent, published or sent. Confirm with POST /v1/confirmations/{id}/confirm — or reject it — before the expiry; the original call is replayed exactly once.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["status","confirmation_id","expires_at"],"properties":{"status":{"type":"string","enum":["pending_confirmation"]},"confirmation_id":{"type":"string"},"summary":{"type":"string","description":"One line an owner can decide from."},"amountCents":{"type":["integer","null"],"description":"Cents this call would spend; null when not knowable up front, which always confirms."},"reason":{"type":"string"},"expires_at":{"type":"number"}}},"hint":{"type":"string"},"next_action":{"type":"string"}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/social/accounts":{"get":{"operationId":"get_social_accounts","summary":"Connected social accounts with trust tier, liveness and postability","tags":["Social"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"status":{"type":"string"},"accounts":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"name":{"type":"string"},"username":{"type":"string","nullable":true},"displayName":{"type":"string","nullable":true},"avatarUrl":{"type":"string","nullable":true},"status":{"type":"string"},"health":{"type":"string","enum":["ok","suspected_dead","confirmed_dead"]},"trust":{"type":"object","properties":{"tier":{"type":"string","enum":["new","warming","established"]},"maxPostsPerDay":{"type":"integer","nullable":true},"allowCaptionLinks":{"type":"boolean"},"mediaReuseWindowHours":{"type":"integer","nullable":true},"nextAllowedAt":{"type":"number","nullable":true}},"required":["tier","maxPostsPerDay","allowCaptionLinks","mediaReuseWindowHours","nextAllowedAt"],"additionalProperties":false},"canPost":{"type":"boolean"},"blockedReason":{"type":"string","nullable":true},"selectedChannelId":{"type":"string","nullable":true},"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"nullable":true}},"required":["platform","name","username","displayName","avatarUrl","status","health","trust","canPost","blockedReason","selectedChannelId","channels"],"additionalProperties":false}},"refreshedAt":{"type":"number","nullable":true},"supportedPlatforms":{"type":"array","items":{"type":"string"}}},"required":["status","accounts","refreshedAt","supportedPlatforms"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/social/connect":{"post":{"operationId":"post_social_connect","summary":"Get a link the owner opens to connect an account (OAuth needs a browser)","tags":["Social"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["TIKTOK","YOUTUBE","INSTAGRAM","FACEBOOK","TWITTER","THREADS","LINKEDIN","PINTEREST","REDDIT","MASTODON","DISCORD","SLACK","BLUESKY","GOOGLE_BUSINESS","SNAPCHAT"]}},"required":["platform"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"platform":{"type":"string"},"connectUrl":{"type":"string"},"alreadyConnected":{"type":"boolean"},"requiresOwnerBrowser":{"type":"boolean","enum":[true]}},"required":["platform","connectUrl","alreadyConnected","requiresOwnerBrowser"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/social/posts":{"get":{"operationId":"get_social_posts","summary":"List social posts, newest first","tags":["Social"],"security":[{"apiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, 1-100 (default 20)","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"Opaque nextCursor from a previous page (URL-encode it)","schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"posts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_approval","rejected","draft","scheduled","processing","review","retrying","published","partially_published","failed","deleted"]},"platforms":{"type":"array","items":{"type":"string"}},"scheduledAt":{"type":"number"},"content":{"type":"object","properties":{"title":{"type":"string","nullable":true},"text":{"type":"string","nullable":true},"link":{"type":"string","nullable":true},"mediaUrls":{"type":"array","items":{"type":"string"}}},"required":["title","text","link","mediaUrls"],"additionalProperties":false},"results":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"status":{"type":"string"},"permalink":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"retryable":{"type":"boolean","nullable":true}},"required":["platform","status","permalink","error","retryable"],"additionalProperties":false}},"error":{"type":"string","nullable":true},"canCancel":{"type":"boolean"},"canRetry":{"type":"boolean"},"terminalAt":{"type":"number","nullable":true},"createdAt":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","state","platforms","scheduledAt","content","results","error","canCancel","canRetry","terminalAt","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true}},"required":["posts","nextCursor"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"post_social_posts","summary":"Compose and publish or schedule a social post","tags":["Social"],"security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique per intent, 1–128 printable ASCII characters. Reuse the SAME value on a retry: the request replays instead of running twice.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platforms":{"type":"array","items":{"type":"string","enum":["TIKTOK","YOUTUBE","INSTAGRAM","FACEBOOK","TWITTER","THREADS","LINKEDIN","PINTEREST","REDDIT","MASTODON","DISCORD","SLACK","BLUESKY","GOOGLE_BUSINESS","SNAPCHAT"]},"minItems":1,"maxItems":15},"title":{"type":"string","maxLength":300},"text":{"type":"string","maxLength":10000},"link":{"type":"string","format":"uri","maxLength":2000},"mediaUrls":{"type":"array","items":{"type":"string","format":"uri","maxLength":2000},"maxItems":10},"platformOptions":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},"scheduledAt":{"type":"integer"},"idempotencyKey":{"type":"string","pattern":"^[A-Za-z0-9._-]{8,64}$"}},"required":["platforms"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_approval","rejected","draft","scheduled","processing","review","retrying","published","partially_published","failed","deleted"]},"platforms":{"type":"array","items":{"type":"string"}},"scheduledAt":{"type":"number"},"content":{"type":"object","properties":{"title":{"type":"string","nullable":true},"text":{"type":"string","nullable":true},"link":{"type":"string","nullable":true},"mediaUrls":{"type":"array","items":{"type":"string"}}},"required":["title","text","link","mediaUrls"],"additionalProperties":false},"results":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"status":{"type":"string"},"permalink":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"retryable":{"type":"boolean","nullable":true}},"required":["platform","status","permalink","error","retryable"],"additionalProperties":false}},"error":{"type":"string","nullable":true},"canCancel":{"type":"boolean"},"canRetry":{"type":"boolean"},"terminalAt":{"type":"number","nullable":true},"createdAt":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","state","platforms","scheduledAt","content","results","error","canCancel","canRetry","terminalAt","createdAt","updatedAt"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_approval","rejected","draft","scheduled","processing","review","retrying","published","partially_published","failed","deleted"]},"platforms":{"type":"array","items":{"type":"string"}},"scheduledAt":{"type":"number"},"content":{"type":"object","properties":{"title":{"type":"string","nullable":true},"text":{"type":"string","nullable":true},"link":{"type":"string","nullable":true},"mediaUrls":{"type":"array","items":{"type":"string"}}},"required":["title","text","link","mediaUrls"],"additionalProperties":false},"results":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"status":{"type":"string"},"permalink":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"retryable":{"type":"boolean","nullable":true}},"required":["platform","status","permalink","error","retryable"],"additionalProperties":false}},"error":{"type":"string","nullable":true},"canCancel":{"type":"boolean"},"canRetry":{"type":"boolean"},"terminalAt":{"type":"number","nullable":true},"createdAt":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","state","platforms","scheduledAt","content","results","error","canCancel","canRetry","terminalAt","createdAt","updatedAt"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"202":{"description":"Parked by the business's spend policy (kind: social_publish). NOTHING has been spent, published or sent. Confirm with POST /v1/confirmations/{id}/confirm — or reject it — before the expiry; the original call is replayed exactly once.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["status","confirmation_id","expires_at"],"properties":{"status":{"type":"string","enum":["pending_confirmation"]},"confirmation_id":{"type":"string"},"summary":{"type":"string","description":"One line an owner can decide from."},"amountCents":{"type":["integer","null"],"description":"Cents this call would spend; null when not knowable up front, which always confirms."},"reason":{"type":"string"},"expires_at":{"type":"number"}}},"hint":{"type":"string"},"next_action":{"type":"string"}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-idempotency":"Honors the Idempotency-Key header on POST."}},"/social/posts/{id}":{"delete":{"operationId":"delete_social_posts_by_id","summary":"Cancel a scheduled post before it publishes","tags":["Social"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_approval","rejected","draft","scheduled","processing","review","retrying","published","partially_published","failed","deleted"]},"platforms":{"type":"array","items":{"type":"string"}},"scheduledAt":{"type":"number"},"content":{"type":"object","properties":{"title":{"type":"string","nullable":true},"text":{"type":"string","nullable":true},"link":{"type":"string","nullable":true},"mediaUrls":{"type":"array","items":{"type":"string"}}},"required":["title","text","link","mediaUrls"],"additionalProperties":false},"results":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"status":{"type":"string"},"permalink":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"retryable":{"type":"boolean","nullable":true}},"required":["platform","status","permalink","error","retryable"],"additionalProperties":false}},"error":{"type":"string","nullable":true},"canCancel":{"type":"boolean"},"canRetry":{"type":"boolean"},"terminalAt":{"type":"number","nullable":true},"createdAt":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","state","platforms","scheduledAt","content","results","error","canCancel","canRetry","terminalAt","createdAt","updatedAt"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/social/posts/{id}/retry":{"post":{"operationId":"post_social_posts_by_id_retry","summary":"Retry a failed or partially published post","tags":["Social"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_approval","rejected","draft","scheduled","processing","review","retrying","published","partially_published","failed","deleted"]},"platforms":{"type":"array","items":{"type":"string"}},"scheduledAt":{"type":"number"},"content":{"type":"object","properties":{"title":{"type":"string","nullable":true},"text":{"type":"string","nullable":true},"link":{"type":"string","nullable":true},"mediaUrls":{"type":"array","items":{"type":"string"}}},"required":["title","text","link","mediaUrls"],"additionalProperties":false},"results":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"status":{"type":"string"},"permalink":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"retryable":{"type":"boolean","nullable":true}},"required":["platform","status","permalink","error","retryable"],"additionalProperties":false}},"error":{"type":"string","nullable":true},"canCancel":{"type":"boolean"},"canRetry":{"type":"boolean"},"terminalAt":{"type":"number","nullable":true},"createdAt":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","state","platforms","scheduledAt","content","results","error","canCancel","canRetry","terminalAt","createdAt","updatedAt"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/usage":{"get":{"operationId":"get_usage","summary":"Credit balance and whether writes are currently allowed","tags":["Usage"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"writesAllowed":{"type":"boolean"},"limit":{"type":"object","properties":{"type":{"type":"string","enum":["daily_tasks","daily_credits","monthly_credits","monthly_tasks","free_grant"]},"current":{"type":"number"},"max":{"type":"number"},"percentUsed":{"type":"number"},"resetsAt":{"type":"number","nullable":true},"reason":{"type":"string","nullable":true}},"required":["type","current","max","percentUsed","resetsAt","reason"],"additionalProperties":false},"freeGrant":{"type":"object","properties":{"grantCredits":{"type":"number"},"usedCredits":{"type":"number"},"remainingCredits":{"type":"number"}},"required":["grantCredits","usedCredits","remainingCredits"],"additionalProperties":false,"nullable":true},"plan":{"type":"string","nullable":true}},"required":["writesAllowed","limit","freeGrant","plan"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks":{"get":{"operationId":"get_webhooks","summary":"List webhook endpoints","tags":["Webhooks"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"webhooks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"failCount":{"type":"integer"},"lastSuccessAt":{"type":"number","nullable":true},"lastFailureAt":{"type":"number","nullable":true},"lastError":{"type":"string","nullable":true},"disabledAt":{"type":"number","nullable":true},"createdAt":{"type":"number"}},"required":["id","url","events","status","failCount","lastSuccessAt","lastFailureAt","lastError","disabledAt","createdAt"],"additionalProperties":false}}},"required":["webhooks"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"post_webhooks","summary":"Register a webhook endpoint (secret returned once)","tags":["Webhooks"],"security":[{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per intent, 1–128 printable ASCII characters. Reuse the SAME value on a retry: the request replays instead of running twice. Required on this route.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","maxLength":2000},"events":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":20}},"required":["url"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"failCount":{"type":"integer"},"lastSuccessAt":{"type":"number","nullable":true},"lastFailureAt":{"type":"number","nullable":true},"lastError":{"type":"string","nullable":true},"disabledAt":{"type":"number","nullable":true},"createdAt":{"type":"number"},"secret":{"type":"string"}},"required":["id","url","events","status","failCount","lastSuccessAt","lastFailureAt","lastError","disabledAt","createdAt","secret"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-idempotency":"Honors the Idempotency-Key header on POST."}},"/webhooks/{id}":{"delete":{"operationId":"delete_webhooks_by_id","summary":"Delete a webhook endpoint","tags":["Webhooks"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success envelope.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","deleted"],"additionalProperties":false},"hint":{"type":"string","description":"One-sentence orientation for agents."},"next_action":{"type":"string","description":"The literal next call an agent would chain."}}}}}},"default":{"description":"Error envelope — machine-readable `code` plus a docs link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Business-scoped API key (`mt_live_…`) — mint with `madethis login` or in dashboard settings."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","docs_url"],"properties":{"code":{"type":"string","enum":["unauthorized","forbidden_scope","not_found","validation_failed","rate_limited","credits_exhausted","plan_required","confirmation_required","idempotency_conflict","internal"]},"message":{"type":"string"},"docs_url":{"type":"string","format":"uri"}}}}}}}}