{"openapi":"3.1.0","info":{"title":"Banger API","version":"0.1.0","description":"Customer-facing Banger API: workspace resources (mailboxes, sending, threads, contacts, lists, segments, templates, Broadcasts, Journeys, approvals, sending domains, webhooks, API keys) and the public signup-form endpoints. Authenticate workspace requests with `Authorization: Bearer <workspace API key>`; create keys in the Banger app under Settings → Developers → Manage API keys. AI agents can use the same capabilities through the Banger MCP server at https://api.bangermail.com/mcp.","contact":{"name":"Banger support","email":"hello@team.bangermail.com","url":"https://bangermail.com/support/"},"termsOfService":"https://bangermail.com/terms/"},"externalDocs":{"description":"Banger API reference","url":"https://bangermail.com/docs/api/"},"servers":[{"url":"https://api.bangermail.com"}],"security":[{"bearerAuth":[]}],"paths":{"/v1/workspaces/{workspaceId}/feedback":{"get":{"operationId":"getCustomerFeedbackAvailability","summary":"Check whether customer feedback delivery is available","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Feedback availability for the authenticated workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","required":["available"],"properties":{"available":{"type":"boolean"}}}}}}}}}},"post":{"operationId":"submitCustomerFeedback","summary":"Report a bug, send feedback, or suggest a feature","description":"Creates one internal Linear issue and sends a Slack team alert. Retry an interrupted submission with the same submission_id.","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"x-banger-product-id","in":"header","required":false,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["kind","title","description","submission_id"],"properties":{"kind":{"type":"string","enum":["bug","feedback","feature"]},"title":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","minLength":1,"maxLength":10000},"submission_id":{"type":"string","format":"uuid"},"attachment_ids":{"type":"array","maxItems":5,"uniqueItems":true,"items":{"type":"string","format":"uuid"},"description":"Completed private uploads owned by this reporter and workspace. Unsubmitted uploads expire after 24 hours; files can belong to only one report."}}}}}},"responses":{"201":{"description":"Linear issue and Slack alert completed, including an idempotent replay.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","required":["id","status"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["submitted"]},"linearIssueIdentifier":{"type":["string","null"]},"linearIssueUrl":{"type":["string","null"],"format":"uri"}}}}}}}},"429":{"description":"Reporter limit reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Linear or Slack delivery failed; retry with the same submission_id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Internal feedback delivery is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/feedback/attachments":{"post":{"operationId":"uploadCustomerFeedbackAttachment","summary":"Upload a screenshot or video to private Linear storage","description":"Binary uploads support up to 25 MiB. JSON base64 uploads support up to 2 MiB. Reuse attachment_id when retrying the same file. Requires automation:execute for API keys.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"attachment_id","in":"query","description":"Required for binary uploads; UUID per file.","schema":{"type":"string","format":"uuid"}},{"name":"x-banger-filename","in":"header","description":"URI-encoded filename, required for binary uploads.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/gif":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"video/mp4":{"schema":{"type":"string","format":"binary"}},"video/webm":{"schema":{"type":"string","format":"binary"}},"video/quicktime":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"object","required":["attachment_id","filename","mime_type","base64"],"properties":{"attachment_id":{"type":"string","format":"uuid"},"filename":{"type":"string","minLength":1,"maxLength":200},"mime_type":{"type":"string","enum":["image/png","image/jpeg","image/gif","image/webp","video/mp4","video/webm","video/quicktime"]},"base64":{"type":"string","minLength":4,"maxLength":2796204}}}}}},"responses":{"200":{"description":"Existing completed attachment.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["attachment_id","status"],"properties":{"attachment_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["ready"]}}}}}}}},"201":{"description":"Uploaded and verified attachment; data contains attachment_id and status ready.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["attachment_id","status"],"properties":{"attachment_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["ready"]}}}}}}}},"400":{"description":"Invalid metadata or base64.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"File exceeds the supported size.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported or mismatched media format.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Upload limit reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Linear upload failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/feedback/attachments/prepare":{"post":{"operationId":"prepareCustomerFeedbackAttachment","summary":"Prepare a direct agent or server media upload","description":"Returns a temporary signed PUT URL and required upload headers. Send file bytes with those headers, without Banger credentials, then complete the upload. Do not upload directly from browsers; use the authenticated binary proxy. Up to 30 uploads and 250 MiB per reporter per day.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["attachment_id","filename","mime_type","size_bytes"],"properties":{"attachment_id":{"type":"string","format":"uuid"},"filename":{"type":"string","minLength":1,"maxLength":200},"mime_type":{"type":"string","enum":["image/png","image/jpeg","image/gif","image/webp","video/mp4","video/webm","video/quicktime"]},"size_bytes":{"type":"integer","minimum":1,"maximum":26214400}}}}}},"responses":{"201":{"description":"data contains attachment_id, status, and upload with signed url, method PUT, and headers when uploading. If ready, no upload is needed.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["attachment_id","filename","mime_type","size_bytes","status"],"properties":{"attachment_id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"mime_type":{"type":"string"},"size_bytes":{"type":"integer"},"status":{"type":"string","enum":["ready","uploading"]},"upload":{"type":"object","required":["url","method","headers"],"properties":{"url":{"type":"string"},"method":{"type":"string","enum":["PUT"]},"headers":{"type":"object","additionalProperties":{"type":"string"}}}}}}}}}}},"409":{"description":"Attachment conflicts or is already being prepared.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Upload limit reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Linear upload preparation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/feedback/attachments/{attachmentId}/complete":{"post":{"operationId":"completeCustomerFeedbackAttachment","summary":"Verify a direct media upload before attaching it to feedback","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"attachmentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"data contains attachment_id and status ready. Completion is idempotent.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["attachment_id","status"],"properties":{"attachment_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["ready"]}}}}}}}},"404":{"description":"Attachment not owned by this reporter in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Prepare the upload first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"File content does not match its declared format.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Uploaded file is missing or does not match its declared size and type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/ai/command-runs":{"post":{"operationId":"startMailAssistantCommand","summary":"Start a mail assistant command with reads and confirmation-only proposals","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperationalIdempotencyKey"},{"name":"X-Banger-Product-Id","in":"header","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["commandText"],"properties":{"commandText":{"type":"string","minLength":1,"maxLength":8000}}}}}},"responses":{"200":{"description":"Read requests, an answer, or actions requiring confirmation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailAssistantCommand"}}}}}}},"/v1/workspaces/{workspaceId}/ai/command-runs/{runId}/tool-results":{"post":{"operationId":"continueMailAssistantCommand","summary":"Continue an actor-owned command in its original product scope","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"runId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-Banger-Product-Id","in":"header","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["toolResults"],"properties":{"toolResults":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"object","required":["toolCallId","toolName","ok"],"properties":{"toolCallId":{"type":"string","format":"uuid"},"toolName":{"type":"string","enum":["list_mailboxes","search_mail","list_unread","list_work_items","get_thread"]},"ok":{"type":"boolean"},"result":{},"error":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Next command response; repeated results replay without another inference call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailAssistantCommand"}}}}}}},"/v1/workspaces/{workspaceId}/email-preview":{"get":{"operationId":"getEmailPreview","summary":"Render saved emails for visual iteration without sending","parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"kind","in":"query","required":true,"schema":{"type":"string","enum":["template","broadcast","journey"]}},{"name":"id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"locale","in":"query","required":false,"description":"Optional BCP 47 locale for a managed Broadcast preview.","schema":{"type":"string","maxLength":64}},{"name":"variant","in":"query","required":false,"description":"Optional managed Broadcast experiment variant key.","schema":{"type":"string","maxLength":40}},{"name":"x-banger-product-id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Saved email content and Journey sequence","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["resource_kind","resource_id","product_id","name","status","items","sample_values"],"properties":{"resource_kind":{"type":"string","enum":["template","broadcast","journey"]},"resource_id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string"},"selected_email_key":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["key","kind","name"],"properties":{"key":{"type":"string"},"kind":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"preview_text":{"type":"string"},"body_html":{"type":"string"},"body_text":{"type":"string"},"detail":{"type":"string"}}}},"sample_values":{"type":"boolean"},"image_assets":{"type":"object","additionalProperties":{"type":"string"}}}}}}}}}}}},"/v1/workspaces":{"post":{"operationId":"createWorkspace","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200}}}}}},"responses":{"200":{"description":"Idempotent replay of a previously created workspace.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/WorkspaceSummary"},{"type":"object","required":["replayed"],"properties":{"replayed":{"type":"boolean"}}}]}}}}}},"201":{"description":"Workspace created with free entitlements and the actor as owner.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/WorkspaceSummary"},{"type":"object","required":["replayed"],"properties":{"replayed":{"type":"boolean"}}}]}}}}}}}}},"/v1/workspaces/{workspaceId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"delete":{"operationId":"deleteWorkspace","summary":"Permanently delete an owned workspace and queue physical object cleanup.","description":"Requires the authenticated actor to be an owner. Static workspace API keys cannot delete a workspace; a human session or user-authorized OAuth grant with workspace:admin is required. Paid subscriptions must be cancelled first. PostgreSQL state is deleted atomically and all B2 object versions under the workspace prefix are purged asynchronously.","responses":{"202":{"description":"The canonical workspace was deleted and physical object cleanup was queued.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WorkspaceDeletionReceipt"}}}}}},"403":{"description":"The actor is not an owner or the credential cannot delete workspaces.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The workspace does not exist or is not available to this actor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The paid subscription is active or deletion conflicted with another change.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/access":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"getWorkspaceDirectory","summary":"List workspace members and active invitations.","responses":{"200":{"description":"Workspace directory.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WorkspaceDirectory"}}}}}}}}},"/v1/workspaces/{workspaceId}/invitations":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"createWorkspaceInvitation","summary":"Invite a human actor to the workspace.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["email"],"properties":{"email":{"type":"string","format":"email","maxLength":320},"role":{"type":"string","enum":["admin","member","viewer"],"default":"member"},"mailbox_ids":{"type":"array","maxItems":250,"items":{"type":"string","format":"uuid"}},"send_mode":{"type":"string","enum":["direct","approval_required"],"default":"direct"},"expires_in_hours":{"type":"integer","minimum":1,"maximum":720,"default":168}}}}}},"responses":{"201":{"description":"Invitation created.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WorkspaceInvitation"}}}}}}}}},"/v1/workspaces/{workspaceId}/answer-agents":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listAnswerAgents","responses":{"200":{"description":"Workspace answer agents.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AnswerAgent"}}}}}}}}},"post":{"operationId":"createAnswerAgent","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100},"system_prompt":{"type":"string","maxLength":32000},"enabled":{"type":"boolean","default":true},"send_policy":{"type":"string","enum":["draft_only","reviewed_send","direct_send"],"default":"draft_only"},"mailbox_ids":{"type":"array","maxItems":250,"items":{"type":"string","format":"uuid"}}}}}}},"responses":{"201":{"description":"Answer agent created.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AnswerAgent"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/path":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"put":{"operationId":"selectOnboardingPath","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["path"],"properties":{"path":{"type":"string","enum":["starter_identity","company_domain","resend_gateway","banger_native_sending","work_mailbox","gmail","native_mailbox","existing_provider"]}}}}}},"responses":{"200":{"description":"The server-authoritative onboarding path was selected.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["path"],"properties":{"path":{"type":"string","enum":["starter_identity","company_domain","resend_gateway","banger_native_sending","work_mailbox","gmail","native_mailbox","existing_provider"]}}}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/guided":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"in":"header","name":"x-banger-product-id","schema":{"type":"string","format":"uuid"},"description":"Selected product. Required when multiple active products exist."}],"get":{"operationId":"getGuidedOnboarding","summary":"Read canonical seven-step onboarding without creating resources or sending email.","parameters":[{"in":"query","name":"details","schema":{"type":"integer","enum":[1]},"description":"Include editable drafts, brand, and authoritative DNS records."}],"responses":{"200":{"description":"Persisted progress and independently verified capabilities.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/GuidedOnboardingState"}}}}}}}},"post":{"operationId":"actOnGuidedOnboarding","summary":"Execute one explicit retry-safe onboarding action for the selected product.","description":"Sends target only the authorizing user's verified signup address. Journeys stay inactive and Broadcasts stay unsent. Existing migration approval boundaries apply.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["create_mailbox","send_first","skip_reply","save_business","discover_brand","save_journey","skip_journey","save_broadcast","skip_broadcast","choose_identity","defer_identity","setup_receiving","defer_receiving","setup_sending","verify_dns","continue_domain","add_inboxes","skip_inboxes","send_samples","finish_for_now","finish"]},"data":{"type":"object","additionalProperties":true,"description":"Business fields company_name, primary_goal, website_url and brand; draft fields name, subject, preview_text, body_text and edit; identity fields domain and local_part. Recipient input is never accepted."}}}}}},"responses":{"200":{"description":"Refreshed canonical state after the requested operation.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/GuidedOnboardingState"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/agent-state":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"getAgentOnboardingState","summary":"Resume the shared browser and MCP onboarding journey.","responses":{"200":{"description":"Current server-owned onboarding state.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentOnboardingState"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/agent-state/start":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"startAgentOnboarding","summary":"Select the agent-led entry surface or the browser fallback.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["entry_surface"],"properties":{"entry_surface":{"type":"string","enum":["codex","chatgpt","claude","grok","other_agent","browser"]},"client_name":{"type":"string","minLength":1,"maxLength":100}}}}}},"responses":{"200":{"description":"Journey started or resumed.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentOnboardingState"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/agent-state/aha-one":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"ensureAgentOnboardingAhaOne","summary":"Idempotently create the permanent hosted mailbox and start its real welcome-message round trip.","responses":{"200":{"description":"The hosted mailbox and its existing proof were resumed.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/StarterMailboxProof"}}}}}},"202":{"description":"The hosted mailbox exists and its real proof is running or already complete.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/StarterMailboxProof"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/agent-state/agent-proof":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"sendAgentOnboardingProof","summary":"Send the OAuth-bound agent connection proof to the canonical hosted mailbox.","responses":{"200":{"description":"The same OAuth grant replayed or already completed the proof.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentEmailProof"}}}}}},"202":{"description":"The real agent proof message was accepted for delivery.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentEmailProof"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/agent-state/decision":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"put":{"operationId":"recordAgentOnboardingDecision","summary":"Record one explicit progressive-onboarding choice.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["decision"],"properties":{"decision":{"type":"string","enum":["agent_connection_skipped","goals_chosen","domain_bundle_approved","dns_computer_use_authorized","dns_manual_selected","dns_records_applied","services_reviewed","persistent_mcp_acknowledged","autopilot_proposed","autopilot_skipped","autopilot_activated"]},"details":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"The choice is persisted in the canonical journey.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentOnboardingState"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/agent-state/domain-choice":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"put":{"operationId":"chooseAgentOnboardingDomain","summary":"Persist the user's company-domain or no-domain onboarding decision and run canonical discovery.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["choice"],"properties":{"choice":{"type":"string","enum":["company_domain","no_domain"]},"domain":{"type":"string","minLength":3,"maxLength":253}}}}}},"responses":{"200":{"description":"Domain decision stored and journey resumed.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentOnboardingState"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/agent-state/context":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"put":{"operationId":"submitAgentOnboardingContext","summary":"Store reviewed business context supplied by the browser or connected agent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["context"],"properties":{"context":{"type":"object","additionalProperties":true},"company_domain":{"type":"string","minLength":3,"maxLength":253,"description":"Compatibility bridge for cached connectors that predate chooseAgentOnboardingDomain. The agent must still ask the user first."},"client_name":{"type":"string","minLength":1,"maxLength":100}}}}}},"responses":{"200":{"description":"Context accepted.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentOnboardingState"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/agent-state/plan":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"put":{"operationId":"submitAgentOnboardingPlan","summary":"Store personalized next-step choices after live email activation passes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["opportunities"],"properties":{"opportunities":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":true}}}}}}},"responses":{"200":{"description":"Opportunity plan accepted.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentOnboardingState"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/agent-state/apply":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"recordAgentOnboardingImplementation","summary":"Record reviewed artifacts prepared from the opportunity plan.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["summary"],"properties":{"summary":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Implementation summary recorded.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentOnboardingState"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/agent-state/plan/approve":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"approveAgentOnboardingPlan","summary":"Approve the proposed opportunity map before the agent prepares sensitive changes.","responses":{"200":{"description":"Opportunity plan approved by the authenticated workspace administrator.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentOnboardingState"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/agent-state/validate":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"validateAgentOnboarding","summary":"Derive deterministic activation validation from Banger-owned proof state.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"summary":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Validation result recorded.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentOnboardingState"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/agent-state/complete":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"completeAgentOnboarding","summary":"Complete onboarding after deterministic validation passes.","responses":{"200":{"description":"Onboarding completed.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentOnboardingState"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/starter-proof":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"startStarterMailboxProof","summary":"Start or resume a real send-and-receive proof for a starter address.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["mailbox_id"],"properties":{"mailbox_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"The existing proof was resumed.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/StarterMailboxProof"}}}}}},"202":{"description":"The proof was queued.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/StarterMailboxProof"}}}}}}}},"get":{"operationId":"getStarterMailboxProof","summary":"Read the durable status of a starter-address round trip.","parameters":[{"name":"mailbox_id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Current proof status.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/StarterMailboxProof"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/domain-proof":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"startDomainInfrastructureProof","summary":"Start or resume two real send-and-receive checks for verified Banger infrastructure.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["native_domain_id"],"properties":{"native_domain_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"The existing proof was resumed.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/DomainInfrastructureProof"}}}}}},"202":{"description":"Both proof sends were queued.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/DomainInfrastructureProof"}}}}}}}},"get":{"operationId":"getDomainInfrastructureProof","summary":"Read the durable status of the domain infrastructure checks.","responses":{"200":{"description":"Current proof status.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/DomainInfrastructureProof"}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/goal":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"put":{"operationId":"selectActivationGoal","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["goal"],"properties":{"goal":{"type":"string","enum":["work_inbox","product_email","campaign","company_workflow"]}}}}}},"responses":{"200":{"description":"The first outcome is selected and the guided run may open in the product shell.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["goal"],"properties":{"goal":{"type":"string","enum":["work_inbox","product_email","campaign","company_workflow"]}}}}}}}}}}},"/v1/workspaces/{workspaceId}/onboarding/discovery":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"getWorkspaceDomainDiscovery","responses":{"200":{"description":"The current company and email-stack discovery.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WorkspaceDomainDiscovery"}}}}}}}},"post":{"operationId":"scanWorkspaceDomain","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["domain"],"properties":{"domain":{"type":"string","minLength":3,"maxLength":253},"stream_kind":{"type":"string","enum":["default","transactional","marketing"],"default":"default"}}}}}},"responses":{"201":{"description":"Public DNS and website discovery completed and was persisted.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WorkspaceDomainDiscovery"}}}}}}}},"put":{"operationId":"confirmWorkspaceDomainDiscovery","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["company_name","summary","connection_plan"],"properties":{"company_name":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":4000},"audience":{"type":"string","maxLength":2000},"offerings":{"type":"array","maxItems":8,"items":{"type":"string","maxLength":120}},"website_url":{"type":["string","null"],"format":"uri"},"connection_plan":{"type":"array","maxItems":30,"items":{"$ref":"#/components/schemas/DiscoveryConnectionPlanItem"}}}}}}},"responses":{"200":{"description":"Company context and the suggested connection plan were confirmed.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WorkspaceDomainDiscovery"}}}}}}}}},"/v1/workspaces/{workspaceId}/webhooks":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listProductWebhooks","summary":"List inbound event sources and outbound event destinations.","responses":{"200":{"description":"Workspace webhook endpoints.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProductWebhook"}}}}}}}}},"post":{"operationId":"createProductWebhook","summary":"Create a signed, retried destination or idempotent inbound event source.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProductWebhookRequest"}}}},"responses":{"201":{"description":"Webhook created. Outbound signing secrets are shown once; inbound credential options can be reopened by authorized callers.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/CreatedProductWebhook"}}}}}}}}},"/v1/workspaces/{workspaceId}/webhooks/{endpointId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"endpointId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"patch":{"operationId":"enableProductWebhook","summary":"Re-enable a disabled webhook without rotating its endpoint or secret.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"additionalProperties":false,"properties":{"status":{"type":"string","enum":["active"]}}}}}},"responses":{"200":{"description":"Webhook re-enabled.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ProductWebhook"}}}}}}}},"delete":{"operationId":"disableProductWebhook","summary":"Disable a webhook and stop deliveries or inbound automation events.","responses":{"204":{"description":"Webhook disabled."}}}},"/v1/workspaces/{workspaceId}/webhooks/{endpointId}/credentials":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"endpointId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"x-banger-product-id","in":"header","description":"Required unless the authenticated API key already binds the product.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getIncomingWebhookCredentials","summary":"Reopen an active incoming webhook's existing credential options.","description":"Requires automation:execute. Returns the same secret without creating or rotating resources. Never cache or log this response.","responses":{"200":{"description":"Private source URL, public webhook URL, and separate bearer token.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreatedProductWebhook"}}}}}},"403":{"description":"Insufficient scope or product access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No incoming webhook in this product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Webhook is not active.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Existing credential key is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/webhooks/{endpointId}/deliveries":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"endpointId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"listProductWebhookDeliveries","summary":"List recent delivery attempts and HTTP outcomes for an outbound webhook.","responses":{"200":{"description":"Recent delivery attempts.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProductWebhookDelivery"}}}}}}}}}},"/v1/workspaces/{workspaceId}/webhooks/{endpointId}/test":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"endpointId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"testProductWebhook","summary":"Queue one signed synthetic event through the normal retrying delivery path.","responses":{"202":{"description":"Signed test event queued.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","status"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string"}}}}}}}}}}},"/v1/workspaces/{workspaceId}/content-settings":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"}],"get":{"operationId":"getManagedContentSettings","summary":"Read product-level locale, fallback, timezone, glossary, and review settings.","responses":{"200":{"description":"Current content settings.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ProductContentSettings"}}}}}}}},"put":{"operationId":"putManagedContentSettings","summary":"Save product-level content settings with optimistic version check.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["source_locale","configured_locales","fallback_chain","timezone","glossary","manual_translation_review","expected_version"],"properties":{"source_locale":{"type":"string"},"configured_locales":{"type":"array","items":{"type":"string"}},"fallback_chain":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"glossary":{"type":"object","additionalProperties":{"type":"string"}},"manual_translation_review":{"type":"boolean"},"expected_version":{"type":"integer","minimum":0}}}}}},"responses":{"200":{"description":"Saved content settings.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ProductContentSettings"}}}}}},"409":{"description":"Stale version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/communication-policy":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"}],"get":{"operationId":"getCommunicationPolicy","summary":"Read product-wide recipient conflict, frequency, and delivery-window policy.","responses":{"200":{"description":"Versioned communication policy.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["version","policy"],"properties":{"version":{"type":"integer"},"policy":{"$ref":"#/components/schemas/CommunicationPolicy"}}}}}}}}}},"put":{"operationId":"putCommunicationPolicy","summary":"Save the product communication policy with optimistic version check.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["expected_version","policy"],"properties":{"expected_version":{"type":"integer","minimum":1},"policy":{"$ref":"#/components/schemas/CommunicationPolicy"}}}}}},"responses":{"200":{"description":"Updated versioned policy.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["version","policy"],"properties":{"version":{"type":"integer"},"policy":{"$ref":"#/components/schemas/CommunicationPolicy"}}}}}}}},"409":{"description":"Policy changed; reload before saving.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/communication-policy/simulate":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"}],"post":{"operationId":"simulateCommunicationPolicy","summary":"Read-only policy simulation for fixed send requests to one recipient.","description":"Does not change reservations or move dependent Journey steps.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["requests"],"properties":{"policy":{"$ref":"#/components/schemas/CommunicationPolicy"},"history":{"type":"array","items":{"type":"string","format":"date-time"},"maxItems":10000},"requests":{"type":"array","maxItems":1000,"items":{"type":"object","required":["id","at","category","source_kind"],"properties":{"id":{"type":"string"},"at":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["urgent","product","promotional"]},"source_kind":{"type":"string","enum":["journey","broadcast"]},"expiresAt":{"type":"string","format":"date-time"},"deliveryBlocked":{"type":"boolean"}}}}}}}}},"responses":{"200":{"description":"Per-request send, defer, or discard decision timeline with reasons.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["policy","policy_version","timeline","scope","warnings"],"properties":{"policy":{"$ref":"#/components/schemas/CommunicationPolicy"},"policy_version":{"type":["integer","null"]},"timeline":{"type":"array","items":{"type":"object","required":["id","source_kind","requested_at","action","at","reason"],"properties":{"id":{"type":"string"},"source_kind":{"type":"string","enum":["journey","broadcast"]},"requested_at":{"type":"string","format":"date-time"},"action":{"type":"string","enum":["send","defer","discard"]},"at":{"type":"string","format":"date-time"},"reason":{"type":"string"}}}},"scope":{"type":"string","enum":["one_recipient_fixed_send_requests"]},"warnings":{"type":"array","items":{"type":"string"}}}}}}}}}}}},"/v1/workspaces/{workspaceId}/approvals/{approvalId}/managed-layout-preview/{contentId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"approvalId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"contentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getBoundManagedLayoutApprovalPreview","summary":"Read full source-locale before/after renders for content bound to one layout approval.","description":"Rebuilds from immutable revisions and verifies both source hashes against the approval snapshot. No locale override is accepted.","parameters":[{"name":"sample","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Full hash-verified before and after subject, HTML, and plain text.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["content_id","sample_name","locale","old_source_hash","new_source_hash","before","after"],"properties":{"content_id":{"type":"string","format":"uuid"},"sample_name":{"type":["string","null"]},"locale":{"type":"string"},"old_source_hash":{"type":"string"},"new_source_hash":{"type":"string"},"before":{"type":"object","required":["subject","html","text"],"properties":{"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"}}},"after":{"type":"object","required":["subject","html","text"],"properties":{"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"}}}}}}}}}},"409":{"description":"Snapshot hashes no longer match the bound approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/approvals/{approvalId}/journey-preview":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"approvalId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getJourneyApprovalPreview","summary":"Render every email of a Journey activation or enrollment approval from its bound review snapshot.","description":"Emails render with sample personalization from the exact reviewed definition (saved designs by their immutable HTML key, pinned managed revisions), never the live Journey. Also names the audience lists, segments and trigger/goal connections the snapshot references.","responses":{"200":{"description":"Rendered emails keyed by step position (arm steps as parent.arm.position), plus audience and connection names.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["approval_id","emails","lists","segments","connections","image_assets","sample_values"],"properties":{"approval_id":{"type":"string","format":"uuid"},"sequence_id":{"type":["string","null"],"format":"uuid"},"emails":{"type":"array","items":{"type":"object","required":["key","position","parent_position","arm_key","source","subject","preview_text","body_text"],"properties":{"key":{"type":"string"},"position":{"type":"integer"},"parent_position":{"type":["integer","null"]},"arm_key":{"type":["string","null"]},"source":{"type":"string","enum":["managed","design","inline","empty"]},"subject":{"type":"string"},"preview_text":{"type":"string"},"body_html":{"type":"string"},"body_text":{"type":"string"},"published":{"type":"boolean"},"error":{"type":"string"}}}},"lists":{"type":"array","items":{"type":"object","required":["id","name","member_count"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"member_count":{"type":"integer"}}}},"segments":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}}},"connections":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}}},"image_assets":{"type":"object","additionalProperties":{"type":"string"}},"sample_values":{"type":"boolean"}}}}}}}},"404":{"description":"No Journey approval with this id in the product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/assets":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"}],"get":{"operationId":"listEmailAssets","summary":"List product email images and their immutable public URLs.","responses":{"200":{"description":"Up to 100 newest product email images.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ManagedEmailAsset"}}}}}}}}},"post":{"operationId":"uploadEmailAsset","summary":"Store an immutable image for managed email content.","description":"Send raw PNG, JPEG, GIF or WebP bytes with the matching Content-Type and optional X-File-Name, or JSON with base64, mime_type and filename. Both forms allow up to 2 MiB decoded image bytes. The response URL can be used directly in HTML; no localized destination registry is created.","requestBody":{"required":true,"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/gif":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["base64","mime_type"],"properties":{"base64":{"type":"string","contentEncoding":"base64","description":"Image bytes","at most 2 MiB decoded.":null},"mime_type":{"type":"string","enum":["image/png","image/jpeg","image/gif","image/webp"]},"filename":{"type":"string","maxLength":200}}}}}},"responses":{"201":{"description":"Registered image with immutable public URL.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ManagedEmailAsset"}}}}}},"413":{"description":"Image exceeds 2 MiB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported image or mismatched declared MIME type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/assets/{assetId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"assetId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getEmailAsset","summary":"Read one product email image's metadata and public URL.","responses":{"200":{"description":"Product image metadata.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ManagedEmailAsset"}}}}}}}}},"/v1/forms/embed.js":{"get":{"operationId":"getSignupFormEmbedScript","summary":"The signup form loader. One script tag per form (data-banger-form=\"f_…\") renders the widget in a shadow root and handles triggers and submits.","security":[],"responses":{"200":{"description":"Embeddable signup form loader.","content":{"text/javascript":{"schema":{"type":"string"}}}}}},"head":{"operationId":"headSignupFormEmbed","summary":"Read embed script headers","responses":{"200":{"description":"Successful response."},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[]},"options":{"operationId":"optionsembedjsSignupForm","summary":"Read public signup CORS policy","responses":{"204":{"description":"Successful response.","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string","const":"*"}},"Access-Control-Allow-Methods":{"schema":{"type":"string","const":"GET, POST"}},"Access-Control-Max-Age":{"schema":{"type":"string","const":"86400"}},"Access-Control-Allow-Headers":{"schema":{"type":"string","const":"content-type"}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[]}},"/v1/forms/{publicId}/widget":{"parameters":[{"name":"publicId","in":"path","required":true,"schema":{"type":"string","pattern":"^f_[a-z0-9]{16}$"}}],"get":{"operationId":"getSignupFormWidget","summary":"A live form's rendered widget (html, css, font link) and popup behavior. Public, CORS open, cached for a minute.","security":[],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["kind","lang","html","css","font_href","redirect_url","behavior"],"properties":{"kind":{"type":"string","enum":["inline","popup","bar","slide_in","page"]},"lang":{"type":"string"},"html":{"type":"string"},"css":{"type":"string"},"font_href":{"type":"string"},"redirect_url":{"type":"string"},"behavior":{"type":"object","required":["delay_seconds","scroll_percent","exit_intent","frequency_days"],"properties":{"delay_seconds":{"type":"number"},"scroll_percent":{"type":"number"},"exit_intent":{"type":"boolean"},"frequency_days":{"type":"number"}}}}}}}}}},"404":{"description":"The form does not exist or is paused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"options":{"operationId":"optionswidgetSignupForm","summary":"Read public signup CORS policy","parameters":[{"name":"publicId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Successful response.","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string","const":"*"}},"Access-Control-Allow-Methods":{"schema":{"type":"string","const":"GET, POST"}},"Access-Control-Max-Age":{"schema":{"type":"string","const":"86400"}},"Access-Control-Allow-Headers":{"schema":{"type":"string","const":"content-type"}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[]}},"/v1/forms/{publicId}/subscribe":{"parameters":[{"name":"publicId","in":"path","required":true,"schema":{"type":"string","pattern":"^f_[a-z0-9]{16}$"}}],"post":{"operationId":"submitSignupForm","summary":"A visitor signs up. Form-encoded (email, name, page, optional lang) so browsers skip the preflight; JSON is also accepted. Messages and the confirmation email follow the form's language, else lang, else Accept-Language. With double opt-in a confirmation email is sent and the person joins the list after confirming.","security":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","maxLength":320},"name":{"type":"string","maxLength":100},"page":{"type":"string","maxLength":2000},"elapsed":{"type":["number","string"],"description":"Milliseconds elapsed since displaying the form."},"lang":{"type":"string","maxLength":35},"locale":{"type":"string","maxLength":35},"website":{"type":"string","maxLength":200,"description":"Honeypot; leave empty."}},"additionalProperties":{"type":["string","number"]},"description":"Custom answers use x_<field key> (or the unprefixed key). Required answers depend on the form configuration. The handler reads the first 8000 characters of the body."}},"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","maxLength":320},"name":{"type":"string","maxLength":100},"page":{"type":"string","maxLength":2000},"elapsed":{"type":["number","string"],"description":"Milliseconds elapsed since displaying the form."},"lang":{"type":"string","maxLength":35},"locale":{"type":"string","maxLength":35},"website":{"type":"string","maxLength":200,"description":"Honeypot; leave empty."}},"additionalProperties":{"type":["string","number"]},"description":"Custom answers use x_<field key> (or the unprefixed key). Required answers depend on the form configuration. The handler reads the first 8000 characters of the body."}}}},"responses":{"200":{"description":"Signup accepted.","content":{"application/json":{"schema":{"type":"object","required":["ok","status"],"properties":{"ok":{"type":"boolean","const":true},"status":{"type":"string","enum":["pending_confirmation","subscribed","already_subscribed"]},"redirect_url":{"type":"string"}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"options":{"operationId":"optionssubscribeSignupForm","summary":"Read public signup CORS policy","parameters":[{"name":"publicId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Successful response.","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string","const":"*"}},"Access-Control-Allow-Methods":{"schema":{"type":"string","const":"GET, POST"}},"Access-Control-Max-Age":{"schema":{"type":"string","const":"86400"}},"Access-Control-Allow-Headers":{"schema":{"type":"string","const":"content-type"}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[]}},"/v1/forms/{publicId}/view":{"parameters":[{"name":"publicId","in":"path","required":true,"schema":{"type":"string","pattern":"^f_[a-z0-9]{16}$"}}],"post":{"operationId":"recordSignupFormView","summary":"Counts one display of a widget.","security":[],"responses":{"204":{"description":"Counted."}}},"options":{"operationId":"optionsviewSignupForm","summary":"Read public signup CORS policy","parameters":[{"name":"publicId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Successful response.","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string","const":"*"}},"Access-Control-Allow-Methods":{"schema":{"type":"string","const":"GET, POST"}},"Access-Control-Max-Age":{"schema":{"type":"string","const":"86400"}},"Access-Control-Allow-Headers":{"schema":{"type":"string","const":"content-type"}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[]}},"/v1/workspaces/{workspaceId}/managed-layouts":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"}],"get":{"operationId":"listManagedLayouts","summary":"List reusable product email layouts.","responses":{"200":{"description":"Product layouts.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ManagedLayout"}}}}}}}}},"post":{"operationId":"createManagedLayout","summary":"Create a draft layout from validated HTML or a brand-seeded default.","parameters":[{"$ref":"#/components/parameters/OperationalIdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"html":{"type":"string","description":"Must contain exactly one content slot."},"source_locale":{"type":"string"},"source_messages":{"type":"object","additionalProperties":{"type":"string"}},"translations":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string"}}}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","name","version","draft_revision_id","published_revision_id","published_publication_id","replayed"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"integer"},"draft_revision_id":{"type":["string","null"],"format":"uuid"},"published_revision_id":{"type":["string","null"],"format":"uuid"},"published_publication_id":{"type":["string","null"],"format":"uuid"},"replayed":{"type":"boolean"}}}}}}}},"201":{"description":"Draft layout.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","name","version","draft_revision_id","published_revision_id","published_publication_id","replayed"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"integer"},"draft_revision_id":{"type":["string","null"],"format":"uuid"},"published_revision_id":{"type":["string","null"],"format":"uuid"},"published_publication_id":{"type":["string","null"],"format":"uuid"},"replayed":{"type":"boolean"}}}}}}}}}}},"/v1/workspaces/{workspaceId}/managed-layouts/{layoutId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"layoutId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getManagedLayout","summary":"Read a layout and its current draft revision.","responses":{"200":{"description":"Layout and draft revision.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","name","version","draft_revision_id","published_revision_id","published_publication_id","draft_revision"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"integer"},"draft_revision_id":{"type":["string","null"],"format":"uuid"},"published_revision_id":{"type":["string","null"],"format":"uuid"},"published_publication_id":{"type":["string","null"],"format":"uuid"},"draft_revision":{"anyOf":[{"$ref":"#/components/schemas/ManagedLayoutRevision"},{"type":"null"}]}}}}}}}}}},"patch":{"operationId":"saveManagedLayoutDraft","summary":"Save a validated draft layout revision.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["expected_version","html"],"properties":{"expected_version":{"type":"integer","minimum":1},"html":{"type":"string","description":"Must contain exactly one content slot."},"source_locale":{"type":"string"},"source_messages":{"type":"object","additionalProperties":{"type":"string"}},"translations":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string"}}}}}}}},"responses":{"200":{"description":"New draft revision.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ManagedLayout"}}}}}},"409":{"description":"Stale version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/managed-layouts/{layoutId}/versions":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"layoutId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"listManagedLayoutVersions","summary":"List immutable layout revisions.","responses":{"200":{"description":"Layout revisions.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ManagedLayoutRevision"}}}}}}}}}},"/v1/workspaces/{workspaceId}/managed-layouts/{layoutId}/impact":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"layoutId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"describeManagedLayoutImpact","summary":"Describe content drafts and publications depending on this layout.","responses":{"200":{"description":"Layout dependency impact.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["layout_id","layout_revision_id","layout_version","affected_contents","active_journeys","manifest_sha256"],"properties":{"layout_id":{"type":"string","format":"uuid"},"layout_revision_id":{"type":"string","format":"uuid"},"layout_version":{"type":"integer"},"affected_contents":{"type":"array","items":{"type":"object","required":["content_id","version","published_revision_id"],"properties":{"content_id":{"type":"string","format":"uuid"},"version":{"type":"integer"},"published_revision_id":{"type":"string","format":"uuid"}}}},"active_journeys":{"type":"array","items":{"type":"object","required":["journey_id","version","definition_sha256"],"properties":{"journey_id":{"type":"string","format":"uuid"},"version":{"type":"integer"},"definition_sha256":{"type":"string"}}}},"manifest_sha256":{"type":"string"}}}}}}}}}}},"/v1/workspaces/{workspaceId}/managed-layouts/{layoutId}/restore":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"layoutId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"restoreManagedLayoutDraft","summary":"Copy an immutable layout revision into a new draft.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["layout_revision_id","expected_version"],"properties":{"layout_revision_id":{"type":"string","format":"uuid"},"expected_version":{"type":"integer","minimum":1}}}}}},"responses":{"200":{"description":"Restored draft revision.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ManagedLayout"}}}}}}}}},"/v1/workspaces/{workspaceId}/managed-content":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"}],"get":{"operationId":"listManagedContent","summary":"List product managed email content in stable newest-id order.","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Product content inventory and optional next cursor.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["items","next_cursor"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ManagedContentState"}},"next_cursor":{"type":["string","null"],"format":"uuid"}}}}}}}}}},"post":{"operationId":"createManagedContent","summary":"Save a source-locale email draft and queue missing target translations.","description":"Does not send or publish. Translation preparation has no per-language charge.","parameters":[{"$ref":"#/components/parameters/OperationalIdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name","contract"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"contract":{"$ref":"#/components/schemas/ManagedContentContract"}}}}}},"responses":{"201":{"description":"Draft source and queued translation jobs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedContentResponse"}}}},"422":{"description":"The source contract, template, or samples are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/managed-content/{contentId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"contentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getManagedContent","summary":"Read the draft revision, translations, and preparation status.","responses":{"200":{"description":"Current content state.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/ManagedContentState"},{"type":"object","required":["source_revision","translations","translation_jobs"],"properties":{"source_revision":{"$ref":"#/components/schemas/ManagedSourceRevision"},"translations":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/ManagedTranslation"},{"type":"object","required":["strings_sha256"],"properties":{"strings_sha256":{"type":"string"}}}]}},"translation_jobs":{"type":"array","items":{"type":"object","required":["id","source_revision_id","locale","status","attempt_count","error_code"],"properties":{"id":{"type":"string","format":"uuid"},"source_revision_id":{"type":"string","format":"uuid"},"locale":{"type":"string"},"status":{"type":"string"},"attempt_count":{"type":"integer"},"error_code":{"type":["string","null"]}}}}}}]}}}}}}}},"patch":{"operationId":"updateManagedContent","summary":"Save a new source draft revision without changing production publication.","description":"A breaking variable change cannot publish over this content ID. Create and publish new managed content, change each Journey or draft Broadcast reference to the new ID, then review/activate the Journey or schedule the Broadcast. Existing accepted sends and scheduled Broadcast recipients retain their pinned revisions.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["expected_version","contract"],"properties":{"expected_version":{"type":"integer","minimum":1},"contract":{"$ref":"#/components/schemas/ManagedContentContract"}}}}}},"responses":{"200":{"description":"New draft revision and queued translation jobs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedContentResponse"}}}},"409":{"description":"The expected version is stale.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The source or typed variable contract is invalid. Breaking contracts require a new content ID and reviewed reference migration before publication.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/managed-content/{contentId}/render":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"contentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"renderManagedContent","summary":"Preview a saved source revision and one ready locale without sending.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"description":"Use either sample_set or variables, never both. Defaults to the first named sample.","properties":{"source_revision_id":{"type":"string","format":"uuid"},"variant":{"type":"string","description":"Source A/B version key."},"locale":{"type":"string"},"timezone":{"type":"string","description":"IANA timezone; defaults to UTC."},"sample_set":{"type":"string"},"variables":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Deterministic subject, preheader, HTML, derived plain text, locale, and direction.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/RenderedManagedEmail"}}}}}},"422":{"description":"The locale, sample, values, or rendered HTML are not ready or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/managed-content/{contentId}/translations/{locale}/retry":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"contentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"locale","in":"path","required":true,"schema":{"type":"string"}}],"post":{"operationId":"retryManagedTranslation","summary":"Retry a failed automatic translation of the current source draft.","responses":{"200":{"description":"Translation retry queued.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"boolean"}}}}}},"404":{"description":"Translation job not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Translation is not eligible for retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/managed-content/{contentId}/translations":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"contentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getManagedContentTranslations","summary":"Read translation catalogs and preparation jobs for the draft revision.","responses":{"200":{"description":"Current content state including translations and jobs.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/ManagedContentState"},{"type":"object","required":["source_revision","translations","translation_jobs"],"properties":{"source_revision":{"$ref":"#/components/schemas/ManagedSourceRevision"},"translations":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/ManagedTranslation"},{"type":"object","required":["strings_sha256"],"properties":{"strings_sha256":{"type":"string"}}}]}},"translation_jobs":{"type":"array","items":{"type":"object","required":["id","source_revision_id","locale","status","attempt_count","error_code"],"properties":{"id":{"type":"string","format":"uuid"},"source_revision_id":{"type":"string","format":"uuid"},"locale":{"type":"string"},"status":{"type":"string"},"attempt_count":{"type":"integer"},"error_code":{"type":["string","null"]}}}}}}]}}}}}}}}},"/v1/workspaces/{workspaceId}/managed-content/{contentId}/translations/{locale}/review":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"contentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"locale","in":"path","required":true,"schema":{"type":"string"}}],"post":{"operationId":"reviewManagedContentTranslation","summary":"Review the exact pending translation catalog for one source revision.","description":"Requires the catalog SHA-256 from current readback. Corrected strings are optional; the source is not published by this operation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["source_revision_id","expected_translation_sha256"],"properties":{"source_revision_id":{"type":"string","format":"uuid"},"expected_translation_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"strings":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"responses":{"200":{"description":"Reviewed catalog and its new SHA-256.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["source_revision_id","locale","strings","provenance","status","strings_sha256"],"properties":{"source_revision_id":{"type":"string","format":"uuid"},"locale":{"type":"string"},"strings":{"type":"object","additionalProperties":{"type":"string"}},"provenance":{"type":"string","enum":["reviewed"]},"status":{"type":"string","enum":["ready"]},"strings_sha256":{"type":"string"}}}}}}}},"409":{"description":"The source or catalog changed, or this translation is not pending review.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/managed-content/{contentId}/versions":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"contentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"listManagedContentPublications","summary":"List immutable publication history.","responses":{"200":{"description":"Publication records.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["versions","publications"],"properties":{"versions":{"type":"array","items":{"type":"object","required":["id","revision","source_locale","configured_locales","source","source_messages","samples","restored_from_revision_id","created_by_actor_id","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"revision":{"type":"integer"},"source_locale":{"type":"string"},"configured_locales":{"type":"array","items":{"type":"string"}},"source":{"type":"object","additionalProperties":false,"required":["subject","body_html","variables"],"properties":{"subject":{"type":"string","minLength":1,"maxLength":100000},"preheader":{"type":"string","maxLength":100000},"body_text":{"type":"string","maxLength":100000,"description":"Accepted for source compatibility; rendered plain text derives from final HTML."},"body_html":{"type":"string","minLength":1,"maxLength":100000},"layout":{"type":"string","maxLength":100000,"description":"Must contain one {{ content }} slot."},"variants":{"type":"object","minProperties":2,"maxProperties":4,"description":"Optional source versions. Every version is translated automatically in the same revision.","additionalProperties":{"type":"object","additionalProperties":false,"required":["subject","body_html"],"properties":{"subject":{"type":"string","minLength":1,"maxLength":100000},"preheader":{"type":"string","maxLength":100000},"body_html":{"type":"string","minLength":1,"maxLength":100000},"body_text":{"type":"string","maxLength":100000},"layout":{"type":"string","maxLength":100000}}}},"variables":{"type":"object","maxProperties":100,"additionalProperties":{"$ref":"#/components/schemas/ManagedContentField"}}}},"source_messages":{"type":"object","additionalProperties":{"type":"string"}},"samples":{"type":"object","additionalProperties":{"type":"object","additionalProperties":true}},"restored_from_revision_id":{"type":["string","null"],"format":"uuid"},"created_by_actor_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}},"publications":{"type":"array","items":{"type":"object","required":["id","source_revision_id","approval_id","published_by_actor_id","published_at"],"properties":{"id":{"type":"string","format":"uuid"},"source_revision_id":{"type":"string","format":"uuid"},"approval_id":{"type":["string","null"],"format":"uuid"},"published_by_actor_id":{"type":"string"},"published_at":{"type":"string","format":"date-time"}}}}}}}}}}}}}},"/v1/workspaces/{workspaceId}/managed-content/{contentId}/restore":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"contentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"restoreManagedContentRevision","summary":"Copy an earlier source revision into a new draft, without publishing it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["source_revision_id","expected_version"],"properties":{"source_revision_id":{"type":"string","format":"uuid"},"expected_version":{"type":"integer","minimum":1}}}}}},"responses":{"200":{"description":"Restored draft state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedContentResponse"}}}}}}},"/v1/workspaces/{workspaceId}/journeys":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listJourneys","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["draft","discovered","active","paused","archived"]}},{"name":"trigger_kind","in":"query","schema":{"type":"string"}},{"name":"testing","in":"query","schema":{"type":"string","enum":["1"]}},{"name":"q","in":"query","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Product Journeys.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Journey"}}}}}}}}},"post":{"operationId":"createJourney","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyInput"}}}},"responses":{"201":{"description":"Journey created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Journey"}}}}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/JourneyId"}],"delete":{"operationId":"deleteJourney","description":"Removes the journey from the default list and stops active enrollments by archiving it. Sending history is retained.","responses":{"204":{"description":"Journey removed."}}},"get":{"operationId":"getJourney","responses":{"200":{"description":"Journey definition, enrollment activity, and tests.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Journey"}}}}}}}},"put":{"operationId":"updateJourney","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyInput"}}}},"responses":{"200":{"description":"Journey updated.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Journey"}}}}}}}},"patch":{"operationId":"patchJourney","summary":"Update selected Journey fields while preserving its other definition fields.","description":"Supports name, description, mailbox_id, from_local_part, trigger, audience, goal, exit, approval_mode, api, and steps. Trigger, goal, api, and exit objects merge one level; steps replace the supplied tree. Include expected_version to reject a stale edit.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"expected_version":{"type":"integer","minimum":1},"name":{"type":"string"},"description":{"type":"string"},"mailbox_id":{"type":"string","format":"uuid"},"from_local_part":{"type":"string"},"trigger":{"type":"object","additionalProperties":true},"audience":{"type":"object","additionalProperties":true},"goal":{"type":"object","additionalProperties":true},"exit":{"type":"object","additionalProperties":true},"approval_mode":{"type":"string","enum":["policy","required"]},"api":{"type":"object","additionalProperties":true},"steps":{"type":"array","items":{"$ref":"#/components/schemas/JourneyStep"}}}}}}},"responses":{"200":{"description":"Journey updated.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Journey"}}}}}},"409":{"description":"expected_version is stale.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/convert-managed":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"$ref":"#/components/parameters/JourneyId"}],"post":{"operationId":"convertJourneyToManaged","summary":"Convert a paused or draft legacy Journey to prepared managed content.","description":"One-way conversion. For a Journey with one email step, supply contract. For multiple emails, including split arms, supply step_contents with exactly one saved step_id and prepared HTML/Liquid contract per email. The conversion is atomic and changes the Journey to draft. Every new managed content revision receives its own governed publication review; no email is sent or published during conversion. Banger never imports or executes source code.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["expected_version"],"properties":{"expected_version":{"type":"integer","minimum":1},"contract":{"$ref":"#/components/schemas/ManagedContentContract"},"step_contents":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["step_id","contract"],"properties":{"step_id":{"type":"string","format":"uuid"},"contract":{"$ref":"#/components/schemas/ManagedContentContract"}}}}},"oneOf":[{"required":["contract"]},{"required":["step_contents"]}]}}}},"responses":{"200":{"description":"Idempotent replay of the same conversion.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/JourneyManagedConversion"}}}}}},"201":{"description":"All email steps converted to managed drafts; publication reviews requested.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/JourneyManagedConversion"}}}}}},"409":{"description":"Stale Journey version or Journey is active/already managed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Missing, duplicate, or unknown email step contract.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/render":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"$ref":"#/components/parameters/JourneyId"}],"post":{"operationId":"renderJourneyManagedEmail","summary":"Render one saved Journey email step without sending.","description":"Specify step_id when the Journey has multiple email steps, including split branches. Uses the selected draft or published immutable content revision.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"step_id":{"type":"string","format":"uuid"},"content_state":{"type":"string","enum":["draft","published"],"default":"draft"},"locale":{"type":"string"},"timezone":{"type":"string"},"sample_set":{"type":"string"},"variables":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Rendered subject, HTML, plain text, locale, revision identifiers, and extraction warnings.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/RenderedManagedEmail"}}}}}},"422":{"description":"Missing email step, managed content, sample, or ready locale.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/simulate":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"$ref":"#/components/parameters/JourneyId"}],"post":{"operationId":"simulateJourneyAfterEnrollment","summary":"Dry-run a saved Journey with optional trigger-time eligibility and managed broadcasts.","description":"Read-only simulation. Omit enrollment for an after-enrollment preview, or provide an explicit trigger scenario to check the current saved contact's eligibility. Present enrollment yields scope from_trigger and a first timeline entry of kind enrollment; ineligible recipients skip Journey steps while independent broadcast candidates continue. assume_active models hypothetical activation, not governance approval. Provider event receipt/deduplication, provider delivery and latency, historical audience state, schedule and inbound-email triggers are not simulated. A discovered API Journey uses its special onboarding upsert path; later delivery suppression is separate. An active API Journey checks its saved audience before the contact upsert; simulation models that order without writing. A suppressed API recipient can therefore have an eligible enrollment entry followed by exit/suppress, with no rendered send; pending broadcasts are cancelled.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["at","contact"],"properties":{"at":{"type":"string","format":"date-time"},"enrollment_id":{"type":"string"},"content_state":{"type":"string","enum":["draft","published"],"default":"draft"},"locale":{"type":"string"},"variables":{"type":"object","additionalProperties":true},"communication_history":{"type":"array","maxItems":10000,"description":"Previous sends or reservations for this simulated recipient.","items":{"type":"string","format":"date-time"}},"contact":{"type":"object","required":["email","display_name","attributes"],"properties":{"email":{"type":"string","format":"email"},"display_name":{"type":"string"},"attributes":{"type":"object","additionalProperties":true}}},"enrollment":{"type":"object","additionalProperties":false,"required":["kind"],"description":"Optional trigger attempt at the top-level at timestamp. Saved contacts use current subscription, suppression and audience membership. Hypothetical API/event contacts require explicit subscribed and suppressed=false state and an all_subscribed audience.","properties":{"kind":{"type":"string","enum":["manual","api","contact_created","audience_joined","event"]},"event":{"type":"string","maxLength":200},"assume_active":{"type":"boolean","default":false},"contact_status":{"type":"string","enum":["subscribed","unsubscribed"]},"suppressed":{"type":"boolean"}}},"events":{"type":"array","maxItems":1000,"items":{"type":"object","required":["at","kind"],"properties":{"at":{"type":"string","format":"date-time"},"kind":{"type":"string","enum":["attributes","reply","unsubscribe","suppress","goal"]},"attributes":{"type":"object","additionalProperties":true}}}},"broadcasts":{"type":"array","maxItems":20,"description":"Saved scheduled broadcasts or explicit managed-content candidates evaluated on the same recipient timeline.","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","maxLength":100},"at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"campaign_id":{"type":"string","format":"uuid"},"content_id":{"type":"string","format":"uuid"},"source_revision_id":{"type":"string","format":"uuid"},"locale":{"type":"string"},"variables":{"type":"object","additionalProperties":true}},"oneOf":[{"required":["campaign_id"]},{"required":["content_id","at"]}]}}}}}}},"responses":{"200":{"description":"Ordered timeline, rendered email details, scope and simulation warnings. Enrollment outcomes include eligible, eligible_assuming_activation, trigger_mismatch, event_mismatch, journey_not_active_or_reviewed, contact_unsubscribed, recipient_hash_missing, contact_suppressed, outside_journey_audience, already_enrolled, contact_predates_enrollment_scan, saved_contact_required, contact_state_unverified and audience_unverified. Details identify the trigger and contact-state source and may note that stored trigger conditions are not evaluated by the current runtime. Saved broadcast recipients already queued for dispatch produce already_queued; already_sent is reserved for an accepted send.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["journey_id","journey_version","content_state","scope","communication_policy_version","timeline","emails","warnings"],"properties":{"journey_id":{"type":"string","format":"uuid"},"journey_version":{"type":"integer"},"content_state":{"type":"string","enum":["draft","published"]},"scope":{"type":"string","enum":["from_trigger","after_enrollment"]},"communication_policy_version":{"type":"integer"},"timeline":{"type":"array","items":{"type":"object","required":["at","kind","outcome"],"properties":{"at":{"type":"string","format":"date-time"},"step_id":{"type":"string","format":"uuid"},"kind":{"type":"string"},"outcome":{"type":"string"},"details":{"description":"Outcome-specific simulation evidence."}}}},"emails":{"type":"array","items":{"type":"object","required":["step_id","name","source","status"],"properties":{"step_id":{"type":["string","null"],"format":"uuid"},"name":{"type":"string"},"arm":{"type":"object","required":["key","label"],"properties":{"split_step_id":{"type":"string","format":"uuid"},"key":{"type":"string"},"label":{"type":"string"}}},"source":{"type":"string","enum":["managed","design","inline","empty"]},"status":{"type":"string","enum":["rendered","blocked"]},"subject":{"type":"string"},"preview":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}}}},"warnings":{"type":"array","items":{"type":"string"}}}}}}}}},"422":{"description":"Invalid sample input or unsupported Journey action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/status":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/JourneyId"}],"post":{"operationId":"setJourneyStatus","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["draft","active","paused","archived"]}}}}}},"responses":{"200":{"description":"Journey status updated.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Journey"}}}}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/preview":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/JourneyId"}],"post":{"operationId":"previewJourney","responses":{"200":{"description":"Journey audience and readiness preview.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["sequence_id","recipient_count","sample_recipients","steps","ready","exit_config","emails","blockers"],"properties":{"sequence_id":{"type":"string","format":"uuid"},"recipient_count":{"type":"integer"},"sample_recipients":{"type":"array","items":{"type":"object","required":["id","email","display_name"],"properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"display_name":{"type":["string","null"]}}}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/JourneyStep"}},"ready":{"type":"boolean"},"exit_config":{"$ref":"#/components/schemas/JourneyExit"},"emails":{"type":"array","items":{"type":"object","required":["step_id","name","source","subject","preview","blockers"],"properties":{"step_id":{"type":["string","null"],"format":"uuid"},"name":{"type":"string"},"arm":{"type":"object","required":["key","label"],"properties":{"split_step_id":{"type":"string","format":"uuid"},"key":{"type":"string"},"label":{"type":"string"}}},"source":{"type":"string","enum":["managed","design","inline","empty"]},"template_id":{"type":"string","format":"uuid"},"managed_content_id":{"type":"string","format":"uuid"},"subject":{"type":"string"},"preview":{"type":"string"},"blockers":{"type":"array","items":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}},"blockers":{"type":"array","items":{"type":"object","required":["code","message","step_id","step_name"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"step_id":{"type":["string","null"],"format":"uuid"},"step_name":{"type":"string"},"arm":{"type":"string"}}}}}}}}}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/enroll":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/JourneyId"}],"post":{"operationId":"enrollJourneyContacts","responses":{"403":{"description":"governed_review_required: enroll through the governed action endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/executions":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/JourneyId"}],"get":{"operationId":"listJourneyExecutions","responses":{"200":{"description":"Journey step executions.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/JourneyExecution"}}}}}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyKey}/send":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"journeyKey","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"post":{"operationId":"sendJourney","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"properties":{"expires_at":{"type":"string","format":"date-time"},"expires_after_seconds":{"type":"integer","minimum":1,"maximum":604800}}}}}},"responses":{"202":{"description":"Journey email accepted.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/JourneySendReceipt"}}}}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/claim":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/JourneyId"}],"post":{"operationId":"claimJourney","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","mailbox_id","delivery_class","content_mode"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"mailbox_id":{"type":"string","format":"uuid"},"delivery_class":{"type":"string","enum":["product","broadcast"]},"content_mode":{"type":"string","enum":["code","managed"]},"template_id":{"type":"string","format":"uuid"},"from_sample":{"type":"boolean"},"variables":{"type":"array","maxItems":50,"items":{"type":"object","required":["literal","name"],"properties":{"literal":{"type":"string","minLength":1,"maxLength":10000},"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"}}}},"activate":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Discovered Journey claimed.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Journey"}}}}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/merge":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/JourneyId"}],"post":{"operationId":"mergeJourneys","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["loser_id"],"properties":{"loser_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"Journeys merged.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Journey"}}}}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/splits/{stepId}/decide":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/JourneyId"},{"name":"stepId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"decideJourneySplit","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["arm_key"],"properties":{"arm_key":{"type":"string"}}}}}},"responses":{"200":{"description":"Winning arm promoted.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Journey"}}}}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/splits/recommend":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/JourneyId"}],"get":{"operationId":"recommendJourneyArms","parameters":[{"name":"position","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Recommended test arm count and decision time.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["arms_max","weekly_arrivals","per_arm_eta_days"],"properties":{"arms_max":{"type":"integer"},"weekly_arrivals":{"type":"integer"},"per_arm_eta_days":{"type":"object","additionalProperties":{"type":"number"}}}}}}}}}}}},"/v1/workspaces/{workspaceId}/approvals":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listApprovalRequests","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["undecided","pending","approved","rejected","cancelled","expired"]}}],"responses":{"200":{"description":"Automatic and human review audit inbox for the workspace.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalRequest"}}}}}}}}},"post":{"operationId":"createApprovalRequest","description":"For canonical Banger actions, Banger derives exact scopes, applies the workspace review policy, records an immutable audit request, and automatically queues actions within the configured limit. To publish managed email source, use action_kind managed_email.publish and payload {content_id, expected_version}; Banger binds the source revision/hash and enforces human review when required. Generic approval kinds always remain pending and must provide summary, capabilities, and resources.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["action_kind","payload"],"properties":{"action_kind":{"type":"string","minLength":1,"maxLength":100},"summary":{"type":"string","minLength":1,"maxLength":500},"capabilities":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"string","maxLength":100}},"resources":{"type":"object","additionalProperties":{"type":"array","maxItems":500,"items":{"type":"string","maxLength":200}}},"payload":{"type":"object","additionalProperties":true},"expires_in_seconds":{"type":"integer","minimum":60,"maximum":86400,"default":3600}}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":16,"maxLength":128},"description":"Required for recognized Banger actions; custom approval requests do not consume this header."}],"responses":{"201":{"description":"Governed request created; it may already be automatically approved and queued.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ApprovalRequest"}}}}}}}}},"/v1/workspaces/{workspaceId}/approvals/count":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"countUndecidedApprovals","summary":"Count approvals that are waiting or were missed before a decision.","responses":{"200":{"description":"Product-scoped undecided approval counts.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["pending","missed","total"],"properties":{"pending":{"type":"integer","minimum":0},"missed":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":0}}}}}}}}}}},"/v1/workspaces/{workspaceId}/approvals/{approvalId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"approvalId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getApprovalRequest","responses":{"200":{"description":"Exact approval request and bound action payload.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ApprovalRequest"}}}}}}}}},"/v1/workspaces/{workspaceId}/approvals/{approvalId}/decision":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"approvalId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"decideApprovalRequest","description":"Human browser sessions only. Workspace API keys cannot decide approvals.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["decision"],"properties":{"decision":{"type":"string","enum":["approved","rejected"]},"reason":{"type":"string","maxLength":500},"expected_payload_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Hash of the exact approval payload displayed to the reviewer; a mismatch returns 409."}}}}}},"responses":{"200":{"description":"Approval decision recorded.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ApprovalRequest"}}}}}}}}},"/v1/workspaces/{workspaceId}/approvals/{approvalId}/cancel":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"approvalId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"cancelApprovalRequest","description":"Cancel a still-pending approval without executing it. Human browser sessions only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string","maxLength":500}}}}}},"responses":{"200":{"description":"Approval cancelled and any waiting agent run resumed without the action.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ApprovalRequest"}}}}}}}}},"/v1/workspaces/{workspaceId}/approvals/{approvalId}/dismiss":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"approvalId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"dismissApprovalRequest","description":"Dismiss an approval whose decision window was missed. Human browser sessions only.","responses":{"200":{"description":"Missed approval dismissed and recorded as cancelled.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ApprovalRequest"}}}}}}}}},"/v1/workspaces/{workspaceId}/approvals/{approvalId}/rerequest":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"approvalId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"rerequestApprovalRequest","description":"Clone a missed approval with a fresh decision window and cancel the old request. Human browser sessions only.","responses":{"201":{"description":"Fresh approval request created.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ApprovalRequest"}}}}}}}}},"/v1/workspaces/{workspaceId}/approvals/{approvalId}/revise":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"approvalId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"reviseApprovalRequest","description":"Replace a pending governed Banger action with a newly canonicalized approval. The previous request remains in history as cancelled.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["payload"],"properties":{"payload":{"type":"object","additionalProperties":true}}}}}},"responses":{"201":{"description":"Replacement approval created for human review.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ApprovalRequest"}}}}}}}}},"/v1/workspaces/{workspaceId}/automation/jobs":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"createExecutionJob","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["kind","capabilities","resources","input"],"properties":{"kind":{"type":"string","minLength":1,"maxLength":100},"approval_id":{"type":"string","format":"uuid"},"capabilities":{"type":"array","minItems":1,"maxItems":50,"description":"API keys may delegate only capabilities already present on that key.","items":{"type":"string","maxLength":100}},"resources":{"type":"object","additionalProperties":{"type":"array","maxItems":500,"items":{"type":"string","maxLength":200}}},"input":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Idempotent replay of an existing isolated execution job.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ExecutionJob"}}}}}},"202":{"description":"Durable isolated execution job accepted.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ExecutionJob"}}}}}}}}},"/v1/workspaces/{workspaceId}/automation/jobs/{jobId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"jobId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getExecutionJob","responses":{"200":{"description":"Current canonical execution state.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ExecutionJob"}}}}}}}}},"/v1/workspaces/{workspaceId}/agent-runs":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listAgentRuns","summary":"List recent internal-agent runs for the workspace.","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"Recent runs in reverse chronological order.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentRun"}}}}}}}}},"post":{"operationId":"createAgentRun","summary":"Start an isolated Banger internal-agent run.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["task"],"properties":{"task":{"type":"string","minLength":1,"maxLength":32000},"model":{"type":"string","minLength":1,"maxLength":200},"max_steps":{"type":"integer","minimum":1,"maximum":50,"default":12},"max_runtime_seconds":{"type":"integer","minimum":30,"maximum":3600,"default":900},"connection_tools":{"type":"array","maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["connection_id","adapter_key","operations"],"properties":{"connection_id":{"type":"string","format":"uuid"},"adapter_key":{"type":"string","minLength":1,"maxLength":63},"operations":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":100}}}}},"action_tools":{"type":"array","maxItems":6,"uniqueItems":true,"items":{"type":"string","enum":["mailbox.create","mail.draft","transactional.send","template.update","campaign.draft","campaign.schedule"]}}}}}}},"responses":{"200":{"description":"Idempotent replay of the existing run.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentRun"}}}}}},"202":{"description":"Agent run durably accepted and queued.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentRun"}}}}}}}}},"/v1/workspaces/{workspaceId}/agent-runs/{runId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"runId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getAgentRun","responses":{"200":{"description":"Canonical run, checkpoint, terminal result, and ordered steps.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentRun"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/workspaces/{workspaceId}/agent-runs/{runId}/cancel":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"runId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"cancelAgentRun","responses":{"200":{"description":"Agent run cancelled.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AgentRun"}}}}}}}}},"/v1/workspaces/{workspaceId}/mailboxes":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listMailboxes","responses":{"200":{"description":"Mailboxes visible to the actor.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Mailbox"}}}}}}}}},"post":{"operationId":"createNativeMailbox","summary":"Create a Banger-native work mailbox on a workspace sending domain.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["domain_id","local_part"],"properties":{"domain_id":{"type":"string","format":"uuid"},"local_part":{"type":"string","minLength":1,"maxLength":64},"display_name":{"type":"string","maxLength":200}}}}}},"responses":{"200":{"description":"Idempotent replay of a native mailbox creation.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Mailbox"}}}}}},"201":{"description":"Native mailbox created. It remains pending until inbound MX is verified.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Mailbox"}}}}}}}}},"/v1/workspaces/{workspaceId}/mailboxes/starter":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"createStarterMailbox","summary":"Create a hosted mailbox restricted to same-product hosted inboxes and the workspace signup recipient.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"create_new":{"type":"boolean","description":"Create an additional hosted mailbox instead of resuming the initial one."},"local_part":{"type":"string","minLength":3,"maxLength":40,"description":"Name before @bangermail.com. Without it the mailbox gets a word name such as quiet-maple-harbor."},"display_name":{"type":"string","maxLength":200}}}}}},"responses":{"200":{"description":"Idempotent replay of starter identity creation.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Mailbox"}}}}}},"201":{"description":"Starter Banger address created.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Mailbox"}}}}}}}}},"/v1/workspaces/{workspaceId}/mailboxes/{mailboxId}/reactivate":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"mailboxId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"reactivateMailbox","summary":"Resume the sender-reputation pause holding one mailbox, under the self-serve resume rules of resumeSending.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["acknowledge_recipient_complaint"],"properties":{"acknowledge_recipient_complaint":{"type":"boolean","const":true},"reason":{"type":"string","maxLength":500,"description":"Why sending is being restored; recorded in the audit log."}}}}}},"responses":{"200":{"description":"Mailbox reactivated, or already active after a prior successful request.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Mailbox"}}}}}}}}},"/v1/workspaces/{workspaceId}/sending-health":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"getSendingHealth","summary":"Read sender-reputation enforcement state, lane rates, pauses and the enforced thresholds.","description":"Every lane (Mailbox, Product, Broadcast) of every sending domain with its trailing 24-hour hard bounce and complaint rates and state (active, warning, paused), any domain pause, paused mailboxes, and whether the workspace is frozen. Each pause lists its top bounce and complaint sources and whether a workspace admin may resume it. Thresholds are documented in docs/product/sending-reputation-enforcement.md.","responses":{"200":{"description":"Sending health.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/SendingHealth"}}}}}}}}},"/v1/workspaces/{workspaceId}/sending-health/resume":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"resumeSending","summary":"Resume one lane, domain or mailbox pause after reviewing its rates and sources.","description":"Workspace admin only. Allowed 24 hours after a lane or domain pause and once per 30 days per domain. A repeat pause within 30 days or a frozen workspace needs Banger review and is refused with 423. After a resume the lane sends in smaller batches for 24 hours; held Broadcasts and Journeys continue automatically.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["hold_id","acknowledge_reputation_risk"],"properties":{"hold_id":{"type":"string","format":"uuid","description":"The pause (hold.id) from getSendingHealth."},"acknowledge_reputation_risk":{"type":"boolean","const":true},"reason":{"type":"string","maxLength":500,"description":"What was fixed; recorded in the audit log."}}}}}},"responses":{"200":{"description":"The pause was released.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["resumed","probation_until","health"],"properties":{"resumed":{"$ref":"#/components/schemas/SendingHold"},"probation_until":{"type":["string","null"],"format":"date-time"},"health":{"$ref":"#/components/schemas/SendingHealth"}}}}}}}},"409":{"description":"Too early to resume (sending_resume_too_early), or a lane of a paused domain (sending_domain_paused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"423":{"description":"Needs Banger review (sending_resume_review_required, sending_resume_limit_reached, sending_workspace_frozen).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/mail-page":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"getMailPage","description":"Returns the complete first-paint mail payload in one request: visible mailboxes, the selected mailbox, labels, mailbox counts, workspace revision, and the selected mailbox's first thread page.","parameters":[{"$ref":"#/components/parameters/Limit"},{"name":"mailbox_id","in":"query","description":"Preferred mailbox. Falls back to the first visible mailbox.","schema":{"type":"string","format":"uuid"}},{"name":"label_id","in":"query","description":"Return only selected-mailbox threads carrying this label.","schema":{"type":"string","format":"uuid"}},{"name":"view","in":"query","schema":{"type":"string","enum":["inbox","sent","drafts","archive","trash","spam","all"],"default":"inbox"}}],"responses":{"200":{"description":"First-paint mail data for the workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailPageResponse"}}}}}}},"/v1/workspaces/{workspaceId}/surface-data/{surface}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"surface","in":"path","required":true,"schema":{"type":"string","enum":["home","product","broadcasts","audience","domains","mailboxes","journeys","deliverability","api_keys","webhooks","approvals","connections","logs"]}}],"get":{"operationId":"getSurfaceData","summary":"Load a product screen through one authorized database transaction.","description":"Returns the bounded first-paint data for one product-scoped screen. The request validates workspace membership and the selected product in the same tenant-isolated transaction as the endpoint queries. The webhooks screen includes event_definitions (Journey trigger and goal names, including drafts), event_stats (counts across saved incoming receipts), and receipts (newest first, up to 51 rows). Clients display 50 receipts and use the extra row to detect another page. Incoming webhooks include a public_url; credentials are fetched separately. Receipt metadata does not contain raw payloads or a historical test/live label. outgoing_event_types contains the fixed catalog of automatic Banger events and the manual webhook.test event, independent of configured endpoints.","parameters":[{"$ref":"#/components/parameters/Limit"},{"name":"webhook_id","in":"query","description":"On the webhooks screen, restrict receipt history and outbound deliveries to this endpoint.","schema":{"type":"string","format":"uuid"}},{"name":"event_type","in":"query","description":"On the webhooks screen, filter incoming receipts by exact event name. Catalog definitions and totals remain product-wide.","schema":{"type":"string","maxLength":120}},{"name":"receipt_before","in":"query","description":"Incoming receipt cursor, a JSON object with receivedAt, endpointId, and eventId from the last displayed row. Preserve receivedAt verbatim to retain sub-millisecond precision. URL-encode the JSON value.","schema":{"type":"string","maxLength":4096}},{"name":"mailbox_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"approval_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"label_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"view","in":"query","schema":{"type":"string","enum":["inbox","sent","drafts","archive","trash","spam","all"]}},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Product-scoped first-paint screen data.","headers":{"Server-Timing":{"description":"Database context, authorization, validation, query, serialization, and total timings.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":true,"description":"Screen-specific aggregate selected by surface and query parameters. Keys and nested resource projections vary by surface (home, product, broadcasts, audience, domains, mailboxes, journeys, deliverability, api_keys, webhooks, approvals, connections, logs)."}}}}}}}}},"/v1/workspaces/{workspaceId}/home":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"getHome","summary":"Load the setup or operating Home for the selected product.","description":"Membership, product validity, setup projection, operating summaries, and recent activity are read in one tenant-isolated database statement.","responses":{"200":{"description":"The selected product's Home surface.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomeSurfaceResponse"}}}}}}},"/v1/workspaces/{workspaceId}/api-keys":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listWorkspaceApiKeys","responses":{"200":{"description":"Active scoped API keys. Secret values are never returned.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceApiKey"}}}}}}}}},"post":{"operationId":"createWorkspaceApiKey","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceApiKeyRequest"}}}},"responses":{"201":{"description":"API key created. The token is returned only once.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/WorkspaceApiKey"},{"type":"object","required":["token"],"properties":{"token":{"type":"string"}}}]}}}}}}}}},"/v1/workspaces/{workspaceId}/api-keys/{apiKeyId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"apiKeyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"delete":{"operationId":"revokeWorkspaceApiKey","responses":{"204":{"description":"API key revoked."}}}},"/v1/workspaces/{workspaceId}/agents":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listAgentConnections","summary":"List the AI agents (MCP clients) that can act for this workspace.","responses":{"200":{"description":"Active agent connections, newest first.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","client_name","scopes","connected_at","last_active_at","connected_by_you"],"properties":{"id":{"type":"string","format":"uuid"},"client_name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"connected_at":{"type":"string","format":"date-time"},"last_active_at":{"type":"string","format":"date-time"},"connected_by_you":{"type":"boolean"}}}}}}}}}}}},"/v1/workspaces/{workspaceId}/agents/{agentId}/revoke":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"agentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"revokeAgentConnection","summary":"Revoke one agent's access. It stops working within about 30 seconds.","responses":{"200":{"description":"Agent access revoked.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","revoked"],"properties":{"id":{"type":"string","format":"uuid"},"revoked":{"type":"boolean","const":true}}}}}}}}}}},"/v1/workspaces/{workspaceId}/connections":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listConnections","summary":"List Banger-managed product and business data connections.","responses":{"200":{"description":"Connection metadata and capabilities. Credential material is never returned.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Connection"}}}}}}}}}},"/v1/workspaces/{workspaceId}/connections/adapters/{adapterKey}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"adapterKey","in":"path","required":true,"schema":{"type":"string","enum":["anthropic","figma","github","google-analytics","google-calendar","hubspot","linear","mailchimp","notion","openai","slack","snowflake","zendesk"]}}],"post":{"operationId":"createConnection","summary":"Validate and encrypt a Banger-managed source connection.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionCredential"}}}},"responses":{"200":{"description":"Idempotent replay of an existing connection request.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Connection"}}}}}},"201":{"description":"Credential validated, encrypted, and connected.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Connection"}}}}}}}}},"/v1/workspaces/{workspaceId}/ai/email/revise":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"reviseEmailWithAi","summary":"Generate a reviewable email revision without saving or sending it.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiEmailRevisionRequest"}}}},"responses":{"200":{"description":"Structured revision proposal from the selected customer-owned AI connection.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AiEmailRevisionResult"}}}}}}}}},"/v1/workspaces/{workspaceId}/connections/{connectionId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ConnectionId"}],"delete":{"operationId":"disableConnection","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"Connection, credential, sync state, and grants revoked."}}}},"/v1/workspaces/{workspaceId}/connections/{connectionId}/validate":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ConnectionId"}],"post":{"operationId":"validateConnection","summary":"Revalidate the active credential and refresh account metadata.","responses":{"200":{"description":"Connection credential is valid.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Connection"}}}}}}}}},"/v1/workspaces/{workspaceId}/connections/{connectionId}/credential":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ConnectionId"}],"post":{"operationId":"rotateConnectionCredential","summary":"Validate and atomically rotate a managed connection credential.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionCredential"}}}},"responses":{"200":{"description":"Idempotent replay of a previous rotation.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Connection"}}}}}},"201":{"description":"Credential validated and rotated.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Connection"}}}}}}}}},"/v1/workspaces/{workspaceId}/connections/{connectionId}/query":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ConnectionId"}],"post":{"operationId":"queryConnection","summary":"Execute a typed, bounded read against a Banger-managed connection.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionQueryRequest"}}}},"responses":{"200":{"description":"An authenticated, typed response from the connected source.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ConnectionQueryResult"}}}}}},"403":{"description":"The API key has no matching connection grant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/connections/{connectionId}/grants":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ConnectionId"}],"get":{"operationId":"listConnectionGrants","responses":{"200":{"description":"Active grants for the connection.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ConnectionGrant"}}}}}}}}}},"/v1/workspaces/{workspaceId}/connections/{connectionId}/grants/{principalKind}/{principalId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ConnectionId"},{"name":"principalKind","in":"path","required":true,"schema":{"type":"string","enum":["agent","automation","api_key"]}},{"name":"principalId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}}],"put":{"operationId":"grantConnectionAccess","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionGrantRequest"}}}},"responses":{"200":{"description":"Connection access granted or replaced.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ConnectionGrant"}}}}}}}},"delete":{"operationId":"revokeConnectionAccess","responses":{"204":{"description":"Connection grant revoked."}}}},"/v1/workspaces/{workspaceId}/providers/google/oauth/session":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"createGmailOAuthSession","summary":"Start a PKCE-protected Gmail mailbox connection for this workspace.","responses":{"200":{"description":"Gmail authorization URL and poll contract.","content":{"application/json":{"schema":{"type":"object","required":["session"],"properties":{"session":{"$ref":"#/components/schemas/GmailOAuthSessionStart"}}}}}}}}},"/v1/workspaces/{workspaceId}/providers/google/oauth/sessions/{sessionId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"sessionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getWorkspaceGmailOAuthSession","summary":"Poll a Gmail authorization session inside its workspace boundary.","responses":{"200":{"description":"Current Gmail authorization state.","content":{"application/json":{"schema":{"type":"object","required":["session"],"properties":{"session":{"$ref":"#/components/schemas/GmailOAuthSessionStatus"}}}}}}}}},"/v1/workspaces/{workspaceId}/provider-connections":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listProviderConnections","responses":{"200":{"description":"Provider connection metadata. Credential material is never returned.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProviderConnection"}}}}}}}}}},"/v1/workspaces/{workspaceId}/provider-connections/resend":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"createResendProviderConnection","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendProviderCredential"}}}},"responses":{"200":{"description":"Idempotent replay of the created Resend connection.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ProviderConnection"}}}}}},"201":{"description":"Resend connection created after its delivery webhook and both encrypted credentials are active.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ProviderConnection"}}}}}}}}},"/v1/workspaces/{workspaceId}/provider-connections/{providerConnectionId}/credential":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"providerConnectionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"put":{"operationId":"rotateResendProviderCredential","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendProviderCredential"}}}},"responses":{"200":{"description":"Resend credential rotated.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ProviderConnection"}}}}}}}}},"/v1/workspaces/{workspaceId}/provider-connections/{providerConnectionId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"providerConnectionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"delete":{"operationId":"disableProviderConnection","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"Provider connection and active credential revoked."}}}},"/v1/workspaces/{workspaceId}/sending-domain-migrations":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"requestNativeDomainMigration","description":"Freeze the exact setup and observed DNS into a pending domain.migrate approval. Does not provision resources. Only a signed-in administrator may authorize it through the Approvals panel; agent credentials and automatic review are rejected. Authorization atomically rechecks the DNS snapshot and prepares the approved domain.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["domain"],"properties":{"domain":{"type":"string","minLength":3,"maxLength":253,"description":"The product's exact domain or subdomain. By default Banger derives three separate lane subdomains."},"setup_mode":{"type":"string","enum":["simple","advanced"],"default":"advanced","description":"Simple provisions one mailbox transport for receiving and sending from selected mailbox addresses, including Broadcasts and Journeys. Advanced provisions separate sending lanes."},"mailbox_mode":{"type":"string","enum":["subdomain","migrate"],"description":"Simple setup defaults to the root when no mailbox prefix is supplied; advanced defaults to a subdomain. Subdomain preserves existing domain mail. Migrate requests Mailboxes at the exact domain. An occupied exact domain or lane requires a request through sending-domain-migrations followed by authorization in the signed-in Banger Approvals panel. Agent credentials cannot authorize migration. No old messages are imported and DNS is never changed automatically."},"root_dmarc_confirmed":{"type":"boolean","description":"True only after the domain owner confirms all services sending from the root From domain authenticate with aligned SPF or DKIM. Required when Banger must prepare a new root DMARC p=reject policy. Dedicated subdomains do not need this confirmation."},"lane_prefixes":{"type":"object","additionalProperties":false,"properties":{"mailbox":{"type":"string","minLength":1,"maxLength":63,"default":"mail"},"product":{"type":"string","minLength":1,"maxLength":63,"default":"tx"},"broadcast":{"type":"string","minLength":1,"maxLength":63,"default":"broadcast"}}},"route_providers":{"type":"object","additionalProperties":false,"description":"Resend is accepted only when Banger already detected it in this domain's DNS and the selected product has an active connection. Clients must never advertise it otherwise.","properties":{"product":{"type":"string","enum":["banger","resend"],"default":"banger"},"broadcast":{"type":"string","enum":["banger","resend"],"default":"banger"}}},"route_domains":{"type":"object","additionalProperties":false,"description":"Exact verified domains synchronized from Resend. Required for each lane that keeps Resend.","properties":{"product":{"type":"string","minLength":3,"maxLength":253},"broadcast":{"type":"string","minLength":3,"maxLength":253}}}}}}}},"responses":{"200":{"description":"Existing migration request returned idempotently.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ApprovalRequest"}}}}}},"201":{"description":"Pending migration authorization created.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ApprovalRequest"}}}}}}}}},"/v1/workspaces/{workspaceId}/sending-domains":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"createNativeSendingDomain","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["domain"],"properties":{"domain":{"type":"string","minLength":3,"maxLength":253,"description":"The product's exact domain or subdomain. By default Banger derives three separate lane subdomains."},"setup_mode":{"type":"string","enum":["simple","advanced"],"default":"advanced","description":"Simple provisions one mailbox transport for receiving and sending from selected mailbox addresses, including Broadcasts and Journeys. Advanced provisions separate sending lanes."},"mailbox_mode":{"type":"string","enum":["subdomain","migrate"],"description":"Simple setup defaults to the root when no mailbox prefix is supplied; advanced defaults to a subdomain. Subdomain preserves existing domain mail. Migrate requests Mailboxes at the exact domain. An occupied exact domain or lane requires a request through sending-domain-migrations followed by authorization in the signed-in Banger Approvals panel. Agent credentials cannot authorize migration. No old messages are imported and DNS is never changed automatically."},"root_dmarc_confirmed":{"type":"boolean","description":"True only after the domain owner confirms all services sending from the root From domain authenticate with aligned SPF or DKIM. Required when Banger must prepare a new root DMARC p=reject policy. Dedicated subdomains do not need this confirmation."},"lane_prefixes":{"type":"object","additionalProperties":false,"properties":{"mailbox":{"type":"string","minLength":1,"maxLength":63,"default":"mail"},"product":{"type":"string","minLength":1,"maxLength":63,"default":"tx"},"broadcast":{"type":"string","minLength":1,"maxLength":63,"default":"broadcast"}}},"route_providers":{"type":"object","additionalProperties":false,"description":"Resend is accepted only when Banger already detected it in this domain's DNS and the selected product has an active connection. Clients must never advertise it otherwise.","properties":{"product":{"type":"string","enum":["banger","resend"],"default":"banger"},"broadcast":{"type":"string","enum":["banger","resend"],"default":"banger"}}},"route_domains":{"type":"object","additionalProperties":false,"description":"Exact verified domains synchronized from Resend. Required for each lane that keeps Resend.","properties":{"product":{"type":"string","minLength":3,"maxLength":253},"broadcast":{"type":"string","minLength":3,"maxLength":253}}}}}}}},"responses":{"200":{"description":"Idempotent replay of a Banger-native sending-domain request.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/NativeSendingDomain"}}}}}},"202":{"description":"The three canonical lanes were saved and queued for resumable provisioning.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/NativeSendingDomain"}}}}}}}},"get":{"operationId":"listNativeSendingDomains","responses":{"200":{"description":"Banger-native sending domains for the workspace.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/NativeSendingDomain"}}}}}}}}}},"/v1/workspaces/{workspaceId}/sending-domains/{sendingDomainId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"sendingDomainId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getNativeSendingDomain","responses":{"200":{"description":"Current domain, stream, provisioning, and required DNS state.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/NativeSendingDomain"}}}}}}}},"delete":{"operationId":"deleteNativeSendingDomain","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm_domain"],"properties":{"confirm_domain":{"type":"string","minLength":3,"maxLength":253,"description":"Must exactly match the root domain being deleted."}}}}}},"responses":{"202":{"description":"Sending and receiving are stopped and idempotent provider teardown is queued. Email history and audit records are preserved.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/NativeSendingDomain"}}}}}}}}},"/v1/workspaces/{workspaceId}/sending-domains/{sendingDomainId}/lanes/{laneKind}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"sendingDomainId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"laneKind","in":"path","required":true,"schema":{"type":"string","enum":["mailbox","product","broadcast"]}}],"delete":{"operationId":"removeNativeSendingLane","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirm_domain"],"properties":{"confirm_domain":{"type":"string","description":"Exact subdomain of the selected lane."}}}}}},"responses":{"202":{"description":"Only the selected lane is stopped and queued for removal. Other lanes and message history are preserved.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/NativeSendingDomain"}}}}}}}}},"/v1/workspaces/{workspaceId}/sending-domains/{sendingDomainId}/lanes/{laneKind}/pause":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"sendingDomainId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"laneKind","in":"path","required":true,"schema":{"type":"string","enum":["mailbox","product","broadcast"]}}],"post":{"operationId":"pauseNativeSendingLane","responses":{"200":{"description":"The selected lane is paused without changing its DNS or another lane.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/NativeSendingDomain"}}}}}}}}},"/v1/workspaces/{workspaceId}/sending-domains/{sendingDomainId}/lanes/{laneKind}/resume":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"sendingDomainId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"laneKind","in":"path","required":true,"schema":{"type":"string","enum":["mailbox","product","broadcast"]}}],"post":{"operationId":"resumeNativeSendingLane","responses":{"200":{"description":"The selected lane resumes when its saved DNS and provider state are ready.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/NativeSendingDomain"}}}}}}}}},"/v1/workspaces/{workspaceId}/sending-domains/{sendingDomainId}/verify":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"sendingDomainId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"verifyNativeSendingDomain","responses":{"200":{"description":"Banger identity and DNS verification were safely rechecked.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/NativeSendingDomain"}}}}}}}}},"/v1/workspaces/{workspaceId}/send-intents":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listSendIntents","parameters":[{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Recent canonical sends and their provider state.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SendIntentStatus"}}}}}}}}}},"/v1/workspaces/{workspaceId}/send-intents/{sendIntentId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"sendIntentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getSendIntent","responses":{"200":{"description":"Canonical asynchronous send status.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/SendIntentStatus"}}}}}}}}},"/v1/workspaces/{workspaceId}/threads":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listThreads","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"},{"name":"mailbox_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"label_id","in":"query","description":"Return only threads carrying this mailbox label.","schema":{"type":"string","format":"uuid"}},{"name":"view","in":"query","schema":{"type":"string","enum":["inbox","sent","drafts","archive","trash","spam","all"],"default":"inbox"}}],"responses":{"200":{"description":"Keyset-paginated workspace threads.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadPageResponse"}}}}}}},"/v1/workspaces/{workspaceId}/threads/{threadId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"threadId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getThread","responses":{"200":{"description":"Thread and ordered messages.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ThreadDetail"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/workspaces/{workspaceId}/messages/{messageId}/html":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"messageId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getMessageHtml","responses":{"200":{"description":"Authenticated, sandbox-constrained HTML message body.","content":{"text/html":{"schema":{"type":"string"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/workspaces/{workspaceId}/sender-avatar":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"getSenderAvatar","description":"Resolves an exact sender avatar first, then discovers and caches the sender domain icon in the private workspace B2 prefix.","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","format":"email","maxLength":320}}],"responses":{"200":{"description":"Authenticated sender or domain avatar image.","content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"image/svg+xml":{"schema":{"type":"string","format":"binary"}},"image/x-icon":{"schema":{"type":"string","format":"binary"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/workspaces/{workspaceId}/attachments/{attachmentId}/content":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"attachmentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"downloadAttachment","responses":{"200":{"description":"Authenticated attachment stream.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/workspaces/{workspaceId}/search":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"searchMail","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":512}},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"},{"name":"mailbox_id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Workspace-wide search results.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadPageResponse"}}}}}}},"/v1/workspaces/{workspaceId}/work":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listWork","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"},{"name":"status","in":"query","schema":{"type":"string","enum":["open","waiting","done"],"default":"open"}}],"responses":{"200":{"description":"Workspace-wide Work items.","content":{"application/json":{"schema":{"type":"object","required":["data","page"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkItem"}},"page":{"$ref":"#/components/schemas/PageInfo"}}}}}}}}},"/v1/workspaces/{workspaceId}/commands":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"createCommand","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCommandRequest"}}}},"responses":{"202":{"description":"Command committed and queued for provider execution.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Command"}}}}}},"409":{"description":"Idempotency key was reused for a different payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/changes":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listChanges","parameters":[{"name":"after_revision","in":"query","required":true,"schema":{"type":"integer","format":"int64","minimum":0}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":200}}],"responses":{"200":{"description":"Ordered invalidations after a client revision.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["current_revision","changes","has_more"],"properties":{"current_revision":{"type":"integer","format":"int64"},"changes":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceChange"}},"has_more":{"type":"boolean"}}}}}}}}}}},"/v1/workspaces/{workspaceId}/realtime-ticket":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"createRealtimeTicket","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["device_id"],"properties":{"device_id":{"type":"string","minLength":8,"maxLength":128}}}}}},"responses":{"200":{"description":"Short-lived ticket scoped to the actor and workspace.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["ticket","websocket_url","expires_at"],"properties":{"ticket":{"type":"string"},"websocket_url":{"type":"string","format":"uri"},"expires_at":{"type":"string","format":"date-time"}}}}}}}}}}},"/v1/workspaces/{workspaceId}/commands/{commandId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"commandId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCommand","responses":{"200":{"description":"Durable provider-command status.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Command"}}}}}}}}},"/v1/workspaces/{workspaceId}/labels":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listLabels","parameters":[{"name":"mailbox_id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","mailbox_id","name","color","kind","emoji","description","suggestion_id","source","updated_at","auto_set","applied_by_rule_count"],"properties":{"id":{"type":"string","format":"uuid"},"mailbox_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"color":{"type":["string","null"]},"kind":{"type":"string"},"emoji":{"type":["string","null"]},"description":{"type":["string","null"]},"suggestion_id":{"type":["string","null"]},"source":{"type":"string","enum":["banger","provider"]},"updated_at":{"type":"string","format":"date-time"},"auto_set":{"anyOf":[{"type":"object","required":["rule_id","enabled","description","exact_conditions"],"properties":{"rule_id":{"type":"string","format":"uuid"},"enabled":{"type":"boolean"},"description":{"type":["string","null"]},"exact_conditions":{"$ref":"#/components/schemas/TriageExactConditions"}}},{"type":"null"}]},"applied_by_rule_count":{"type":"integer"}}}}}}}}}}},"post":{"operationId":"createLabel","description":"Create a Banger label in one mailbox. Pass suggestion_id to create a suggested label; an existing name returns the existing label (200). Banger labels never sync to Gmail.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mailbox_id"],"properties":{"mailbox_id":{"type":"string","format":"uuid"},"name":{"type":"string","maxLength":120},"color":{"type":"string","maxLength":32},"emoji":{"type":"string","maxLength":16,"description":"One emoji shown before the name."},"description":{"type":"string","maxLength":2000},"suggestion_id":{"type":"string","maxLength":64},"auto_set":{"$ref":"#/components/schemas/LabelAutoSet"}}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":256},"description":"Optional retry key, applied when a product is selected."}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","mailbox_id","name","color","kind","emoji","description","suggestion_id","source","updated_at","auto_set","applied_by_rule_count"],"properties":{"id":{"type":"string","format":"uuid"},"mailbox_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"color":{"type":["string","null"]},"kind":{"type":"string"},"emoji":{"type":["string","null"]},"description":{"type":["string","null"]},"suggestion_id":{"type":["string","null"]},"source":{"type":"string","enum":["banger","provider"]},"updated_at":{"type":"string","format":"date-time"},"auto_set":{"anyOf":[{"type":"object","required":["rule_id","enabled","description","exact_conditions"],"properties":{"rule_id":{"type":"string","format":"uuid"},"enabled":{"type":"boolean"},"description":{"type":["string","null"]},"exact_conditions":{"$ref":"#/components/schemas/TriageExactConditions"}}},{"type":"null"}]},"applied_by_rule_count":{"type":"integer"}}}}}}}},"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","mailbox_id","name","color","kind","emoji","description","suggestion_id","source","updated_at","auto_set","applied_by_rule_count"],"properties":{"id":{"type":"string","format":"uuid"},"mailbox_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"color":{"type":["string","null"]},"kind":{"type":"string"},"emoji":{"type":["string","null"]},"description":{"type":["string","null"]},"suggestion_id":{"type":["string","null"]},"source":{"type":"string","enum":["banger","provider"]},"updated_at":{"type":"string","format":"date-time"},"auto_set":{"anyOf":[{"type":"object","required":["rule_id","enabled","description","exact_conditions"],"properties":{"rule_id":{"type":"string","format":"uuid"},"enabled":{"type":"boolean"},"description":{"type":["string","null"]},"exact_conditions":{"$ref":"#/components/schemas/TriageExactConditions"}}},{"type":"null"}]},"applied_by_rule_count":{"type":"integer"}}}}}}}}}}},"/v1/workspaces/{workspaceId}/label-suggestions":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listLabelSuggestions","parameters":[{"name":"mailbox_id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","name","emoji","color","description","already_added"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":"string"},"color":{"type":"string"},"description":{"type":"string"},"already_added":{"type":"boolean"}}}}}}}}}}}},"/v1/workspaces/{workspaceId}/triage-rules":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listTriageRules","parameters":[{"name":"mailbox_id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TriageRule"}}}}}}}}},"post":{"operationId":"createTriageRule","description":"Create a Triage rule for incoming mail (every plan; enabled rules count toward the plan amount). When = description (judged by Jev) and/or exact_conditions and/or has_label_ids; Then = actions.","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TriageRuleInput"},{"type":"object","required":["mailbox_id","name","actions"],"properties":{"mailbox_id":{"type":"string","format":"uuid"}}}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":256},"description":"Optional retry key, applied when a product is selected."}],"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/TriageRule"}}}}}}}}},"/v1/workspaces/{workspaceId}/triage-rules/preview":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"previewTriageRule","description":"Which recent threads a When would match. Read-only; returns no scores.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mailbox_id"],"properties":{"mailbox_id":{"type":"string","format":"uuid"},"rule_id":{"type":"string","format":"uuid"},"description":{"type":"string","maxLength":2000},"exact_conditions":{"$ref":"#/components/schemas/TriageExactConditions"},"has_label_ids":{"type":"array","maxItems":50,"items":{"type":"string","format":"uuid"}},"limit":{"type":"integer","minimum":1,"maximum":200}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["scanned","matches"],"properties":{"scanned":{"type":"integer"},"matches":{"type":"array","items":{"type":"object","required":["thread_id","subject"],"properties":{"thread_id":{"type":"string","format":"uuid"},"subject":{"type":"string"},"from":{"type":"string"},"received_at":{"type":"string","format":"date-time"}}}}}}}}}}}}}},"/v1/workspaces/{workspaceId}/triage-rules/run-past-mail":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"runTriageOnPastMail","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mailbox_id"],"properties":{"mailbox_id":{"type":"string","format":"uuid"},"rule_ids":{"type":"array","maxItems":50,"items":{"type":"string","format":"uuid"}},"days":{"type":"integer","minimum":1,"maximum":90},"include_other_actions":{"type":"boolean","description":"Also archive","mark read":null,"and star. Default applies labels only.":null}}}}}},"responses":{"202":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["queued_threads","days","labels_only"],"properties":{"queued_threads":{"type":"integer"},"days":{"type":"integer"},"labels_only":{"type":"boolean"}}}}}}}}}}},"/v1/workspaces/{workspaceId}/triage-rules/{ruleId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"ruleId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getTriageRule","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/TriageRule"}}}}}}}},"patch":{"operationId":"updateTriageRule","description":"A label's auto-set rule can only be edited through updateLabel.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriageRuleInput"}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":256},"description":"Optional retry key, applied when a product is selected."}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/TriageRule"}}}}}}}},"delete":{"operationId":"deleteTriageRule","responses":{"204":{"description":"Triage rule deleted."}}}},"/v1/workspaces/{workspaceId}/triage-actions":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listTriageActions","parameters":[{"name":"mailbox_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"thread_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"rule_id","in":"query","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","mailbox_id","thread_id","rule_id","rule_name","auto_set_for_label_id","action","label_id","label_name","label_emoji","thread_subject","created_at","undone_at"],"properties":{"id":{"type":"string","format":"uuid"},"mailbox_id":{"type":"string","format":"uuid"},"thread_id":{"type":"string","format":"uuid"},"rule_id":{"type":"string","format":"uuid"},"rule_name":{"type":"string"},"auto_set_for_label_id":{"type":["string","null"],"format":"uuid"},"action":{"type":"string"},"label_id":{"type":["string","null"],"format":"uuid"},"label_name":{"type":["string","null"]},"label_emoji":{"type":["string","null"]},"thread_subject":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"undone_at":{"type":["string","null"],"format":"date-time"}}}}}}}}}}}},"/v1/workspaces/{workspaceId}/triage-actions/{actionId}/undo":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"actionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"undoTriageAction","description":"Not this. Reverse one Triage action and teach its rule the email is not a match.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["undone","command_id"],"properties":{"undone":{"type":"boolean","const":true},"command_id":{"type":["string","null"],"format":"uuid"}}}}}}}}}}},"/v1/workspaces/{workspaceId}/review-policy":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"getActionReviewPolicy","responses":{"200":{"description":"Workspace automatic-review policy.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ActionReviewPolicy"}}}}}}}},"put":{"operationId":"updateActionReviewPolicy","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["automatic_review_enabled","manual_send_recipient_threshold"],"properties":{"automatic_review_enabled":{"type":"boolean"},"manual_send_recipient_threshold":{"type":"integer","minimum":1,"maximum":1000000},"manual_send_review_enabled":{"type":"boolean","description":"Enable the optional human review limit; explicit legacy threshold updates keep it enabled."}}}}}},"responses":{"200":{"description":"Updated automatic-review policy.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ActionReviewPolicy"}}}}}}}}},"/v1/workspaces/{workspaceId}/labels/{labelId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"labelId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"patch":{"operationId":"updateLabel","description":"Rename a Banger label, change color, emoji or description, or turn its auto-set rule on or off. Gmail and system labels are read-only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":120},"color":{"type":["string","null"],"maxLength":32},"emoji":{"type":["string","null"],"maxLength":16},"description":{"type":["string","null"],"maxLength":2000},"auto_set":{"$ref":"#/components/schemas/LabelAutoSet"}}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":256},"description":"Optional retry key, applied when a product is selected."}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","mailbox_id","name","color","kind","emoji","description","suggestion_id","source","updated_at","auto_set","applied_by_rule_count"],"properties":{"id":{"type":"string","format":"uuid"},"mailbox_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"color":{"type":["string","null"]},"kind":{"type":"string"},"emoji":{"type":["string","null"]},"description":{"type":["string","null"]},"suggestion_id":{"type":["string","null"]},"source":{"type":"string","enum":["banger","provider"]},"updated_at":{"type":"string","format":"date-time"},"auto_set":{"anyOf":[{"type":"object","required":["rule_id","enabled","description","exact_conditions"],"properties":{"rule_id":{"type":"string","format":"uuid"},"enabled":{"type":"boolean"},"description":{"type":["string","null"]},"exact_conditions":{"$ref":"#/components/schemas/TriageExactConditions"}}},{"type":"null"}]},"applied_by_rule_count":{"type":"integer"}}}}}}}}}},"delete":{"operationId":"deleteLabel","responses":{"204":{"description":"Label deleted."}}}},"/v1/workspaces/{workspaceId}/documents":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listDocuments","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"},{"name":"mailbox_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"q","in":"query","schema":{"type":"string","maxLength":512}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data","page"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MailDocument"}},"page":{"$ref":"#/components/schemas/PageInfo"}}}}}}}}},"/v1/workspaces/{workspaceId}/drafts":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listDrafts","parameters":[{"name":"mailbox_id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Draft"}}}}}}}}},"post":{"operationId":"createDraft","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftWrite"}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Draft"}}}}}}}}},"/v1/workspaces/{workspaceId}/drafts/{draftId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"draftId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getDraft","responses":{"200":{"description":"Canonical deliverability performance, health, and incidents.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Draft"}}}}}}}},"put":{"operationId":"updateDraft","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/DraftWrite"},{"type":"object","required":["version"],"properties":{"version":{"type":"integer","minimum":1}}}]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Draft"}}}}}}}},"delete":{"operationId":"deleteDraft","responses":{"204":{"description":"Draft and referenced objects scheduled for deletion."}}}},"/v1/workspaces/{workspaceId}/drafts/{draftId}/send":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"draftId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"post":{"operationId":"sendDraft","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"202":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Command"}}}}}}}}},"/v1/workspaces/{workspaceId}/drafts/{draftId}/attachments":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"draftId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"uploadDraftAttachment","parameters":[{"name":"X-Banger-Filename","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":500}}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary","maxLength":26214400}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/DraftAttachment"}}}}}},"413":{"description":"Attachment or workspace quota exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/drafts/{draftId}/attachments/{attachmentId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"draftId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"attachmentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"delete":{"operationId":"deleteDraftAttachment","responses":{"204":{"description":"Attachment scheduled for version-aware B2 deletion."}}}},"/v1/workspaces/{workspaceId}/contacts":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listContacts","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"},{"name":"q","in":"query","schema":{"type":"string","maxLength":512}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data","page"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"page":{"$ref":"#/components/schemas/PageInfo"}}}}}}}},"post":{"operationId":"upsertContact","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["email","status"],"properties":{"email":{"type":"string","format":"email"},"display_name":{"type":"string","maxLength":1000},"status":{"type":"string","enum":["subscribed","unsubscribed","bounced","complained"]},"attributes":{"type":"object","additionalProperties":true},"consent_confirmed":{"type":"boolean","description":"Required when newly subscribing an address."}}}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}}}}},"/v1/workspaces/{workspaceId}/contacts/{contactId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"contactId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getContact","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","email","display_name","attributes","status","created_at","updated_at","suppressed","suppression_reason","sources","lists","subscription_status","consent_evidence"],"properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"display_name":{"type":["string","null"]},"attributes":{"type":"object","additionalProperties":true},"status":{"type":"string","enum":["subscribed","unsubscribed","bounced","complained"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"suppressed":{"type":"boolean"},"suppression_reason":{"type":["string","null"]},"sources":{"type":"array","items":{"type":"object","required":["kind","reference","connection_id","metadata","first_seen_at","last_seen_at"],"properties":{"kind":{"type":"string"},"reference":{"type":"string"},"connection_id":{"type":["string","null"],"format":"uuid"},"metadata":{"type":"object","additionalProperties":true},"first_seen_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","format":"date-time"}}}},"lists":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}}}},"subscription_status":{"type":"string"},"consent_evidence":{"type":"array","items":{"type":"object","required":["kind","reference","connection_id","metadata","first_seen_at","last_seen_at"],"properties":{"kind":{"type":"string"},"reference":{"type":"string"},"connection_id":{"type":["string","null"],"format":"uuid"},"metadata":{"type":"object","additionalProperties":true},"first_seen_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","format":"date-time"}}}}}}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"operationId":"deleteContact","responses":{"204":{"description":"Contact deleted."}}}},"/v1/workspaces/{workspaceId}/contacts/imports":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listContactImports","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AudienceImport"}}}}}}}}},"post":{"operationId":"importContacts","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["filename","rows"],"properties":{"filename":{"type":"string","minLength":1,"maxLength":500},"list_id":{"type":"string","format":"uuid"},"consent_confirmed":{"type":"boolean","description":"Required when any imported row is subscribed."},"rows":{"type":"array","minItems":1,"maxItems":5000,"items":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"display_name":{"type":"string","maxLength":1000},"status":{"type":"string","enum":["subscribed","unsubscribed","bounced","complained"]},"attributes":{"type":"object","additionalProperties":true}}}}}}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","status","total_rows","imported_rows","invalid_rows","list_id"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued"]},"total_rows":{"type":"integer"},"imported_rows":{"type":"integer"},"invalid_rows":{"type":"integer"},"list_id":{"type":["string","null"],"format":"uuid"}}}}}}}}}}},"/v1/workspaces/{workspaceId}/contact-lists":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listContactLists","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ContactList"}}}}}}}}},"post":{"operationId":"createContactList","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":200,"minLength":1},"description":{"type":"string","maxLength":2000}}}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ContactList"}}}}}}}}},"/v1/workspaces/{workspaceId}/contact-lists/{listId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"listId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getContactList","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","name","description","created_at","updated_at","members"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"members":{"type":"array","items":{"type":"object","required":["id","email","display_name","status","attributes","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"display_name":{"type":["string","null"]},"status":{"type":"string"},"attributes":{"type":"object","additionalProperties":true},"updated_at":{"type":"string","format":"date-time"}}}}}}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/workspaces/{workspaceId}/contact-lists/{listId}/members":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"listId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"addContactListMembers","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contact_ids"],"properties":{"contact_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":1000}}}}}},"responses":{"204":{"description":"List membership updated."},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"removeContactListMembers","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contact_ids"],"properties":{"contact_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":1000}}}}}},"responses":{"204":{"description":"List membership updated."},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/contact-fields":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listContactFieldDefinitions","summary":"The product's contact fields (built-in, declared and discovered) with type, choices, source, how many contacts have a value, and the segment operators each supports.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ContactField"}}}}}}}}},"post":{"operationId":"createContactField","summary":"Declare a contact field: label, type (text, number, boolean, date, choice, choices), optional key, options and description.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["label"],"properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","maxLength":80,"minLength":1},"description":{"type":"string","maxLength":500},"type":{"type":"string","enum":["text","number","boolean","date","choice","choices"],"default":"text"},"options":{"type":"array","items":{"type":"string"},"maxItems":50}}}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ContactField"}}}}}},"409":{"description":"A field with that key already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/contact-fields/{key}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"}}],"patch":{"operationId":"updateContactField","summary":"Rename, describe, retype (converting stored values, or 409 with an example that doesn't fit), change choices, or hide a field.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","maxLength":80},"description":{"type":"string","maxLength":500},"type":{"type":"string","enum":["text","number","boolean","date","choice","choices"]},"options":{"type":"array","items":{"type":"string"},"maxItems":50},"status":{"type":"string","enum":["active","hidden"]}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ContactField"}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Built-in field, or stored values don't fit the new type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/signup-forms":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listSignupForms","summary":"The product's signup forms with embed code, hosted link, views, signups, confirmations, subscribers and conversion rate.","parameters":[{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SignupForm"}}}}}}}}},"post":{"operationId":"createSignupForm","summary":"Create a form: kind (inline, popup, bar, slide_in, page), list_id or list_name, optional mailbox_id, double_opt_in (default true) and partial config.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"kind":{"type":"string","enum":["inline","popup","bar","slide_in","page"],"default":"inline"},"list_id":{"type":"string","format":"uuid"},"list_name":{"type":"string","maxLength":200},"mailbox_id":{"type":["string","null"],"format":"uuid"},"double_opt_in":{"type":"boolean","default":true},"config":{"$ref":"#/components/schemas/SignupFormConfig"}}}}}},"parameters":[{"$ref":"#/components/parameters/OperationalIdempotencyKey"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"public_id":{"type":"string","pattern":"^f_[a-z0-9]{16}$"},"name":{"type":"string"},"kind":{"type":"string","enum":["inline","popup","bar","slide_in","page"]},"list_id":{"type":"string","format":"uuid"},"list_name":{"type":"string"},"mailbox_id":{"type":["string","null"],"format":"uuid"},"double_opt_in":{"type":"boolean"},"config":{"$ref":"#/components/schemas/SignupFormConfig"},"status":{"type":"string","enum":["active","paused","archived"]},"views":{"type":"integer"},"submissions":{"type":"integer"},"confirmations":{"type":"integer"},"subscribers":{"type":"integer"},"version":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"hosted_url":{"type":"string"},"embed_code":{"type":"string"},"embed_slot":{"type":"string"},"open_button":{"type":"string"},"conversion_rate":{"type":"number"},"replayed":{"type":"boolean"}}}}}}}},"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","product_id","public_id","name","kind","list_id","list_name","mailbox_id","double_opt_in","config","status","views","submissions","confirmations","subscribers","version","created_at","updated_at","hosted_url","embed_code","embed_slot","open_button","conversion_rate","replayed"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"public_id":{"type":"string","pattern":"^f_[a-z0-9]{16}$"},"name":{"type":"string"},"kind":{"type":"string","enum":["inline","popup","bar","slide_in","page"]},"list_id":{"type":"string","format":"uuid"},"list_name":{"type":"string"},"mailbox_id":{"type":["string","null"],"format":"uuid"},"double_opt_in":{"type":"boolean"},"config":{"$ref":"#/components/schemas/SignupFormConfig"},"status":{"type":"string","enum":["active","paused","archived"]},"views":{"type":"integer"},"submissions":{"type":"integer"},"confirmations":{"type":"integer"},"subscribers":{"type":"integer"},"version":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"hosted_url":{"type":"string"},"embed_code":{"type":"string"},"embed_slot":{"type":"string"},"open_button":{"type":"string"},"conversion_rate":{"type":"number"},"replayed":{"type":"boolean"}}}}}}}}}}},"/v1/workspaces/{workspaceId}/signup-forms/readiness":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"getSignupFormReadiness","summary":"Whether this product can turn forms on (its product lane sends from a verified domain).","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["forms_enabled"],"properties":{"forms_enabled":{"type":"boolean"},"reason":{"type":"string","enum":["verified_domain_required"]}}}}}}}}}}},"/v1/workspaces/{workspaceId}/signup-forms/preview":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"previewUnsavedSignupForm","summary":"Render unsaved form settings as a complete HTML page on a sketched website.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["inline","popup","bar","slide_in","page"]},"config":{"$ref":"#/components/schemas/SignupFormConfig"},"double_opt_in":{"type":"boolean"},"state":{"type":"string","enum":["form","success"]}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["kind","state","html"],"properties":{"kind":{"type":"string","enum":["inline","popup","bar","slide_in","page"]},"state":{"type":"string","enum":["form","success"]},"html":{"type":"string"}}}}}}}}}}},"/v1/workspaces/{workspaceId}/signup-forms/{formId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"formId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getSignupForm","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/SignupForm"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"operationId":"updateSignupForm","summary":"Partial update; config merges into the saved settings; status active, paused or archived; expected_version guards concurrent edits.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"kind":{"type":"string","enum":["inline","popup","bar","slide_in","page"],"default":"inline"},"list_id":{"type":"string","format":"uuid"},"list_name":{"type":"string","maxLength":200},"mailbox_id":{"type":["string","null"],"format":"uuid"},"double_opt_in":{"type":"boolean","default":true},"config":{"$ref":"#/components/schemas/SignupFormConfig"},"status":{"type":"string","enum":["active","paused","archived"]},"expected_version":{"type":"integer"}}}}}},"parameters":[{"$ref":"#/components/parameters/OperationalIdempotencyKey"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","product_id","public_id","name","kind","list_id","list_name","mailbox_id","double_opt_in","config","status","views","submissions","confirmations","subscribers","version","created_at","updated_at","hosted_url","embed_code","embed_slot","open_button","conversion_rate","replayed"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"public_id":{"type":"string","pattern":"^f_[a-z0-9]{16}$"},"name":{"type":"string"},"kind":{"type":"string","enum":["inline","popup","bar","slide_in","page"]},"list_id":{"type":"string","format":"uuid"},"list_name":{"type":"string"},"mailbox_id":{"type":["string","null"],"format":"uuid"},"double_opt_in":{"type":"boolean"},"config":{"$ref":"#/components/schemas/SignupFormConfig"},"status":{"type":"string","enum":["active","paused","archived"]},"views":{"type":"integer"},"submissions":{"type":"integer"},"confirmations":{"type":"integer"},"subscribers":{"type":"integer"},"version":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"hosted_url":{"type":"string"},"embed_code":{"type":"string"},"embed_slot":{"type":"string"},"open_button":{"type":"string"},"conversion_rate":{"type":"number"},"replayed":{"type":"boolean"}}}}}}}},"409":{"description":"The form changed since it was loaded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/signup-forms/{formId}/preview":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"formId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewSignupForm","summary":"Render a saved form, optionally with unsaved changes, in the form or success state.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["inline","popup","bar","slide_in","page"]},"config":{"$ref":"#/components/schemas/SignupFormConfig"},"double_opt_in":{"type":"boolean"},"state":{"type":"string","enum":["form","success"]}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["kind","state","html"],"properties":{"kind":{"type":"string","enum":["inline","popup","bar","slide_in","page"]},"state":{"type":"string","enum":["form","success"]},"html":{"type":"string"}}}}}}}}}}},"/v1/workspaces/{workspaceId}/segments":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listSegments","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ContactSegment"}}}}}}}}},"post":{"operationId":"createSegment","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":200,"minLength":1},"filter":{"$ref":"#/components/schemas/ContactFilter"}}}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ContactSegment"}}}}}}}}},"/v1/workspaces/{workspaceId}/segments/{segmentId}/preview":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"segmentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"previewSegment","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/ContactSegment"},{"$ref":"#/components/schemas/AudiencePreview"}]}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/workspaces/{workspaceId}/suppressions":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listSuppressions","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Suppression"}}}}}}}}},"post":{"operationId":"createSuppression","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","maxLength":320,"minLength":3},"reason":{"type":"string","enum":["unsubscribe","hard_bounce","complaint","manual"],"default":"manual"},"source_id":{"type":"string","maxLength":500}}}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Suppression"}}}}}}}}},"/v1/workspaces/{workspaceId}/suppressions/{emailHash}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"emailHash","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}}],"delete":{"operationId":"deleteSuppression","responses":{"204":{"description":"Suppression removed."}}}},"/v1/workspaces/{workspaceId}/templates":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listTemplates","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EmailTemplate"}}}}}}}}},"post":{"operationId":"createTemplate","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":200,"minLength":1},"subject":{"type":"string","maxLength":10000},"body_text":{"type":"string","maxLength":2000000},"body_html":{"type":"string","maxLength":2000000},"content":{"type":"object","additionalProperties":{"type":"string"}},"slots":{"type":"array","items":{"$ref":"#/components/schemas/TemplateSlot"}},"origin":{"type":"string","enum":["person","agent","starter","import"]},"message_kind":{"type":"string"},"starter_id":{"type":"string","maxLength":80},"starter_version":{"type":"integer","minimum":1}}}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EmailTemplate"}}}}}}}}},"/v1/workspaces/{workspaceId}/templates/preview":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"previewDesign","description":"Render unsaved design input with sample or audience values and report placeholder gaps.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","maxLength":10000},"body_text":{"type":"string","maxLength":2000000},"body_html":{"type":"string","maxLength":2000000},"content":{"type":"object","additionalProperties":{"type":"string"}},"audience":{"$ref":"#/components/schemas/CampaignAudience"},"sample_email":{"type":"string","maxLength":320}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EmailDesignPreview"}}}}}}}}},"/v1/workspaces/{workspaceId}/templates/{templateId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"templateId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getTemplate","description":"One design with its inline HTML, fill-in content, and effective slots.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EmailTemplate"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"operationId":"updateTemplate","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"subject":{"type":"string","maxLength":10000},"body_text":{"type":"string","maxLength":2000000},"body_html":{"type":"string","minLength":1,"maxLength":2000000},"content":{"type":"object","additionalProperties":{"type":"string","maxLength":20000}},"slots":{"type":"array","maxItems":100,"items":{"type":"object","required":["key"],"properties":{"key":{"type":"string","maxLength":200},"label":{"type":"string","maxLength":120},"type":{"type":"string","enum":["text","paragraph","url","image"]},"help":{"type":"string","maxLength":300}}}},"status":{"type":"string","enum":["active","archived"]}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EmailTemplate"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/workspaces/{workspaceId}/templates/{templateId}/duplicate":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"templateId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"duplicateTemplate","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":200}}}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EmailTemplate"}}}}}}}}},"/v1/workspaces/{workspaceId}/templates/{templateId}/preview":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"templateId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewTemplate","description":"Render a saved design with sample or audience values and report placeholder gaps.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"object","additionalProperties":{"type":"string"}},"audience":{"$ref":"#/components/schemas/CampaignAudience"},"sample_email":{"type":"string","maxLength":320}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EmailDesignPreview"}}}}}}}}},"/v1/workspaces/{workspaceId}/campaigns/coverage-preview":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"previewCampaignCoverage","description":"Required placeholders an audience cannot fill, before any Broadcast is saved.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["audience"],"properties":{"subject":{"type":"string","maxLength":10000},"body_text":{"type":"string","maxLength":2000000},"body_html":{"type":"string","maxLength":2000000},"content":{"type":"object","additionalProperties":{"type":"string"}},"audience":{"$ref":"#/components/schemas/CampaignAudience"},"sample_email":{"type":"string","maxLength":320},"template_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["required_variables","audience_count","gaps"],"properties":{"required_variables":{"type":"array","items":{"type":"string"}},"audience_count":{"type":"integer"},"gaps":{"type":"array","items":{"type":"object","required":["variable","missing_count","sample_emails"],"properties":{"variable":{"type":"string"},"missing_count":{"type":"integer"},"sample_emails":{"type":"array","items":{"type":"string"}}}}}}}}}}}}}}},"/v1/workspaces/{workspaceId}/brand/discover":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"product_id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"discoverProductBrand","description":"Read the product website and save discovered brand suggestions without overwriting explicit brand values. Requires campaigns write scope.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ResolvedProductBrand"}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"A public website is required or the website could not be read.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/brand":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"getBrand","description":"The resolved product brand kit with per-field sources.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ResolvedProductBrand"}}}}}}}},"put":{"operationId":"updateBrand","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ProductBrand"},{"type":"object","required":["brand"],"properties":{"brand":{"$ref":"#/components/schemas/ProductBrand"}}}]}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ResolvedProductBrand"}}}}}}}}},"/v1/workspaces/{workspaceId}/starters":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listStarters","description":"Starter layouts rendered in the product brand, each with a brief (job, when to send, metric, mechanic, subject lines to test), slots and default content. Listings are compact and default to the product's kind of business; request one starter by id for its body_html.","parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"string"},"description":"One starter; includes body_html."},{"name":"business","in":"query","required":false,"schema":{"type":"string","enum":["all","saas","shop","creator","services","local","community"]}},{"name":"stage","in":"query","required":false,"schema":{"type":"string","enum":["onboarding","activation","revenue","retention","publish","account"]}},{"name":"category","in":"query","required":false,"schema":{"type":"string","enum":["product","lifecycle","broadcast"]}},{"name":"include_html","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"style","in":"query","required":false,"schema":{"type":"string","enum":["brand","clarity","editorial","luxe","material","playful","bold","plain"]},"description":"Visual style; defaults to the brand's email_style."}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data","business","style","businesses","stages","styles"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EmailStarter"}},"business":{"type":"string"},"style":{"type":"string"},"businesses":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"hint":{"type":"string"}}}},"stages":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}}}},"styles":{"type":"array","items":{"type":"object","required":["key","label","description"],"properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}}}}}}}},"404":{"description":"No starter has that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/experiments":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listExperiments","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EmailExperiment"}}}}}}}}},"post":{"operationId":"createExperiment","description":"Start an A/B test on a Broadcast, journey step, or automation rule.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentInput"}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EmailExperiment"}}}}}}}}},"/v1/workspaces/{workspaceId}/experiments/{experimentId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"experimentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getExperiment","description":"The experiment with per-variant results and a suggested winner.","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/EmailExperiment"},{"type":"object","required":["results"],"properties":{"results":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"sends":{"type":"integer"},"delivered":{"type":"integer"},"human_opens":{"type":"integer"},"human_clicks":{"type":"integer"},"replies":{"type":"integer"},"conversions":{"type":"integer"},"unsubscribes":{"type":"integer"},"complaints":{"type":"integer"},"rate":{"type":"number"},"lift_vs_first":{"type":["number","null"]},"confidence_vs_first":{"type":["number","null"]},"sample_ok":{"type":"boolean"},"guardrail_tripped":{"type":"boolean"}}}},"suggested_winner":{"type":"object","required":["key","reason","basis","confidence","sample_ok"],"properties":{"key":{"type":"string"},"reason":{"type":"string"},"basis":{"type":"string","enum":["confident","deadline","guardrail"]},"confidence":{"type":["number","null"]},"sample_ok":{"type":"boolean"}}}}}]}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/workspaces/{workspaceId}/experiments/{experimentId}/decide":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"experimentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"decideExperiment","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["winner_key"],"properties":{"winner_key":{"type":"string","maxLength":40,"minLength":1},"reason":{"type":"string","maxLength":500}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EmailExperiment"}}}}}}}}},"/v1/workspaces/{workspaceId}/experiments/{experimentId}/stop":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"experimentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"stopExperiment","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EmailExperiment"}}}}}}}}},"/v1/workspaces/{workspaceId}/ai/email/capabilities":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"getAiEmailCapabilities","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["categorization","managed"],"properties":{"categorization":{"type":"object","required":["available","enabled","reason"],"properties":{"available":{"type":"boolean","const":false},"enabled":{"type":"boolean","const":false},"reason":{"type":"string","enum":["not_configured"]}}},"managed":{"oneOf":[{"type":"object","required":["available"],"properties":{"available":{"type":"boolean","const":false}}},{"type":"object","required":["available","provider","model"],"properties":{"available":{"type":"boolean","const":true},"provider":{"type":"string","enum":["openai","anthropic"]},"model":{"type":"string"}}}]}}}}}}}}}}},"/v1/workspaces/{workspaceId}/ai/email/generate":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"generateEmailWithAi","description":"Generate a complete on-brand email design from a brief. Proposal only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["brief"],"properties":{"brief":{"type":"string","maxLength":40000,"minLength":1},"audience":{"type":"string","maxLength":4000},"starter":{"type":"object","properties":{"subject":{"type":"string","maxLength":998},"body_text":{"type":"string","maxLength":100000},"body_html":{"type":"string","maxLength":200000}}},"connection_id":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["openai","anthropic"]},"model":{"type":"string","maxLength":200}}}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AiGeneratedEmail"}}}}}}}}},"/v1/workspaces/{workspaceId}/templates/{templateId}/html":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"templateId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getTemplateHtml","responses":{"200":{"description":"Scriptless HTML email template body.","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/v1/workspaces/{workspaceId}/campaigns":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listCampaigns","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}}}}}}}}},"post":{"operationId":"createCampaign","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","mailbox_id","template_id","audience"],"properties":{"name":{"type":"string","maxLength":200},"mailbox_id":{"type":"string","format":"uuid"},"template_id":{"type":"string","format":"uuid"},"subject_variants":{"type":"array","maxItems":8,"items":{"type":"string","minLength":1,"maxLength":998}},"selected_subject_variant":{"type":"integer","minimum":0,"nullable":true},"audience":{"type":"object","properties":{"all_subscribed":{"type":"boolean","default":false},"contact_ids":{"type":"array","maxItems":10000,"items":{"type":"string","format":"uuid"}},"list_ids":{"type":"array","maxItems":1000,"items":{"type":"string","format":"uuid"}},"segment_ids":{"type":"array","maxItems":1000,"items":{"type":"string","format":"uuid"}}}}}}}}},"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Campaign"}}}}}}}}},"/v1/workspaces/{workspaceId}/campaigns/audience-preview":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"post":{"operationId":"previewCampaignAudience","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["audience"],"properties":{"audience":{"$ref":"#/components/schemas/CampaignAudience"}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AudiencePreview"}}}}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/CampaignId"}],"get":{"operationId":"getCampaign","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Campaign"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"operationId":"updateCampaign","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","mailbox_id","audience"],"properties":{"name":{"type":"string","maxLength":200},"mailbox_id":{"type":"string","format":"uuid"},"template_id":{"type":"string","format":"uuid"},"subject_variants":{"type":"array","maxItems":8,"items":{"type":"string","minLength":1,"maxLength":998}},"selected_subject_variant":{"type":"integer","minimum":0,"nullable":true},"audience":{"type":"object"}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Campaign"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"operationId":"deleteCampaign","summary":"Delete an unsent campaign","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"campaignId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","deleted"],"properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","const":true}}}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/recipients":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/CampaignId"}],"get":{"operationId":"listCampaignRecipients","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","queued","sent","failed","skipped","delivered","deferred","bounced","complained","unsubscribed"]}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data","page"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"contact_id":{"type":["string","null"],"format":"uuid"},"recipient_email":{"type":"string"},"recipient_name":{"type":["string","null"]},"recipient_hash":{"type":"string"},"status":{"type":"string"},"dispatch_status":{"type":"string"},"command_id":{"type":["string","null"],"format":"uuid"},"error_code":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"delivery_state":{"type":["string","null"]},"provider_message_key":{"type":["string","null"]},"last_event_at":{"type":["string","null"],"format":"date-time"},"first_delivered_at":{"type":["string","null"],"format":"date-time"},"first_opened_at":{"type":["string","null"],"format":"date-time"},"first_clicked_at":{"type":["string","null"],"format":"date-time"},"first_human_likely_opened_at":{"type":["string","null"],"format":"date-time"},"first_human_likely_clicked_at":{"type":["string","null"],"format":"date-time"},"first_replied_at":{"type":["string","null"],"format":"date-time"},"machine_open_count":{"type":"integer"},"machine_click_count":{"type":"integer"},"privacy_proxy_open_count":{"type":"integer"},"unknown_open_count":{"type":"integer"},"unknown_click_count":{"type":"integer"},"first_unsubscribed_at":{"type":["string","null"],"format":"date-time"}}}},"page":{"$ref":"#/components/schemas/PageInfo"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/timeline":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/CampaignId"}],"get":{"operationId":"listCampaignTimeline","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","type","occurred_at","actor_id","detail"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"occurred_at":{"type":"string","format":"date-time"},"actor_id":{"type":["string","null"]},"detail":{"type":"object","additionalProperties":true}}}}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/pause":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/CampaignId"}],"post":{"operationId":"pauseCampaign","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","product_id","name","mailbox_id","template_id","status","audience_query","scheduled_at","started_at","completed_at","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"mailbox_id":{"type":"string","format":"uuid"},"template_id":{"type":["string","null"],"format":"uuid"},"status":{"type":"string"},"audience_query":{"$ref":"#/components/schemas/CampaignAudience"},"scheduled_at":{"type":["string","null"],"format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}}}},"409":{"$ref":"#/components/responses/Conflict"}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/resume":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/CampaignId"}],"post":{"operationId":"resumeCampaign","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","product_id","name","mailbox_id","template_id","status","audience_query","scheduled_at","started_at","completed_at","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"mailbox_id":{"type":"string","format":"uuid"},"template_id":{"type":["string","null"],"format":"uuid"},"status":{"type":"string"},"audience_query":{"$ref":"#/components/schemas/CampaignAudience"},"scheduled_at":{"type":["string","null"],"format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}}}},"409":{"$ref":"#/components/responses/Conflict"}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/cancel":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/CampaignId"}],"post":{"operationId":"cancelCampaign","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","product_id","name","mailbox_id","template_id","status","audience_query","scheduled_at","started_at","completed_at","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"mailbox_id":{"type":"string","format":"uuid"},"template_id":{"type":["string","null"],"format":"uuid"},"status":{"type":"string"},"audience_query":{"$ref":"#/components/schemas/CampaignAudience"},"scheduled_at":{"type":["string","null"],"format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}}}},"409":{"$ref":"#/components/responses/Conflict"}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/schedule":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/CampaignId"}],"post":{"operationId":"scheduleCampaign","deprecated":true,"description":"Deprecated direct scheduling boundary. Always returns governed_review_required; use the campaign review endpoint so the workspace recipient threshold is enforced.","responses":{"403":{"description":"governed_review_required: schedule through /review.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/test":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/CampaignId"}],"post":{"operationId":"testCampaign","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to"],"properties":{"to":{"type":"string","maxLength":320,"minLength":3},"data_mode":{"type":"string","enum":["sample","fallback","contact"],"default":"contact"},"contact_email":{"type":"string","maxLength":320},"variant_key":{"type":"string","maxLength":80},"locale":{"type":"string"}}}}}},"responses":{"202":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/TransactionalSendReceipt"}}}}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/review":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/CampaignId"}],"post":{"operationId":"requestCampaignReview","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":[],"properties":{"expected_version":{"type":"integer","minimum":1},"expected_design_version":{"type":"integer","minimum":1},"recipient_selection":{"type":"object","additionalProperties":false,"properties":{"all_subscribed":{"type":"boolean"},"contact_ids":{"type":"array","maxItems":10000,"items":{"type":"string","format":"uuid"}},"list_ids":{"type":"array","maxItems":1000,"items":{"type":"string","format":"uuid"}},"segment_ids":{"type":"array","maxItems":1000,"items":{"type":"string","format":"uuid"}}}},"scheduled_at":{"type":"string","format":"date-time"},"send_now":{"type":"boolean","const":true}},"oneOf":[{"required":["scheduled_at"]},{"required":["send_now"]}]}}}},"responses":{"201":{"description":"Campaign scheduling approval created.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ApprovalRequest"}}}}}}}}},"/v1/workspaces/{workspaceId}/transactional-sends":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listTransactionalSends","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":200}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TransactionalSend"}}}}}}}}},"post":{"operationId":"createTransactionalSend","description":"One recipient per Journey send. The To field accepts one email string or a one-element array of email strings/participant objects; Cc and Bcc must be empty. A new API Journey defaults to managed source content; legacy code Journeys retain complete-content sends.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mailbox_id","to"],"properties":{"mailbox_id":{"type":"string","format":"uuid"},"to":{"oneOf":[{"type":"string","format":"email"},{"type":"array","minItems":1,"maxItems":1,"items":{"oneOf":[{"type":"string","format":"email"},{"$ref":"#/components/schemas/Participant"}]}}]},"cc":{"type":"array","maxItems":0,"items":{"$ref":"#/components/schemas/Participant"}},"bcc":{"type":"array","maxItems":0,"items":{"$ref":"#/components/schemas/Participant"}},"subject":{"type":"string","maxLength":10000},"expires_at":{"type":"string","format":"date-time","description":"Discard a deferred Journey send after this instant; at most seven days from the original request."},"expires_after_seconds":{"type":"integer","minimum":1,"maximum":604800},"body_text":{"type":"string","maxLength":2000000},"body_html":{"type":"string","maxLength":2000000},"reply_to":{"type":"array","maxItems":500,"items":{"$ref":"#/components/schemas/Participant"}},"headers":{"type":"object","maxProperties":100,"additionalProperties":{"type":"string","maxLength":5000}},"tags":{"type":"array","maxItems":49,"items":{"type":"object","additionalProperties":false,"required":["name","value"],"properties":{"name":{"type":"string","minLength":1,"maxLength":256},"value":{"type":"string","minLength":1,"maxLength":256}}}}}}}}},"responses":{"202":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/JourneySendReceipt"}}}}}}}}},"/v1/workspaces/{workspaceId}/logs":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"listLogs","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"},{"name":"direction","in":"query","schema":{"type":"string","enum":["all","out","in"]}},{"name":"origin","in":"query","schema":{"type":"string","enum":["journey","broadcast","mailbox","api","agent"]}},{"name":"mailbox_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","schema":{"$ref":"#/components/schemas/LogStatus"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"query","in":"query","schema":{"type":"string","maxLength":512}}],"responses":{"200":{"description":"Cursor page from the merged sent and received timeline.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogPage"}}}}}}},"/v1/workspaces/{workspaceId}/logs/{entryId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"entryId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getLogEntry","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/LogEntry"},{"type":"object","required":["detail"],"properties":{"detail":{"oneOf":[{"type":"object","required":["kind","thread"],"properties":{"kind":{"type":"string","enum":["inbound"]},"thread":{"$ref":"#/components/schemas/ThreadDetail"}}},{"type":"object","required":["kind","send","timeline"],"properties":{"kind":{"type":"string","enum":["broadcast","outbound"]},"send":{"$ref":"#/components/schemas/TransactionalSend"},"timeline":{"type":"array","items":{"$ref":"#/components/schemas/TransactionalSendTimelineEvent"}}}}]}}}]}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/workspaces/{workspaceId}/transactional-sends/{transactionalSendId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"transactionalSendId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getTransactionalSend","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/TransactionalSend"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/workspaces/{workspaceId}/transactional-sends/{transactionalSendId}/timeline":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"transactionalSendId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"listTransactionalSendTimeline","responses":{"200":{"description":"Ordered acceptance, provider-attempt, and recipient-event timeline.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TransactionalSendTimelineEvent"}}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/workspaces/{workspaceId}/transactional-sends/{transactionalSendId}/retry":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"transactionalSendId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"retryTransactionalSend","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"202":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/TransactionalSendReceipt"}}}}}},"409":{"description":"The send is not safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/deliverability":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"get":{"operationId":"getDeliverabilitySummary","parameters":[{"name":"since","in":"query","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/DeliverabilitySummary"}}}}}}}}},"/v1/workspaces/{workspaceId}/deliverability/resolutions":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"}}],"get":{"operationId":"listDeliverabilityResolutions","responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","reason","count","domains","status","title","explanation","impact"],"properties":{"id":{"type":"string"},"reason":{"type":"string","enum":["complaint","hard_bounce"]},"count":{"type":"integer"},"domains":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"decidedAt":{"type":["string","null"],"format":"date-time"},"title":{"type":"string"},"explanation":{"type":"string"},"impact":{"type":"string"}}}}}}}}}}},"post":{"operationId":"decideDeliverabilityResolution","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","decision"],"properties":{"id":{"type":"string","minLength":64,"maxLength":64},"decision":{"type":"string","enum":["approved","rejected"]}}}}}},"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["status","approvalId"],"properties":{"status":{"type":"string","enum":["approved","rejected"]},"approvalId":{"type":"string","format":"uuid"},"replayed":{"type":"boolean"},"count":{"type":"integer"}}}}}}}}}}},"/v1/workspaces/{workspaceId}/contacts/upsert":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"}],"post":{"operationId":"upsertProductContact","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"type":"object","required":["id","email","display_name","attributes","status","created_at","updated_at","suppressed","suppression_reason","sources","lists","subscription_status","consent_evidence"],"properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"display_name":{"type":["string","null"]},"attributes":{"type":"object","additionalProperties":true},"status":{"type":"string","enum":["subscribed","unsubscribed","bounced","complained"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"suppressed":{"type":"boolean"},"suppression_reason":{"type":["string","null"]},"sources":{"type":"array","items":{"type":"object","required":["kind","reference","connection_id","metadata","first_seen_at","last_seen_at"],"properties":{"kind":{"type":"string"},"reference":{"type":"string"},"connection_id":{"type":["string","null"],"format":"uuid"},"metadata":{"type":"object","additionalProperties":true},"first_seen_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","format":"date-time"}}}},"lists":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}}}},"subscription_status":{"type":"string"},"consent_evidence":{"type":"array","items":{"type":"object","required":["kind","reference","connection_id","metadata","first_seen_at","last_seen_at"],"properties":{"kind":{"type":"string"},"reference":{"type":"string"},"connection_id":{"type":["string","null"],"format":"uuid"},"metadata":{"type":"object","additionalProperties":true},"first_seen_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","format":"date-time"}}}}}},{"type":"object","required":["replayed"],"properties":{"replayed":{"type":"boolean"}}}]}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"parameters":[{"$ref":"#/components/parameters/OperationalIdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["email","status"],"properties":{"email":{"type":"string","format":"email","maxLength":320},"display_name":{"type":"string","minLength":0,"maxLength":1000},"attributes":{"type":"object","additionalProperties":true},"status":{"type":"string","enum":["subscribed","unsubscribed","bounced","complained"]},"consent_evidence":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"observed_at":{"type":"string","format":"date-time"},"statement":{"type":"string","minLength":1,"maxLength":2000}}},"consent_confirmed":{"type":"boolean"}}}}}}}},"/v1/workspaces/{workspaceId}/contacts/import-validation":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"}],"post":{"operationId":"validateProductContactImport","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["valid","total_rows","valid_rows","errors"],"properties":{"valid":{"type":"boolean"},"total_rows":{"type":"integer"},"valid_rows":{"type":"integer"},"errors":{"type":"array","items":{"type":"object","required":["row","code","message"],"properties":{"row":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"rows":{"type":"array","minItems":1,"maxItems":5000,"items":{"type":"object","additionalProperties":false,"required":["email","status"],"properties":{"email":{"type":"string","format":"email","maxLength":320},"display_name":{"type":"string","minLength":0,"maxLength":1000},"attributes":{"type":"object","additionalProperties":true},"status":{"type":"string","enum":["subscribed","unsubscribed","bounced","complained"]},"consent_evidence":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"observed_at":{"type":"string","format":"date-time"},"statement":{"type":"string","minLength":1,"maxLength":2000}}}}}},"consent_confirmed":{"type":"boolean"}}}}}}}},"/v1/workspaces/{workspaceId}/contacts/imports/{importId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"importId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getProductContactImport","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AudienceImport"}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/brand/patch":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"}],"patch":{"operationId":"patchProductBrandFooter","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["brand","sources","discovery_domain","missing","product_id","replayed"],"properties":{"brand":{"$ref":"#/components/schemas/ProductBrand"},"sources":{"type":"object","additionalProperties":{"type":"string","enum":["product","discovery","default"]}},"discovery_domain":{"type":["string","null"]},"missing":{"type":"array","items":{"type":"string"}},"product_kind":{"type":"string","enum":["product","store","brand","newsletter","company","other"]},"discovery_status":{"type":["string","null"]},"product_id":{"type":"string","format":"uuid"},"product_domain":{"type":["string","null"]},"reviewed_at":{"type":["string","null"],"format":"date-time"},"discovery_attempted_at":{"type":["string","null"],"format":"date-time"},"hero_image_url":{"type":["string","null"]},"replayed":{"type":"boolean"}}}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"parameters":[{"$ref":"#/components/parameters/OperationalIdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["brand"],"properties":{"brand":{"type":"object","additionalProperties":false,"properties":{"company_name":{"type":"string","minLength":0,"maxLength":2000},"logo_url":{"type":"string","minLength":0,"maxLength":2000},"wordmark_url":{"type":"string","minLength":0,"maxLength":2000},"website_url":{"type":"string","minLength":0,"maxLength":2000},"primary_color":{"type":"string","minLength":0,"maxLength":2000},"accent_color":{"type":"string","minLength":0,"maxLength":2000},"background_color":{"type":"string","minLength":0,"maxLength":2000},"surface_color":{"type":"string","minLength":0,"maxLength":2000},"text_color":{"type":"string","minLength":0,"maxLength":2000},"muted_text_color":{"type":"string","minLength":0,"maxLength":2000},"heading_font_family":{"type":"string","minLength":0,"maxLength":2000},"body_font_family":{"type":"string","minLength":0,"maxLength":2000},"tone":{"type":"string","minLength":0,"maxLength":2000},"footer_address":{"type":"string","minLength":0,"maxLength":2000}}}}}}}}}},"/v1/workspaces/{workspaceId}/broadcasts":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"}],"post":{"operationId":"createBroadcast","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"allOf":[{"$ref":"#/components/schemas/Broadcast"},{"type":"object","required":["replayed"],"properties":{"replayed":{"type":"boolean"}}}]},{"type":"object","required":["translation_jobs"],"properties":{"preview":{"$ref":"#/components/schemas/RenderedEmail"},"translation_jobs":{"type":"array","items":{"type":"string","format":"uuid"}}}}]}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"parameters":[{"$ref":"#/components/parameters/OperationalIdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name","mailbox_id"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"mailbox_id":{"type":"string","format":"uuid"},"template_id":{"type":"string","format":"uuid"},"audience":{"type":"object","additionalProperties":false,"properties":{"all_subscribed":{"type":"boolean"},"contact_ids":{"type":"array","maxItems":10000,"items":{"type":"string","format":"uuid"}},"list_ids":{"type":"array","maxItems":1000,"items":{"type":"string","format":"uuid"}},"segment_ids":{"type":"array","maxItems":1000,"items":{"type":"string","format":"uuid"}}}},"subject_variants":{"type":"array","maxItems":8,"items":{"type":"string","minLength":1,"maxLength":998}},"selected_subject_variant":{"type":"integer","minimum":0,"maximum":7},"expires_after_seconds":{"type":"integer","minimum":1,"maximum":604800,"description":"Discard unsent recipients after this many seconds from the scheduled time; defaults to seven days."},"content_overrides":{"type":"object","additionalProperties":{"type":"string","maxLength":20000}}}}}}}}},"/v1/workspaces/{workspaceId}/broadcasts/{broadcastId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"broadcastId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getBroadcast","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Broadcast"}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateBroadcast","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Broadcast"},{"type":"object","required":["replayed"],"properties":{"replayed":{"type":"boolean"}}}]}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"parameters":[{"$ref":"#/components/parameters/OperationalIdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["expected_version"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"mailbox_id":{"type":"string","format":"uuid"},"template_id":{"type":"string","format":"uuid"},"audience":{"type":"object","additionalProperties":false,"properties":{"all_subscribed":{"type":"boolean"},"contact_ids":{"type":"array","maxItems":10000,"items":{"type":"string","format":"uuid"}},"list_ids":{"type":"array","maxItems":1000,"items":{"type":"string","format":"uuid"}},"segment_ids":{"type":"array","maxItems":1000,"items":{"type":"string","format":"uuid"}}}},"subject_variants":{"type":"array","maxItems":8,"items":{"type":"string","minLength":1,"maxLength":998}},"selected_subject_variant":{"type":"integer","minimum":0,"maximum":7},"expires_after_seconds":{"type":"integer","minimum":1,"maximum":604800,"description":"Discard unsent recipients after this many seconds from the scheduled time."},"content_overrides":{"type":"object","additionalProperties":{"type":"string","maxLength":20000}},"expected_version":{"type":"integer","minimum":1}}}}}}}},"/v1/workspaces/{workspaceId}/broadcasts/audience-preview":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"}],"post":{"operationId":"previewBroadcastAudience","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/BroadcastAudiencePreview"}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["audience"],"properties":{"audience":{"type":"object","additionalProperties":false,"properties":{"all_subscribed":{"type":"boolean"},"contact_ids":{"type":"array","maxItems":10000,"items":{"type":"string","format":"uuid"}},"list_ids":{"type":"array","maxItems":1000,"items":{"type":"string","format":"uuid"}},"segment_ids":{"type":"array","maxItems":1000,"items":{"type":"string","format":"uuid"}}}},"template_id":{"type":"string","format":"uuid"},"subject":{"type":"string","minLength":0,"maxLength":10000},"content_overrides":{"type":"object","additionalProperties":{"type":"string","maxLength":20000}}}}}}}}},"/v1/workspaces/{workspaceId}/broadcasts/{broadcastId}/audience-preview":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"broadcastId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"previewSavedBroadcastAudience","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/BroadcastAudiencePreview"}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":[],"properties":{"audience":{"type":"object","additionalProperties":false,"properties":{"all_subscribed":{"type":"boolean"},"contact_ids":{"type":"array","maxItems":10000,"items":{"type":"string","format":"uuid"}},"list_ids":{"type":"array","maxItems":1000,"items":{"type":"string","format":"uuid"}},"segment_ids":{"type":"array","maxItems":1000,"items":{"type":"string","format":"uuid"}}}}}}}}}}},"/v1/workspaces/{workspaceId}/broadcasts/{broadcastId}/readiness":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"broadcastId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"checkBroadcastReadiness","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/BroadcastReadiness"}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/broadcasts/{broadcastId}/recipients":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"broadcastId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"listBroadcastRecipients","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data","page","delivery_semantics"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"contact_id":{"type":["string","null"],"format":"uuid"},"recipient_email":{"type":"string"},"recipient_name":{"type":["string","null"]},"recipient_hash":{"type":"string"},"status":{"type":"string"},"dispatch_status":{"type":"string"},"command_id":{"type":["string","null"],"format":"uuid"},"error_code":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"delivery_state":{"type":["string","null"]},"provider_message_key":{"type":["string","null"]},"last_event_at":{"type":["string","null"],"format":"date-time"},"first_delivered_at":{"type":["string","null"],"format":"date-time"},"first_opened_at":{"type":["string","null"],"format":"date-time"},"first_clicked_at":{"type":["string","null"],"format":"date-time"},"first_human_likely_opened_at":{"type":["string","null"],"format":"date-time"},"first_human_likely_clicked_at":{"type":["string","null"],"format":"date-time"},"first_replied_at":{"type":["string","null"],"format":"date-time"},"machine_open_count":{"type":"integer"},"machine_click_count":{"type":"integer"},"privacy_proxy_open_count":{"type":"integer"},"unknown_open_count":{"type":"integer"},"unknown_click_count":{"type":"integer"},"first_unsubscribed_at":{"type":["string","null"],"format":"date-time"}}}},"page":{"$ref":"#/components/schemas/PageInfo"},"delivery_semantics":{"type":"string"}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","minLength":0,"maxLength":1024}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","queued","sent","delivered","failed","skipped","bounced","complained"]}}]}},"/v1/workspaces/{workspaceId}/broadcasts/{broadcastId}/timeline":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"broadcastId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"listBroadcastTimeline","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data","delivery_semantics"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","type","occurred_at","actor_id","detail"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"occurred_at":{"type":"string","format":"date-time"},"actor_id":{"type":["string","null"]},"detail":{"type":"object","additionalProperties":true}}}},"delivery_semantics":{"type":"string"}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/audience/lists":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"}],"post":{"operationId":"createProductContactList","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"type":"object","required":["id","name","description","created_at","updated_at","members"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"members":{"type":"array","items":{"type":"object","required":["id","email","display_name","status","attributes","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"display_name":{"type":["string","null"]},"status":{"type":"string"},"attributes":{"type":"object","additionalProperties":true},"updated_at":{"type":"string","format":"date-time"}}}}}},{"type":"object","required":["replayed"],"properties":{"replayed":{"type":"boolean"}}}]}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"parameters":[{"$ref":"#/components/parameters/OperationalIdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","minLength":0,"maxLength":2000}}}}}}}},"/v1/workspaces/{workspaceId}/audience/lists/{listId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"listId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getProductContactList","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","name","description","created_at","updated_at","members"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"members":{"type":"array","items":{"type":"object","required":["id","email","display_name","status","attributes","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"display_name":{"type":["string","null"]},"status":{"type":"string"},"attributes":{"type":"object","additionalProperties":true},"updated_at":{"type":"string","format":"date-time"}}}}}}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/audience/lists/{listId}/members":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"listId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"addProductContactListMembers","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"type":"object","required":["id","name","description","created_at","updated_at","members"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"members":{"type":"array","items":{"type":"object","required":["id","email","display_name","status","attributes","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"display_name":{"type":["string","null"]},"status":{"type":"string"},"attributes":{"type":"object","additionalProperties":true},"updated_at":{"type":"string","format":"date-time"}}}}}},{"type":"object","required":["replayed"],"properties":{"replayed":{"type":"boolean"}}}]}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"parameters":[{"$ref":"#/components/parameters/OperationalIdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["contact_ids"],"properties":{"contact_ids":{"type":"array","maxItems":1000,"items":{"type":"string","format":"uuid"}}}}}}}},"delete":{"operationId":"removeProductContactListMembers","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"type":"object","required":["id","name","description","created_at","updated_at","members"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"members":{"type":"array","items":{"type":"object","required":["id","email","display_name","status","attributes","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"display_name":{"type":["string","null"]},"status":{"type":"string"},"attributes":{"type":"object","additionalProperties":true},"updated_at":{"type":"string","format":"date-time"}}}}}},{"type":"object","required":["replayed"],"properties":{"replayed":{"type":"boolean"}}}]}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"parameters":[{"$ref":"#/components/parameters/OperationalIdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["contact_ids"],"properties":{"contact_ids":{"type":"array","maxItems":1000,"items":{"type":"string","format":"uuid"}}}}}}}}},"/v1/workspaces/{workspaceId}/audience/segments":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"}],"post":{"operationId":"createProductSegment","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"allOf":[{"$ref":"#/components/schemas/ContactSegment"},{"$ref":"#/components/schemas/AudiencePreview"}]},{"type":"object","required":["replayed"],"properties":{"replayed":{"type":"boolean"}}}]}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"parameters":[{"$ref":"#/components/parameters/OperationalIdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name","filter"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"filter":{"type":"object","additionalProperties":false,"properties":{"status":{"type":"string","enum":["subscribed","unsubscribed","bounced","complained"]},"attributes":{"type":"object","additionalProperties":true}}}}}}}}}},"/v1/workspaces/{workspaceId}/audience/segments/{segmentId}/preview":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"segmentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"previewProductSegment","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/ContactSegment"},{"$ref":"#/components/schemas/AudiencePreview"}]}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/audience/approvals":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"}],"get":{"operationId":"listProductApprovalEvidence","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalEvidence"}}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["pending","approved","rejected","cancelled","expired","undecided"]}}]}},"/v1/workspaces/{workspaceId}/audience/approvals/{approvalId}":{"parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/OperatingProductId"},{"name":"approvalId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getProductApprovalEvidence","responses":{"200":{"description":"Canonical read-back or idempotent receipt. Provider acceptance is sent; delivered requires a delivery event and does not prove inbox placement.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ApprovalEvidence"}}}}}},"400":{"description":"Invalid input or missing operating product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Existing OAuth scope or product boundary denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Consent, suppression, personalization, or readiness blocker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/products":{"get":{"operationId":"listProducts","summary":"List workspace products","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createProduct","summary":"Create a product","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Product"}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":160,"minLength":1},"kind":{"type":"string","enum":["product","store","brand","newsletter","company","other"],"default":"product"},"website_url":{"type":["string","null"],"maxLength":2000},"description":{"type":"string","maxLength":4000},"context":{"type":"object","additionalProperties":true},"domains":{"type":"array","items":{"type":"string","maxLength":253},"maxItems":20}}}}}}}},"/v1/workspaces/{workspaceId}/products/{productId}":{"get":{"operationId":"getProduct","summary":"Get a product","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"productId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Product"}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateProduct","summary":"Update a product","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"productId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Product"}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":160},"kind":{"type":"string","enum":["product","store","brand","newsletter","company","other"]},"website_url":{"type":["string","null"],"maxLength":2000},"description":{"type":"string","maxLength":4000},"context":{"type":"object","additionalProperties":true},"brand":{"$ref":"#/components/schemas/ProductBrand"},"status":{"type":"string","enum":["active","archived"]}}}}}}}},"/v1/workspaces/{workspaceId}/products/{productId}/setup/{key}":{"put":{"operationId":"updateProductSetup","summary":"Update a product setup item","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"productId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","enum":["context","domain","mailboxes","journeys","broadcasts","compliance"]}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ProductSetup"}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["todo","in_progress","complete","not_relevant"]},"completion_source":{"type":"string","enum":["system","person","agent"],"default":"person"},"note":{"type":"string","maxLength":1000}}}}}}}},"/v1/workspaces/{workspaceId}/products/{productId}/domains":{"post":{"operationId":"addProductDomain","summary":"Associate a domain with a product","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"productId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Product"}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","maxLength":253,"minLength":3}}}}}}}},"/v1/workspaces/{workspaceId}/billing":{"get":{"operationId":"getBilling","summary":"Read billing, usage, and available plans","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/BillingSnapshot"}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"syncBilling","summary":"Synchronize billing from Stripe","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/BillingSnapshot"}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Alias of POST /billing/sync. Requires workspace:admin."}},"/v1/workspaces/{workspaceId}/billing/sync":{"post":{"operationId":"syncBillingFromStripe","summary":"Synchronize the latest Stripe subscription","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/BillingSnapshot"}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/billing/checkout":{"post":{"operationId":"createBillingCheckout","summary":"Start checkout or open the billing portal","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["url","kind"],"properties":{"url":{"type":"string","format":"uri"},"kind":{"type":"string","enum":["checkout","portal"]}}}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan_key":{"type":"string","enum":["starter","pro","business","scale"]},"planKey":{"type":"string","enum":["starter","pro","business","scale"]},"interval":{"type":"string","enum":["month","year"],"default":"month"},"billing_attempt_id":{"type":"string","description":"Optional retry identifier: 8–64 letters, digits or hyphens. Invalid identifiers are ignored."},"billingAttemptId":{"type":"string"}},"anyOf":[{"required":["plan_key"]},{"required":["planKey"]}]}}}},"description":"Requires workspace:admin. Only paid self-serve plans are sold. An active subscription opens the customer portal. Snake-case fields take precedence over camel-case aliases."}},"/v1/workspaces/{workspaceId}/billing/portal":{"post":{"operationId":"createBillingPortal","summary":"Open the customer billing portal","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"}}}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/billing/agent-payment":{"post":{"operationId":"createBillingAgentPayment","summary":"Buy prepaid plan time with a Shared Payment Token","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["status","payment_intent_id","message"],"properties":{"status":{"type":"string"},"payment_intent_id":{"type":"string"},"message":{"type":"string"},"plan_key":{"type":"string","enum":["starter","pro"]},"prepaid_until":{"type":["string","null"],"format":"date-time"}}}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["plan_key","shared_payment_token"],"properties":{"plan_key":{"type":"string","enum":["starter","pro"]},"interval":{"type":"string","enum":["month","year"],"default":"month"},"shared_payment_token":{"type":"string","pattern":"^spt_[A-Za-z0-9_]{6,200}$"}}}}}}}},"/v1/workspaces/{workspaceId}/analytics/visitor":{"post":{"operationId":"linkAnalyticsVisitor","summary":"Link a website visit to the signed-in person","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"204":{"description":"Successful response."},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["visitor_id"],"properties":{"visitor_id":{"type":"string","pattern":"^[A-Za-z0-9-]{8,64}$"}}}}}},"description":"Requires a signed-in human session; API keys are rejected."}},"/v1/workspaces/{workspaceId}/oauth/setup-ticket":{"post":{"operationId":"createOAuthSetupTicket","summary":"Create an agent connection setup ticket","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["mcp_url","expires_at","scopes"],"properties":{"mcp_url":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"scopes":{"type":"array","items":{"type":"string"}}}}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entry_surface","client_name"],"properties":{"entry_surface":{"type":"string","enum":["codex","chatgpt","claude","grok","other_agent"]},"client_name":{"type":"string","maxLength":100,"minLength":1}}}}}},"description":"Requires a signed-in human session. API keys and agent credentials cannot authorize this operation."}},"/v1/workspaces/{workspaceId}/oauth/setup-ticket/connection-code":{"post":{"operationId":"issueOAuthConnectionCode","summary":"Email an agent connection code","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"201":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["status","expires_at"],"properties":{"status":{"type":"string","enum":["code_sent"]},"message":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}}}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mcp_url"],"properties":{"mcp_url":{"type":"string","maxLength":8000,"minLength":8},"reuse_pending":{"type":"boolean"}}}}}},"description":"Requires a signed-in human session. API keys and agent credentials cannot authorize this operation."},"delete":{"operationId":"cancelOAuthConnectionCode","summary":"Cancel a pending agent connection code","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["cancelled"]}}}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mcp_url"],"properties":{"mcp_url":{"type":"string","maxLength":8000,"minLength":8}}}}}},"description":"Requires a signed-in human session. API keys and agent credentials cannot authorize this operation."}},"/v1/workspaces/{workspaceId}/onboarding/agent-state/confirm-connection":{"post":{"operationId":"confirmAgentConnection","summary":"Confirm the current OAuth agent connection","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["status","message","workspace_id","client_name","confirmed_at"],"properties":{"status":{"type":"string","enum":["connected"]},"message":{"type":"string"},"workspace_id":{"type":"string","format":"uuid"},"client_name":{"type":"string"},"confirmed_at":{"type":"string","format":"date-time"}}}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"description":"Requires the OAuth credential installed in the current agent client and automation:read scope."}},"/v1/workspaces/{workspaceId}/contacts/fields":{"get":{"operationId":"listContactAttributeKeys","summary":"List stored contact attribute keys","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"string"}}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/contacts/import-mapping":{"post":{"operationId":"proposeContactImportMapping","summary":"Propose contact import column mappings","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["mapping","review","source"],"properties":{"mapping":{"$ref":"#/components/schemas/ContactImportMapping"},"review":{"type":"object","required":["needed","reasons","columns"],"properties":{"needed":{"type":"boolean"},"reasons":{"type":"array","items":{"type":"string"}},"columns":{"type":"array","items":{"type":"string"}}}},"source":{"type":"string","enum":["saved","ai","rules"]}}}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["columns"],"properties":{"filename":{"type":"string","maxLength":500},"columns":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":200,"minLength":1},"samples":{"type":"array","items":{"type":"string","maxLength":120},"maxItems":8},"filled":{"type":"integer","minimum":0},"rows":{"type":"integer","minimum":0}}},"minItems":1,"maxItems":100}}}}}}}},"/v1/workspaces/{workspaceId}/segments/{segmentId}":{"delete":{"operationId":"deleteSegment","summary":"Delete a segment","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"segmentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","deleted"],"properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","const":true}}}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/archive":{"post":{"operationId":"archiveCampaign","summary":"Archive a campaign","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"campaignId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","name","status","archived_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string"},"archived_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/unarchive":{"post":{"operationId":"unarchiveCampaign","summary":"Unarchive a campaign","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"campaignId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","name","status","archived_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string"},"archived_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/drafts/{draftId}/html":{"get":{"operationId":"getDraftHtml","summary":"Read a draft HTML body","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"draftId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Draft HTML.","content":{"text/html":{"schema":{"type":"string"}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/design-test":{"put":{"operationId":"saveCampaignDesignTest","summary":"Save one to four campaign email designs","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"campaignId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","name","status","version","design_template_id"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"mailbox_id":{"type":"string","format":"uuid"},"template_id":{"type":["string","null"],"format":"uuid"},"managed_content_id":{"type":["string","null"],"format":"uuid"},"managed_source_revision_id":{"type":["string","null"],"format":"uuid"},"managed_publication_id":{"type":["string","null"],"format":"uuid"},"managed_locales_snapshot":{"type":"array","items":{"type":"string"}},"localization_failure_policy":{"type":"string"},"expires_after_seconds":{"type":["integer","null"]},"status":{"type":"string"},"version":{"type":"integer"},"subject_variants":{"type":"array","items":{"type":"string"}},"selected_subject_variant":{"type":"integer"},"content_overrides":{"type":"object","additionalProperties":{"type":"string"}},"audience_query":{"$ref":"#/components/schemas/CampaignAudience"},"audience_frozen_at":{"type":["string","null"],"format":"date-time"},"audience_recipient_count":{"type":["integer","null"]},"audience_snapshot_sha256":{"type":["string","null"]},"audience_snapshot_campaign_version":{"type":["integer","null"]},"scheduled_at":{"type":["string","null"],"format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"archived_at":{"type":["string","null"],"format":"date-time"},"stats":{"type":"object","additionalProperties":true},"design_template_id":{"type":"string","format":"uuid"}}}}}}}},"default":{"description":"Request failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","mailbox_id","audience","variants"],"properties":{"name":{"type":"string","maxLength":200,"minLength":1},"mailbox_id":{"type":"string","format":"uuid"},"audience":{"$ref":"#/components/schemas/CampaignAudience"},"automatic_translation":{"type":"boolean"},"variants":{"type":"array","items":{"type":"object","required":["body_html"],"properties":{"body_html":{"type":"string","maxLength":2000000,"minLength":1},"subject":{"type":"string","maxLength":10000},"body_text":{"type":"string","maxLength":2000000},"content":{"type":"object","additionalProperties":{"type":"string"}}}},"minItems":1,"maxItems":4}}}}}}}}},"components":{"parameters":{"CampaignId":{"name":"campaignId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"ConnectionId":{"name":"connectionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"Cursor":{"name":"cursor","in":"query","schema":{"type":"string","maxLength":1024}},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128}},"JourneyId":{"name":"journeyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"Limit":{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},"OperatingProductId":{"name":"X-Banger-Product-Id","in":"header","required":true,"description":"Explicit operating product; must match product-scoped OAuth credentials.","schema":{"type":"string","format":"uuid"}},"OperationalIdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":256}},"WorkspaceId":{"name":"workspaceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}},"responses":{"Conflict":{"description":"The requested state transition conflicts with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"The requested resource does not exist in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ActionReviewPolicy":{"type":"object","required":["policy_version","automatic_review_enabled","manual_send_review_enabled","manual_send_recipient_threshold","updated_by_actor_id"],"properties":{"policy_version":{"type":"integer","enum":[1,2]},"automatic_review_enabled":{"type":"boolean"},"manual_send_review_enabled":{"type":"boolean","description":"False by default for direct requests; saved stricter limits remain enabled."},"manual_send_recipient_threshold":{"type":"integer","minimum":1,"maximum":1000000},"updated_by_actor_id":{"type":"string"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"AgentActivationCheckpoint":{"type":"object","required":["key","label","status","detail"],"properties":{"key":{"type":"string","enum":["domain","provider","infrastructure","dns","mailbox","product","broadcast"]},"label":{"type":"string"},"status":{"type":"string","enum":["pending","working","action_required","verified"]},"detail":{"type":"string"}}},"AgentActivationLane":{"type":"object","required":["status","detail"],"properties":{"status":{"type":"string","enum":["pending","working","action_required","verified"]},"detail":{"type":"string"}}},"AgentActivationState":{"type":"object","required":["mode","status","domain","sending_domain_id","mailbox_id","mailbox_address","exact_dns_records","checkpoints","lanes","proof","overall_ready","production_ready"],"properties":{"mode":{"type":"string","enum":["hosted","company_domain","starter"]},"status":{"type":"string","enum":["hosted_mailbox_required","hosted_mailbox_proving","hosted_mailbox_ready","needs_context","needs_provisioning","provisioning","dns_required","ready_for_proof","proving","activated","starter_required","starter_proving","starter_ready"]},"domain":{"type":["string","null"]},"sending_domain_id":{"type":["string","null"],"format":"uuid"},"mailbox_id":{"type":["string","null"],"format":"uuid"},"mailbox_address":{"type":["string","null"],"format":"email"},"exact_dns_records":{"type":"array","items":{"$ref":"#/components/schemas/NativeSendingDnsRecord"}},"checkpoints":{"type":"array","items":{"$ref":"#/components/schemas/AgentActivationCheckpoint"}},"lanes":{"type":"object","required":["mailbox","transactional","marketing"],"properties":{"mailbox":{"$ref":"#/components/schemas/AgentActivationLane"},"transactional":{"$ref":"#/components/schemas/AgentActivationLane"},"marketing":{"$ref":"#/components/schemas/AgentActivationLane"}}},"proof":{"oneOf":[{"$ref":"#/components/schemas/StarterMailboxProof"},{"$ref":"#/components/schemas/DomainInfrastructureProof"},{"type":"null"}]},"overall_ready":{"type":"boolean"},"production_ready":{"type":"boolean"}}},"AgentEmailProof":{"type":"object","required":["status","attempt_id","oauth_grant_id","oauth_client_id","client_name","mailbox_id","mailbox_address","expected_subject","initiated_at"],"properties":{"status":{"type":"string","enum":["pending","verified"]},"attempt_id":{"type":"string","format":"uuid"},"oauth_grant_id":{"type":"string"},"oauth_client_id":{"type":["string","null"]},"client_name":{"type":["string","null"]},"mailbox_id":{"type":"string","format":"uuid"},"mailbox_address":{"type":"string","format":"email"},"expected_subject":{"type":"string"},"initiated_at":{"type":"string","format":"date-time"},"command_id":{"type":"string","format":"uuid"},"send_status":{"type":"string"},"dispatch_status":{"type":"string","enum":["completed","already-running","already-settled"]},"replayed":{"type":"boolean"},"message_id":{"type":"string","format":"uuid"},"thread_id":{"type":"string","format":"uuid"},"received_at":{"type":"string","format":"date-time"}}},"AgentOnboardingNextAction":{"type":"string","enum":["choose_agent","provision_hosted_mailbox","send_aha_1","wait_for_aha_1","offer_custom_domain","review_domain_bundle","provision_domain_bundle","wait_for_dns_records","ask_computer_use_permission","configure_dns_with_computer_use","present_manual_dns_instructions","wait_for_dns_propagation","send_aha_2","wait_for_aha_2","create_starter_mailbox","run_starter_proof","wait_for_starter_proof","collect_business_context","build_lifecycle_map","review_growth_system","connect_required_services","explain_persistent_mcp","offer_autopilot","activate_autopilot","validate","complete","open_dashboard"]},"AgentOnboardingRecord":{"type":"object","required":["workspace_id","status","entry_surface","agent_status","agent_client_name","domain_choice","company_domain","domain_chosen_at","business_context","opportunity_plan","implementation_summary","validation_summary","journey_metadata","context_reviewed_at","plan_proposed_at","plan_approved_at","completed_at","version","updated_at"],"properties":{"workspace_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["choose_agent","discovering","planning","implementing","validating","ready","complete"]},"entry_surface":{"type":["string","null"],"enum":["codex","chatgpt","claude","grok","other_agent","browser",null]},"agent_status":{"type":"string","enum":["not_connected","connecting","connected","browser_only"]},"agent_client_name":{"type":["string","null"]},"domain_choice":{"type":"string","enum":["undecided","company_domain","no_domain"]},"company_domain":{"type":["string","null"]},"domain_chosen_at":{"type":["string","null"],"format":"date-time"},"business_context":{"type":"object","additionalProperties":true},"opportunity_plan":{"type":"array","items":{"type":"object","additionalProperties":true}},"implementation_summary":{"type":"object","additionalProperties":true},"validation_summary":{"type":"object","additionalProperties":true},"journey_metadata":{"type":"object","additionalProperties":true},"context_reviewed_at":{"type":["string","null"],"format":"date-time"},"plan_proposed_at":{"type":["string","null"],"format":"date-time"},"plan_approved_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"version":{"type":"integer","format":"int64","minimum":1},"updated_at":{"type":"string","format":"date-time"}}},"AgentOnboardingState":{"allOf":[{"$ref":"#/components/schemas/AgentOnboardingRecord"},{"type":"object","required":["domain_discovery","recommended_connections","domain_bundle","growth","activation","completed","pending","next_action","action_required","secure_url","mcp_url","dashboard_url"],"properties":{"domain_discovery":{"oneOf":[{"$ref":"#/components/schemas/WorkspaceDomainDiscovery"},{"type":"null"}]},"recommended_connections":{"type":"array","items":{"$ref":"#/components/schemas/SetupConnectionRecommendation"}},"domain_bundle":{"type":["object","null"],"additionalProperties":true},"growth":{"type":"object","additionalProperties":true},"activation":{"$ref":"#/components/schemas/AgentActivationState"},"completed":{"type":"boolean"},"pending":{"type":"boolean"},"next_action":{"$ref":"#/components/schemas/AgentOnboardingNextAction"},"action_required":{"type":"object","required":["type","required","action","url","instructions"],"properties":{"type":{"type":"string"},"required":{"type":"boolean"},"action":{"$ref":"#/components/schemas/AgentOnboardingNextAction"},"url":{"type":["string","null"],"format":"uri"},"instructions":{"type":["string","null"]}}},"secure_url":{"type":["string","null"],"format":"uri"},"mcp_url":{"type":"string","format":"uri"},"dashboard_url":{"type":"string","format":"uri"}}}]},"AgentRun":{"type":"object","required":["id","requested_by_actor_id","task","model","capability_scopes","resource_scope","status","max_steps","max_runtime_seconds","current_generation","latest_checkpoint_sequence","created_at","updated_at","replayed"],"properties":{"id":{"type":"string","format":"uuid"},"execution_job_id":{"type":"string","format":"uuid"},"requested_by_actor_id":{"type":"string"},"task":{"type":"string"},"model":{"type":"string"},"capability_scopes":{"type":"array","items":{"type":"string"}},"resource_scope":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status":{"type":"string","enum":["queued","running","waiting_approval","waiting_external","succeeded","failed","cancelled"]},"max_steps":{"type":"integer"},"max_runtime_seconds":{"type":"integer"},"current_generation":{"type":"integer"},"latest_checkpoint":{"type":["object","null"],"additionalProperties":true},"latest_checkpoint_sequence":{"type":"integer"},"result":{"type":["object","null"],"additionalProperties":true},"error_code":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"replayed":{"type":"boolean"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/AgentRunStep"}}}},"AgentRunStep":{"type":"object","required":["sequence","attempt_generation","kind","status","created_at"],"properties":{"sequence":{"type":"integer","minimum":1},"attempt_generation":{"type":"integer","minimum":1},"kind":{"type":"string","enum":["model","tool","checkpoint","approval","output","system"]},"status":{"type":"string","enum":["started","succeeded","failed","waiting_approval","waiting_external"]},"name":{"type":["string","null"]},"input":{},"output":{},"error_code":{"type":["string","null"]},"input_tokens":{"type":["integer","null"],"minimum":0},"output_tokens":{"type":["integer","null"],"minimum":0},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"}}},"AiEmailRevisionRequest":{"type":"object","additionalProperties":false,"required":["connection_id","provider","instruction","current"],"properties":{"connection_id":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["openai","anthropic"]},"model":{"type":"string","maxLength":200},"instruction":{"type":"string","minLength":1,"maxLength":40000},"current":{"type":"object","additionalProperties":false,"required":["subject","body_text","body_html"],"properties":{"subject":{"type":"string","maxLength":998},"body_text":{"type":"string","maxLength":100000},"body_html":{"type":"string","maxLength":200000}}}}},"AiEmailRevisionResult":{"type":"object","additionalProperties":false,"required":["data","model"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["subject","subject_options","body_text","body_html","change_summary"],"properties":{"subject":{"type":"string"},"subject_options":{"type":"array","items":{"type":"string"}},"body_text":{"type":"string"},"body_html":{"type":"string"},"change_summary":{"type":"string"}}},"provider_response_id":{"type":"string"},"model":{"type":"string"},"usage":{"type":"object","additionalProperties":true}}},"AiGeneratedEmail":{"type":"object","required":["data","model","managed"],"properties":{"data":{"type":"object","required":["subject","subject_options","body_text","body_html","change_summary"],"properties":{"subject":{"type":"string"},"subject_options":{"type":"array","items":{"type":"string"}},"body_text":{"type":"string"},"body_html":{"type":"string"},"change_summary":{"type":"string"}}},"provider_response_id":{"type":"string"},"model":{"type":"string"},"usage":{"type":"object","additionalProperties":true},"managed":{"type":"boolean"}}},"AnswerAgent":{"type":"object","required":["id","identityId","workspaceId","origin","name","enabled","sendPolicy","mailboxIds","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"identityId":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"origin":{"type":"string","const":"internal"},"name":{"type":"string"},"systemPrompt":{"type":"string"},"enabled":{"type":"boolean"},"sendPolicy":{"type":"string","enum":["draft_only","reviewed_send","direct_send"]},"mailboxIds":{"type":"array","items":{"type":"string","format":"uuid"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"ApiKeyScope":{"type":"string","enum":["mail:read","mail:write","mail:send","contacts:read","contacts:write","campaigns:read","campaigns:write","campaigns:send","automation:read","automation:execute","connections:read","connections:use","connections:admin","workspace:admin"]},"ApprovalEvidence":{"allOf":[{"$ref":"#/components/schemas/ApprovalRequest"},{"type":"object","required":["approval_id","broadcast_id","import_id","blockers","executions","execution_job_ids","execution_status","human_review_url","human_review_instruction"],"properties":{"approval_id":{"type":"string","format":"uuid"},"broadcast_id":{"type":["string","null"],"format":"uuid"},"import_id":{"type":["string","null"],"format":"uuid"},"blockers":{"type":"array","items":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}},"executions":{"type":"array","items":{"type":"object","required":["id","status","result","error_code"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string"},"result":{"type":"object","additionalProperties":true},"error_code":{"type":["string","null"]}}}},"execution_job_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"execution_status":{"type":"string","enum":["completed","failed","queued","awaiting_review","not_queued"]},"human_review_url":{"type":["string","null"]},"human_review_instruction":{"type":["string","null"]}}}]},"ApprovalRequest":{"type":"object","required":["id","requested_by_actor_id","action_kind","summary","capability_scopes","resource_scope","payload","payload_sha256","status","missed","expires_at","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"requested_by_actor_id":{"type":"string"},"action_kind":{"type":"string"},"summary":{"type":"string"},"capability_scopes":{"type":"array","items":{"type":"string"}},"resource_scope":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"payload":{"type":"object","additionalProperties":true},"payload_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"status":{"type":"string","enum":["pending","approved","rejected","cancelled","expired"]},"missed":{"type":"boolean"},"expires_at":{"type":"string","format":"date-time"},"decided_by_actor_id":{"type":["string","null"]},"decision_reason":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"decided_at":{"type":["string","null"],"format":"date-time"},"execution_job_id":{"type":"string","format":"uuid"},"review":{"type":"object","additionalProperties":false,"required":["disposition","recipient_count","reasons","checks"],"properties":{"disposition":{"type":"string","enum":["automatic","human_required"]},"recipient_count":{"type":["integer","null"],"minimum":0},"reasons":{"type":"array","items":{"type":"string"}},"checks":{"type":"array","items":{"type":"string"}}}}}},"Attachment":{"type":"object","required":["id","filename","content_type","size_bytes","download_url"],"properties":{"id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"},"disposition":{"type":"string"},"size_bytes":{"type":"integer","format":"int64"},"download_url":{"type":"string","format":"uri"}}},"AudienceImport":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"list_id":{"type":["string","null"],"format":"uuid"},"list_name":{"type":["string","null"]},"status":{"type":"string"},"total_rows":{"type":"integer"},"imported_rows":{"type":"integer"},"invalid_rows":{"type":"integer"},"error_summary":{"type":"array","items":{"type":"string"}},"consent_confirmed":{"type":"boolean"},"consent_confirmed_at":{"type":["string","null"],"format":"date-time"},"processed_rows":{"type":"integer"},"attempt_count":{"type":"integer"},"last_error_code":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"}}},"AudiencePreview":{"type":"object","required":["count","missing_consent_evidence_count","sample","excluded"],"properties":{"count":{"type":"integer"},"missing_consent_evidence_count":{"type":"integer"},"sample":{"type":"array","items":{"type":"object","required":["id","email","display_name","attributes"],"properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"display_name":{"type":["string","null"]},"attributes":{"type":"object","additionalProperties":true}}}},"excluded":{"type":"object","required":["suppressed","not_subscribed","missing_recipient_hash","missing_consent_evidence"],"properties":{"suppressed":{"type":"integer"},"not_subscribed":{"type":"integer"},"missing_recipient_hash":{"type":"integer"},"missing_consent_evidence":{"type":"integer"}}}}},"BillingSnapshot":{"type":"object","required":["billing","usage","catalog","agentPayment"],"properties":{"billing":{"type":"object","required":["workspaceId","tier","planKey","status","planInterval","stripeCustomerId","stripeSubscriptionId","currentPeriodEnd","cancelAtPeriodEnd","prepaidPlanKey","prepaidUntil"],"properties":{"workspaceId":{"type":"string","format":"uuid"},"tier":{"type":"string","enum":["free","starter","pro","business","scale","enterprise"]},"planKey":{"type":"string","enum":["free","starter","pro","business","scale","enterprise"]},"status":{"type":"string"},"planInterval":{"type":["string","null"],"enum":["month","year",null]},"stripeCustomerId":{"type":["string","null"]},"stripeSubscriptionId":{"type":["string","null"]},"currentPeriodEnd":{"type":["integer","null"],"description":"Unix timestamp in milliseconds."},"cancelAtPeriodEnd":{"type":"boolean"},"prepaidPlanKey":{"type":["string","null"]},"prepaidUntil":{"type":["integer","null"],"description":"Unix timestamp in milliseconds."}}},"usage":{"type":"object","required":["storageBytes","storageLimitBytes","sendsThisMonth","sendLimit","sendsToday","dailySendLimit","periodEnd"],"properties":{"storageBytes":{"type":"number"},"storageLimitBytes":{"type":"number"},"sendsThisMonth":{"type":"number"},"sendLimit":{"type":"number"},"sendsToday":{"type":"number"},"dailySendLimit":{"type":["number","null"]},"periodEnd":{"type":["integer","null"],"description":"Unix timestamp in milliseconds."}}},"catalog":{"type":"object","required":["plans","addons"],"properties":{"plans":{"type":"array","items":{"type":"object","required":["planKey","label","sendLimit","storageGb","gmailImportLimit","triageRuleLimit","triageRunLimit","prices"],"properties":{"planKey":{"type":"string","enum":["free","starter","pro","business","scale","enterprise"]},"label":{"type":"string"},"sendLimit":{"type":"number"},"storageGb":{"type":"number"},"gmailImportLimit":{"type":"number"},"triageRuleLimit":{"type":"number"},"triageRunLimit":{"type":"number"},"prices":{"type":"array","items":{"type":"object","required":["priceId","interval","currency","unitAmount"],"properties":{"priceId":{"type":"string"},"interval":{"type":"string","enum":["month","year"]},"currency":{"type":"string","enum":["usd"]},"unitAmount":{"type":"integer"}}}}}}},"addons":{"type":"array","maxItems":0,"items":{}}}},"agentPayment":{"anyOf":[{"type":"object","required":["network_id","currency","how","options"],"properties":{"network_id":{"type":"string"},"currency":{"type":"string","enum":["usd"]},"how":{"type":"string"},"options":{"type":"array","items":{"type":"object","required":["plan_key","interval","months","amount_cents"],"properties":{"plan_key":{"type":"string","enum":["starter","pro"]},"interval":{"type":"string","enum":["month","year"]},"months":{"type":"integer","enum":[1,12]},"amount_cents":{"type":"integer"}}}}}},{"type":"null"}]}}},"Broadcast":{"type":"object","required":["id","name","version","broadcast_id","product_id","sender_address","sending_blocker","design","managed_content","subject","sender_mailbox","reply_mailbox","design_version","audience"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"mailbox_id":{"type":"string","format":"uuid"},"template_id":{"type":["string","null"],"format":"uuid"},"managed_content_id":{"type":["string","null"],"format":"uuid"},"managed_source_revision_id":{"type":["string","null"],"format":"uuid"},"managed_publication_id":{"type":["string","null"],"format":"uuid"},"managed_locales_snapshot":{"type":"array","items":{"type":"string"}},"localization_failure_policy":{"type":"string"},"expires_after_seconds":{"type":["integer","null"]},"status":{"type":"string"},"version":{"type":"integer"},"subject_variants":{"type":"array","items":{"type":"string"}},"selected_subject_variant":{"type":"integer"},"content_overrides":{"type":"object","additionalProperties":{"type":"string"}},"audience_query":{"$ref":"#/components/schemas/CampaignAudience"},"audience_frozen_at":{"type":["string","null"],"format":"date-time"},"audience_recipient_count":{"type":["integer","null"]},"audience_snapshot_sha256":{"type":["string","null"]},"audience_snapshot_campaign_version":{"type":["integer","null"]},"scheduled_at":{"type":["string","null"],"format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"archived_at":{"type":["string","null"],"format":"date-time"},"stats":{"type":"object","additionalProperties":true},"broadcast_id":{"type":"string","format":"uuid"},"sender_address":{"type":["string","null"]},"sending_blocker":{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},{"type":"null"}]},"design":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"subject":{"type":"string"},"body_text":{"type":"string"},"content":{"type":"object","additionalProperties":{"type":"string"}},"slots":{"type":"array","items":{"$ref":"#/components/schemas/TemplateSlot"}},"status":{"type":"string","enum":["active","archived"]},"origin":{"type":"string","enum":["person","agent","starter","import"]},"created_by_actor_id":{"type":["string","null"]},"campaign_id":{"type":["string","null"],"format":"uuid"},"message_kind":{"type":"string"},"starter_id":{"type":["string","null"]},"starter_version":{"type":["integer","null"]},"version":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"body_html_url":{"type":"string","format":"uri"},"body_html":{"type":["string","null"]},"body_html_b2_key":{"type":["string","null"]}}},{"type":"null"}]},"managed_content":{"anyOf":[{"allOf":[{"$ref":"#/components/schemas/ManagedContentState"},{"type":"object","required":["source_revision","published_source_revision","translations"],"properties":{"source_revision":{"anyOf":[{"$ref":"#/components/schemas/ManagedSourceRevision"},{"type":"null"}]},"published_source_revision":{"anyOf":[{"$ref":"#/components/schemas/ManagedSourceRevision"},{"type":"null"}]},"translations":{"type":"array","items":{"$ref":"#/components/schemas/ManagedTranslation"}}}}]},{"type":"null"}]},"subject":{"type":["string","null"]},"sender_mailbox":{"anyOf":[{"type":"object","required":["id","address","display_name","status"],"properties":{"id":{"type":"string","format":"uuid"},"address":{"type":"string"},"display_name":{"type":"string"},"status":{"type":"string"}}},{"type":"null"}]},"reply_mailbox":{"anyOf":[{"type":"object","required":["id","address","display_name","status"],"properties":{"id":{"type":"string","format":"uuid"},"address":{"type":"string"},"display_name":{"type":"string"},"status":{"type":"string"}}},{"type":"null"}]},"design_version":{"type":["integer","null"]},"audience":{"$ref":"#/components/schemas/CampaignAudience"}}},"BroadcastAudiencePreview":{"allOf":[{"$ref":"#/components/schemas/AudiencePreview"},{"type":"object","required":["eligible_count","required_variables","missing_personalization_fields","audience"],"properties":{"eligible_count":{"type":"integer"},"required_variables":{"type":"array","items":{"type":"string"}},"missing_personalization_fields":{"type":"array","items":{"type":"object","required":["variable","missingCount","sampleEmails"],"properties":{"variable":{"type":"string"},"missingCount":{"type":"integer"},"sampleEmails":{"type":"array","items":{"type":"string"}}}}},"audience":{"$ref":"#/components/schemas/CampaignAudience"}}}]},"BroadcastReadiness":{"type":"object","required":["broadcast_id","product_id","ready","blockers","audience","campaign_version","design_version","languages","sending","delivery_pace","approval_requirements","footer","checks_are_advisory","next_action"],"properties":{"broadcast_id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"ready":{"type":"boolean"},"blockers":{"type":"array","items":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}},"audience":{"$ref":"#/components/schemas/BroadcastAudiencePreview"},"campaign_version":{"type":"integer"},"design_version":{"type":["integer","null"]},"languages":{"anyOf":[{"type":"object","required":["requested","pending_locales","fallback_locales"],"properties":{"requested":{"type":"array","items":{"type":"object","required":["locale","count"],"properties":{"locale":{"type":"string"},"count":{"type":"integer"}}}},"pending_locales":{"type":"array","items":{"type":"string"}},"fallback_locales":{"type":"array","items":{"type":"string"}}}},{"type":"null"}]},"sending":{"type":"object","properties":{"route_kind":{"type":["string","null"]},"sending_stream_id":{"type":["string","null"],"format":"uuid"},"banger_send_limit":{"type":["integer","string","null"]},"daily_send_limit":{"type":["integer","string","null"]},"used":{"type":["integer","string","null"]},"daily_used":{"type":["integer","string","null"]}}},"delivery_pace":{"anyOf":[{"type":"object","required":["days","daily_limit","message"],"properties":{"days":{"type":"integer"},"daily_limit":{"type":"integer"},"message":{"type":"string"}}},{"type":"null"}]},"approval_requirements":{"type":"object","required":["disposition","recipient_count","reasons","checks"],"properties":{"disposition":{"type":"string","enum":["automatic","human_required"]},"recipient_count":{"type":["integer","null"]},"reasons":{"type":"array","items":{"type":"string"}},"checks":{"type":"array","items":{"type":"string"}}}},"footer":{"type":"object","required":["identity_present","address_present"],"properties":{"identity_present":{"type":"boolean"},"address_present":{"type":"boolean"}}},"checks_are_advisory":{"type":"boolean","const":true},"next_action":{"type":"string"}}},"Campaign":{"type":"object","required":["id","name","status","version"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"mailbox_id":{"type":"string","format":"uuid"},"template_id":{"type":["string","null"],"format":"uuid"},"managed_content_id":{"type":["string","null"],"format":"uuid"},"managed_source_revision_id":{"type":["string","null"],"format":"uuid"},"managed_publication_id":{"type":["string","null"],"format":"uuid"},"managed_locales_snapshot":{"type":"array","items":{"type":"string"}},"localization_failure_policy":{"type":"string"},"expires_after_seconds":{"type":["integer","null"]},"status":{"type":"string"},"version":{"type":"integer"},"subject_variants":{"type":"array","items":{"type":"string"}},"selected_subject_variant":{"type":"integer"},"content_overrides":{"type":"object","additionalProperties":{"type":"string"}},"audience_query":{"$ref":"#/components/schemas/CampaignAudience"},"audience_frozen_at":{"type":["string","null"],"format":"date-time"},"audience_recipient_count":{"type":["integer","null"]},"audience_snapshot_sha256":{"type":["string","null"]},"audience_snapshot_campaign_version":{"type":["integer","null"]},"scheduled_at":{"type":["string","null"],"format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"archived_at":{"type":["string","null"],"format":"date-time"},"stats":{"type":"object","additionalProperties":true}}},"CampaignAudience":{"type":"object","properties":{"all_subscribed":{"type":"boolean"},"contact_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":10000},"list_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":1000},"segment_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":1000}},"description":"Select all subscribed contacts or at least one nonempty contact_ids, list_ids, or segment_ids list."},"Command":{"type":"object","required":["id","type","status","workspace_revision","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"status":{"type":"string","enum":["accepted","executing","succeeded","failed"]},"workspace_revision":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"date-time"}}},"CommunicationPolicy":{"type":"object","additionalProperties":false,"required":["conflict"],"properties":{"conflict":{"type":"string","enum":["defer","discard"]},"minimumIntervalSeconds":{"type":"integer","minimum":0,"maximum":604800},"caps":{"type":"array","maxItems":8,"items":{"type":"object","additionalProperties":false,"required":["count","windowSeconds"],"properties":{"count":{"type":"integer","minimum":1},"windowSeconds":{"type":"integer","minimum":1,"maximum":2592000}}}},"window":{"type":"object","additionalProperties":false,"required":["start","end","timeZone"],"properties":{"start":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},"end":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},"timeZone":{"type":"string"},"weekdays":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7}}}}},"CompanyContextDiscovery":{"type":"object","required":["domain","website_url","website_status","company_name","summary","audience","offerings","logo_url","favicon_url","visual_identity","source_snapshot"],"properties":{"domain":{"type":"string"},"website_url":{"type":["string","null"],"format":"uri"},"website_status":{"type":"string","enum":["available","missing","blocked","error"]},"company_name":{"type":"string"},"summary":{"type":"string"},"audience":{"type":"string"},"offerings":{"type":"array","items":{"type":"string"}},"logo_url":{"type":["string","null"],"format":"uri"},"favicon_url":{"type":["string","null"],"format":"uri"},"visual_identity":{"$ref":"#/components/schemas/CompanyVisualIdentity"},"source_snapshot":{"type":"object","additionalProperties":true}}},"CompanyVisualIdentity":{"type":"object","required":["colors","fonts","tone","source_confidence","palette","typography","assets","brand_summary","imagery_style"],"properties":{"colors":{"type":"array","maxItems":6,"items":{"type":"string"}},"fonts":{"type":"array","maxItems":6,"items":{"type":"string"}},"tone":{"type":"array","maxItems":6,"items":{"type":"string"}},"source_confidence":{"type":"string","enum":["high","medium","low"]},"hero_image_url":{"type":"string","format":"uri"},"palette":{"type":"array","maxItems":6,"items":{"type":"object","additionalProperties":false,"required":["value","role","name"],"properties":{"value":{"type":"string"},"role":{"type":"string","enum":["primary","accent","background","surface","text","other"]},"name":{"type":"string"}}}},"typography":{"type":"array","maxItems":6,"items":{"type":"object","additionalProperties":false,"required":["family","role","weights"],"properties":{"family":{"type":"string"},"role":{"type":"string","enum":["heading","body","mono","other"]},"weights":{"type":"array","items":{"type":"integer","minimum":100,"maximum":900}}}}},"assets":{"type":"array","maxItems":8,"items":{"type":"object","additionalProperties":false,"required":["url","kind","source"],"properties":{"url":{"type":"string","format":"uri"},"kind":{"type":"string","enum":["logo","wordmark","favicon","hero"]},"source":{"type":"string"}}}},"brand_summary":{"type":"string"},"imagery_style":{"type":"array","maxItems":6,"items":{"type":"string"}}}},"Connection":{"type":"object","additionalProperties":false,"required":["id","adapter_key","category","display_name","status","auth_kind","freshness_mode","capabilities","resource_scope","config","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"adapter_key":{"type":"string"},"category":{"type":"string","enum":["email","customer","product","work","data"]},"display_name":{"type":"string"},"status":{"type":"string","enum":["pending_validation","active","error","disabled"]},"auth_kind":{"type":"string","enum":["api_key","oauth2","service_account","none"]},"freshness_mode":{"type":"string","enum":["webhook","poll","on_demand","hybrid"]},"capabilities":{"type":"array","items":{"type":"string"}},"resource_scope":{"type":"object","additionalProperties":true},"config":{"type":"object","description":"Non-secret adapter configuration such as a cloud host and project ID.","additionalProperties":true},"active_credential_version":{"type":["integer","null"]},"external_account_id":{"type":["string","null"]},"external_account_name":{"type":["string","null"]},"last_validated_at":{"type":["string","null"],"format":"date-time"},"last_success_at":{"type":["string","null"],"format":"date-time"},"last_error_code":{"type":["string","null"]},"disabled_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ConnectionCredential":{"type":"object","additionalProperties":false,"required":["api_key"],"properties":{"api_key":{"type":"string","minLength":12,"maxLength":10000,"writeOnly":true,"description":"API key or provider service-account JSON."},"display_name":{"type":"string","maxLength":100},"config":{"type":"object","additionalProperties":true}}},"ConnectionGrant":{"type":"object","additionalProperties":false,"required":["connection_id","principal_kind","principal_id","capabilities","resource_scope","created_by_actor_id","created_at","updated_at"],"properties":{"connection_id":{"type":"string","format":"uuid"},"principal_kind":{"type":"string","enum":["agent","automation","api_key"]},"principal_id":{"type":"string"},"capabilities":{"type":"array","items":{"type":"string"}},"resource_scope":{"type":"object","additionalProperties":true},"created_by_actor_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"revoked_at":{"type":["string","null"],"format":"date-time"}}},"ConnectionGrantRequest":{"type":"object","additionalProperties":false,"required":["capabilities"],"properties":{"capabilities":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"}},"resource_scope":{"type":"object","additionalProperties":true},"expires_at":{"type":"string","format":"date-time"}}},"ConnectionQueryRequest":{"type":"object","additionalProperties":false,"required":["adapter_key","operation"],"properties":{"adapter_key":{"type":"string","enum":["figma","github","google-analytics","google-calendar","hubspot","linear","mailchimp","notion","slack","snowflake","zendesk"]},"operation":{"type":"string","enum":["audiences.list","blocks.children.list","campaigns.list","changelog.brief","channels.list","comments.list","commits.list","companies.list","contacts.list","cohorts.list","customer.brief","customers.list","deals.list","events.list","file.summary","funnels.list","images.render","invoices.list","issues.list","launch.brief","messages.history","messages.search","nodes.get","notifications.list","pages.retrieve","payment_intents.list","persons.list","profiles.list","queries.execute","queries.list","releases.list","reports.list","reports.run","repositories.list","search.list","subscriptions.list"]},"parameters":{"type":"object","additionalProperties":true}}},"ConnectionQueryResult":{"type":"object","additionalProperties":false,"required":["adapter_key","operation","capability","source","data"],"properties":{"adapter_key":{"type":"string","enum":["figma","github","google-analytics","google-calendar","hubspot","linear","mailchimp","notion","slack","snowflake","zendesk"]},"operation":{"type":"string"},"capability":{"type":"string"},"source":{"type":"object","additionalProperties":false,"required":["external_account_id","external_account_name","fetched_at","freshness"],"properties":{"external_account_id":{"type":"string"},"external_account_name":{"type":"string"},"fetched_at":{"type":"string","format":"date-time"},"freshness":{"type":"string","const":"live"}}},"data":{"type":"object","additionalProperties":true}}},"Contact":{"type":"object","required":["id","email","display_name","attributes","status","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"display_name":{"type":["string","null"]},"attributes":{"type":"object","additionalProperties":true},"status":{"type":"string","enum":["subscribed","unsubscribed","bounced","complained"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ContactField":{"type":"object","required":["key","label","description","type","options","origin","status"],"properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","maxLength":80},"description":{"type":"string","maxLength":500},"type":{"type":"string","enum":["text","number","boolean","date","choice","choices"]},"options":{"type":"array","items":{"type":"string"},"maxItems":50},"origin":{"type":"string","enum":["system","person","agent","form","import","api","event","discovered"]},"status":{"type":"string","enum":["active","hidden"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"operators":{"type":"array","items":{"type":"string"}},"contacts_with_value":{"type":"integer"}}},"ContactFilter":{"type":"object","properties":{"status":{"type":"string","enum":["subscribed","unsubscribed","bounced","complained"]},"attributes":{"type":"object","additionalProperties":true},"conditions":{"type":"array","items":{"type":"object","required":["field","op"],"properties":{"field":{"type":"string"},"op":{"type":"string","enum":["is","is_not","contains","set","not_set","gt","gte","lt","lte","within_days","any_of","includes"]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}}},"maxItems":20},"match":{"type":"string","enum":["all","any"]}},"additionalProperties":false,"description":"Conditions must reference declared contact fields and use operators supported by their type. set and not_set omit value; within_days uses 1–3650 days."},"ContactImportMapping":{"type":"object","required":["columns","locale_values"],"properties":{"columns":{"type":"array","items":{"type":"object","required":["column","target","confidence","source"],"properties":{"column":{"type":"string"},"target":{"type":"string","enum":["email","display_name","first_name","last_name","locale","time_zone","status","unsubscribed_flag","subscribed_flag","field","ignore"]},"field_key":{"type":"string"},"field_type":{"type":"string","enum":["text","number","boolean","date","choice","choices"]},"confidence":{"type":"number"},"source":{"type":"string","enum":["saved","ai","rules","person"]},"alternatives":{"type":"array","items":{"type":"object","required":["target","probability"],"properties":{"target":{"type":"string","enum":["email","display_name","first_name","last_name","locale","time_zone","status","unsubscribed_flag","subscribed_flag","field","ignore"]},"field_key":{"type":"string"},"probability":{"type":"number"}}}}}}},"locale_values":{"type":"object","additionalProperties":{"type":["string","null"]}}}},"ContactList":{"type":"object","required":["id","name","description","member_count","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"member_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ContactSegment":{"type":"object","required":["id","name","filter","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"filter":{"$ref":"#/components/schemas/ContactFilter"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"CreateCommandRequest":{"type":"object","required":["type","target"],"properties":{"type":{"type":"string","enum":["mark_read","mark_unread","archive","unarchive","trash","restore","spam","not_spam","star","unstar","add_label","remove_label","move","assign","set_work_status"]},"target":{"type":"object","required":["thread_id"],"properties":{"thread_id":{"type":"string","format":"uuid"}}},"parameters":{"type":"object","additionalProperties":true}}},"CreateProductWebhookRequest":{"type":"object","additionalProperties":false,"required":["kind","name"],"properties":{"kind":{"type":"string","enum":["outbound","inbound"]},"name":{"type":"string","minLength":1,"maxLength":120},"source_key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,62}$","default":"custom"},"source_config":{"type":"object","additionalProperties":false,"description":"Source-specific deterministic event evaluation and delivery mapping. Supported for Zendesk and Supabase Auth.","properties":{"vip_tags":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"}},"sla_warning_minutes":{"type":"integer","minimum":1,"maximum":10080},"project_url":{"type":"string","format":"uri","description":"Supabase project URL."},"mailbox_id":{"type":"string","format":"uuid","description":"Active Banger sending address used for Supabase Auth email."},"template_ids":{"type":"object","additionalProperties":false,"description":"Banger template selected for each Supabase Auth email action.","required":["signup","invite","magiclink","recovery","email_change","reauthentication","password_changed_notification","email_changed_notification","phone_changed_notification","identity_linked_notification","identity_unlinked_notification","mfa_factor_enrolled_notification","mfa_factor_unenrolled_notification"],"properties":{"signup":{"type":"string","format":"uuid"},"invite":{"type":"string","format":"uuid"},"magiclink":{"type":"string","format":"uuid"},"recovery":{"type":"string","format":"uuid"},"email_change":{"type":"string","format":"uuid"},"reauthentication":{"type":"string","format":"uuid"},"password_changed_notification":{"type":"string","format":"uuid"},"email_changed_notification":{"type":"string","format":"uuid"},"phone_changed_notification":{"type":"string","format":"uuid"},"identity_linked_notification":{"type":"string","format":"uuid"},"identity_unlinked_notification":{"type":"string","format":"uuid"},"mfa_factor_enrolled_notification":{"type":"string","format":"uuid"},"mfa_factor_unenrolled_notification":{"type":"string","format":"uuid"}}}}},"signing_secret":{"type":"string","minLength":20,"maxLength":500,"description":"Supabase Send Email Hook secret. Accepted only for an inbound Supabase source and encrypted at rest."},"endpoint_url":{"type":"string","format":"uri","description":"Required for outbound destinations only."},"event_types":{"type":"array","minItems":1,"maxItems":100,"uniqueItems":true,"items":{"type":"string"}}}},"CreateWorkspaceApiKeyRequest":{"type":"object","additionalProperties":false,"required":["name","scopes"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100},"scopes":{"type":"array","minItems":1,"uniqueItems":true,"items":{"$ref":"#/components/schemas/ApiKeyScope"}},"expires_at":{"type":"string","format":"date-time"}}},"CreatedProductWebhook":{"allOf":[{"$ref":"#/components/schemas/ProductWebhook"},{"type":"object","properties":{"signing_secret":{"type":"string","description":"Outbound request signing secret","shown once.":null},"source_url":{"type":"string","format":"uri","description":"Inbound event URL containing its unguessable secret."},"webhook_url":{"type":"string","format":"uri","description":"Public inbound URL to use with the Authorization header."},"bearer_token":{"type":"string","description":"Secret endpoint token to send as Authorization Bearer."}}}]},"DeliverabilityCounts":{"type":"object","additionalProperties":true,"properties":{"sent_count":{"type":"integer","format":"int64"},"delivered_count":{"type":"integer","format":"int64"},"deferred_count":{"type":"integer","format":"int64"},"bounced_count":{"type":"integer","format":"int64"},"complained_count":{"type":"integer","format":"int64"},"opened_count":{"type":"integer","format":"int64"},"clicked_count":{"type":"integer","format":"int64"},"unsubscribed_count":{"type":"integer","format":"int64"},"failed_count":{"type":"integer","format":"int64"},"suppressed_count":{"type":"integer","format":"int64"},"last_event_at":{"type":["string","null"],"format":"date-time"}}},"DeliverabilityIssue":{"type":"object","required":["severity","code","title","detail","resource_kind","resource_id"],"properties":{"severity":{"type":"string","enum":["warning","critical"]},"code":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"resource_kind":{"type":"string"},"resource_id":{"type":"string"}}},"DeliverabilityProvider":{"allOf":[{"$ref":"#/components/schemas/DeliverabilityCounts"},{"type":"object","required":["provider","display_name","ownership","status"],"properties":{"provider_connection_id":{"type":["string","null"],"format":"uuid"},"provider":{"type":"string"},"display_name":{"type":"string"},"ownership":{"type":"string"},"status":{"type":"string"}}}]},"DeliverabilityRecipientDomain":{"allOf":[{"$ref":"#/components/schemas/DeliverabilityCounts"},{"type":"object","required":["recipient_domain"],"properties":{"recipient_domain":{"type":"string"}}}]},"DeliverabilitySendingStream":{"type":"object","required":["id","domain","stream_kind","display_name","status","required_records","verified_records","pending_records","error_records"],"properties":{"id":{"type":"string","format":"uuid"},"domain":{"type":"string"},"stream_kind":{"type":"string"},"display_name":{"type":"string"},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"provider_status":{"type":["string","null"]},"required_records":{"type":"integer","format":"int64"},"verified_records":{"type":"integer","format":"int64"},"pending_records":{"type":"integer","format":"int64"},"error_records":{"type":"integer","format":"int64"},"last_checked_at":{"type":["string","null"],"format":"date-time"}}},"DeliverabilitySummary":{"type":"object","required":["since","generated_at","totals","time_series","providers","recipient_domains","sending_streams","feedback_pipeline","issues"],"properties":{"counting_basis":{"type":"string","enum":["recipients","events"]},"simulator_events":{"type":"integer"},"since":{"type":"string","format":"date-time"},"generated_at":{"type":"string","format":"date-time"},"totals":{"$ref":"#/components/schemas/DeliverabilityCounts"},"time_series":{"type":"array","items":{"$ref":"#/components/schemas/DeliverabilityTimeBucket"}},"providers":{"type":"array","items":{"$ref":"#/components/schemas/DeliverabilityProvider"}},"recipient_domains":{"type":"array","items":{"$ref":"#/components/schemas/DeliverabilityRecipientDomain"}},"sending_streams":{"type":"array","items":{"$ref":"#/components/schemas/DeliverabilitySendingStream"}},"feedback_pipeline":{"type":"object","additionalProperties":false,"required":["status","eligible_attempts","unmatched_attempts"],"properties":{"status":{"type":"string","enum":["healthy","degraded","unproven"]},"eligible_attempts":{"type":"integer","format":"int64"},"unmatched_attempts":{"type":"integer","format":"int64"},"last_receipt_at":{"type":["string","null"],"format":"date-time"}}},"issues":{"type":"array","items":{"$ref":"#/components/schemas/DeliverabilityIssue"}}}},"DeliverabilityTimeBucket":{"allOf":[{"$ref":"#/components/schemas/DeliverabilityCounts"},{"type":"object","required":["bucket"],"properties":{"bucket":{"type":"string","format":"date"}}}]},"DiscoveryCapability":{"type":"object","required":["kind","label","status","provider_keys","recommendation"],"properties":{"kind":{"type":"string","enum":["work_mailbox","transactional","marketing","deliverability"]},"label":{"type":"string"},"status":{"type":"string","enum":["detected","missing","needs_review"]},"provider_keys":{"type":"array","items":{"type":"string"}},"recommendation":{"type":"string","enum":["connect","setup_banger","review"]}}},"DiscoveryConnectionPlanItem":{"type":"object","additionalProperties":false,"required":["capability","action"],"properties":{"capability":{"type":"string","enum":["work_mailbox","transactional","marketing","deliverability"]},"provider_key":{"type":"string"},"action":{"type":"string","enum":["connect","setup_banger","review"]},"domain":{"type":"string","minLength":3,"maxLength":253}}},"DnsProviderDetection":{"type":"object","additionalProperties":false,"required":["key","name","confidence","dashboard_url","evidence"],"properties":{"key":{"type":"string"},"name":{"type":"string"},"confidence":{"type":"string","enum":["high","medium","low"]},"dashboard_url":{"type":"string","format":"uri"},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/DnsSignal"}}}},"DnsSignal":{"type":"object","required":["name","type","value","ttl"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["MX","TXT","CNAME","NS"]},"value":{"type":"string"},"ttl":{"type":"integer","minimum":0}}},"DomainInfrastructureProof":{"type":"object","required":["proof_id","domain_id","native_domain_id","mailbox_id","mailbox_address","transactional_subject","marketing_subject","phase","send_complete","transactional_received","marketing_received","receive_complete","agent_check_complete","complete","replayed"],"properties":{"proof_id":{"type":"string","format":"uuid"},"domain_id":{"type":"string","format":"uuid"},"native_domain_id":{"type":"string","format":"uuid"},"mailbox_id":{"type":"string","format":"uuid"},"mailbox_address":{"type":"string","format":"email"},"transactional_send_intent_id":{"type":"string","format":"uuid"},"marketing_send_intent_id":{"type":"string","format":"uuid"},"transactional_subject":{"type":"string"},"marketing_subject":{"type":"string"},"phase":{"type":"string","enum":["sending","receiving","received","checked","failed"]},"send_complete":{"type":"boolean"},"transactional_received":{"type":"boolean"},"marketing_received":{"type":"boolean"},"receive_complete":{"type":"boolean"},"agent_check_complete":{"type":"boolean"},"complete":{"type":"boolean"},"error_code":{"type":"string"},"replayed":{"type":"boolean"}}},"Draft":{"type":"object","required":["id","mailbox_id","thread_id","version","to","cc","bcc","subject","body_text","status","created_at","updated_at","attachments"],"properties":{"id":{"type":"string","format":"uuid"},"mailbox_id":{"type":"string","format":"uuid"},"thread_id":{"type":["string","null"],"format":"uuid"},"version":{"type":"integer"},"to":{"type":"array","items":{"type":"object","required":["email"],"properties":{"email":{"type":"string"},"name":{"type":"string"}}}},"cc":{"type":"array","items":{"type":"object","required":["email"],"properties":{"email":{"type":"string"},"name":{"type":"string"}}}},"bcc":{"type":"array","items":{"type":"object","required":["email"],"properties":{"email":{"type":"string"},"name":{"type":"string"}}}},"subject":{"type":"string"},"body_text":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/DraftAttachment"}},"body_html_url":{"type":"string","format":"uri"}}},"DraftAttachment":{"type":"object","required":["id","filename","content_type","size_bytes"],"properties":{"id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"content_type":{"type":"string"},"size_bytes":{"type":"integer"},"sha256":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"DraftWrite":{"type":"object","additionalProperties":false,"required":["mailbox_id"],"properties":{"mailbox_id":{"type":"string","format":"uuid"},"thread_id":{"type":"string","format":"uuid"},"to":{"type":"array","maxItems":500,"items":{"$ref":"#/components/schemas/Participant"}},"cc":{"type":"array","maxItems":500,"items":{"$ref":"#/components/schemas/Participant"}},"bcc":{"type":"array","maxItems":500,"items":{"$ref":"#/components/schemas/Participant"}},"subject":{"type":"string","maxLength":10000},"body_text":{"type":"string","maxLength":2000000},"body_html":{"type":"string","maxLength":2000000}}},"EmailDesignPreview":{"type":"object","required":["subject","body_text","font_rendering","sample_recipient","required_variables","effective_slots"],"properties":{"subject":{"type":"string"},"body_text":{"type":"string"},"body_html":{"type":"string"},"font_rendering":{"type":"array","items":{"$ref":"#/components/schemas/EmailFontReport"}},"sample_recipient":{"anyOf":[{"type":"object","required":["email","display_name"],"properties":{"email":{"type":"string"},"display_name":{"type":["string","null"]}}},{"type":"null"}]},"required_variables":{"type":"array","items":{"type":"string"}},"effective_slots":{"type":"array","items":{"$ref":"#/components/schemas/TemplateSlot"}},"audience_count":{"type":"integer"},"gaps":{"type":"array","items":{"type":"object","required":["variable","missing_count","sample_emails"],"properties":{"variable":{"type":"string"},"missing_count":{"type":"integer"},"sample_emails":{"type":"array","items":{"type":"string"}}}}}}},"EmailExperiment":{"type":"object","required":["id","name","subject_kind","subject_id","dimension","variants","status"],"properties":{"name":{"type":"string","maxLength":200,"minLength":1},"subject_kind":{"type":"string","enum":["campaign","sequence_step","automation_rule"]},"subject_id":{"type":"string","maxLength":200,"minLength":1},"dimension":{"type":"string","enum":["subject","design","content","from_name"]},"variants":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"label":{"type":"string","maxLength":120},"subject":{"type":"string","maxLength":998,"minLength":1},"template_id":{"type":"string","format":"uuid"},"content":{"type":"object","additionalProperties":{"type":"string"}},"from_name":{"type":"string","maxLength":200,"minLength":1}}},"minItems":2,"maxItems":4},"allocation":{"type":"array","items":{"type":"integer","minimum":1,"maximum":100}},"sample_percent":{"type":"integer","minimum":5,"maximum":100,"default":100},"primary_metric":{"type":"string","enum":["human_open","human_click","reply","conversion"],"default":"human_click"},"min_sample_per_arm":{"type":"integer","minimum":10,"maximum":100000,"default":100},"decision":{"type":"object","properties":{"mode":{"type":"string","enum":["manual","auto"]},"after_hours":{"type":"integer","minimum":1,"maximum":336},"confidence":{"type":"number","minimum":0.8,"maximum":0.99}}},"guardrails":{"type":"object","properties":{"max_complaint_rate":{"type":"number","exclusiveMinimum":0,"maximum":1},"max_unsubscribe_rate":{"type":"number","exclusiveMinimum":0,"maximum":1}}},"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["running","decided","stopped"]},"winner_key":{"type":["string","null"]},"decided_by":{"type":["string","null"]},"decision_basis":{"type":["string","null"],"enum":["confident","deadline","guardrail","manual",null]},"decision_confidence":{"type":["number","null"]},"decision_reason":{"type":["string","null"]},"started_at":{"type":"string","format":"date-time"},"decided_at":{"type":["string","null"],"format":"date-time"},"created_by_actor_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"EmailFontReport":{"type":"object","required":["stack","font","web_font","clients"],"properties":{"stack":{"type":"string"},"font":{"type":"string"},"web_font":{"type":"boolean"},"clients":{"type":"array","items":{"type":"object","required":["client","label","font","web_font","fallback"],"properties":{"client":{"type":"string"},"label":{"type":"string"},"font":{"type":"string"},"web_font":{"type":"boolean"},"fallback":{"type":"boolean"}}}}}},"EmailStarter":{"type":"object","required":["id","version","category","message_kind","family","stage","businesses","name","description","subject","body_text","brief","slots","content"],"properties":{"id":{"type":"string"},"version":{"type":"integer"},"category":{"type":"string"},"message_kind":{"type":"string"},"family":{"type":"string"},"stage":{"type":"string"},"businesses":{"type":"array","items":{"type":"string"}},"name":{"type":"string"},"description":{"type":"string"},"subject":{"type":"string"},"body_text":{"type":"string"},"brief":{"type":"object","required":["job","send_when","metric","mechanic","subject_variants"],"properties":{"job":{"type":"string"},"send_when":{"type":"string"},"metric":{"type":"string"},"mechanic":{"type":"string"},"subject_variants":{"type":"array","items":{"type":"string"}},"keep":{"type":"array","items":{"type":"string"}},"avoid":{"type":"array","items":{"type":"string"}},"imagery":{"type":"object","required":["default"],"properties":{"default":{"type":"string"},"slot":{"type":"string"},"photo_idea":{"type":"string"}}}}},"slots":{"type":"array","items":{"$ref":"#/components/schemas/TemplateSlot"}},"content":{"type":"object","additionalProperties":{"type":"string"}},"body_html":{"type":"string"}}},"EmailTemplate":{"type":"object","required":["id","name","subject","body_text","content","slots","status","origin","version","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"subject":{"type":"string"},"body_text":{"type":"string"},"content":{"type":"object","additionalProperties":{"type":"string"}},"slots":{"type":"array","items":{"$ref":"#/components/schemas/TemplateSlot"}},"status":{"type":"string","enum":["active","archived"]},"origin":{"type":"string","enum":["person","agent","starter","import"]},"created_by_actor_id":{"type":["string","null"]},"campaign_id":{"type":["string","null"],"format":"uuid"},"message_kind":{"type":"string"},"starter_id":{"type":["string","null"]},"starter_version":{"type":["integer","null"]},"version":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"body_html_url":{"type":"string","format":"uri"}}},"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"details":{"type":"object","additionalProperties":true,"description":"Machine-readable context. A send refused by sender-reputation enforcement (423 sending_lane_paused, sending_domain_paused, sending_mailbox_paused, sending_workspace_frozen) carries scope, reason, hold_id, paused_at, review_required and resumable_after."}}}}},"ExecutionJob":{"type":"object","required":["id","placement_id","placement_generation","kind","requested_by_actor_id","capability_scopes","resource_scope","status","attempt_count","created_at","updated_at","replayed"],"properties":{"id":{"type":"string","format":"uuid"},"placement_id":{"type":"string","format":"uuid"},"placement_generation":{"type":"integer","format":"int64"},"kind":{"type":"string"},"requested_by_actor_id":{"type":"string"},"approval_id":{"type":["string","null"],"format":"uuid"},"capability_scopes":{"type":"array","items":{"type":"string"}},"resource_scope":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"status":{"type":"string","enum":["queued","leased","succeeded","failed","cancelled"]},"attempt_count":{"type":"integer"},"result":{},"error_code":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"replayed":{"type":"boolean"}}},"ExperimentInput":{"type":"object","required":["name","subject_kind","subject_id","dimension","variants"],"properties":{"name":{"type":"string","maxLength":200,"minLength":1},"subject_kind":{"type":"string","enum":["campaign","sequence_step","automation_rule"]},"subject_id":{"type":"string","maxLength":200,"minLength":1},"dimension":{"type":"string","enum":["subject","design","content","from_name"]},"variants":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"label":{"type":"string","maxLength":120},"subject":{"type":"string","maxLength":998,"minLength":1},"template_id":{"type":"string","format":"uuid"},"content":{"type":"object","additionalProperties":{"type":"string"}},"from_name":{"type":"string","maxLength":200,"minLength":1}}},"minItems":2,"maxItems":4},"allocation":{"type":"array","items":{"type":"integer","minimum":1,"maximum":100}},"sample_percent":{"type":"integer","minimum":5,"maximum":100,"default":100},"primary_metric":{"type":"string","enum":["human_open","human_click","reply","conversion"],"default":"human_click"},"min_sample_per_arm":{"type":"integer","minimum":10,"maximum":100000,"default":100},"decision":{"type":"object","properties":{"mode":{"type":"string","enum":["manual","auto"]},"after_hours":{"type":"integer","minimum":1,"maximum":336},"confidence":{"type":"number","minimum":0.8,"maximum":0.99}}},"guardrails":{"type":"object","properties":{"max_complaint_rate":{"type":"number","exclusiveMinimum":0,"maximum":1},"max_unsubscribe_rate":{"type":"number","exclusiveMinimum":0,"maximum":1}}}},"description":"Variant payload must match dimension: subject, template_id (design), content, or from_name. Keys must be unique and cannot be holdback. Allocation must have one percentage per variant and sum to 100; omitted allocation splits evenly."},"GmailOAuthSessionStart":{"type":"object","additionalProperties":false,"required":["sessionId","authUrl","expiresAt","pollIntervalMs"],"properties":{"sessionId":{"type":"string","format":"uuid"},"authUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"integer","format":"int64"},"pollIntervalMs":{"type":"integer","minimum":250}}},"GmailOAuthSessionStatus":{"type":"object","additionalProperties":false,"required":["status","mailboxId","email","error","expiresAt"],"properties":{"status":{"type":"string","enum":["pending","complete","error","expired"]},"mailboxId":{"type":["string","null"],"format":"uuid"},"email":{"type":["string","null"],"format":"email"},"error":{"type":["string","null"]},"expiresAt":{"type":"integer","format":"int64"}}},"GuidedOnboardingState":{"type":"object","required":["product_id","steps","current_step","completed_count","total_steps","complete","outcome","recommended_action","readiness","progress"],"additionalProperties":true,"properties":{"product_id":{"type":"string","format":"uuid"},"lesson":{"$ref":"#/components/schemas/OnboardingLesson"},"guidance":{"type":"string"},"current_step":{"type":"string","enum":["connect","mailbox","business","journey","broadcast","identity","sending"]},"completed_count":{"type":"integer"},"total_steps":{"type":"integer","enum":[4,7]},"complete":{"type":"boolean"},"shared_education_complete":{"type":"boolean"},"outcome":{"type":"string","enum":["in_progress","production_deferred","production_ready"]},"recommended_action":{"type":"string"},"readiness":{"type":"object","additionalProperties":{"type":"boolean"}},"progress":{"type":"object","additionalProperties":true},"steps":{"type":"array","items":{"type":"object","required":["id","title","status","actions","resource_ids","evidence"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"explanation":{"type":"string"},"status":{"type":"string","enum":["not_started","in_progress","waiting","needs_attention","complete","skipped"]},"blocking_dependency":{"type":["string","null"]},"recommended_action":{"type":"string"},"actions":{"type":"array","items":{"type":"string"}},"resource_ids":{"type":"array","items":{"type":"string"}},"evidence":{"type":"object","additionalProperties":true}}}}}},"HomeSetupItem":{"type":"object","additionalProperties":false,"required":["status","detail"],"properties":{"status":{"type":"string","enum":["todo","in_progress","complete","not_relevant"]},"detail":{"type":"string"}}},"HomeSurface":{"type":"object","additionalProperties":false,"required":["setup","needsYou","journeys","broadcast","recentLogs","volume","agent"],"properties":{"setup":{"type":"object","additionalProperties":false,"required":["stage","domain","mailboxes","journeys","broadcast"],"properties":{"stage":{"type":"string","enum":["domain","mailboxes","journeys","broadcast","complete"]},"domain":{"$ref":"#/components/schemas/HomeSetupItem"},"mailboxes":{"$ref":"#/components/schemas/HomeSetupItem"},"journeys":{"$ref":"#/components/schemas/HomeSetupItem"},"broadcast":{"$ref":"#/components/schemas/HomeSetupItem"}}},"needsYou":{"type":"object","additionalProperties":false,"required":["undecidedApprovals","oldestApprovals","failedSteps24h","deliverabilityAlerts","unreadInbound","splitsReadyToDecide","unclaimedJourneys"],"properties":{"undecidedApprovals":{"type":"integer","minimum":0},"oldestApprovals":{"type":"array","items":{"type":"object","required":["id","summary","actionKind","createdAt"],"properties":{"id":{"type":"string","format":"uuid"},"summary":{"type":"string"},"actionKind":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}}},"failedSteps24h":{"type":"array","items":{"type":"object","required":["journeyId","journeyName","count"],"properties":{"journeyId":{"type":"string","format":"uuid"},"journeyName":{"type":"string"},"count":{"type":"integer","minimum":0}}}},"deliverabilityAlerts":{"type":"array","items":{"type":"object","required":["kind","detail","destination"],"properties":{"kind":{"type":"string","enum":["bounce_rate","complaint_rate","dns_drift","lane_paused"]},"detail":{"type":"string"},"destination":{"type":"string","enum":["deliverability","domains"]}}}},"unreadInbound":{"type":"array","items":{"type":"object","required":["mailboxId","address","count"],"properties":{"mailboxId":{"type":"string","format":"uuid"},"address":{"type":"string"},"count":{"type":"integer","minimum":0}}}},"splitsReadyToDecide":{"type":"array","items":{"type":"object","required":["journeyId","journeyName"],"properties":{"journeyId":{"type":"string","format":"uuid"},"journeyName":{"type":"string"}}}},"unclaimedJourneys":{"type":"integer","minimum":0}}},"journeys":{"type":"object","additionalProperties":false,"required":["active","entered30d","sent30d","top"],"properties":{"active":{"type":"integer","minimum":0},"entered30d":{"type":"integer","minimum":0},"sent30d":{"type":"integer","minimum":0},"top":{"type":"array","items":{"$ref":"#/components/schemas/Journey"}}}},"broadcast":{"type":"object","additionalProperties":false,"properties":{"next":{"type":"object","required":["id","name","scheduledAt","recipients"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"scheduledAt":{"type":"string","format":"date-time"},"recipients":{"type":"integer","minimum":0}}},"last":{"type":"object","required":["id","name","sentAt","delivered","humanOpened","replied"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"sentAt":{"type":"string","format":"date-time"},"delivered":{"type":"integer","minimum":0},"humanOpened":{"type":"integer","minimum":0},"replied":{"type":"integer","minimum":0}}}}},"recentLogs":{"type":"array","items":{"$ref":"#/components/schemas/LogEntry"}},"volume":{"type":"object","additionalProperties":true,"required":["sentPeriod","limit","mailboxes","verifiedDomains"],"properties":{"sentPeriod":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":0},"deliveredRate":{"type":"number","minimum":0,"maximum":1},"mailboxes":{"type":"integer","minimum":0},"verifiedDomains":{"type":"integer","minimum":0}}},"agent":{"type":"object","additionalProperties":false,"required":["connected"],"properties":{"connected":{"type":"boolean"},"clientName":{"type":"string"}}}}},"HomeSurfaceResponse":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/HomeSurface"}}},"Journey":{"allOf":[{"$ref":"#/components/schemas/JourneyInput"},{"type":"object","required":["id","status","version","stats","health","indicator","sparkline"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","discovered","active","paused","archived"]},"api_key":{"type":["string","null"]},"content_mode":{"type":["string","null"],"enum":["code","managed",null]},"identity":{"type":["string","null"]},"identity_aliases":{"type":"array","items":{"type":"string"}},"samples":{"type":"array","items":{"type":"object","additionalProperties":true}},"version":{"type":"integer","minimum":1},"stats":{"type":"object","additionalProperties":true},"stepStats":{"type":"array","items":{"type":"object","additionalProperties":true}},"armStats":{"type":"array","items":{"type":"object","additionalProperties":true}},"health":{"type":"object","additionalProperties":true},"indicator":{"type":"object","additionalProperties":true},"sparkline":{"type":"array","items":{"type":"number"}},"activated_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"last_activity_at":{"type":["string","null"],"format":"date-time"}}}]},"JourneyArm":{"type":"object","additionalProperties":false,"required":["key","label","allocation","steps"],"properties":{"key":{"type":"string","enum":["A","B","C","D"]},"label":{"type":"string","maxLength":120},"allocation":{"type":"number","minimum":0,"maximum":100},"steps":{"type":"array","items":{"$ref":"#/components/schemas/JourneyStep"}}}},"JourneyExecution":{"type":"object","required":["enrollment_id","step_id","position","kind","name","status","attempt_count","send_intent_id","error_code","started_at","completed_at","updated_at"],"properties":{"enrollment_id":{"type":"string","format":"uuid"},"step_id":{"type":"string","format":"uuid"},"position":{"type":"integer"},"kind":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"attempt_count":{"type":"integer"},"send_intent_id":{"type":["string","null"],"format":"uuid"},"error_code":{"type":["string","null"]},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"JourneyExit":{"type":"object","additionalProperties":false,"properties":{"on_reply":{"type":"boolean","default":true},"on_unsubscribe":{"type":"boolean","default":true},"on_suppression":{"type":"boolean","default":true},"event":{"type":"string","maxLength":200}}},"JourneyGoal":{"type":"object","additionalProperties":false,"required":["kind","config"],"properties":{"kind":{"type":"string","enum":["none","event","reply","conversion"]},"connection_id":{"type":"string","format":"uuid"},"config":{"type":"object","additionalProperties":true}}},"JourneyInput":{"type":"object","additionalProperties":false,"required":["name","trigger","steps"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"mailbox_id":{"type":"string","format":"uuid"},"from_local_part":{"type":"string","maxLength":64,"pattern":"^[a-z0-9][a-z0-9._+-]{0,62}$"},"trigger":{"type":"object","required":["kind"],"properties":{"kind":{"type":"string","enum":["manual","contact_created","audience_joined","event","schedule","inbound_email","api"]},"connection_id":{"type":"string","format":"uuid"},"config":{"type":"object","additionalProperties":true,"properties":{"event":{"type":"string"},"once_per_person":{"type":"boolean","default":true,"description":"Each person enters once. Set false to let people re-enter after they finish."},"reentry_days":{"type":"integer","minimum":1,"maximum":365,"description":"With once_per_person false, days after a person's last entry before they may enter again."}}},"conditions":{"type":"array","items":{"type":"object","additionalProperties":true}}}},"audience":{"type":"object","additionalProperties":true},"goal":{"$ref":"#/components/schemas/JourneyGoal"},"exit":{"$ref":"#/components/schemas/JourneyExit"},"approval_mode":{"type":"string","enum":["policy","required"]},"api":{"type":"object","properties":{"key":{"type":"string","maxLength":100},"content_mode":{"type":"string","enum":["code","managed"]},"identity":{"type":"string","maxLength":300}}},"managed_content":{"$ref":"#/components/schemas/ManagedContentContract","description":"Create-only shortcut: atomically save a source-managed email draft and a Journey whose email step references it. Missing target languages queue for free translation; this does not publish or activate the Journey."},"steps":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/JourneyStep"}}}},"JourneyManagedConversion":{"type":"object","required":["journey_id","status","review_required","managed_content_steps","replayed","approvals"],"properties":{"journey_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft"]},"review_required":{"type":"boolean","const":true},"managed_content_steps":{"type":"array","items":{"type":"object","required":["step_id","managed_content_id","content_version","source_revision_id","preview","translation_jobs"],"properties":{"step_id":{"type":"string","format":"uuid"},"managed_content_id":{"type":"string","format":"uuid"},"content_version":{"type":"integer"},"source_revision_id":{"type":["string","null"],"format":"uuid"},"preview":{"$ref":"#/components/schemas/RenderedEmail"},"translation_jobs":{"type":"array","items":{"type":"string","format":"uuid"}}}}},"managed_content_id":{"type":"string","format":"uuid"},"content_version":{"type":"integer"},"source_revision_id":{"type":["string","null"],"format":"uuid"},"preview":{"$ref":"#/components/schemas/RenderedEmail"},"replayed":{"type":"boolean"},"approvals":{"type":"array","items":{"type":"object","required":["step_id","approval"],"properties":{"step_id":{"type":"string","format":"uuid"},"approval":{"$ref":"#/components/schemas/ApprovalRequest"}}}},"approval":{"$ref":"#/components/schemas/ApprovalRequest"}}},"JourneySendReceipt":{"type":"object","required":["action_kind","status","journey","ignored_variables"],"properties":{"action_kind":{"type":"string","enum":["transactional.send"]},"id":{"type":"string","format":"uuid"},"send_intent_id":{"type":"string","format":"uuid"},"provider_attempt_id":{"type":"string","format":"uuid"},"status":{"type":"string"},"replayed":{"type":"boolean"},"journey":{"anyOf":[{"type":"object","required":["journey_id","enrollment_id","step_id","step_position"],"properties":{"journey_id":{"type":"string","format":"uuid"},"enrollment_id":{"type":"string","format":"uuid"},"step_id":{"type":"string","format":"uuid"},"step_position":{"type":"integer"},"origin":{"type":"string","enum":["journey"]},"journey_identity":{"type":"string"}}},{"type":"null"}]},"ignored_variables":{"type":"array","items":{"type":"string"}},"scheduled_at":{"type":"string","format":"date-time"},"reason":{"type":"string"},"communication_reservation_id":{"type":"string","format":"uuid"}}},"JourneyStep":{"type":"object","additionalProperties":false,"required":["kind","name","config"],"properties":{"id":{"type":"string","format":"uuid"},"position":{"type":"integer","minimum":1,"maximum":100},"kind":{"type":"string","enum":["email","wait","condition","action","split"]},"name":{"type":"string","minLength":1,"maxLength":200},"managed_content":{"type":"object","readOnly":true,"description":"Typed source contract and draft/published revision identity for an email step.","properties":{"id":{"type":"string","format":"uuid"},"version":{"type":"integer"},"draft_revision_id":{"type":["string","null"],"format":"uuid"},"published_revision_id":{"type":["string","null"],"format":"uuid"},"published_publication_id":{"type":["string","null"],"format":"uuid"},"source_revision_id":{"type":["string","null"],"format":"uuid"},"layout_revision_id":{"type":["string","null"],"format":"uuid"},"published_layout_revision_id":{"type":["string","null"],"format":"uuid"},"source_locale":{"type":["string","null"]},"configured_locales":{"type":"array","items":{"type":"string"}},"variables":{"type":"object","additionalProperties":true},"published_variables":{"type":"object","additionalProperties":true}}},"config":{"type":"object","additionalProperties":true,"description":"Wait steps optionally accept until with name, path, operator (equals, not_equals, contains, or exists), and value, plus required on_met (continue or end_journey). continue skips the following reminder email; end_journey completes the Journey. A reminder email must immediately follow in the same branch. The wait checks current customer data every minute up to amount/unit. Missing fields are unknown and hold the reminder. Ordinary waits and standalone conditions retain their existing behavior. Name checks with verified customer milestones. Managed email steps reference the published content through managed_content_id; activation rejects an unpublished reference. Email steps may set expires_after_seconds (1-604800) to discard a deferred send after that interval from its original start; the default is seven days."},"arms":{"type":"array","minItems":2,"maxItems":4,"items":{"$ref":"#/components/schemas/JourneyArm"}}}},"Label":{"type":"object","required":["id","mailbox_id","name","kind","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"mailbox_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"color":{"type":["string","null"]},"kind":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"LabelAutoSet":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"},"description":{"type":["string","null"],"maxLength":2000},"exact_conditions":{"$ref":"#/components/schemas/TriageExactConditions"}}},"LogEntry":{"type":"object","required":["id","direction","at","mailbox_id","from","to","recipient_count","subject","origin","status"],"properties":{"id":{"type":"string","format":"uuid"},"direction":{"type":"string","enum":["out","in"]},"at":{"type":"string","format":"date-time"},"mailbox_id":{"type":"string","format":"uuid"},"thread_id":{"type":"string","format":"uuid"},"send_intent_id":{"type":"string","format":"uuid"},"traffic_class":{"type":"string","enum":["mailbox","product","broadcast"]},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"recipient_count":{"type":"integer","minimum":0},"subject":{"type":"string"},"origin":{"$ref":"#/components/schemas/LogOrigin"},"status":{"$ref":"#/components/schemas/LogStatus"},"detail":{"type":"object","additionalProperties":true}}},"LogOrigin":{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"type":"string","enum":["journey","broadcast","mailbox","api","agent"]},"id":{"type":"string"},"name":{"type":"string"}}},"LogPage":{"type":"object","required":["data","page"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LogEntry"}},"page":{"type":"object","additionalProperties":false,"required":["has_more"],"properties":{"has_more":{"type":"boolean"},"next_cursor":{"type":"string"}}}}},"LogStatus":{"type":"string","enum":["queued","sent","delivered","bounced","complained","opened","clicked","replied","received","failed"]},"MailAssistantCommand":{"type":"object","required":["runId","status","assistantMessage","toolCalls","proposedActions"],"properties":{"runId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["requires_tool_results","completed","requires_confirmation"]},"assistantMessage":{"type":"string"},"toolCalls":{"type":"array","items":{"$ref":"#/components/schemas/MailAssistantTool"}},"proposedActions":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/MailAssistantTool"},{"type":"object","required":["confirmationRequired"],"properties":{"confirmationRequired":{"type":"boolean","const":true}}}]}}}},"MailAssistantTool":{"type":"object","required":["id","toolName","arguments","reason"],"properties":{"id":{"type":"string","format":"uuid"},"toolName":{"type":"string"},"arguments":{"type":"object","additionalProperties":true},"reason":{"type":"string"}}},"MailDocument":{"type":"object","required":["id","message_id","mailbox_id","thread_id","filename","content_type","size_bytes","sent_at","subject"],"properties":{"id":{"type":"string","format":"uuid"},"message_id":{"type":"string","format":"uuid"},"mailbox_id":{"type":"string","format":"uuid"},"thread_id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"content_type":{"type":"string"},"size_bytes":{"type":"integer"},"sent_at":{"type":"string","format":"date-time"},"subject":{"type":"string"}}},"MailPage":{"type":"object","required":["mailboxes","domains","labels","threads","page","mailbox_thread_counts","revision"],"properties":{"mailboxes":{"type":"array","items":{"$ref":"#/components/schemas/Mailbox"}},"domains":{"type":"array","items":{"$ref":"#/components/schemas/SendingDomainSummary"}},"selected_mailbox_id":{"type":"string","format":"uuid"},"labels":{"type":"array","items":{"$ref":"#/components/schemas/Label"}},"threads":{"type":"array","items":{"$ref":"#/components/schemas/ThreadSummary"}},"page":{"$ref":"#/components/schemas/PageInfo"},"mailbox_thread_counts":{"type":"object","additionalProperties":{"type":"integer"}},"revision":{"type":"integer","format":"int64"}}},"MailPageResponse":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/MailPage"}}},"Mailbox":{"type":"object","required":["id","workspace_id","address","display_name","provider","status","mailbox_kind"],"properties":{"id":{"type":"string","format":"uuid"},"workspace_id":{"type":"string","format":"uuid"},"product_id":{"type":["string","null"],"format":"uuid","description":"The product (project) the mailbox belongs to. Clients group mailboxes and build web-app links with it."},"domain_id":{"type":["string","null"],"format":"uuid"},"address":{"type":"string","format":"email"},"display_name":{"type":"string"},"provider":{"type":"string","enum":["gmail","smtp"]},"status":{"type":"string","enum":["pending","active","suspended","reconnect_required","disabled"]},"status_reason":{"type":["string","null"]},"suspended_at":{"type":["string","null"]},"mailbox_kind":{"type":"string","enum":["domain","starter"]}}},"ManagedContentContract":{"type":"object","additionalProperties":false,"required":["source"],"properties":{"source_locale":{"type":"string","description":"Canonical BCP 47 source locale; inherits product settings when omitted."},"configured_locales":{"type":"array","maxItems":100,"uniqueItems":true,"description":"Source plus target locales; omitted source is added by the server.","items":{"type":"string"}},"fallback_locale":{"type":"string"},"layout_id":{"type":"string","format":"uuid","description":"Selected reusable layout; the server snapshots its published revision into this content revision."},"localization_policy":{"type":"object","additionalProperties":false,"properties":{"manual_review":{"type":"boolean","default":false},"journey_translation":{"type":"object","additionalProperties":false,"required":["mode"],"description":"Optional bounded hold for ordinary Journey email while its requested translation is missing or awaiting review. Default fallback preserves immediate sending; urgent messages always bypass the hold and use the configured fallback language.","properties":{"mode":{"type":"string","enum":["fallback","wait"]},"max_wait_seconds":{"type":"integer","minimum":60,"maximum":86400},"on_timeout":{"type":"string","enum":["fallback","discard"]}}}}},"source":{"type":"object","additionalProperties":false,"required":["subject","body_html","variables"],"properties":{"subject":{"type":"string","minLength":1,"maxLength":100000},"preheader":{"type":"string","maxLength":100000},"body_text":{"type":"string","maxLength":100000,"description":"Accepted for source compatibility; rendered plain text derives from final HTML."},"body_html":{"type":"string","minLength":1,"maxLength":100000},"layout":{"type":"string","maxLength":100000,"description":"Must contain one {{ content }} slot."},"variants":{"type":"object","minProperties":2,"maxProperties":4,"description":"Optional source versions. Every version is translated automatically in the same revision.","additionalProperties":{"type":"object","additionalProperties":false,"required":["subject","body_html"],"properties":{"subject":{"type":"string","minLength":1,"maxLength":100000},"preheader":{"type":"string","maxLength":100000},"body_html":{"type":"string","minLength":1,"maxLength":100000},"body_text":{"type":"string","maxLength":100000},"layout":{"type":"string","maxLength":100000}}}},"variables":{"type":"object","maxProperties":100,"additionalProperties":{"$ref":"#/components/schemas/ManagedContentField"}}}},"samples":{"type":"object","description":"Named sample value sets for preview and source validation.","additionalProperties":{"type":"object","additionalProperties":true}},"translations":{"type":"object","description":"Source ICU message catalog and optional supplied target catalogs. Missing configured targets are queued for asynchronous translation; saving does not require them.","additionalProperties":{"type":"object","additionalProperties":{"type":"string"}}}}},"ManagedContentField":{"oneOf":[{"type":"object","additionalProperties":false,"required":["type"],"properties":{"type":{"type":"string","enum":["string","text","url","image_url","html","date","datetime","number","boolean","money"]},"required":{"type":"boolean"},"description":{"type":"string","maxLength":2000},"default":{"description":"Must match the field type."}}},{"type":"object","additionalProperties":false,"required":["type","properties"],"properties":{"type":{"const":"object"},"required":{"type":"boolean"},"description":{"type":"string","maxLength":2000},"default":{"type":"object"},"properties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ManagedContentField"}}}},{"type":"object","additionalProperties":false,"required":["type","items"],"properties":{"type":{"const":"list"},"required":{"type":"boolean"},"description":{"type":"string","maxLength":2000},"default":{"type":"array"},"items":{"$ref":"#/components/schemas/ManagedContentField"}}}],"description":"Recursive typed variable. Money values use {amount_cents: integer, currency: ISO 4217 code}; date values are ISO calendar dates and datetime values are ISO timestamps with offsets."},"ManagedContentResponse":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ManagedContentState"}}},"ManagedContentState":{"type":"object","required":["id","name","version","review_required"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"integer","minimum":1},"review_required":{"type":"boolean"},"draft_revision_id":{"type":["string","null"],"format":"uuid"},"submitted_revision_id":{"type":["string","null"],"format":"uuid"},"approved_revision_id":{"type":["string","null"],"format":"uuid"},"published_revision_id":{"type":["string","null"],"format":"uuid"},"published_publication_id":{"type":["string","null"],"format":"uuid"},"source_revision":{"type":"object","additionalProperties":true},"translations":{"type":"array","items":{"type":"object","additionalProperties":true}},"translation_jobs":{"type":"array","items":{"type":"object","additionalProperties":true}}}},"ManagedEmailAsset":{"type":"object","additionalProperties":false,"required":["id","product_id","filename","mime_type","size_bytes","sha256","created_at","public_url"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"mime_type":{"type":"string","enum":["image/png","image/jpeg","image/gif","image/webp"]},"size_bytes":{"type":"integer","minimum":1,"maximum":2097152},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"created_at":{"type":"string","format":"date-time"},"public_url":{"type":"string","format":"uri"}}},"ManagedLayout":{"type":"object","required":["id","name","version","draft_revision_id","published_revision_id","published_publication_id"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"integer"},"draft_revision_id":{"type":["string","null"],"format":"uuid"},"published_revision_id":{"type":["string","null"],"format":"uuid"},"published_publication_id":{"type":["string","null"],"format":"uuid"}}},"ManagedLayoutRevision":{"type":"object","required":["id","revision","html","brand_snapshot","source_locale","source_messages","translations","restored_from_revision_id"],"properties":{"id":{"type":"string","format":"uuid"},"layout_id":{"type":"string","format":"uuid"},"revision":{"type":"integer"},"html":{"type":"string"},"brand_snapshot":{"$ref":"#/components/schemas/ProductBrand"},"source_locale":{"type":"string"},"source_messages":{"type":"object","additionalProperties":{"type":"string"}},"translations":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string"}}},"restored_from_revision_id":{"type":["string","null"],"format":"uuid"},"created_by_actor_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"ManagedSourceRevision":{"type":"object","required":["id","content_id","revision","source_locale","configured_locales","fallback_locale","localization_policy","source","source_messages","layout_id","layout_revision_id","samples","restored_from_revision_id"],"properties":{"id":{"type":"string","format":"uuid"},"content_id":{"type":"string","format":"uuid"},"revision":{"type":"integer"},"source_locale":{"type":"string"},"configured_locales":{"type":"array","items":{"type":"string"}},"fallback_locale":{"type":["string","null"]},"localization_policy":{"type":"object","additionalProperties":false,"properties":{"manual_review":{"type":"boolean","default":false},"journey_translation":{"type":"object","additionalProperties":false,"required":["mode"],"description":"Optional bounded hold for ordinary Journey email while its requested translation is missing or awaiting review. Default fallback preserves immediate sending; urgent messages always bypass the hold and use the configured fallback language.","properties":{"mode":{"type":"string","enum":["fallback","wait"]},"max_wait_seconds":{"type":"integer","minimum":60,"maximum":86400},"on_timeout":{"type":"string","enum":["fallback","discard"]}}}}},"source":{"type":"object","additionalProperties":false,"required":["subject","body_html","variables"],"properties":{"subject":{"type":"string","minLength":1,"maxLength":100000},"preheader":{"type":"string","maxLength":100000},"body_text":{"type":"string","maxLength":100000,"description":"Accepted for source compatibility; rendered plain text derives from final HTML."},"body_html":{"type":"string","minLength":1,"maxLength":100000},"layout":{"type":"string","maxLength":100000,"description":"Must contain one {{ content }} slot."},"variants":{"type":"object","minProperties":2,"maxProperties":4,"description":"Optional source versions. Every version is translated automatically in the same revision.","additionalProperties":{"type":"object","additionalProperties":false,"required":["subject","body_html"],"properties":{"subject":{"type":"string","minLength":1,"maxLength":100000},"preheader":{"type":"string","maxLength":100000},"body_html":{"type":"string","minLength":1,"maxLength":100000},"body_text":{"type":"string","maxLength":100000},"layout":{"type":"string","maxLength":100000}}}},"variables":{"type":"object","maxProperties":100,"additionalProperties":{"$ref":"#/components/schemas/ManagedContentField"}}}},"source_messages":{"type":"object","additionalProperties":{"type":"string"}},"layout_id":{"type":["string","null"],"format":"uuid"},"layout_revision_id":{"type":["string","null"],"format":"uuid"},"samples":{"type":"object","additionalProperties":{"type":"object","additionalProperties":true}},"restored_from_revision_id":{"type":["string","null"],"format":"uuid"}}},"ManagedTranslation":{"type":"object","required":["source_revision_id","locale","strings","provenance","status"],"properties":{"source_revision_id":{"type":"string","format":"uuid"},"locale":{"type":"string"},"strings":{"type":"object","additionalProperties":{"type":"string"}},"provenance":{"type":"string","enum":["supplied","generated","reviewed"]},"status":{"type":"string","enum":["ready","needs_review"]}}},"Message":{"type":"object","required":["id","mailbox_id","thread_id","sent_at","from","to","has_attachments"],"properties":{"id":{"type":"string","format":"uuid"},"mailbox_id":{"type":"string","format":"uuid"},"thread_id":{"type":"string","format":"uuid"},"sent_at":{"type":"string","format":"date-time"},"from":{"$ref":"#/components/schemas/Participant"},"to":{"type":"array","items":{"$ref":"#/components/schemas/Participant"}},"cc":{"type":"array","items":{"$ref":"#/components/schemas/Participant"}},"body_text":{"type":"string"},"body_html_url":{"type":"string","format":"uri"},"reply_origin":{"$ref":"#/components/schemas/ReplyOrigin"},"has_attachments":{"type":"boolean"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}}}},"NativeSendingDnsRecord":{"type":"object","additionalProperties":false,"required":["id","lane_id","provider","purpose","type","name","value","priority","required","status","provider_status","first_observed_at","last_checked_at","error","provider_reference"],"properties":{"id":{"type":"string","format":"uuid"},"lane_id":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["banger","resend"]},"purpose":{"type":"string"},"type":{"type":"string","enum":["TXT","MX","CNAME"]},"name":{"type":"string"},"value":{"type":"string"},"priority":{"type":["integer","null"]},"required":{"type":"boolean"},"status":{"type":"string","enum":["pending","verified","error"]},"provider_status":{"type":"string","enum":["pending","verified","error","not_applicable"]},"first_observed_at":{"type":["string","null"],"format":"date-time"},"last_checked_at":{"type":["string","null"],"format":"date-time"},"error":{"type":"object","additionalProperties":true},"provider_reference":{"type":["string","null"]}}},"NativeSendingDomain":{"type":"object","additionalProperties":false,"required":["domain_id","product_id","root_domain","domain_status","lanes","dns_records","deletion"],"properties":{"domain_id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"root_domain":{"type":"string"},"setup_mode":{"type":"string","enum":["simple","advanced"]},"domain_status":{"type":"string","enum":["pending","verified","failed","disabled","deleting","deleted"]},"lanes":{"type":"array","minItems":1,"maxItems":3,"items":{"$ref":"#/components/schemas/NativeSendingLane"}},"dns_records":{"type":"array","items":{"$ref":"#/components/schemas/NativeSendingDnsRecord"}},"deletion":{"type":["object","null"],"additionalProperties":false,"required":["job_id","status","last_error_code","cleanup_records"],"properties":{"job_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","processing","waiting_provider","completed","failed"]},"last_error_code":{"type":["string","null"]},"cleanup_records":{"type":"array","description":"Exact DNS records the user may remove after teardown completes.","items":{"$ref":"#/components/schemas/NativeSendingDnsRecord"}}}}}},"NativeSendingLane":{"type":"object","additionalProperties":false,"required":["id","kind","display_name","from_domain","mail_from_domain","inbound_domain","route_provider","selected_provider_connection_id","inbound_provider","status","status_reason","desired_revision","observed_revision","dns_ready","provider_ready","inbound_ready","outbound_ready","banger_transport_ready","banger_mail_from_domain","provisioning_job_id","provisioning_status","dns_records"],"properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["mailbox","product","broadcast"]},"display_name":{"type":"string"},"from_domain":{"type":"string"},"mail_from_domain":{"type":["string","null"]},"inbound_domain":{"type":["string","null"]},"route_provider":{"type":"string","enum":["banger","resend"]},"selected_provider_connection_id":{"type":["string","null"],"format":"uuid"},"inbound_provider":{"type":["string","null"],"enum":["banger",null]},"status":{"type":"string","enum":["pending","active","paused","deleting","deleted"]},"status_reason":{"type":["string","null"]},"desired_revision":{"type":"integer","minimum":1},"observed_revision":{"type":"integer","minimum":0},"dns_ready":{"type":"boolean"},"provider_ready":{"type":"boolean"},"inbound_ready":{"type":"boolean"},"outbound_ready":{"type":"boolean"},"banger_transport_ready":{"type":"boolean"},"banger_mail_from_domain":{"type":["string","null"]},"provisioning_job_id":{"type":["string","null"],"format":"uuid"},"provisioning_status":{"type":"string","enum":["pending","provisioning","waiting_dns","active","failed","deleting","deleted","not_required"]},"provisioning_error_code":{"type":["string","null"]},"provisioning_next_attempt_at":{"type":["string","null"]},"provisioning_last_checked_at":{"type":["string","null"]},"provider_identity_status":{"type":["string","null"]},"provider_dkim_status":{"type":["string","null"]},"dns_records":{"type":"array","items":{"$ref":"#/components/schemas/NativeSendingDnsRecord"}}}},"OnboardingLesson":{"type":"object","required":["step","purpose","setup","boundary","example_request","result","choice","skip"],"properties":{"step":{"type":"string"},"purpose":{"type":"string"},"setup":{"type":"string"},"boundary":{"type":"string"},"example_request":{"type":"string"},"result":{"type":"string"},"choice":{"type":"string"},"skip":{"type":["string","null"]}}},"PageInfo":{"type":"object","required":["has_more"],"properties":{"next_cursor":{"type":"string"},"has_more":{"type":"boolean"}}},"Participant":{"type":"object","required":["email"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"}}},"Product":{"type":"object","required":["id","workspace_id","name","slug","kind","website_url","domains","description","context","brand","status","is_default","route_ready","setup","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"workspace_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"kind":{"type":"string","enum":["product","store","brand","newsletter","company","other"]},"website_url":{"type":["string","null"]},"domains":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"context":{"type":"object","additionalProperties":true},"brand":{"$ref":"#/components/schemas/ProductBrand"},"status":{"type":"string","enum":["active","archived"]},"is_default":{"type":"boolean"},"route_ready":{"type":"boolean"},"setup":{"type":"array","items":{"$ref":"#/components/schemas/ProductSetup"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ProductBrand":{"type":"object","properties":{"company_name":{"type":"string","maxLength":160},"logo_url":{"type":"string","maxLength":2000},"wordmark_url":{"type":"string","maxLength":2000},"website_url":{"type":"string","maxLength":2000},"primary_color":{"type":"string","maxLength":7},"accent_color":{"type":"string","maxLength":7},"background_color":{"type":"string","maxLength":7},"surface_color":{"type":"string","maxLength":7},"text_color":{"type":"string","maxLength":7},"muted_text_color":{"type":"string","maxLength":7},"heading_font_family":{"type":"string","maxLength":200},"body_font_family":{"type":"string","maxLength":200},"tone":{"type":"string","maxLength":1000},"footer_address":{"type":"string","maxLength":500},"email_style":{"type":"string","maxLength":20}}},"ProductContentSettings":{"type":"object","required":["source_locale","configured_locales","fallback_chain","timezone","glossary","manual_translation_review","version"],"properties":{"source_locale":{"type":"string"},"configured_locales":{"type":"array","items":{"type":"string"}},"fallback_chain":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"glossary":{"type":"object","additionalProperties":{"type":"string"}},"manual_translation_review":{"type":"boolean"},"version":{"type":"integer"}}},"ProductSetup":{"type":"object","required":["key","status","completion_source","note","updated_at"],"properties":{"key":{"type":"string","enum":["context","domain","mailboxes","journeys","broadcasts","compliance"]},"status":{"type":"string","enum":["todo","in_progress","complete","not_relevant"]},"completion_source":{"type":["string","null"],"enum":["system","person","agent",null]},"note":{"type":"string"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"ProductWebhook":{"type":"object","required":["id","kind","source_key","name","status","event_types","delivered_count","failed_count","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["outbound","inbound"]},"source_key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,62}$"},"name":{"type":"string"},"endpoint_url":{"type":["string","null"],"format":"uri"},"status":{"type":"string","enum":["active","disabled","error"]},"event_types":{"type":"array","items":{"type":"string"}},"connection_id":{"type":["string","null"],"format":"uuid"},"delivered_count":{"type":"integer","minimum":0},"failed_count":{"type":"integer","minimum":0},"last_delivered_at":{"type":["string","null"],"format":"date-time"},"last_received_at":{"type":["string","null"],"format":"date-time"},"last_error_code":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ProductWebhookDelivery":{"type":"object","required":["id","event_type","status","attempt_count","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","delivering","delivered","failed"]},"attempt_count":{"type":"integer","minimum":0},"http_status":{"type":["integer","null"],"minimum":100,"maximum":599},"last_error_code":{"type":["string","null"]},"delivered_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}}},"ProviderConnection":{"type":"object","required":["id","kind","ownership","status","display_name","capabilities","credential_rotation_required","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string"},"ownership":{"type":"string","enum":["customer","banger"]},"status":{"type":"string","enum":["pending","active","suspended","reconnect_required","disabled"]},"display_name":{"type":"string"},"capabilities":{"type":"array","items":{"type":"string"}},"active_credential_version":{"type":["integer","null"]},"credential_rotation_required":{"type":"boolean"},"last_validated_at":{"type":["string","null"],"format":"date-time"},"last_error_code":{"type":["string","null"]},"disabled_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"verified_domains":{"type":"array","items":{"type":"string"}}}},"ProviderDetection":{"type":"object","required":["key","name","categories","confidence","evidence"],"properties":{"key":{"type":"string"},"name":{"type":"string"},"categories":{"type":"array","items":{"type":"string","enum":["work_mailbox","transactional","marketing","deliverability"]}},"confidence":{"type":"string","enum":["high","medium","low"]},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/DnsSignal"}}}},"RenderedEmail":{"type":"object","additionalProperties":true,"required":["subject","html","text","locale","direction"],"properties":{"subject":{"type":"string"},"preheader":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"locale":{"type":"string"},"direction":{"type":"string","enum":["ltr","rtl"]},"warnings":{"type":"array","items":{"type":"string"}}}},"RenderedManagedEmail":{"allOf":[{"$ref":"#/components/schemas/RenderedEmail"},{"type":"object","required":["source_revision_id","layout_revision_id"],"properties":{"source_revision_id":{"type":"string","format":"uuid"},"layout_revision_id":{"type":["string","null"],"format":"uuid"}}}]},"ReplyOrigin":{"type":"object","required":["send_intent_id","source","traffic_class","kind"],"properties":{"send_intent_id":{"type":"string","format":"uuid"},"source":{"type":"string","enum":["gateway","transactional","marketing","mailbox","agent"]},"source_id":{"type":"string","format":"uuid","nullable":true},"traffic_class":{"type":"string","enum":["transactional","marketing","mailbox"]},"kind":{"type":"string","enum":["campaign","sequence","transactional","mailbox","agent"]},"name":{"type":"string","nullable":true}}},"ResendProviderCredential":{"type":"object","additionalProperties":false,"required":["api_key"],"properties":{"api_key":{"type":"string","minLength":16,"maxLength":500,"writeOnly":true},"display_name":{"type":"string","maxLength":100}}},"ResolvedProductBrand":{"type":"object","required":["brand","sources","discovery_domain","missing","product_kind","product_id","product_domain","media","email_fonts"],"properties":{"brand":{"$ref":"#/components/schemas/ProductBrand"},"sources":{"type":"object","additionalProperties":{"type":"string","enum":["product","discovery","default"]}},"discovery_domain":{"type":["string","null"]},"missing":{"type":"array","items":{"type":"string"}},"product_kind":{"type":"string","enum":["product","store","brand","newsletter","company","other"]},"discovery_status":{"type":["string","null"]},"product_id":{"type":"string","format":"uuid"},"product_domain":{"type":["string","null"]},"reviewed_at":{"type":["string","null"],"format":"date-time"},"discovery_attempted_at":{"type":["string","null"],"format":"date-time"},"media":{"type":"object","required":["art_base_url"],"properties":{"art_base_url":{"type":"string"},"hero_image_url":{"type":"string"}}},"email_fonts":{"type":"object","required":["heading","body"],"properties":{"heading":{"$ref":"#/components/schemas/EmailFontReport"},"body":{"$ref":"#/components/schemas/EmailFontReport"}}}}},"SendIntentStatus":{"type":"object","additionalProperties":false,"required":["id","status","traffic_class","recipient_count","provider_key","provider_state","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["accepted","scheduled","queued","executing","partially_succeeded","succeeded","failed","canceled"]},"traffic_class":{"type":"string","enum":["mailbox","product","broadcast"]},"recipient_count":{"type":"integer","minimum":1},"provider_key":{"type":"string"},"provider_state":{"type":"string","enum":["pending","leased","submitted","accepted","ambiguous","reconciling","succeeded","failed","canceled"]},"provider_message_id":{"type":["string","null"]},"error_code":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"}}},"SendingDomainSummary":{"type":"object","required":["id","product_id","name","status"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string","enum":["pending","verified","failed","disabled","deleting","deleted"]}}},"SendingHealth":{"type":"object","required":["workspace","domains","mailboxes","thresholds"],"properties":{"workspace":{"type":"object","required":["state","hold"],"properties":{"state":{"type":"string","enum":["active","frozen"]},"hold":{"oneOf":[{"$ref":"#/components/schemas/SendingHold"},{"type":"null"}]}}},"domains":{"type":"array","items":{"type":"object","required":["domain_id","domain","product_id","state","hold","lanes"],"properties":{"domain_id":{"type":"string","format":"uuid"},"domain":{"type":"string"},"product_id":{"type":["string","null"],"format":"uuid"},"state":{"type":"string","enum":["active","paused"]},"hold":{"oneOf":[{"$ref":"#/components/schemas/SendingHold"},{"type":"null"}]},"lanes":{"type":"array","items":{"type":"object","required":["lane_kind","sending_stream_id","from_domain","state","probation_until","rates","hold"],"properties":{"lane_kind":{"type":"string","enum":["mailbox","product","broadcast"]},"sending_stream_id":{"type":"string","format":"uuid"},"from_domain":{"type":"string"},"state":{"type":"string","enum":["active","warning","paused"]},"probation_until":{"type":["string","null"],"format":"date-time"},"rates":{"$ref":"#/components/schemas/SendingRates"},"hold":{"oneOf":[{"$ref":"#/components/schemas/SendingHold"},{"type":"null"}]}}}}}}},"mailboxes":{"type":"array","items":{"type":"object","required":["mailbox_id","address","product_id","state","hold"],"properties":{"mailbox_id":{"type":"string","format":"uuid"},"address":{"type":"string"},"product_id":{"type":["string","null"],"format":"uuid"},"state":{"type":"string","enum":["paused"]},"hold":{"$ref":"#/components/schemas/SendingHold"}}}},"thresholds":{"type":"object","additionalProperties":true,"description":"The enforced thresholds (src/sending/reputation-policy.ts)."}}},"SendingHold":{"type":"object","required":["id","scope","state","reason","started_at","review_required","evidence","resume"],"properties":{"id":{"type":"string","format":"uuid"},"scope":{"type":"string","enum":["mailbox","lane","domain","workspace"]},"state":{"type":"string","enum":["warning","paused","frozen"]},"reason":{"type":"string","description":"bounce_rate, complaint_rate, core_lane_paused, multiple_lanes_paused, repeat_lane_pause, multiple_domains_paused, shared_organizational_root or complaint_burst."},"started_at":{"type":"string","format":"date-time"},"review_required":{"type":"boolean"},"evidence":{"type":"object","additionalProperties":true},"resume":{"type":"object","required":["self_serve","blocked_reason","resumable_at"],"properties":{"self_serve":{"type":"boolean"},"blocked_reason":{"type":["string","null"]},"resumable_at":{"type":["string","null"],"format":"date-time"}}},"top_sources":{"type":"array","items":{"type":"object","required":["signal","source","source_id","count"],"properties":{"signal":{"type":"string","enum":["hard_bounce","complaint"]},"source":{"type":"string"},"source_id":{"type":["string","null"]},"count":{"type":"integer"}}}},"top_recipient_domains":{"type":"array","items":{"type":"object","required":["signal","recipient_domain","count"],"properties":{"signal":{"type":"string","enum":["hard_bounce","complaint"]},"recipient_domain":{"type":"string"},"count":{"type":"integer"}}}}}},"SendingRates":{"type":"object","required":["window_hours","volume","hard_bounced","complained","bounce_rate","complaint_rate","small_sender"],"properties":{"window_hours":{"type":"integer"},"volume":{"type":"integer","description":"Sends in the window (the larger of sent and delivered plus hard bounced)."},"hard_bounced":{"type":"integer"},"complained":{"type":"integer"},"bounce_rate":{"type":"number"},"complaint_rate":{"type":"number"},"small_sender":{"type":"boolean","description":"Fewer than the minimum volume; absolute counts apply."}}},"SetupConnectionRecommendation":{"type":"object","additionalProperties":false,"required":["key","name","category","priority","reason","source","setup_mode","available","evidence"],"properties":{"key":{"type":"string"},"name":{"type":"string"},"category":{"type":"string","enum":["email","customer","product","work","data"]},"priority":{"type":"string","enum":["required","recommended"]},"reason":{"type":"string"},"source":{"type":"string","enum":["dns","business_context","opportunity_plan","banger_recommendation"]},"setup_mode":{"type":"string","enum":["oauth","secure_credentials"]},"available":{"type":"boolean"},"provider_key":{"type":"string"},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/DnsSignal"}}}},"SignupForm":{"type":"object","required":["id","product_id","public_id","name","kind","list_id","list_name","mailbox_id","double_opt_in","config","status","views","submissions","confirmations","subscribers","version","created_at","updated_at","hosted_url","embed_code","embed_slot","open_button","conversion_rate"],"properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"string","format":"uuid"},"public_id":{"type":"string","pattern":"^f_[a-z0-9]{16}$"},"name":{"type":"string"},"kind":{"type":"string","enum":["inline","popup","bar","slide_in","page"]},"list_id":{"type":"string","format":"uuid"},"list_name":{"type":"string"},"mailbox_id":{"type":["string","null"],"format":"uuid"},"double_opt_in":{"type":"boolean"},"config":{"$ref":"#/components/schemas/SignupFormConfig"},"status":{"type":"string","enum":["active","paused","archived"]},"views":{"type":"integer"},"submissions":{"type":"integer"},"confirmations":{"type":"integer"},"subscribers":{"type":"integer"},"version":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"hosted_url":{"type":"string"},"embed_code":{"type":"string"},"embed_slot":{"type":"string"},"open_button":{"type":"string"},"conversion_rate":{"type":"number"}}},"SignupFormConfig":{"type":"object","properties":{"eyebrow":{"type":"string","maxLength":60},"headline":{"type":"string","maxLength":140,"minLength":1},"body":{"type":"string","maxLength":400},"button_label":{"type":"string","maxLength":40,"minLength":1},"email_placeholder":{"type":"string","maxLength":80},"name_placeholder":{"type":"string","maxLength":60},"fine_print":{"type":"string","maxLength":160},"incentive":{"type":"string","maxLength":160},"success_headline":{"type":"string","maxLength":120},"success_body":{"type":"string","maxLength":400},"redirect_url":{"type":"string","maxLength":2000,"pattern":"^(|https://[^\\s\"'<>]+)$"},"image_url":{"type":"string","maxLength":2000,"pattern":"^(|https://[^\\s\"'<>]+)$"},"art":{"type":"string","enum":["arcs","blocks","horizon","confetti","frame","bands","dots"]},"style":{"type":"string","enum":["","brand","material","clarity","editorial","bold","luxe","playful","plain"]},"count_noun":{"type":"string","maxLength":30},"confirm_promise":{"type":"string","maxLength":200},"locale":{"type":"string"},"collect_name":{"type":"boolean"},"show_logo":{"type":"boolean"},"show_count":{"type":"boolean"},"exit_intent":{"type":"boolean"},"delay_seconds":{"type":"integer","minimum":0,"maximum":600},"scroll_percent":{"type":"integer","minimum":0,"maximum":100},"frequency_days":{"type":"integer","minimum":0,"maximum":365},"image":{"type":"string","enum":["none","photo","art"]},"layout":{"type":"string","enum":["stacked","split"]},"theme":{"type":"string","enum":["light","dark","brand","auto"]},"position":{"type":"string","enum":["bottom","top","right","left"]},"fields":{"type":"array","items":{"type":"object","required":["label"],"properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","maxLength":80,"minLength":1},"type":{"type":"string","enum":["text","select","checkbox"],"default":"text"},"required":{"type":"boolean","default":false},"placeholder":{"type":"string","maxLength":80},"options":{"type":"array","items":{"type":"string","maxLength":80,"minLength":1},"minItems":1,"maxItems":20,"uniqueItems":true}},"additionalProperties":false,"description":"Select questions require options. Other question types do not accept options. Keys must be unique and cannot use reserved form fields; omitted keys are derived from labels."},"maxItems":6}},"additionalProperties":false},"StarterMailboxProof":{"type":"object","required":["proof_id","mailbox_id","mailbox_address","command_id","phase","send_complete","receive_complete","round_trip_check_complete","agent_check_complete","complete","expected_subject","expected_body_text","replayed"],"properties":{"proof_id":{"type":"string","format":"uuid"},"mailbox_id":{"type":"string","format":"uuid"},"mailbox_address":{"type":"string","format":"email"},"command_id":{"type":"string","format":"uuid"},"phase":{"type":"string","enum":["sending","sent","received","checked","failed"]},"send_complete":{"type":"boolean"},"receive_complete":{"type":"boolean"},"round_trip_check_complete":{"type":"boolean"},"agent_check_complete":{"type":"boolean"},"complete":{"type":"boolean"},"expected_subject":{"type":"string"},"expected_body_text":{"type":"string"},"received_message_id":{"type":"string","format":"uuid"},"received_thread_id":{"type":"string","format":"uuid"},"received_subject":{"type":"string"},"received_body_text":{"type":"string"},"received_at":{"type":"string","format":"date-time"},"agent_label":{"type":"string"},"agent_suggested_action":{"type":"string"},"error_code":{"type":"string"},"replayed":{"type":"boolean"}}},"Suppression":{"type":"object","required":["email_hash","reason","source_id","created_at"],"properties":{"email_hash":{"type":"string"},"reason":{"type":"string","enum":["unsubscribe","hard_bounce","complaint","manual"]},"source_id":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}}},"TemplateSlot":{"type":"object","required":["key"],"properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9_$.-]{1,200}$"},"label":{"type":"string","maxLength":120},"type":{"type":"string","enum":["text","paragraph","url","image"]},"help":{"type":"string","maxLength":300}}},"ThreadDetail":{"allOf":[{"$ref":"#/components/schemas/ThreadSummary"},{"type":"object","required":["messages"],"properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}}}}]},"ThreadPageResponse":{"type":"object","required":["data","page"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ThreadSummary"}},"page":{"$ref":"#/components/schemas/PageInfo"}}},"ThreadSummary":{"type":"object","required":["id","mailbox_id","subject","snippet","last_message_at","message_count","unread_count","is_archived","is_trash","is_spam","is_starred","is_sent","has_attachments","labels"],"properties":{"id":{"type":"string","format":"uuid"},"mailbox_id":{"type":"string","format":"uuid"},"subject":{"type":"string"},"snippet":{"type":"string"},"last_message_at":{"type":"string","format":"date-time"},"message_count":{"type":"integer"},"unread_count":{"type":"integer"},"is_archived":{"type":"boolean"},"is_trash":{"type":"boolean"},"is_spam":{"type":"boolean"},"is_starred":{"type":"boolean"},"is_sent":{"type":"boolean"},"has_attachments":{"type":"boolean"},"labels":{"type":"array","items":{"type":"string"}},"participants":{"type":"array","items":{"$ref":"#/components/schemas/Participant"}}}},"TransactionalSend":{"type":"object","required":["id","mailbox_id","command_id","status","command_status","recipient_count","created_at","updated_at","completed_at"],"properties":{"id":{"type":"string","format":"uuid"},"mailbox_id":{"type":["string","null"],"format":"uuid"},"command_id":{"type":["string","null"],"format":"uuid"},"status":{"type":"string"},"command_status":{"type":["string","null"]},"subject":{"type":"string"},"recipients":{"type":"array","items":{"type":"object","required":["email"],"properties":{"email":{"type":"string"},"name":{"type":"string"}}}},"recipient_count":{"type":"integer"},"error_code":{"type":["string","null"]},"send_intent_id":{"type":"string","format":"uuid"},"provider":{"type":["string","null"]},"route_kind":{"type":["string","null"]},"source":{"type":"string"},"from_address":{"type":"string"},"recipient_states":{"type":"object","additionalProperties":{"type":"integer"}},"provider_message_id":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"template_id":{"type":["string","null"],"format":"uuid"},"template_version":{"type":["integer","null"]},"workspace_revision":{"type":["integer","null"]},"command_result":{"type":"object","additionalProperties":true},"command_started_at":{"type":["string","null"],"format":"date-time"},"command_completed_at":{"type":["string","null"],"format":"date-time"},"body_text":{"type":"string"},"body_html":{"type":"string"},"reply_to":{"type":"array","items":{"type":"object","required":["email"],"properties":{"email":{"type":"string"},"name":{"type":"string"}}}},"headers":{"type":"object","additionalProperties":{"type":"string"}},"tags":{"type":"array","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}}}},"TransactionalSendReceipt":{"type":"object","required":["action_kind","id","send_intent_id","provider_attempt_id","status","replayed"],"properties":{"action_kind":{"type":"string","enum":["transactional.send"]},"id":{"type":"string","format":"uuid"},"send_intent_id":{"type":"string","format":"uuid"},"provider_attempt_id":{"type":"string","format":"uuid"},"status":{"type":"string"},"replayed":{"type":"boolean"}}},"TransactionalSendTimelineEvent":{"type":"object","required":["occurred_at","event_type","label"],"properties":{"occurred_at":{"type":"string","format":"date-time"},"event_type":{"type":"string"},"label":{"type":"string"},"provider":{"type":["string","null"]},"recipient_domain":{"type":["string","null"]},"error_code":{"type":["string","null"]}}},"TriageExactConditions":{"type":"object","additionalProperties":false,"properties":{"from":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":320}},"to":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":320}},"subject_contains":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":320}},"has_words":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":320}},"excludes_words":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":320}},"has_attachment":{"type":"boolean"}}},"TriageRule":{"type":"object","required":["id","mailbox_id","name","auto_set_for_label_id","description","exact_conditions","has_label_ids","actions","enabled","version","error_code","example_count","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"mailbox_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"auto_set_for_label_id":{"type":["string","null"],"format":"uuid"},"description":{"type":["string","null"]},"exact_conditions":{"$ref":"#/components/schemas/TriageExactConditions"},"has_label_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"actions":{"type":"array","items":{"$ref":"#/components/schemas/TriageRuleAction"}},"enabled":{"type":"boolean"},"version":{"type":"integer"},"error_code":{"type":["string","null"]},"example_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"TriageRuleAction":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["apply_label","archive","mark_read","star"]},"label_id":{"type":"string","format":"uuid"}}},"TriageRuleInput":{"type":"object","properties":{"name":{"type":"string","maxLength":120},"description":{"type":["string","null"],"maxLength":2000},"exact_conditions":{"$ref":"#/components/schemas/TriageExactConditions"},"has_label_ids":{"type":"array","maxItems":50,"items":{"type":"string","format":"uuid"}},"actions":{"type":"array","minItems":1,"maxItems":8,"items":{"$ref":"#/components/schemas/TriageRuleAction"}},"enabled":{"type":"boolean"}}},"WorkItem":{"type":"object","required":["id","thread","status","priority","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"thread":{"$ref":"#/components/schemas/ThreadSummary"},"status":{"type":"string","enum":["open","waiting","done"]},"priority":{"type":"integer"},"assignee_identity_id":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"WorkspaceApiKey":{"type":"object","required":["id","name","prefix","scopes","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyScope"}},"expires_at":{"type":"string","format":"date-time"},"last_used_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"}}},"WorkspaceChange":{"type":"object","required":["revision","topics","created_at"],"properties":{"revision":{"type":"integer","format":"int64"},"topics":{"type":"array","items":{"type":"string","enum":["mailboxes","threads","messages","work","drafts","contacts","campaigns","deliverability"]}},"mailbox_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"created_at":{"type":"string","format":"date-time"}}},"WorkspaceDeletionReceipt":{"type":"object","additionalProperties":false,"required":["id","name","deleted","storage_cleanup"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"deleted":{"type":"boolean","const":true},"storage_cleanup":{"type":"string","const":"queued"},"next_workspace_id":{"type":"string","format":"uuid"}}},"WorkspaceDirectory":{"type":"object","required":["actorId","identities","pendingInvitations"],"properties":{"actorId":{"type":"string"},"identities":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceIdentity"}},"pendingInvitations":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceInvitation"}}}},"WorkspaceDomainDiscovery":{"type":"object","required":["domain","scan_status","company","dns_signals","dns_provider","provider_detections","capability_summary","recommended_connections","connection_plan","limitations","scanned_at","confirmed_at"],"properties":{"domain":{"type":"string"},"scan_status":{"type":"string","enum":["complete","partial","failed"]},"company":{"$ref":"#/components/schemas/CompanyContextDiscovery"},"dns_signals":{"type":"array","items":{"$ref":"#/components/schemas/DnsSignal"}},"dns_provider":{"oneOf":[{"$ref":"#/components/schemas/DnsProviderDetection"},{"type":"null"}]},"provider_detections":{"type":"array","items":{"$ref":"#/components/schemas/ProviderDetection"}},"capability_summary":{"type":"array","items":{"$ref":"#/components/schemas/DiscoveryCapability"}},"recommended_connections":{"type":"array","items":{"$ref":"#/components/schemas/SetupConnectionRecommendation"}},"connection_plan":{"type":"array","items":{"$ref":"#/components/schemas/DiscoveryConnectionPlanItem"}},"limitations":{"type":"array","items":{"type":"string"}},"scanned_at":{"type":"string","format":"date-time"},"confirmed_at":{"type":["string","null"],"format":"date-time"}}},"WorkspaceIdentity":{"type":"object","required":["id","userId","kind","role","status"],"properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string"},"email":{"type":"string","format":"email"},"displayName":{"type":"string"},"kind":{"type":"string","const":"user"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"status":{"type":"string","enum":["active","suspended"]}}},"WorkspaceInvitation":{"type":"object","required":["id","code","workspaceId","workspaceName","role","status","expiresAt"],"properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","format":"uuid"},"inviteCode":{"type":"string","format":"uuid"},"invitedEmail":{"type":"string","format":"email"},"workspaceId":{"type":"string","format":"uuid"},"workspaceName":{"type":"string"},"role":{"type":"string","enum":["admin","member","viewer"]},"accessScope":{"type":"string","const":"workspace"},"status":{"type":"string","enum":["pending","accepted"]},"expiresAt":{"type":"string","format":"date-time"},"notificationSent":{"type":"boolean"}}},"WorkspaceSummary":{"type":"object","required":["id","name","shard","role","revision"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"shard":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"revision":{"type":"integer","format":"int64"}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT or bgr_ workspace API key"}}}}