{"openapi":"3.0.3","info":{"title":"Wraps Platform API","description":"REST API for the Wraps email marketing platform. Send emails, manage contacts, trigger workflows, and process events.\n\n**Errors.** Every 4xx and 5xx response returns the `ApiError` object: branch on the stable `code`, show `error` to a person, quote `requestId` to support. The full list of codes is enumerated on the schema.\n\n**Rate limits.** Limited responses carry `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset` (seconds, not a timestamp) and `RateLimit-Policy`, plus `Retry-After` on a 429. See https://wraps.dev/docs/reference/rate-limits\n\n**Versioning.** Breaking changes ship as a new version; deprecations are announced with `Deprecation` and `Sunset` headers and a 6-month minimum notice. Policy: https://wraps.dev/docs/reference/versioning","version":"1.0.0","contact":{"name":"Wraps Support","url":"https://wraps.dev","email":"support@wraps.dev"},"license":{"name":"Proprietary","url":"https://wraps.dev/terms"},"termsOfService":"https://wraps.dev/terms"},"externalDocs":{"description":"Wraps documentation","url":"https://wraps.dev/docs"},"servers":[{"url":"https://api.wraps.dev","description":"Production API"}],"tags":[{"name":"brand-kits","description":"Brand kit CRUD and the organization's default brand kit"},{"name":"health","description":"Health check and API info endpoints"},{"name":"contacts","description":"Contact management - create, update, delete, and list contacts"},{"name":"batch","description":"Batch email sending operations for broadcasts"},{"name":"events","description":"Custom event ingestion for triggering workflows"},{"name":"workflows","description":"API-triggered workflow execution endpoints"},{"name":"connections","description":"AWS account connection management"},{"name":"domains","description":"Sending identity (domain) verification state, read live from SES"},{"name":"templates","description":"Email template CRUD, publish to SES, and CLI sync"},{"name":"segments","description":"Audience segment CRUD and condition preview. Requires a Pro plan or higher."},{"name":"api-keys","description":"API key list, create and revoke. Session-only: an API key cannot call these routes."},{"name":"topics","description":"Subscription topic CRUD and subscriber lists. Requires a Pro plan or higher."},{"name":"email-logs","description":"Email delivery log inspection"},{"name":"audit-logs","description":"Read and export the organization's audit log. Owners and admins only; export requires the Business plan."},{"name":"Inbound","description":"Inbound email reads from the customer's S3 inbound bucket. Read-only; nothing is stored in Wraps."},{"name":"suppressions","description":"SES account-level suppression list. Listing reads the org's AWS accounts; removing an address requires confirm=true."},{"name":"webhooks","description":"Webhook endpoints for receiving SES events"},{"name":"unsubscribe","description":"RFC 8058 compliant email unsubscribe endpoints"},{"name":"tools","description":"Free email deliverability tools (no auth required)"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key (wraps_*) or session token. Use format: Bearer wraps_your_api_key"}},"schemas":{"ApiError":{"type":"object","required":["error","code"],"description":"Returned by every 4xx and 5xx response. Branch on `code`, show `error`, quote `requestId` to support.","properties":{"error":{"type":"string","description":"Human-readable message. Wording may change; do not parse it.","examples":["AWS account does not belong to this organization"]},"code":{"type":"string","description":"Stable machine-readable code. Safe to branch on across releases.","enum":["BAD_REQUEST","CONFLICT","FORBIDDEN","INTERNAL_ERROR","MALFORMED_REQUEST","NOT_FOUND","PAYLOAD_TOO_LARGE","PAYMENT_REQUIRED","RATE_LIMITED","REQUEST_FAILED","UNAUTHORIZED","VALIDATION_FAILED"],"examples":["FORBIDDEN"]},"requestId":{"type":"string","description":"Correlates with the `x-request-id` response header and with server logs."}}}},"responses":{"BadRequest":{"description":"Malformed request — unparseable body or an invalid parameter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"Unauthorized":{"description":"Missing, malformed, or revoked credentials. Send `Authorization: Bearer <api key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"Forbidden":{"description":"Authenticated, but the resource belongs to another organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"NotFound":{"description":"No such route, or no such resource in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"ValidationFailed":{"description":"The request parsed but failed schema validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"RateLimited":{"description":"Rate limit exceeded. Wait for the window named by the RateLimit headers.","headers":{"RateLimit-Limit":{"description":"Requests permitted in the window closest to exhaustion.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests still available in that window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until that window resets.","schema":{"type":"integer"}},"RateLimit-Policy":{"description":"Every policy in force, as \"<limit>;w=<window seconds>\", comma-separated.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"InternalError":{"description":"Unexpected server failure. Safe to retry with backoff; quote `requestId` if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"security":[{"bearerAuth":[]}],"paths":{"/health":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"description":"Health status","examples":["ok"],"type":"string"},"timestamp":{"description":"ISO 8601 timestamp","format":"date-time","type":"string"},"version":{"description":"API version","examples":["1.0.0"],"type":"string"}},"required":["status","timestamp","version"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"status":{"description":"Health status","examples":["ok"],"type":"string"},"timestamp":{"description":"ISO 8601 timestamp","format":"date-time","type":"string"},"version":{"description":"API version","examples":["1.0.0"],"type":"string"}},"required":["status","timestamp","version"]}},"text/plain":{"schema":{"type":"object","properties":{"status":{"description":"Health status","examples":["ok"],"type":"string"},"timestamp":{"description":"ISO 8601 timestamp","format":"date-time","type":"string"},"version":{"description":"API version","examples":["1.0.0"],"type":"string"}},"required":["status","timestamp","version"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getHealth","tags":["health"],"summary":"Health check","description":"Returns the health status of the API"}},"/":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"API name","type":"string"},"version":{"description":"API version","type":"string"},"docs":{"description":"Documentation URL","type":"string"}},"required":["name","version","docs"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"description":"API name","type":"string"},"version":{"description":"API version","type":"string"},"docs":{"description":"Documentation URL","type":"string"}},"required":["name","version","docs"]}},"text/plain":{"schema":{"type":"object","properties":{"name":{"description":"API name","type":"string"},"version":{"description":"API version","type":"string"},"docs":{"description":"Documentation URL","type":"string"}},"required":["name","version","docs"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getIndex","tags":["health"],"summary":"API info","description":"Returns basic API information"}},"/v1/account/console-policy/{awsAccountId}/recheck":{"post":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"awsAccountId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"anyOf":[{"type":"number"},{"type":"null"}]},"currentVersion":{"type":"number"},"upToDate":{"type":"boolean"},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"rechecked":{"type":"boolean"}},"required":["version","currentVersion","upToDate","checkedAt","rechecked"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"version":{"anyOf":[{"type":"number"},{"type":"null"}]},"currentVersion":{"type":"number"},"upToDate":{"type":"boolean"},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"rechecked":{"type":"boolean"}},"required":["version","currentVersion","upToDate","checkedAt","rechecked"]}},"text/plain":{"schema":{"type":"object","properties":{"version":{"anyOf":[{"type":"number"},{"type":"null"}]},"currentVersion":{"type":"number"},"upToDate":{"type":"boolean"},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"rechecked":{"type":"boolean"}},"required":["version","currentVersion","upToDate","checkedAt","rechecked"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1AccountConsole-policyByAwsAccountIdRecheck","tags":["account"],"summary":"Re-probe one account's console-access policy version","description":"Assumes the account's wraps-console-access-role and probes which version of the Wraps console policy it carries, then persists the reading. Exists so a customer who has just repaired their role sees it reflected immediately rather than waiting for the hourly sweep, which does not re-probe an account it checked within the last day. Rate limited to one probe per account per minute; inside that window, or when SES throttles the probe, the stored reading is returned with `rechecked: false`."}},"/v1/account/health":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"anyOf":[{"const":"healthy","type":"string"},{"const":"at_risk","type":"string"},{"const":"in_danger","type":"string"},{"const":"unknown","type":"string"}]},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"accounts":{"type":"array","items":{"type":"object","required":["id","accountNumber","region","status","checkedAt","sandbox","productionAccessEnabled","sendingEnabled","enforcementStatus","quota","reputation","thresholds","reasons"],"properties":{"id":{"type":"string"},"accountNumber":{"type":"string"},"region":{"type":"string"},"status":{"anyOf":[{"const":"healthy","type":"string"},{"const":"at_risk","type":"string"},{"const":"in_danger","type":"string"},{"const":"unknown","type":"string"}]},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sandbox":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"productionAccessEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"sendingEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"enforcementStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"quota":{"type":"object","required":["max24Hour","sentLast24Hours","usedRatio","maxSendRate"],"properties":{"max24Hour":{"anyOf":[{"type":"number"},{"type":"null"}]},"sentLast24Hours":{"anyOf":[{"type":"number"},{"type":"null"}]},"usedRatio":{"anyOf":[{"type":"number"},{"type":"null"}]},"maxSendRate":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"reputation":{"type":"object","required":["bounceRate","complaintRate"],"properties":{"bounceRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"complaintRate":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"thresholds":{"type":"object","required":["bounceReview","bouncePause","complaintReview","complaintPause","quotaWarn"],"properties":{"bounceReview":{"type":"number"},"bouncePause":{"type":"number"},"complaintReview":{"type":"number"},"complaintPause":{"type":"number"},"quotaWarn":{"type":"number"}}},"reasons":{"type":"array","items":{"type":"string"}}}}}},"required":["status","checkedAt","accounts"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"status":{"anyOf":[{"const":"healthy","type":"string"},{"const":"at_risk","type":"string"},{"const":"in_danger","type":"string"},{"const":"unknown","type":"string"}]},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"accounts":{"type":"array","items":{"type":"object","required":["id","accountNumber","region","status","checkedAt","sandbox","productionAccessEnabled","sendingEnabled","enforcementStatus","quota","reputation","thresholds","reasons"],"properties":{"id":{"type":"string"},"accountNumber":{"type":"string"},"region":{"type":"string"},"status":{"anyOf":[{"const":"healthy","type":"string"},{"const":"at_risk","type":"string"},{"const":"in_danger","type":"string"},{"const":"unknown","type":"string"}]},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sandbox":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"productionAccessEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"sendingEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"enforcementStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"quota":{"type":"object","required":["max24Hour","sentLast24Hours","usedRatio","maxSendRate"],"properties":{"max24Hour":{"anyOf":[{"type":"number"},{"type":"null"}]},"sentLast24Hours":{"anyOf":[{"type":"number"},{"type":"null"}]},"usedRatio":{"anyOf":[{"type":"number"},{"type":"null"}]},"maxSendRate":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"reputation":{"type":"object","required":["bounceRate","complaintRate"],"properties":{"bounceRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"complaintRate":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"thresholds":{"type":"object","required":["bounceReview","bouncePause","complaintReview","complaintPause","quotaWarn"],"properties":{"bounceReview":{"type":"number"},"bouncePause":{"type":"number"},"complaintReview":{"type":"number"},"complaintPause":{"type":"number"},"quotaWarn":{"type":"number"}}},"reasons":{"type":"array","items":{"type":"string"}}}}}},"required":["status","checkedAt","accounts"]}},"text/plain":{"schema":{"type":"object","properties":{"status":{"anyOf":[{"const":"healthy","type":"string"},{"const":"at_risk","type":"string"},{"const":"in_danger","type":"string"},{"const":"unknown","type":"string"}]},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"accounts":{"type":"array","items":{"type":"object","required":["id","accountNumber","region","status","checkedAt","sandbox","productionAccessEnabled","sendingEnabled","enforcementStatus","quota","reputation","thresholds","reasons"],"properties":{"id":{"type":"string"},"accountNumber":{"type":"string"},"region":{"type":"string"},"status":{"anyOf":[{"const":"healthy","type":"string"},{"const":"at_risk","type":"string"},{"const":"in_danger","type":"string"},{"const":"unknown","type":"string"}]},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sandbox":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"productionAccessEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"sendingEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"enforcementStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"quota":{"type":"object","required":["max24Hour","sentLast24Hours","usedRatio","maxSendRate"],"properties":{"max24Hour":{"anyOf":[{"type":"number"},{"type":"null"}]},"sentLast24Hours":{"anyOf":[{"type":"number"},{"type":"null"}]},"usedRatio":{"anyOf":[{"type":"number"},{"type":"null"}]},"maxSendRate":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"reputation":{"type":"object","required":["bounceRate","complaintRate"],"properties":{"bounceRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"complaintRate":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"thresholds":{"type":"object","required":["bounceReview","bouncePause","complaintReview","complaintPause","quotaWarn"],"properties":{"bounceReview":{"type":"number"},"bouncePause":{"type":"number"},"complaintReview":{"type":"number"},"complaintPause":{"type":"number"},"quotaWarn":{"type":"number"}}},"reasons":{"type":"array","items":{"type":"string"}}}}}},"required":["status","checkedAt","accounts"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1AccountHealth","tags":["account"],"summary":"Org-wide SES health rollup","description":"Returns the SES health verdict the hourly account-health sweep last persisted for every AWS account connected to this organization, plus the org-wide rollup (worst status wins; `unknown` outranks `healthy`). Zero AWS calls — this is Postgres-only, bounded by the freshness of the last hourly sweep (`checkedAt`)."}},"/v1/account/health/{awsAccountId}":{"get":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"awsAccountId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"accountNumber":{"type":"string"},"region":{"type":"string"},"status":{"anyOf":[{"const":"healthy","type":"string"},{"const":"at_risk","type":"string"},{"const":"in_danger","type":"string"},{"const":"unknown","type":"string"}]},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sandbox":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"productionAccessEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"sendingEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"enforcementStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"quota":{"type":"object","required":["max24Hour","sentLast24Hours","usedRatio","maxSendRate"],"properties":{"max24Hour":{"anyOf":[{"type":"number"},{"type":"null"}]},"sentLast24Hours":{"anyOf":[{"type":"number"},{"type":"null"}]},"usedRatio":{"anyOf":[{"type":"number"},{"type":"null"}]},"maxSendRate":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"reputation":{"type":"object","required":["bounceRate","complaintRate"],"properties":{"bounceRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"complaintRate":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"thresholds":{"type":"object","required":["bounceReview","bouncePause","complaintReview","complaintPause","quotaWarn"],"properties":{"bounceReview":{"type":"number"},"bouncePause":{"type":"number"},"complaintReview":{"type":"number"},"complaintPause":{"type":"number"},"quotaWarn":{"type":"number"}}},"reasons":{"type":"array","items":{"type":"string"}}},"required":["id","accountNumber","region","status","checkedAt","sandbox","productionAccessEnabled","sendingEnabled","enforcementStatus","quota","reputation","thresholds","reasons"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"accountNumber":{"type":"string"},"region":{"type":"string"},"status":{"anyOf":[{"const":"healthy","type":"string"},{"const":"at_risk","type":"string"},{"const":"in_danger","type":"string"},{"const":"unknown","type":"string"}]},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sandbox":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"productionAccessEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"sendingEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"enforcementStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"quota":{"type":"object","required":["max24Hour","sentLast24Hours","usedRatio","maxSendRate"],"properties":{"max24Hour":{"anyOf":[{"type":"number"},{"type":"null"}]},"sentLast24Hours":{"anyOf":[{"type":"number"},{"type":"null"}]},"usedRatio":{"anyOf":[{"type":"number"},{"type":"null"}]},"maxSendRate":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"reputation":{"type":"object","required":["bounceRate","complaintRate"],"properties":{"bounceRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"complaintRate":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"thresholds":{"type":"object","required":["bounceReview","bouncePause","complaintReview","complaintPause","quotaWarn"],"properties":{"bounceReview":{"type":"number"},"bouncePause":{"type":"number"},"complaintReview":{"type":"number"},"complaintPause":{"type":"number"},"quotaWarn":{"type":"number"}}},"reasons":{"type":"array","items":{"type":"string"}}},"required":["id","accountNumber","region","status","checkedAt","sandbox","productionAccessEnabled","sendingEnabled","enforcementStatus","quota","reputation","thresholds","reasons"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"accountNumber":{"type":"string"},"region":{"type":"string"},"status":{"anyOf":[{"const":"healthy","type":"string"},{"const":"at_risk","type":"string"},{"const":"in_danger","type":"string"},{"const":"unknown","type":"string"}]},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sandbox":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"productionAccessEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"sendingEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"enforcementStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"quota":{"type":"object","required":["max24Hour","sentLast24Hours","usedRatio","maxSendRate"],"properties":{"max24Hour":{"anyOf":[{"type":"number"},{"type":"null"}]},"sentLast24Hours":{"anyOf":[{"type":"number"},{"type":"null"}]},"usedRatio":{"anyOf":[{"type":"number"},{"type":"null"}]},"maxSendRate":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"reputation":{"type":"object","required":["bounceRate","complaintRate"],"properties":{"bounceRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"complaintRate":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"thresholds":{"type":"object","required":["bounceReview","bouncePause","complaintReview","complaintPause","quotaWarn"],"properties":{"bounceReview":{"type":"number"},"bouncePause":{"type":"number"},"complaintReview":{"type":"number"},"complaintPause":{"type":"number"},"quotaWarn":{"type":"number"}}},"reasons":{"type":"array","items":{"type":"string"}}},"required":["id","accountNumber","region","status","checkedAt","sandbox","productionAccessEnabled","sendingEnabled","enforcementStatus","quota","reputation","thresholds","reasons"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1AccountHealthByAwsAccountId","tags":["account"],"summary":"SES health for one connected AWS account","description":"Returns the persisted SES health verdict for a single AWS account connected to this organization. 404 if the account does not exist or does not belong to the authenticated organization."}},"/v1/connections/":{"post":{"parameters":[],"responses":{"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1Connections","tags":["connections"],"summary":"Register or update an AWS connection","description":"Registers or updates the AWS account connection. Returns externalId for IAM role trust policy and webhookSecret for EventBridge configuration.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["accountId","region"],"properties":{"accountId":{"description":"AWS account ID (12 digits)","type":"string"},"region":{"description":"AWS region (e.g. us-east-1)","type":"string"},"name":{"description":"Display name for the account","type":"string"},"features":{"additionalProperties":true,"description":"Service features config","type":"object","properties":{}}}}},"multipart/form-data":{"schema":{"type":"object","required":["accountId","region"],"properties":{"accountId":{"description":"AWS account ID (12 digits)","type":"string"},"region":{"description":"AWS region (e.g. us-east-1)","type":"string"},"name":{"description":"Display name for the account","type":"string"},"features":{"additionalProperties":true,"description":"Service features config","type":"object","properties":{}}}}},"text/plain":{"schema":{"type":"object","required":["accountId","region"],"properties":{"accountId":{"description":"AWS account ID (12 digits)","type":"string"},"region":{"description":"AWS region (e.g. us-east-1)","type":"string"},"name":{"description":"Display name for the account","type":"string"},"features":{"additionalProperties":true,"description":"Service features config","type":"object","properties":{}}}}}}}},"get":{"operationId":"getV1Connections","tags":["connections"],"summary":"List AWS connections","description":"Returns all AWS account connections for the authenticated organization.","responses":{"200":{},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/connections/{id}":{"delete":{"parameters":[{"description":"Connection ID","schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteV1ConnectionsById","tags":["connections"],"summary":"Disconnect an AWS account","description":"Clears the webhook secret for the connection. The account record is preserved."}},"/v1/domains/":{"get":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"query","name":"awsAccountId","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["identity","identityType","sendingEnabled","verificationStatus","awsAccountId","region"],"properties":{"identity":{"type":"string"},"identityType":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendingEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"verificationStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"type":"string"},"region":{"type":"string"}}}},"accounts":{"type":"array","items":{"type":"object","required":["id","accountId","region","reachable"],"properties":{"id":{"type":"string"},"accountId":{"type":"string"},"region":{"type":"string"},"reachable":{"type":"boolean"}}}}},"required":["data","accounts"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["identity","identityType","sendingEnabled","verificationStatus","awsAccountId","region"],"properties":{"identity":{"type":"string"},"identityType":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendingEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"verificationStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"type":"string"},"region":{"type":"string"}}}},"accounts":{"type":"array","items":{"type":"object","required":["id","accountId","region","reachable"],"properties":{"id":{"type":"string"},"accountId":{"type":"string"},"region":{"type":"string"},"reachable":{"type":"boolean"}}}}},"required":["data","accounts"]}},"text/plain":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["identity","identityType","sendingEnabled","verificationStatus","awsAccountId","region"],"properties":{"identity":{"type":"string"},"identityType":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendingEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"verificationStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"type":"string"},"region":{"type":"string"}}}},"accounts":{"type":"array","items":{"type":"object","required":["id","accountId","region","reachable"],"properties":{"id":{"type":"string"},"accountId":{"type":"string"},"region":{"type":"string"},"reachable":{"type":"boolean"}}}}},"required":["data","accounts"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1Domains","tags":["domains"],"summary":"List sending identities","description":"Lists SES sending identities (domains and email addresses) across the organization's connected AWS accounts, read live from SES. An account whose console-access role cannot be assumed is reported unreachable in `accounts` rather than failing the whole request."}},"/v1/domains/{identity}":{"get":{"parameters":[{"schema":{"type":"string","maxLength":253},"in":"path","name":"identity","required":true},{"schema":{"type":"string","maxLength":36},"in":"query","name":"awsAccountId","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"identity":{"type":"string"},"identityType":{"anyOf":[{"type":"string"},{"type":"null"}]},"verifiedForSending":{"type":"boolean"},"verificationStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"dkim":{"anyOf":[{"type":"object","required":["status","signingAttributesOrigin","tokens"],"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"signingAttributesOrigin":{"anyOf":[{"type":"string"},{"type":"null"}]},"tokens":{"type":"array","items":{"type":"string"}}}},{"type":"null"}]},"mailFromDomain":{"anyOf":[{"type":"object","required":["domain","status"],"properties":{"domain":{"type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"feedbackForwarding":{"type":"boolean"},"configurationSet":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"type":"string"},"region":{"type":"string"},"unreachableAccountIds":{"type":"array","items":{"type":"string"}}},"required":["identity","identityType","verifiedForSending","verificationStatus","dkim","mailFromDomain","feedbackForwarding","configurationSet","awsAccountId","region","unreachableAccountIds"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"identity":{"type":"string"},"identityType":{"anyOf":[{"type":"string"},{"type":"null"}]},"verifiedForSending":{"type":"boolean"},"verificationStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"dkim":{"anyOf":[{"type":"object","required":["status","signingAttributesOrigin","tokens"],"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"signingAttributesOrigin":{"anyOf":[{"type":"string"},{"type":"null"}]},"tokens":{"type":"array","items":{"type":"string"}}}},{"type":"null"}]},"mailFromDomain":{"anyOf":[{"type":"object","required":["domain","status"],"properties":{"domain":{"type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"feedbackForwarding":{"type":"boolean"},"configurationSet":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"type":"string"},"region":{"type":"string"},"unreachableAccountIds":{"type":"array","items":{"type":"string"}}},"required":["identity","identityType","verifiedForSending","verificationStatus","dkim","mailFromDomain","feedbackForwarding","configurationSet","awsAccountId","region","unreachableAccountIds"]}},"text/plain":{"schema":{"type":"object","properties":{"identity":{"type":"string"},"identityType":{"anyOf":[{"type":"string"},{"type":"null"}]},"verifiedForSending":{"type":"boolean"},"verificationStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"dkim":{"anyOf":[{"type":"object","required":["status","signingAttributesOrigin","tokens"],"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"signingAttributesOrigin":{"anyOf":[{"type":"string"},{"type":"null"}]},"tokens":{"type":"array","items":{"type":"string"}}}},{"type":"null"}]},"mailFromDomain":{"anyOf":[{"type":"object","required":["domain","status"],"properties":{"domain":{"type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"feedbackForwarding":{"type":"boolean"},"configurationSet":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"type":"string"},"region":{"type":"string"},"unreachableAccountIds":{"type":"array","items":{"type":"string"}}},"required":["identity","identityType","verifiedForSending","verificationStatus","dkim","mailFromDomain","feedbackForwarding","configurationSet","awsAccountId","region","unreachableAccountIds"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["error","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["error","message"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["error","message"]}}}}},"operationId":"getV1DomainsByIdentity","tags":["domains"],"summary":"Get sending identity detail","description":"Returns full verification and DKIM detail for one identity (domain or email address), searching the organization's connected AWS accounts and stopping at the first that has it. `unreachableAccountIds` lists accounts whose role could not be assumed while searching. Returns 503 only when every connected account is unreachable."}},"/v1/email/logs/":{"get":{"parameters":[{"schema":{"anyOf":[{"const":"sent","type":"string"},{"const":"delivered","type":"string"},{"const":"opened","type":"string"},{"const":"clicked","type":"string"},{"const":"bounced","type":"string"},{"const":"complained","type":"string"},{"const":"suppressed","type":"string"},{"const":"failed","type":"string"},{"const":"queued","type":"string"},{"const":"pending","type":"string"},{"const":"opted_out","type":"string"}]},"in":"query","name":"status","required":false},{"schema":{"type":"number","default":20,"minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false}],"operationId":"getV1EmailLogs","tags":["email-logs"],"summary":"List email delivery logs","description":"Returns paginated email delivery logs for the organization.","responses":{"200":{},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/email/logs/{messageId}":{"get":{"parameters":[{"description":"SES Message ID","schema":{"type":"string"},"in":"path","name":"messageId","required":true}],"operationId":"getV1EmailLogsByMessageId","tags":["email-logs"],"summary":"Get email log by message ID","description":"Returns full log detail for a specific SES message ID.","responses":{"200":{},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/email/inbound":{"get":{"parameters":[{"schema":{"type":"string","maxLength":128},"in":"query","name":"awsAccountId","required":false},{"schema":{"minimum":1,"maximum":100,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":100,"type":"number"}]},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":8192},"in":"query","name":"cursor","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["awsAccountId","emailId","from","to","subject","receivedAt","hasAttachments","attachmentCount","spamVerdict","virusVerdict"],"properties":{"awsAccountId":{"type":"string"},"emailId":{"type":"string"},"from":{"type":"object","required":["address","name"],"properties":{"address":{"type":"string"},"name":{"type":"string"}}},"to":{"type":"array","items":{"type":"object","required":["address","name"],"properties":{"address":{"type":"string"},"name":{"type":"string"}}}},"subject":{"type":"string"},"receivedAt":{"type":"string"},"hasAttachments":{"type":"boolean"},"attachmentCount":{"type":"number"},"spamVerdict":{"anyOf":[{"type":"string"},{"type":"null"}]},"virusVerdict":{"anyOf":[{"type":"string"},{"type":"null"}]},"envelopeRecipients":{"type":"array","items":{"type":"string"}}}}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"deniedAccountIds":{"type":"array","items":{"type":"string"}},"unreachableAccountIds":{"type":"array","items":{"type":"string"}}},"required":["data","nextCursor","deniedAccountIds","unreachableAccountIds"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["awsAccountId","emailId","from","to","subject","receivedAt","hasAttachments","attachmentCount","spamVerdict","virusVerdict"],"properties":{"awsAccountId":{"type":"string"},"emailId":{"type":"string"},"from":{"type":"object","required":["address","name"],"properties":{"address":{"type":"string"},"name":{"type":"string"}}},"to":{"type":"array","items":{"type":"object","required":["address","name"],"properties":{"address":{"type":"string"},"name":{"type":"string"}}}},"subject":{"type":"string"},"receivedAt":{"type":"string"},"hasAttachments":{"type":"boolean"},"attachmentCount":{"type":"number"},"spamVerdict":{"anyOf":[{"type":"string"},{"type":"null"}]},"virusVerdict":{"anyOf":[{"type":"string"},{"type":"null"}]},"envelopeRecipients":{"type":"array","items":{"type":"string"}}}}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"deniedAccountIds":{"type":"array","items":{"type":"string"}},"unreachableAccountIds":{"type":"array","items":{"type":"string"}}},"required":["data","nextCursor","deniedAccountIds","unreachableAccountIds"]}},"text/plain":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["awsAccountId","emailId","from","to","subject","receivedAt","hasAttachments","attachmentCount","spamVerdict","virusVerdict"],"properties":{"awsAccountId":{"type":"string"},"emailId":{"type":"string"},"from":{"type":"object","required":["address","name"],"properties":{"address":{"type":"string"},"name":{"type":"string"}}},"to":{"type":"array","items":{"type":"object","required":["address","name"],"properties":{"address":{"type":"string"},"name":{"type":"string"}}}},"subject":{"type":"string"},"receivedAt":{"type":"string"},"hasAttachments":{"type":"boolean"},"attachmentCount":{"type":"number"},"spamVerdict":{"anyOf":[{"type":"string"},{"type":"null"}]},"virusVerdict":{"anyOf":[{"type":"string"},{"type":"null"}]},"envelopeRecipients":{"type":"array","items":{"type":"string"}}}}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"deniedAccountIds":{"type":"array","items":{"type":"string"}},"unreachableAccountIds":{"type":"array","items":{"type":"string"}}},"required":["data","nextCursor","deniedAccountIds","unreachableAccountIds"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1EmailInbound","tags":["Inbound"],"summary":"List inbound emails","description":"Lists parsed inbound emails from the S3 inbound bucket in each connected AWS account. Emails are read live from the customer's account; nothing is stored in Wraps. Results come in S3 key order (by the email's storage key), not received time, so the newest email is not necessarily first. A page can span several accounts, and each entry carries its awsAccountId. limit defaults to 20 and is capped at 100. A page can hold fewer entries than limit, including none while nextCursor is set, because non-email objects are skipped. To get the next page, pass nextCursor back unchanged as cursor; it is null on the last page. Without awsAccountId every account with an inbound bucket is read; with it, only that account (404 if it is not in this org). Accounts that deny access are listed in deniedAccountIds and skipped; accounts that cannot be read are listed in unreachableAccountIds. Attachments are not downloadable through the API: the list carries only hasAttachments and attachmentCount. envelopeRecipients, when present, lists the lowercased SMTP envelope recipients SES delivered to (Bcc included); it is absent for mail received before the inbound trigger upgrade, which means unknown. Requires authentication only."}},"/v1/email/inbound/{emailId}":{"get":{"parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"in":"path","name":"emailId","required":true},{"schema":{"type":"string","maxLength":128},"in":"query","name":"awsAccountId","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"awsAccountId":{"type":"string"},"emailId":{"type":"string"},"messageId":{"type":"string"},"from":{"type":"object","required":["address","name"],"properties":{"address":{"type":"string"},"name":{"type":"string"}}},"to":{"type":"array","items":{"type":"object","required":["address","name"],"properties":{"address":{"type":"string"},"name":{"type":"string"}}}},"cc":{"type":"array","items":{"type":"object","required":["address","name"],"properties":{"address":{"type":"string"},"name":{"type":"string"}}}},"subject":{"type":"string"},"date":{"type":"string"},"html":{"anyOf":[{"type":"string"},{"type":"null"}]},"htmlTruncated":{"type":"boolean"},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"headers":{"type":"object","patternProperties":{"^(.*)$":{}}},"attachments":{"type":"array","items":{"type":"object","required":["id","filename","contentType","size","s3Key","contentDisposition","cid"],"properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"number"},"s3Key":{"type":"string"},"contentDisposition":{"anyOf":[{"type":"string"},{"type":"null"}]},"cid":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"spamVerdict":{"anyOf":[{"type":"string"},{"type":"null"}]},"virusVerdict":{"anyOf":[{"type":"string"},{"type":"null"}]},"rawS3Key":{"type":"string"},"receivedAt":{"type":"string"},"envelopeRecipients":{"type":"array","items":{"type":"string"}}},"required":["awsAccountId","emailId","messageId","from","to","cc","subject","date","html","htmlTruncated","text","headers","attachments","spamVerdict","virusVerdict","rawS3Key","receivedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"awsAccountId":{"type":"string"},"emailId":{"type":"string"},"messageId":{"type":"string"},"from":{"type":"object","required":["address","name"],"properties":{"address":{"type":"string"},"name":{"type":"string"}}},"to":{"type":"array","items":{"type":"object","required":["address","name"],"properties":{"address":{"type":"string"},"name":{"type":"string"}}}},"cc":{"type":"array","items":{"type":"object","required":["address","name"],"properties":{"address":{"type":"string"},"name":{"type":"string"}}}},"subject":{"type":"string"},"date":{"type":"string"},"html":{"anyOf":[{"type":"string"},{"type":"null"}]},"htmlTruncated":{"type":"boolean"},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"headers":{"type":"object","patternProperties":{"^(.*)$":{}}},"attachments":{"type":"array","items":{"type":"object","required":["id","filename","contentType","size","s3Key","contentDisposition","cid"],"properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"number"},"s3Key":{"type":"string"},"contentDisposition":{"anyOf":[{"type":"string"},{"type":"null"}]},"cid":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"spamVerdict":{"anyOf":[{"type":"string"},{"type":"null"}]},"virusVerdict":{"anyOf":[{"type":"string"},{"type":"null"}]},"rawS3Key":{"type":"string"},"receivedAt":{"type":"string"},"envelopeRecipients":{"type":"array","items":{"type":"string"}}},"required":["awsAccountId","emailId","messageId","from","to","cc","subject","date","html","htmlTruncated","text","headers","attachments","spamVerdict","virusVerdict","rawS3Key","receivedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"awsAccountId":{"type":"string"},"emailId":{"type":"string"},"messageId":{"type":"string"},"from":{"type":"object","required":["address","name"],"properties":{"address":{"type":"string"},"name":{"type":"string"}}},"to":{"type":"array","items":{"type":"object","required":["address","name"],"properties":{"address":{"type":"string"},"name":{"type":"string"}}}},"cc":{"type":"array","items":{"type":"object","required":["address","name"],"properties":{"address":{"type":"string"},"name":{"type":"string"}}}},"subject":{"type":"string"},"date":{"type":"string"},"html":{"anyOf":[{"type":"string"},{"type":"null"}]},"htmlTruncated":{"type":"boolean"},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"headers":{"type":"object","patternProperties":{"^(.*)$":{}}},"attachments":{"type":"array","items":{"type":"object","required":["id","filename","contentType","size","s3Key","contentDisposition","cid"],"properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"number"},"s3Key":{"type":"string"},"contentDisposition":{"anyOf":[{"type":"string"},{"type":"null"}]},"cid":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"spamVerdict":{"anyOf":[{"type":"string"},{"type":"null"}]},"virusVerdict":{"anyOf":[{"type":"string"},{"type":"null"}]},"rawS3Key":{"type":"string"},"receivedAt":{"type":"string"},"envelopeRecipients":{"type":"array","items":{"type":"string"}}},"required":["awsAccountId","emailId","messageId","from","to","cc","subject","date","html","htmlTruncated","text","headers","attachments","spamVerdict","virusVerdict","rawS3Key","receivedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1EmailInboundByEmailId","tags":["Inbound"],"summary":"Get an inbound email","description":"Returns one parsed inbound email by emailId, as listed by GET /v1/email/inbound. Without awsAccountId every account with an inbound bucket is tried in account id order and the first match is returned; with it, only that account. Returns 404 when the email is not in any account read, or when awsAccountId is not in this org. Accounts that deny access or cannot be read are skipped, so a 404 can also mean the email sits in an account this key could not read. htmlTruncated: true means the HTML body was longer than the 200 KB cap (204,800 characters, counted as JavaScript string length) when the email was received and was cut to that prefix, so html may be incomplete markup. html is null when the email had no HTML part. The response carries the message headers, text body and attachment metadata. Attachments are metadata only: each has an s3Key, but there is no endpoint that downloads attachment contents. envelopeRecipients, when present, lists the lowercased SMTP envelope recipients SES delivered to (Bcc included); it is absent for mail received before the inbound trigger upgrade, which means unknown. Requires authentication only."}},"/v1/email/metrics/":{"get":{"parameters":[{"description":"ISO 8601 date or datetime","schema":{"type":"string"},"in":"query","name":"start_date","required":false},{"description":"ISO 8601 date or datetime","schema":{"type":"string"},"in":"query","name":"end_date","required":false},{"description":"IANA timezone name, defaults to UTC","schema":{"type":"string"},"in":"query","name":"timezone","required":false},{"schema":{"anyOf":[{"const":"hourly","type":"string"},{"const":"daily","type":"string"},{"const":"weekly","type":"string"},{"const":"monthly","type":"string"}]},"in":"query","name":"granularity","required":false},{"description":"Comma-separated: period, domain, broadcast, template, source, account, region","schema":{"type":"string"},"in":"query","name":"dimensions","required":false},{"description":"Comma-separated, max 100","schema":{"type":"string"},"in":"query","name":"broadcast_id","required":false},{"description":"Comma-separated, max 100","schema":{"type":"string"},"in":"query","name":"template_id","required":false},{"description":"Comma-separated, max 100","schema":{"type":"string"},"in":"query","name":"aws_account_id","required":false},{"description":"Comma-separated, max 100","schema":{"type":"string"},"in":"query","name":"domain","required":false}],"operationId":"getV1EmailMetrics","tags":["metrics"],"summary":"Get aggregate email metrics","description":"Returns aggregate email metrics for the organization, optionally grouped by period/domain/broadcast/template/source/account/region. `opened` excludes user agents matching a known-bot list; `openedRaw` reports the same count with no bot filter applied; `clicked` is currently unfiltered (see plan 107 for this asymmetry). `costUsd` is an estimate from published AWS SES rates, not a billed amount. It covers outbound sending only (billable means non-failed sends), tiered by UTC calendar month at each account's current SES pricing plan and spread as the account's average per-email cost for that month. `null` means the cost is unknown (no recorded plan or no account). Figures for the current month can shift as month-to-date volume grows.","responses":{"200":{},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/contacts/":{"get":{"parameters":[{"description":"Page number (1-indexed)","schema":{"type":"string","maxLength":10},"in":"query","name":"page","required":false},{"description":"Number of items per page (max 100)","schema":{"type":"string","maxLength":10},"in":"query","name":"pageSize","required":false},{"description":"Filter by email status","schema":{"anyOf":[{"const":"active","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"bounced","type":"string"},{"const":"soft_bounced","type":"string"},{"const":"complained","type":"string"},{"const":"suppressed","type":"string"}]},"in":"query","name":"emailStatus","required":false},{"description":"Filter by SMS status","schema":{"anyOf":[{"const":"pending_consent","type":"string"},{"const":"opted_in","type":"string"},{"const":"opted_out","type":"string"},{"const":"invalid","type":"string"}]},"in":"query","name":"smsStatus","required":false},{"description":"Search by email or phone","schema":{"type":"string","maxLength":255},"in":"query","name":"search","required":false},{"description":"Filter by preferred channel","schema":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"in":"query","name":"preferredChannel","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"contacts":{"type":"array","items":{"type":"object","required":["id","externalId","email","phone","firstName","lastName","company","jobTitle","emailStatus","smsStatus","preferredChannel","properties","emailsSent","emailsOpened","emailsClicked","smsSent","smsClicked","createdAt","updatedAt"],"properties":{"id":{"description":"Contact ID","type":"string"},"externalId":{"description":"Caller-supplied external ID","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Email address","anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Phone number","anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"description":"First name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Last name","anyOf":[{"type":"string"},{"type":"null"}]},"company":{"description":"Company name","anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"description":"Job title","anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"description":"Email subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"smsStatus":{"description":"SMS subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"preferredChannel":{"description":"Preferred communication channel","anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"additionalProperties":true,"type":"object","properties":{}},"emailsSent":{"description":"Number of emails sent","type":"number"},"emailsOpened":{"description":"Number of emails opened","type":"number"},"emailsClicked":{"description":"Number of emails clicked","type":"number"},"smsSent":{"description":"Number of SMS sent","type":"number"},"smsClicked":{"description":"Number of SMS clicked","type":"number"},"createdAt":{"description":"Creation timestamp","format":"date-time","type":"string"},"updatedAt":{"description":"Last update timestamp","format":"date-time","type":"string"}}}},"total":{"description":"Total number of contacts matching filter","type":"number"},"page":{"description":"Current page number","type":"number"},"pageSize":{"description":"Number of items per page","type":"number"},"totalPages":{"description":"Total number of pages","type":"number"}},"required":["contacts","total","page","pageSize","totalPages"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"contacts":{"type":"array","items":{"type":"object","required":["id","externalId","email","phone","firstName","lastName","company","jobTitle","emailStatus","smsStatus","preferredChannel","properties","emailsSent","emailsOpened","emailsClicked","smsSent","smsClicked","createdAt","updatedAt"],"properties":{"id":{"description":"Contact ID","type":"string"},"externalId":{"description":"Caller-supplied external ID","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Email address","anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Phone number","anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"description":"First name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Last name","anyOf":[{"type":"string"},{"type":"null"}]},"company":{"description":"Company name","anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"description":"Job title","anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"description":"Email subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"smsStatus":{"description":"SMS subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"preferredChannel":{"description":"Preferred communication channel","anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"additionalProperties":true,"type":"object","properties":{}},"emailsSent":{"description":"Number of emails sent","type":"number"},"emailsOpened":{"description":"Number of emails opened","type":"number"},"emailsClicked":{"description":"Number of emails clicked","type":"number"},"smsSent":{"description":"Number of SMS sent","type":"number"},"smsClicked":{"description":"Number of SMS clicked","type":"number"},"createdAt":{"description":"Creation timestamp","format":"date-time","type":"string"},"updatedAt":{"description":"Last update timestamp","format":"date-time","type":"string"}}}},"total":{"description":"Total number of contacts matching filter","type":"number"},"page":{"description":"Current page number","type":"number"},"pageSize":{"description":"Number of items per page","type":"number"},"totalPages":{"description":"Total number of pages","type":"number"}},"required":["contacts","total","page","pageSize","totalPages"]}},"text/plain":{"schema":{"type":"object","properties":{"contacts":{"type":"array","items":{"type":"object","required":["id","externalId","email","phone","firstName","lastName","company","jobTitle","emailStatus","smsStatus","preferredChannel","properties","emailsSent","emailsOpened","emailsClicked","smsSent","smsClicked","createdAt","updatedAt"],"properties":{"id":{"description":"Contact ID","type":"string"},"externalId":{"description":"Caller-supplied external ID","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Email address","anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Phone number","anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"description":"First name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Last name","anyOf":[{"type":"string"},{"type":"null"}]},"company":{"description":"Company name","anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"description":"Job title","anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"description":"Email subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"smsStatus":{"description":"SMS subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"preferredChannel":{"description":"Preferred communication channel","anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"additionalProperties":true,"type":"object","properties":{}},"emailsSent":{"description":"Number of emails sent","type":"number"},"emailsOpened":{"description":"Number of emails opened","type":"number"},"emailsClicked":{"description":"Number of emails clicked","type":"number"},"smsSent":{"description":"Number of SMS sent","type":"number"},"smsClicked":{"description":"Number of SMS clicked","type":"number"},"createdAt":{"description":"Creation timestamp","format":"date-time","type":"string"},"updatedAt":{"description":"Last update timestamp","format":"date-time","type":"string"}}}},"total":{"description":"Total number of contacts matching filter","type":"number"},"page":{"description":"Current page number","type":"number"},"pageSize":{"description":"Number of items per page","type":"number"},"totalPages":{"description":"Total number of pages","type":"number"}},"required":["contacts","total","page","pageSize","totalPages"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1Contacts","tags":["contacts"],"summary":"List contacts","description":"Lists contacts with pagination and filtering"},"post":{"parameters":[],"responses":{"201":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Contact ID","type":"string"},"externalId":{"description":"Caller-supplied external ID","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Email address","anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Phone number","anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"description":"First name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Last name","anyOf":[{"type":"string"},{"type":"null"}]},"company":{"description":"Company name","anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"description":"Job title","anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"description":"Email subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"smsStatus":{"description":"SMS subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"preferredChannel":{"description":"Preferred communication channel","anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"additionalProperties":true,"type":"object","properties":{}},"emailsSent":{"description":"Number of emails sent","type":"number"},"emailsOpened":{"description":"Number of emails opened","type":"number"},"emailsClicked":{"description":"Number of emails clicked","type":"number"},"smsSent":{"description":"Number of SMS sent","type":"number"},"smsClicked":{"description":"Number of SMS clicked","type":"number"},"createdAt":{"description":"Creation timestamp","format":"date-time","type":"string"},"updatedAt":{"description":"Last update timestamp","format":"date-time","type":"string"},"pendingTopics":{"description":"Topic IDs pending confirmation","type":"array","items":{"type":"string"}}},"required":["id","externalId","email","phone","firstName","lastName","company","jobTitle","emailStatus","smsStatus","preferredChannel","properties","emailsSent","emailsOpened","emailsClicked","smsSent","smsClicked","createdAt","updatedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Contact ID","type":"string"},"externalId":{"description":"Caller-supplied external ID","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Email address","anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Phone number","anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"description":"First name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Last name","anyOf":[{"type":"string"},{"type":"null"}]},"company":{"description":"Company name","anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"description":"Job title","anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"description":"Email subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"smsStatus":{"description":"SMS subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"preferredChannel":{"description":"Preferred communication channel","anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"additionalProperties":true,"type":"object","properties":{}},"emailsSent":{"description":"Number of emails sent","type":"number"},"emailsOpened":{"description":"Number of emails opened","type":"number"},"emailsClicked":{"description":"Number of emails clicked","type":"number"},"smsSent":{"description":"Number of SMS sent","type":"number"},"smsClicked":{"description":"Number of SMS clicked","type":"number"},"createdAt":{"description":"Creation timestamp","format":"date-time","type":"string"},"updatedAt":{"description":"Last update timestamp","format":"date-time","type":"string"},"pendingTopics":{"description":"Topic IDs pending confirmation","type":"array","items":{"type":"string"}}},"required":["id","externalId","email","phone","firstName","lastName","company","jobTitle","emailStatus","smsStatus","preferredChannel","properties","emailsSent","emailsOpened","emailsClicked","smsSent","smsClicked","createdAt","updatedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Contact ID","type":"string"},"externalId":{"description":"Caller-supplied external ID","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Email address","anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Phone number","anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"description":"First name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Last name","anyOf":[{"type":"string"},{"type":"null"}]},"company":{"description":"Company name","anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"description":"Job title","anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"description":"Email subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"smsStatus":{"description":"SMS subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"preferredChannel":{"description":"Preferred communication channel","anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"additionalProperties":true,"type":"object","properties":{}},"emailsSent":{"description":"Number of emails sent","type":"number"},"emailsOpened":{"description":"Number of emails opened","type":"number"},"emailsClicked":{"description":"Number of emails clicked","type":"number"},"smsSent":{"description":"Number of SMS sent","type":"number"},"smsClicked":{"description":"Number of SMS clicked","type":"number"},"createdAt":{"description":"Creation timestamp","format":"date-time","type":"string"},"updatedAt":{"description":"Last update timestamp","format":"date-time","type":"string"},"pendingTopics":{"description":"Topic IDs pending confirmation","type":"array","items":{"type":"string"}}},"required":["id","externalId","email","phone","firstName","lastName","company","jobTitle","emailStatus","smsStatus","preferredChannel","properties","emailsSent","emailsOpened","emailsClicked","smsSent","smsClicked","createdAt","updatedAt"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1Contacts","tags":["contacts"],"summary":"Create contact","description":"Creates a new contact with optional topic subscriptions","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"description":"Caller-supplied external ID (e.g. your own user ID)","maxLength":255,"type":"string"},"email":{"description":"Email address","maxLength":255,"format":"email","type":"string"},"phone":{"description":"Phone number","maxLength":50,"type":"string"},"firstName":{"description":"First name","maxLength":100,"type":"string"},"lastName":{"description":"Last name","maxLength":100,"type":"string"},"company":{"description":"Company name","maxLength":200,"type":"string"},"jobTitle":{"description":"Job title","maxLength":200,"type":"string"},"emailStatus":{"description":"Email subscription status","anyOf":[{"const":"active","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"bounced","type":"string"},{"const":"soft_bounced","type":"string"},{"const":"complained","type":"string"},{"const":"suppressed","type":"string"}]},"smsStatus":{"description":"SMS consent status","anyOf":[{"const":"pending_consent","type":"string"},{"const":"opted_in","type":"string"},{"const":"opted_out","type":"string"},{"const":"invalid","type":"string"}]},"preferredChannel":{"description":"Preferred communication channel","anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"properties":{"additionalProperties":true,"description":"Custom properties","type":"object","properties":{}},"topicIds":{"description":"Topic IDs to subscribe","type":"array","items":{"maxLength":36,"type":"string"}},"topicSlugs":{"description":"Topic slugs to subscribe","type":"array","items":{"maxLength":100,"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"externalId":{"description":"Caller-supplied external ID (e.g. your own user ID)","maxLength":255,"type":"string"},"email":{"description":"Email address","maxLength":255,"format":"email","type":"string"},"phone":{"description":"Phone number","maxLength":50,"type":"string"},"firstName":{"description":"First name","maxLength":100,"type":"string"},"lastName":{"description":"Last name","maxLength":100,"type":"string"},"company":{"description":"Company name","maxLength":200,"type":"string"},"jobTitle":{"description":"Job title","maxLength":200,"type":"string"},"emailStatus":{"description":"Email subscription status","anyOf":[{"const":"active","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"bounced","type":"string"},{"const":"soft_bounced","type":"string"},{"const":"complained","type":"string"},{"const":"suppressed","type":"string"}]},"smsStatus":{"description":"SMS consent status","anyOf":[{"const":"pending_consent","type":"string"},{"const":"opted_in","type":"string"},{"const":"opted_out","type":"string"},{"const":"invalid","type":"string"}]},"preferredChannel":{"description":"Preferred communication channel","anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"properties":{"additionalProperties":true,"description":"Custom properties","type":"object","properties":{}},"topicIds":{"description":"Topic IDs to subscribe","type":"array","items":{"maxLength":36,"type":"string"}},"topicSlugs":{"description":"Topic slugs to subscribe","type":"array","items":{"maxLength":100,"type":"string"}}}}},"text/plain":{"schema":{"type":"object","properties":{"externalId":{"description":"Caller-supplied external ID (e.g. your own user ID)","maxLength":255,"type":"string"},"email":{"description":"Email address","maxLength":255,"format":"email","type":"string"},"phone":{"description":"Phone number","maxLength":50,"type":"string"},"firstName":{"description":"First name","maxLength":100,"type":"string"},"lastName":{"description":"Last name","maxLength":100,"type":"string"},"company":{"description":"Company name","maxLength":200,"type":"string"},"jobTitle":{"description":"Job title","maxLength":200,"type":"string"},"emailStatus":{"description":"Email subscription status","anyOf":[{"const":"active","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"bounced","type":"string"},{"const":"soft_bounced","type":"string"},{"const":"complained","type":"string"},{"const":"suppressed","type":"string"}]},"smsStatus":{"description":"SMS consent status","anyOf":[{"const":"pending_consent","type":"string"},{"const":"opted_in","type":"string"},{"const":"opted_out","type":"string"},{"const":"invalid","type":"string"}]},"preferredChannel":{"description":"Preferred communication channel","anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"properties":{"additionalProperties":true,"description":"Custom properties","type":"object","properties":{}},"topicIds":{"description":"Topic IDs to subscribe","type":"array","items":{"maxLength":36,"type":"string"}},"topicSlugs":{"description":"Topic slugs to subscribe","type":"array","items":{"maxLength":100,"type":"string"}}}}}}}},"delete":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deleted":{"description":"Number of contacts deleted","type":"number"}},"required":["success","deleted"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deleted":{"description":"Number of contacts deleted","type":"number"}},"required":["success","deleted"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deleted":{"description":"Number of contacts deleted","type":"number"}},"required":["success","deleted"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteV1Contacts","tags":["contacts"],"summary":"Bulk delete contacts","description":"Deletes multiple contacts at once (max 100)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"description":"Contact IDs to delete (max 100)","type":"array","items":{"maxLength":36,"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"description":"Contact IDs to delete (max 100)","type":"array","items":{"maxLength":36,"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"description":"Contact IDs to delete (max 100)","type":"array","items":{"maxLength":36,"type":"string"}}}}}}}}},"/v1/contacts/{id}":{"get":{"parameters":[{"description":"Contact UUID, email, or externalId","schema":{"type":"string","maxLength":255},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Contact ID","type":"string"},"externalId":{"description":"Caller-supplied external ID","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Email address","anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Phone number","anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"description":"First name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Last name","anyOf":[{"type":"string"},{"type":"null"}]},"company":{"description":"Company name","anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"description":"Job title","anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"description":"Email subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"smsStatus":{"description":"SMS subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"preferredChannel":{"description":"Preferred communication channel","anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"additionalProperties":true,"type":"object","properties":{}},"emailsSent":{"description":"Number of emails sent","type":"number"},"emailsOpened":{"description":"Number of emails opened","type":"number"},"emailsClicked":{"description":"Number of emails clicked","type":"number"},"smsSent":{"description":"Number of SMS sent","type":"number"},"smsClicked":{"description":"Number of SMS clicked","type":"number"},"createdAt":{"description":"Creation timestamp","format":"date-time","type":"string"},"updatedAt":{"description":"Last update timestamp","format":"date-time","type":"string"},"topics":{"type":"array","items":{"type":"object","required":["topicId","topicName","status","subscribedAt"],"properties":{"topicId":{"type":"string"},"topicName":{"type":"string"},"status":{"type":"string"},"subscribedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["id","externalId","email","phone","firstName","lastName","company","jobTitle","emailStatus","smsStatus","preferredChannel","properties","emailsSent","emailsOpened","emailsClicked","smsSent","smsClicked","createdAt","updatedAt","topics"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Contact ID","type":"string"},"externalId":{"description":"Caller-supplied external ID","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Email address","anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Phone number","anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"description":"First name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Last name","anyOf":[{"type":"string"},{"type":"null"}]},"company":{"description":"Company name","anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"description":"Job title","anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"description":"Email subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"smsStatus":{"description":"SMS subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"preferredChannel":{"description":"Preferred communication channel","anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"additionalProperties":true,"type":"object","properties":{}},"emailsSent":{"description":"Number of emails sent","type":"number"},"emailsOpened":{"description":"Number of emails opened","type":"number"},"emailsClicked":{"description":"Number of emails clicked","type":"number"},"smsSent":{"description":"Number of SMS sent","type":"number"},"smsClicked":{"description":"Number of SMS clicked","type":"number"},"createdAt":{"description":"Creation timestamp","format":"date-time","type":"string"},"updatedAt":{"description":"Last update timestamp","format":"date-time","type":"string"},"topics":{"type":"array","items":{"type":"object","required":["topicId","topicName","status","subscribedAt"],"properties":{"topicId":{"type":"string"},"topicName":{"type":"string"},"status":{"type":"string"},"subscribedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["id","externalId","email","phone","firstName","lastName","company","jobTitle","emailStatus","smsStatus","preferredChannel","properties","emailsSent","emailsOpened","emailsClicked","smsSent","smsClicked","createdAt","updatedAt","topics"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Contact ID","type":"string"},"externalId":{"description":"Caller-supplied external ID","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Email address","anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Phone number","anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"description":"First name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Last name","anyOf":[{"type":"string"},{"type":"null"}]},"company":{"description":"Company name","anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"description":"Job title","anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"description":"Email subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"smsStatus":{"description":"SMS subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"preferredChannel":{"description":"Preferred communication channel","anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"additionalProperties":true,"type":"object","properties":{}},"emailsSent":{"description":"Number of emails sent","type":"number"},"emailsOpened":{"description":"Number of emails opened","type":"number"},"emailsClicked":{"description":"Number of emails clicked","type":"number"},"smsSent":{"description":"Number of SMS sent","type":"number"},"smsClicked":{"description":"Number of SMS clicked","type":"number"},"createdAt":{"description":"Creation timestamp","format":"date-time","type":"string"},"updatedAt":{"description":"Last update timestamp","format":"date-time","type":"string"},"topics":{"type":"array","items":{"type":"object","required":["topicId","topicName","status","subscribedAt"],"properties":{"topicId":{"type":"string"},"topicName":{"type":"string"},"status":{"type":"string"},"subscribedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["id","externalId","email","phone","firstName","lastName","company","jobTitle","emailStatus","smsStatus","preferredChannel","properties","emailsSent","emailsOpened","emailsClicked","smsSent","smsClicked","createdAt","updatedAt","topics"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1ContactsById","tags":["contacts"],"summary":"Get contact","description":"Returns a single contact by ID with topic subscriptions"},"patch":{"parameters":[{"description":"Contact UUID, email, or externalId","schema":{"type":"string","maxLength":255},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Contact ID","type":"string"},"externalId":{"description":"Caller-supplied external ID","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Email address","anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Phone number","anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"description":"First name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Last name","anyOf":[{"type":"string"},{"type":"null"}]},"company":{"description":"Company name","anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"description":"Job title","anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"description":"Email subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"smsStatus":{"description":"SMS subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"preferredChannel":{"description":"Preferred communication channel","anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"additionalProperties":true,"type":"object","properties":{}},"emailsSent":{"description":"Number of emails sent","type":"number"},"emailsOpened":{"description":"Number of emails opened","type":"number"},"emailsClicked":{"description":"Number of emails clicked","type":"number"},"smsSent":{"description":"Number of SMS sent","type":"number"},"smsClicked":{"description":"Number of SMS clicked","type":"number"},"createdAt":{"description":"Creation timestamp","format":"date-time","type":"string"},"updatedAt":{"description":"Last update timestamp","format":"date-time","type":"string"},"pendingTopics":{"description":"Topic IDs pending confirmation","type":"array","items":{"type":"string"}}},"required":["id","externalId","email","phone","firstName","lastName","company","jobTitle","emailStatus","smsStatus","preferredChannel","properties","emailsSent","emailsOpened","emailsClicked","smsSent","smsClicked","createdAt","updatedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Contact ID","type":"string"},"externalId":{"description":"Caller-supplied external ID","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Email address","anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Phone number","anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"description":"First name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Last name","anyOf":[{"type":"string"},{"type":"null"}]},"company":{"description":"Company name","anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"description":"Job title","anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"description":"Email subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"smsStatus":{"description":"SMS subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"preferredChannel":{"description":"Preferred communication channel","anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"additionalProperties":true,"type":"object","properties":{}},"emailsSent":{"description":"Number of emails sent","type":"number"},"emailsOpened":{"description":"Number of emails opened","type":"number"},"emailsClicked":{"description":"Number of emails clicked","type":"number"},"smsSent":{"description":"Number of SMS sent","type":"number"},"smsClicked":{"description":"Number of SMS clicked","type":"number"},"createdAt":{"description":"Creation timestamp","format":"date-time","type":"string"},"updatedAt":{"description":"Last update timestamp","format":"date-time","type":"string"},"pendingTopics":{"description":"Topic IDs pending confirmation","type":"array","items":{"type":"string"}}},"required":["id","externalId","email","phone","firstName","lastName","company","jobTitle","emailStatus","smsStatus","preferredChannel","properties","emailsSent","emailsOpened","emailsClicked","smsSent","smsClicked","createdAt","updatedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Contact ID","type":"string"},"externalId":{"description":"Caller-supplied external ID","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Email address","anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Phone number","anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"description":"First name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Last name","anyOf":[{"type":"string"},{"type":"null"}]},"company":{"description":"Company name","anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"description":"Job title","anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"description":"Email subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"smsStatus":{"description":"SMS subscription status","anyOf":[{"type":"string"},{"type":"null"}]},"preferredChannel":{"description":"Preferred communication channel","anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"additionalProperties":true,"type":"object","properties":{}},"emailsSent":{"description":"Number of emails sent","type":"number"},"emailsOpened":{"description":"Number of emails opened","type":"number"},"emailsClicked":{"description":"Number of emails clicked","type":"number"},"smsSent":{"description":"Number of SMS sent","type":"number"},"smsClicked":{"description":"Number of SMS clicked","type":"number"},"createdAt":{"description":"Creation timestamp","format":"date-time","type":"string"},"updatedAt":{"description":"Last update timestamp","format":"date-time","type":"string"},"pendingTopics":{"description":"Topic IDs pending confirmation","type":"array","items":{"type":"string"}}},"required":["id","externalId","email","phone","firstName","lastName","company","jobTitle","emailStatus","smsStatus","preferredChannel","properties","emailsSent","emailsOpened","emailsClicked","smsSent","smsClicked","createdAt","updatedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchV1ContactsById","tags":["contacts"],"summary":"Update contact","description":"Updates an existing contact","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"description":"Caller-supplied external ID, unique per organization (null to clear)","anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"email":{"description":"Email address","maxLength":255,"format":"email","type":"string"},"phone":{"description":"Phone number","maxLength":50,"type":"string"},"firstName":{"description":"First name","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"lastName":{"description":"Last name","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"company":{"description":"Company name","anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}]},"jobTitle":{"description":"Job title","anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}]},"emailStatus":{"description":"Email subscription status","anyOf":[{"const":"active","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"bounced","type":"string"},{"const":"soft_bounced","type":"string"},{"const":"complained","type":"string"},{"const":"suppressed","type":"string"}]},"smsStatus":{"description":"SMS consent status","anyOf":[{"const":"pending_consent","type":"string"},{"const":"opted_in","type":"string"},{"const":"opted_out","type":"string"},{"const":"invalid","type":"string"}]},"preferredChannel":{"description":"Preferred communication channel (null to clear)","anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"},{"type":"null"}]},"properties":{"additionalProperties":true,"description":"Custom properties","type":"object","properties":{}},"topicIds":{"description":"Topic IDs to subscribe","type":"array","items":{"maxLength":36,"type":"string"}},"topicSlugs":{"description":"Topic slugs to subscribe","type":"array","items":{"maxLength":100,"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"externalId":{"description":"Caller-supplied external ID, unique per organization (null to clear)","anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"email":{"description":"Email address","maxLength":255,"format":"email","type":"string"},"phone":{"description":"Phone number","maxLength":50,"type":"string"},"firstName":{"description":"First name","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"lastName":{"description":"Last name","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"company":{"description":"Company name","anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}]},"jobTitle":{"description":"Job title","anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}]},"emailStatus":{"description":"Email subscription status","anyOf":[{"const":"active","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"bounced","type":"string"},{"const":"soft_bounced","type":"string"},{"const":"complained","type":"string"},{"const":"suppressed","type":"string"}]},"smsStatus":{"description":"SMS consent status","anyOf":[{"const":"pending_consent","type":"string"},{"const":"opted_in","type":"string"},{"const":"opted_out","type":"string"},{"const":"invalid","type":"string"}]},"preferredChannel":{"description":"Preferred communication channel (null to clear)","anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"},{"type":"null"}]},"properties":{"additionalProperties":true,"description":"Custom properties","type":"object","properties":{}},"topicIds":{"description":"Topic IDs to subscribe","type":"array","items":{"maxLength":36,"type":"string"}},"topicSlugs":{"description":"Topic slugs to subscribe","type":"array","items":{"maxLength":100,"type":"string"}}}}},"text/plain":{"schema":{"type":"object","properties":{"externalId":{"description":"Caller-supplied external ID, unique per organization (null to clear)","anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"email":{"description":"Email address","maxLength":255,"format":"email","type":"string"},"phone":{"description":"Phone number","maxLength":50,"type":"string"},"firstName":{"description":"First name","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"lastName":{"description":"Last name","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"company":{"description":"Company name","anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}]},"jobTitle":{"description":"Job title","anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}]},"emailStatus":{"description":"Email subscription status","anyOf":[{"const":"active","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"bounced","type":"string"},{"const":"soft_bounced","type":"string"},{"const":"complained","type":"string"},{"const":"suppressed","type":"string"}]},"smsStatus":{"description":"SMS consent status","anyOf":[{"const":"pending_consent","type":"string"},{"const":"opted_in","type":"string"},{"const":"opted_out","type":"string"},{"const":"invalid","type":"string"}]},"preferredChannel":{"description":"Preferred communication channel (null to clear)","anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"},{"type":"null"}]},"properties":{"additionalProperties":true,"description":"Custom properties","type":"object","properties":{}},"topicIds":{"description":"Topic IDs to subscribe","type":"array","items":{"maxLength":36,"type":"string"}},"topicSlugs":{"description":"Topic slugs to subscribe","type":"array","items":{"maxLength":100,"type":"string"}}}}}}}},"delete":{"parameters":[{"description":"Contact UUID, email, or externalId","schema":{"type":"string","maxLength":255},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteV1ContactsById","tags":["contacts"],"summary":"Delete contact","description":"Deletes a single contact"}},"/v1/contacts/export":{"get":{"parameters":[{"schema":{"type":"string","maxLength":255},"in":"query","name":"search","required":false},{"schema":{"anyOf":[{"const":"active","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"bounced","type":"string"},{"const":"soft_bounced","type":"string"},{"const":"complained","type":"string"},{"const":"suppressed","type":"string"}]},"in":"query","name":"emailStatus","required":false},{"schema":{"type":"string","maxLength":36},"in":"query","name":"topicId","required":false},{"schema":{"anyOf":[{"const":"json","type":"string"},{"const":"csv","type":"string"}]},"in":"query","name":"format","required":false}],"responses":{"200":{"anyOf":[{"type":"object","required":["contacts","total","truncated"],"properties":{"contacts":{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","email","phone","firstName","lastName","company","jobTitle","emailStatus","emailLastSoftBouncedAt","emailSoftBounceCount","smsStatus","properties","createdAt","updatedAt","topics"],"properties":{"id":{"type":"string"},"email":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"emailLastSoftBouncedAt":{"description":"ISO timestamp or null"},"emailSoftBounceCount":{"type":"number"},"smsStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"object","patternProperties":{"^(.*)$":{}}},"createdAt":{"description":"ISO timestamp"},"updatedAt":{"description":"ISO timestamp"},"topics":{"type":"array","items":{"type":"object","required":["topicId","topicName","status","subscribedAt"],"properties":{"topicId":{"type":"string"},"topicName":{"type":"string"},"status":{"type":"string"},"subscribedAt":{}}}}}}},"total":{"type":"number"},"truncated":{"type":"boolean"}}},{"description":"CSV document when format=csv","type":"string"}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["contacts","total","truncated"],"properties":{"contacts":{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","email","phone","firstName","lastName","company","jobTitle","emailStatus","emailLastSoftBouncedAt","emailSoftBounceCount","smsStatus","properties","createdAt","updatedAt","topics"],"properties":{"id":{"type":"string"},"email":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"emailLastSoftBouncedAt":{"description":"ISO timestamp or null"},"emailSoftBounceCount":{"type":"number"},"smsStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"object","patternProperties":{"^(.*)$":{}}},"createdAt":{"description":"ISO timestamp"},"updatedAt":{"description":"ISO timestamp"},"topics":{"type":"array","items":{"type":"object","required":["topicId","topicName","status","subscribedAt"],"properties":{"topicId":{"type":"string"},"topicName":{"type":"string"},"status":{"type":"string"},"subscribedAt":{}}}}}}},"total":{"type":"number"},"truncated":{"type":"boolean"}}},{"description":"CSV document when format=csv","type":"string"}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["contacts","total","truncated"],"properties":{"contacts":{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","email","phone","firstName","lastName","company","jobTitle","emailStatus","emailLastSoftBouncedAt","emailSoftBounceCount","smsStatus","properties","createdAt","updatedAt","topics"],"properties":{"id":{"type":"string"},"email":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"emailLastSoftBouncedAt":{"description":"ISO timestamp or null"},"emailSoftBounceCount":{"type":"number"},"smsStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"object","patternProperties":{"^(.*)$":{}}},"createdAt":{"description":"ISO timestamp"},"updatedAt":{"description":"ISO timestamp"},"topics":{"type":"array","items":{"type":"object","required":["topicId","topicName","status","subscribedAt"],"properties":{"topicId":{"type":"string"},"topicName":{"type":"string"},"status":{"type":"string"},"subscribedAt":{}}}}}}},"total":{"type":"number"},"truncated":{"type":"boolean"}}},{"description":"CSV document when format=csv","type":"string"}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["contacts","total","truncated"],"properties":{"contacts":{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","email","phone","firstName","lastName","company","jobTitle","emailStatus","emailLastSoftBouncedAt","emailSoftBounceCount","smsStatus","properties","createdAt","updatedAt","topics"],"properties":{"id":{"type":"string"},"email":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"emailStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"emailLastSoftBouncedAt":{"description":"ISO timestamp or null"},"emailSoftBounceCount":{"type":"number"},"smsStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"object","patternProperties":{"^(.*)$":{}}},"createdAt":{"description":"ISO timestamp"},"updatedAt":{"description":"ISO timestamp"},"topics":{"type":"array","items":{"type":"object","required":["topicId","topicName","status","subscribedAt"],"properties":{"topicId":{"type":"string"},"topicName":{"type":"string"},"status":{"type":"string"},"subscribedAt":{}}}}}}},"total":{"type":"number"},"truncated":{"type":"boolean"}}},{"description":"CSV document when format=csv","type":"string"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1ContactsExport","tags":["contacts"],"summary":"Export contacts","description":"Exports the org's contacts that match the filters, newest first, capped at 50000 rows. Filters come only from the URL query (search, emailStatus, topicId), the same values the contacts list is filtered by. format=json (default) returns { contacts, total, truncated }; format=csv returns the dashboard's CSV. Response headers x-export-total and x-export-truncated report the real match count and whether the cap cut the file short. Requires contacts:export."}},"/v1/contacts/import":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"number"},"updated":{"type":"number"},"skipped":{"type":"number"},"invalid":{"description":"Number of rows listed in errors","type":"number"},"errors":{"type":"array","items":{"type":"object","required":["row","error"],"properties":{"row":{"type":"number"},"error":{"type":"string"}}}},"duplicates":{"type":"array","items":{"type":"object","required":["row","firstRow","field","value"],"properties":{"row":{"type":"number"},"firstRow":{"type":"number"},"field":{"anyOf":[{"const":"email","type":"string"},{"const":"phone","type":"string"}]},"value":{"type":"string"}}}}},"required":["created","updated","skipped","invalid","errors","duplicates"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"created":{"type":"number"},"updated":{"type":"number"},"skipped":{"type":"number"},"invalid":{"description":"Number of rows listed in errors","type":"number"},"errors":{"type":"array","items":{"type":"object","required":["row","error"],"properties":{"row":{"type":"number"},"error":{"type":"string"}}}},"duplicates":{"type":"array","items":{"type":"object","required":["row","firstRow","field","value"],"properties":{"row":{"type":"number"},"firstRow":{"type":"number"},"field":{"anyOf":[{"const":"email","type":"string"},{"const":"phone","type":"string"}]},"value":{"type":"string"}}}}},"required":["created","updated","skipped","invalid","errors","duplicates"]}},"text/plain":{"schema":{"type":"object","properties":{"created":{"type":"number"},"updated":{"type":"number"},"skipped":{"type":"number"},"invalid":{"description":"Number of rows listed in errors","type":"number"},"errors":{"type":"array","items":{"type":"object","required":["row","error"],"properties":{"row":{"type":"number"},"error":{"type":"string"}}}},"duplicates":{"type":"array","items":{"type":"object","required":["row","firstRow","field","value"],"properties":{"row":{"type":"number"},"firstRow":{"type":"number"},"field":{"anyOf":[{"const":"email","type":"string"},{"const":"phone","type":"string"}]},"value":{"type":"string"}}}}},"required":["created","updated","skipped","invalid","errors","duplicates"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1ContactsImport","tags":["contacts"],"summary":"Import contacts","description":"Imports up to 10000 contacts in one synchronous call and returns the counts (created, updated, skipped, invalid) plus per-row errors and duplicates. Rows match existing contacts by email or phone hash; duplicateStrategy decides whether a match is skipped or updated (update fills blank fields and merges properties, never overwrites consent). Optional sesValidation runs SES Email Address Insights and drops LOW-confidence addresses. Requires contacts:import. Returns 402 when the plan's contact limit is reached.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contacts"],"properties":{"contacts":{"description":"Rows to import. At most 10000 per request.","type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"phone":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"jobTitle":{"type":"string"},"createdAt":{"description":"Any date string the row carries as its creation time","type":"string"},"smsStatus":{"description":"pending_consent | opted_in | opted_out | invalid","type":"string"},"smsConsentedAt":{"description":"Date consent was given; only used with smsStatus opted_in","type":"string"},"properties":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"topicIds":{"type":"array","items":{"maxLength":36,"type":"string"}},"duplicateStrategy":{"description":"What to do with a row that matches an existing contact. Default skip.","anyOf":[{"const":"skip","type":"string"},{"const":"update","type":"string"}]},"sesValidation":{"type":"object","required":["awsAccountId"],"properties":{"awsAccountId":{"maxLength":36,"description":"An org AWS account whose SES plan is PRO or ENTERPRISE","type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["contacts"],"properties":{"contacts":{"description":"Rows to import. At most 10000 per request.","type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"phone":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"jobTitle":{"type":"string"},"createdAt":{"description":"Any date string the row carries as its creation time","type":"string"},"smsStatus":{"description":"pending_consent | opted_in | opted_out | invalid","type":"string"},"smsConsentedAt":{"description":"Date consent was given; only used with smsStatus opted_in","type":"string"},"properties":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"topicIds":{"type":"array","items":{"maxLength":36,"type":"string"}},"duplicateStrategy":{"description":"What to do with a row that matches an existing contact. Default skip.","anyOf":[{"const":"skip","type":"string"},{"const":"update","type":"string"}]},"sesValidation":{"type":"object","required":["awsAccountId"],"properties":{"awsAccountId":{"maxLength":36,"description":"An org AWS account whose SES plan is PRO or ENTERPRISE","type":"string"}}}}}},"text/plain":{"schema":{"type":"object","required":["contacts"],"properties":{"contacts":{"description":"Rows to import. At most 10000 per request.","type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"phone":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"jobTitle":{"type":"string"},"createdAt":{"description":"Any date string the row carries as its creation time","type":"string"},"smsStatus":{"description":"pending_consent | opted_in | opted_out | invalid","type":"string"},"smsConsentedAt":{"description":"Date consent was given; only used with smsStatus opted_in","type":"string"},"properties":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"topicIds":{"type":"array","items":{"maxLength":36,"type":"string"}},"duplicateStrategy":{"description":"What to do with a row that matches an existing contact. Default skip.","anyOf":[{"const":"skip","type":"string"},{"const":"update","type":"string"}]},"sesValidation":{"type":"object","required":["awsAccountId"],"properties":{"awsAccountId":{"maxLength":36,"description":"An org AWS account whose SES plan is PRO or ENTERPRISE","type":"string"}}}}}}}}}},"/v1/contacts/validate":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"verdicts":{"description":"SES confidence verdict per syntactically valid, de-duplicated address","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"const":"LOW","type":"string"},{"const":"MEDIUM","type":"string"},{"const":"HIGH","type":"string"},{"const":"UNKNOWN","type":"string"}]}}},"validatedCount":{"type":"number"},"stoppedEarly":{"description":"True when SES throttled the run; verdicts cover only what was checked","type":"boolean"},"invalid":{"type":"array","items":{"description":"Failed the syntax check; not sent to SES","type":"string"}}},"required":["verdicts","validatedCount","stoppedEarly","invalid"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"verdicts":{"description":"SES confidence verdict per syntactically valid, de-duplicated address","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"const":"LOW","type":"string"},{"const":"MEDIUM","type":"string"},{"const":"HIGH","type":"string"},{"const":"UNKNOWN","type":"string"}]}}},"validatedCount":{"type":"number"},"stoppedEarly":{"description":"True when SES throttled the run; verdicts cover only what was checked","type":"boolean"},"invalid":{"type":"array","items":{"description":"Failed the syntax check; not sent to SES","type":"string"}}},"required":["verdicts","validatedCount","stoppedEarly","invalid"]}},"text/plain":{"schema":{"type":"object","properties":{"verdicts":{"description":"SES confidence verdict per syntactically valid, de-duplicated address","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"const":"LOW","type":"string"},{"const":"MEDIUM","type":"string"},{"const":"HIGH","type":"string"},{"const":"UNKNOWN","type":"string"}]}}},"validatedCount":{"type":"number"},"stoppedEarly":{"description":"True when SES throttled the run; verdicts cover only what was checked","type":"boolean"},"invalid":{"type":"array","items":{"description":"Failed the syntax check; not sent to SES","type":"string"}}},"required":["verdicts","validatedCount","stoppedEarly","invalid"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1ContactsValidate","tags":["contacts"],"summary":"Validate email addresses","description":"Checks up to 100 addresses with SES Email Address Insights through an org AWS account whose SES plan is PRO or ENTERPRISE. Reads only that AWS account row (org-scoped); reads no contacts and writes nothing. Requires contacts:import, the permission the import uses for the same validation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["awsAccountId","emails"],"properties":{"awsAccountId":{"maxLength":36,"description":"An org AWS account whose SES plan is PRO or ENTERPRISE","type":"string"},"emails":{"minItems":1,"description":"Addresses to check, at most 100 per request.","type":"array","items":{"maxLength":320,"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["awsAccountId","emails"],"properties":{"awsAccountId":{"maxLength":36,"description":"An org AWS account whose SES plan is PRO or ENTERPRISE","type":"string"},"emails":{"minItems":1,"description":"Addresses to check, at most 100 per request.","type":"array","items":{"maxLength":320,"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["awsAccountId","emails"],"properties":{"awsAccountId":{"maxLength":36,"description":"An org AWS account whose SES plan is PRO or ENTERPRISE","type":"string"},"emails":{"minItems":1,"description":"Addresses to check, at most 100 per request.","type":"array","items":{"maxLength":320,"type":"string"}}}}}}}}},"/v1/contacts/{id}/topics":{"put":{"parameters":[{"description":"Contact ID","schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"topics":{"type":"array","items":{"type":"object","required":["topicId","topicName","status","subscribedAt"],"properties":{"topicId":{"type":"string"},"topicName":{"type":"string"},"status":{"type":"string"},"subscribedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"pendingTopics":{"type":"array","items":{"type":"string"}}},"required":["topics"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"topics":{"type":"array","items":{"type":"object","required":["topicId","topicName","status","subscribedAt"],"properties":{"topicId":{"type":"string"},"topicName":{"type":"string"},"status":{"type":"string"},"subscribedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"pendingTopics":{"type":"array","items":{"type":"string"}}},"required":["topics"]}},"text/plain":{"schema":{"type":"object","properties":{"topics":{"type":"array","items":{"type":"object","required":["topicId","topicName","status","subscribedAt"],"properties":{"topicId":{"type":"string"},"topicName":{"type":"string"},"status":{"type":"string"},"subscribedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"pendingTopics":{"type":"array","items":{"type":"string"}}},"required":["topics"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"putV1ContactsByIdTopics","tags":["contacts"],"summary":"Replace contact topics","description":"Replaces all topic subscriptions for a contact. Use PATCH to add topics without removing existing ones.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"topicIds":{"description":"Topic IDs to subscribe","type":"array","items":{"maxLength":36,"type":"string"}},"topicSlugs":{"description":"Topic slugs to subscribe","type":"array","items":{"maxLength":100,"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"topicIds":{"description":"Topic IDs to subscribe","type":"array","items":{"maxLength":36,"type":"string"}},"topicSlugs":{"description":"Topic slugs to subscribe","type":"array","items":{"maxLength":100,"type":"string"}}}}},"text/plain":{"schema":{"type":"object","properties":{"topicIds":{"description":"Topic IDs to subscribe","type":"array","items":{"maxLength":36,"type":"string"}},"topicSlugs":{"description":"Topic slugs to subscribe","type":"array","items":{"maxLength":100,"type":"string"}}}}}}}}},"/v1/batch/drafts":{"post":{"parameters":[],"responses":{"201":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Batch ID","type":"string"},"status":{"description":"Always draft","type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"channel":{"type":"string"},"totalRecipients":{"type":"number"},"processedRecipients":{"type":"number"},"sent":{"type":"number"},"delivered":{"type":"number"},"failed":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"},"bounced":{"type":"number"},"complained":{"type":"number"},"suppressed":{"type":"number"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","status","name","channel","totalRecipients","processedRecipients","sent","delivered","failed","opened","clicked","bounced","complained","suppressed","startedAt","completedAt","createdAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Batch ID","type":"string"},"status":{"description":"Always draft","type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"channel":{"type":"string"},"totalRecipients":{"type":"number"},"processedRecipients":{"type":"number"},"sent":{"type":"number"},"delivered":{"type":"number"},"failed":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"},"bounced":{"type":"number"},"complained":{"type":"number"},"suppressed":{"type":"number"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","status","name","channel","totalRecipients","processedRecipients","sent","delivered","failed","opened","clicked","bounced","complained","suppressed","startedAt","completedAt","createdAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Batch ID","type":"string"},"status":{"description":"Always draft","type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"channel":{"type":"string"},"totalRecipients":{"type":"number"},"processedRecipients":{"type":"number"},"sent":{"type":"number"},"delivered":{"type":"number"},"failed":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"},"bounced":{"type":"number"},"complained":{"type":"number"},"suppressed":{"type":"number"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","status","name","channel","totalRecipients","processedRecipients","sent","delivered","failed","opened","clicked","bounced","complained","suppressed","startedAt","completedAt","createdAt"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1BatchDrafts","tags":["batch"],"summary":"Create broadcast draft","description":"Creates a draft; nothing is sent. Send it with POST /v1/batch/{id}/send. Requires the broadcasts write permission. Every referenced ID (templateId, segmentId, topicId, awsAccountId) must belong to the organization. Returns the new draft.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"description":"Channel the draft will send through","anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"name":{"maxLength":255,"type":"string"},"subject":{"maxLength":998,"type":"string"},"previewText":{"maxLength":500,"type":"string"},"from":{"maxLength":255,"type":"string"},"fromName":{"maxLength":100,"type":"string"},"replyTo":{"maxLength":255,"type":"string"},"templateId":{"description":"Email template ID","maxLength":36,"type":"string"},"htmlContent":{"type":"string"},"variableMappings":{"type":"array","items":{"type":"object","required":["variableName","source"],"properties":{"variableName":{"type":"string"},"source":{"anyOf":[{"type":"object","required":["type","value"],"properties":{"type":{"const":"static","type":"string"},"value":{"type":"string"}}},{"type":"object","required":["type","field"],"properties":{"type":{"const":"contact","type":"string"},"field":{"type":"string"}}}]}}}},"body":{"description":"SMS body","maxLength":1600,"type":"string"},"senderId":{"description":"SMS origination identity (phone number or alphanumeric ID)","maxLength":20,"type":"string"},"recipientFilter":{"type":"object","properties":{"audienceType":{"anyOf":[{"const":"all","type":"string"},{"const":"topic","type":"string"},{"const":"segment","type":"string"}]},"topicId":{"maxLength":36,"type":"string"},"segmentId":{"maxLength":36,"type":"string"}}},"awsAccountId":{"description":"AWS account ID to send from. Optional on drafts.","maxLength":36,"type":"string"},"scheduledFor":{"description":"ISO 8601 schedule stored on the draft. Not sent until the draft is sent.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"channel":{"description":"Channel the draft will send through","anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"name":{"maxLength":255,"type":"string"},"subject":{"maxLength":998,"type":"string"},"previewText":{"maxLength":500,"type":"string"},"from":{"maxLength":255,"type":"string"},"fromName":{"maxLength":100,"type":"string"},"replyTo":{"maxLength":255,"type":"string"},"templateId":{"description":"Email template ID","maxLength":36,"type":"string"},"htmlContent":{"type":"string"},"variableMappings":{"type":"array","items":{"type":"object","required":["variableName","source"],"properties":{"variableName":{"type":"string"},"source":{"anyOf":[{"type":"object","required":["type","value"],"properties":{"type":{"const":"static","type":"string"},"value":{"type":"string"}}},{"type":"object","required":["type","field"],"properties":{"type":{"const":"contact","type":"string"},"field":{"type":"string"}}}]}}}},"body":{"description":"SMS body","maxLength":1600,"type":"string"},"senderId":{"description":"SMS origination identity (phone number or alphanumeric ID)","maxLength":20,"type":"string"},"recipientFilter":{"type":"object","properties":{"audienceType":{"anyOf":[{"const":"all","type":"string"},{"const":"topic","type":"string"},{"const":"segment","type":"string"}]},"topicId":{"maxLength":36,"type":"string"},"segmentId":{"maxLength":36,"type":"string"}}},"awsAccountId":{"description":"AWS account ID to send from. Optional on drafts.","maxLength":36,"type":"string"},"scheduledFor":{"description":"ISO 8601 schedule stored on the draft. Not sent until the draft is sent.","type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"channel":{"description":"Channel the draft will send through","anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"name":{"maxLength":255,"type":"string"},"subject":{"maxLength":998,"type":"string"},"previewText":{"maxLength":500,"type":"string"},"from":{"maxLength":255,"type":"string"},"fromName":{"maxLength":100,"type":"string"},"replyTo":{"maxLength":255,"type":"string"},"templateId":{"description":"Email template ID","maxLength":36,"type":"string"},"htmlContent":{"type":"string"},"variableMappings":{"type":"array","items":{"type":"object","required":["variableName","source"],"properties":{"variableName":{"type":"string"},"source":{"anyOf":[{"type":"object","required":["type","value"],"properties":{"type":{"const":"static","type":"string"},"value":{"type":"string"}}},{"type":"object","required":["type","field"],"properties":{"type":{"const":"contact","type":"string"},"field":{"type":"string"}}}]}}}},"body":{"description":"SMS body","maxLength":1600,"type":"string"},"senderId":{"description":"SMS origination identity (phone number or alphanumeric ID)","maxLength":20,"type":"string"},"recipientFilter":{"type":"object","properties":{"audienceType":{"anyOf":[{"const":"all","type":"string"},{"const":"topic","type":"string"},{"const":"segment","type":"string"}]},"topicId":{"maxLength":36,"type":"string"},"segmentId":{"maxLength":36,"type":"string"}}},"awsAccountId":{"description":"AWS account ID to send from. Optional on drafts.","maxLength":36,"type":"string"},"scheduledFor":{"description":"ISO 8601 schedule stored on the draft. Not sent until the draft is sent.","type":"string"}}}}}}}},"/v1/batch/":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Batch ID","type":"string"},"status":{"description":"Batch status (queued, scheduled, processing, completed, failed, cancelled)","type":"string"},"channel":{"description":"Channel (email or sms)","type":"string"},"totalRecipients":{"description":"Total number of recipients","type":"number"},"createdAt":{"description":"Creation timestamp","format":"date-time","type":"string"},"warning":{"description":"Set when the broadcast was accepted but something about it needs saying — e.g. it was marked scheduled in an environment with no scheduler configured, so it will never fire.","type":"string"}},"required":["id","status","channel","totalRecipients","createdAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Batch ID","type":"string"},"status":{"description":"Batch status (queued, scheduled, processing, completed, failed, cancelled)","type":"string"},"channel":{"description":"Channel (email or sms)","type":"string"},"totalRecipients":{"description":"Total number of recipients","type":"number"},"createdAt":{"description":"Creation timestamp","format":"date-time","type":"string"},"warning":{"description":"Set when the broadcast was accepted but something about it needs saying — e.g. it was marked scheduled in an environment with no scheduler configured, so it will never fire.","type":"string"}},"required":["id","status","channel","totalRecipients","createdAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Batch ID","type":"string"},"status":{"description":"Batch status (queued, scheduled, processing, completed, failed, cancelled)","type":"string"},"channel":{"description":"Channel (email or sms)","type":"string"},"totalRecipients":{"description":"Total number of recipients","type":"number"},"createdAt":{"description":"Creation timestamp","format":"date-time","type":"string"},"warning":{"description":"Set when the broadcast was accepted but something about it needs saying — e.g. it was marked scheduled in an environment with no scheduler configured, so it will never fire.","type":"string"}},"required":["id","status","channel","totalRecipients","createdAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1Batch","tags":["batch"],"summary":"Create batch send","description":"Creates a new batch send job and queues it for processing","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["awsAccountId"],"properties":{"channel":{"description":"Channel to send through","anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"name":{"description":"Name for the batch send","maxLength":255,"type":"string"},"audienceType":{"description":"Audience targeting type","anyOf":[{"const":"all","type":"string"},{"const":"topic","type":"string"},{"const":"segment","type":"string"}]},"topicId":{"description":"Topic ID to target","maxLength":36,"type":"string"},"segmentId":{"description":"Segment ID to target","maxLength":36,"type":"string"},"subject":{"description":"Email subject line","maxLength":998,"type":"string"},"previewText":{"description":"Email preview text","maxLength":500,"type":"string"},"from":{"description":"From email address","maxLength":255,"type":"string"},"fromName":{"description":"From display name","maxLength":100,"type":"string"},"replyTo":{"description":"Reply-to email address","maxLength":255,"type":"string"},"templateId":{"description":"Email template ID","maxLength":36,"type":"string"},"htmlContent":{"description":"Raw HTML content (if not using template)","type":"string"},"variableMappings":{"description":"Variable mappings for custom template variables","type":"array","items":{"type":"object","required":["variableName","source"],"properties":{"variableName":{"description":"Template variable name","type":"string"},"source":{"anyOf":[{"type":"object","required":["type","value"],"properties":{"type":{"const":"static","type":"string"},"value":{"description":"Static value","type":"string"}}},{"type":"object","required":["type","field"],"properties":{"type":{"const":"contact","type":"string"},"field":{"description":"Contact field name","type":"string"}}}]}}}},"body":{"description":"SMS body text","maxLength":1600,"type":"string"},"senderId":{"description":"SMS sender ID","maxLength":20,"type":"string"},"scheduledFor":{"description":"ISO 8601 datetime for scheduled send","format":"date-time","type":"string"},"awsAccountId":{"description":"AWS account ID to use for sending","maxLength":36,"type":"string"},"totalRecipients":{"description":"Pre-counted recipient count","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["awsAccountId"],"properties":{"channel":{"description":"Channel to send through","anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"name":{"description":"Name for the batch send","maxLength":255,"type":"string"},"audienceType":{"description":"Audience targeting type","anyOf":[{"const":"all","type":"string"},{"const":"topic","type":"string"},{"const":"segment","type":"string"}]},"topicId":{"description":"Topic ID to target","maxLength":36,"type":"string"},"segmentId":{"description":"Segment ID to target","maxLength":36,"type":"string"},"subject":{"description":"Email subject line","maxLength":998,"type":"string"},"previewText":{"description":"Email preview text","maxLength":500,"type":"string"},"from":{"description":"From email address","maxLength":255,"type":"string"},"fromName":{"description":"From display name","maxLength":100,"type":"string"},"replyTo":{"description":"Reply-to email address","maxLength":255,"type":"string"},"templateId":{"description":"Email template ID","maxLength":36,"type":"string"},"htmlContent":{"description":"Raw HTML content (if not using template)","type":"string"},"variableMappings":{"description":"Variable mappings for custom template variables","type":"array","items":{"type":"object","required":["variableName","source"],"properties":{"variableName":{"description":"Template variable name","type":"string"},"source":{"anyOf":[{"type":"object","required":["type","value"],"properties":{"type":{"const":"static","type":"string"},"value":{"description":"Static value","type":"string"}}},{"type":"object","required":["type","field"],"properties":{"type":{"const":"contact","type":"string"},"field":{"description":"Contact field name","type":"string"}}}]}}}},"body":{"description":"SMS body text","maxLength":1600,"type":"string"},"senderId":{"description":"SMS sender ID","maxLength":20,"type":"string"},"scheduledFor":{"description":"ISO 8601 datetime for scheduled send","format":"date-time","type":"string"},"awsAccountId":{"description":"AWS account ID to use for sending","maxLength":36,"type":"string"},"totalRecipients":{"description":"Pre-counted recipient count","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["awsAccountId"],"properties":{"channel":{"description":"Channel to send through","anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"name":{"description":"Name for the batch send","maxLength":255,"type":"string"},"audienceType":{"description":"Audience targeting type","anyOf":[{"const":"all","type":"string"},{"const":"topic","type":"string"},{"const":"segment","type":"string"}]},"topicId":{"description":"Topic ID to target","maxLength":36,"type":"string"},"segmentId":{"description":"Segment ID to target","maxLength":36,"type":"string"},"subject":{"description":"Email subject line","maxLength":998,"type":"string"},"previewText":{"description":"Email preview text","maxLength":500,"type":"string"},"from":{"description":"From email address","maxLength":255,"type":"string"},"fromName":{"description":"From display name","maxLength":100,"type":"string"},"replyTo":{"description":"Reply-to email address","maxLength":255,"type":"string"},"templateId":{"description":"Email template ID","maxLength":36,"type":"string"},"htmlContent":{"description":"Raw HTML content (if not using template)","type":"string"},"variableMappings":{"description":"Variable mappings for custom template variables","type":"array","items":{"type":"object","required":["variableName","source"],"properties":{"variableName":{"description":"Template variable name","type":"string"},"source":{"anyOf":[{"type":"object","required":["type","value"],"properties":{"type":{"const":"static","type":"string"},"value":{"description":"Static value","type":"string"}}},{"type":"object","required":["type","field"],"properties":{"type":{"const":"contact","type":"string"},"field":{"description":"Contact field name","type":"string"}}}]}}}},"body":{"description":"SMS body text","maxLength":1600,"type":"string"},"senderId":{"description":"SMS sender ID","maxLength":20,"type":"string"},"scheduledFor":{"description":"ISO 8601 datetime for scheduled send","format":"date-time","type":"string"},"awsAccountId":{"description":"AWS account ID to use for sending","maxLength":36,"type":"string"},"totalRecipients":{"description":"Pre-counted recipient count","type":"number"}}}}}}},"get":{"parameters":[{"schema":{"type":"number","default":1,"minimum":1},"in":"query","name":"page","required":false},{"schema":{"type":"number","default":20,"minimum":1,"maximum":100},"in":"query","name":"pageSize","required":false},{"schema":{"anyOf":[{"const":"draft","type":"string"},{"const":"scheduled","type":"string"},{"const":"queued","type":"string"},{"const":"processing","type":"string"},{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"cancelled","type":"string"}]},"in":"query","name":"status","required":false},{"schema":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"in":"query","name":"channel","required":false},{"schema":{"type":"string","maxLength":200},"in":"query","name":"search","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["id","name","status","channel","subject","totalRecipients","processedRecipients","sent","delivered","opened","clicked","bounced","complained","suppressed","failed","scheduledFor","startedAt","completedAt","createdAt","template","awsAccount"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"channel":{"type":"string"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"totalRecipients":{"type":"number"},"processedRecipients":{"type":"number"},"sent":{"type":"number"},"delivered":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"},"bounced":{"type":"number"},"complained":{"type":"number"},"suppressed":{"type":"number"},"failed":{"type":"number"},"scheduledFor":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"template":{"anyOf":[{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"awsAccount":{"anyOf":[{"type":"object","required":["id","name","region"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"region":{"type":"string"}}},{"type":"null"}]}}}},"page":{"type":"number"},"pageSize":{"type":"number"},"total":{"type":"number"}},"required":["data","page","pageSize","total"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["id","name","status","channel","subject","totalRecipients","processedRecipients","sent","delivered","opened","clicked","bounced","complained","suppressed","failed","scheduledFor","startedAt","completedAt","createdAt","template","awsAccount"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"channel":{"type":"string"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"totalRecipients":{"type":"number"},"processedRecipients":{"type":"number"},"sent":{"type":"number"},"delivered":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"},"bounced":{"type":"number"},"complained":{"type":"number"},"suppressed":{"type":"number"},"failed":{"type":"number"},"scheduledFor":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"template":{"anyOf":[{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"awsAccount":{"anyOf":[{"type":"object","required":["id","name","region"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"region":{"type":"string"}}},{"type":"null"}]}}}},"page":{"type":"number"},"pageSize":{"type":"number"},"total":{"type":"number"}},"required":["data","page","pageSize","total"]}},"text/plain":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["id","name","status","channel","subject","totalRecipients","processedRecipients","sent","delivered","opened","clicked","bounced","complained","suppressed","failed","scheduledFor","startedAt","completedAt","createdAt","template","awsAccount"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"channel":{"type":"string"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"totalRecipients":{"type":"number"},"processedRecipients":{"type":"number"},"sent":{"type":"number"},"delivered":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"},"bounced":{"type":"number"},"complained":{"type":"number"},"suppressed":{"type":"number"},"failed":{"type":"number"},"scheduledFor":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"template":{"anyOf":[{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"awsAccount":{"anyOf":[{"type":"object","required":["id","name","region"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"region":{"type":"string"}}},{"type":"null"}]}}}},"page":{"type":"number"},"pageSize":{"type":"number"},"total":{"type":"number"}},"required":["data","page","pageSize","total"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1Batch","tags":["batch"],"summary":"List batch sends","description":"Lists batch sends for the organization, paginated and optionally filtered by status, channel, or search."}},"/v1/batch/{id}":{"get":{"parameters":[{"description":"Batch ID","schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"channel":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"totalRecipients":{"type":"number"},"processedRecipients":{"type":"number"},"sent":{"type":"number"},"delivered":{"type":"number"},"failed":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"},"bounced":{"type":"number"},"complained":{"type":"number"},"suppressed":{"type":"number"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","status","channel","name","totalRecipients","processedRecipients","sent","delivered","failed","opened","clicked","bounced","complained","suppressed","startedAt","completedAt","createdAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"channel":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"totalRecipients":{"type":"number"},"processedRecipients":{"type":"number"},"sent":{"type":"number"},"delivered":{"type":"number"},"failed":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"},"bounced":{"type":"number"},"complained":{"type":"number"},"suppressed":{"type":"number"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","status","channel","name","totalRecipients","processedRecipients","sent","delivered","failed","opened","clicked","bounced","complained","suppressed","startedAt","completedAt","createdAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"channel":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"totalRecipients":{"type":"number"},"processedRecipients":{"type":"number"},"sent":{"type":"number"},"delivered":{"type":"number"},"failed":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"},"bounced":{"type":"number"},"complained":{"type":"number"},"suppressed":{"type":"number"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","status","channel","name","totalRecipients","processedRecipients","sent","delivered","failed","opened","clicked","bounced","complained","suppressed","startedAt","completedAt","createdAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1BatchById","tags":["batch"],"summary":"Get batch status","description":"Returns the current status of a batch send job. Counts are maintained incrementally during the send and reflect SES events received so far."},"delete":{"parameters":[{"description":"Batch ID to cancel","schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"status":{"type":"string"}},"required":["success","id","status"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"status":{"type":"string"}},"required":["success","id","status"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"status":{"type":"string"}},"required":["success","id","status"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteV1BatchById","tags":["batch"],"summary":"Cancel batch send","description":"Cancels a scheduled or queued batch send. If scheduled, also deletes the EventBridge schedule."},"patch":{"parameters":[{"description":"Draft or scheduled broadcast ID","schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["id","status","name","channel","subject","audienceType","topicId","segmentId","awsAccountId","scheduledFor"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"channel":{"type":"string"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"audienceType":{"anyOf":[{"type":"string"},{"type":"null"}]},"topicId":{"anyOf":[{"type":"string"},{"type":"null"}]},"segmentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"scheduledFor":{"description":"ISO 8601 schedule for the draft, or null","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["id","status","scheduledFor"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"scheduledFor":{"format":"date-time","type":"string"},"warning":{"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["id","status","name","channel","subject","audienceType","topicId","segmentId","awsAccountId","scheduledFor"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"channel":{"type":"string"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"audienceType":{"anyOf":[{"type":"string"},{"type":"null"}]},"topicId":{"anyOf":[{"type":"string"},{"type":"null"}]},"segmentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"scheduledFor":{"description":"ISO 8601 schedule for the draft, or null","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["id","status","scheduledFor"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"scheduledFor":{"format":"date-time","type":"string"},"warning":{"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["id","status","name","channel","subject","audienceType","topicId","segmentId","awsAccountId","scheduledFor"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"channel":{"type":"string"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"audienceType":{"anyOf":[{"type":"string"},{"type":"null"}]},"topicId":{"anyOf":[{"type":"string"},{"type":"null"}]},"segmentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"scheduledFor":{"description":"ISO 8601 schedule for the draft, or null","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["id","status","scheduledFor"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"scheduledFor":{"format":"date-time","type":"string"},"warning":{"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["id","status","name","channel","subject","audienceType","topicId","segmentId","awsAccountId","scheduledFor"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"channel":{"type":"string"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"audienceType":{"anyOf":[{"type":"string"},{"type":"null"}]},"topicId":{"anyOf":[{"type":"string"},{"type":"null"}]},"segmentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"scheduledFor":{"description":"ISO 8601 schedule for the draft, or null","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["id","status","scheduledFor"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"scheduledFor":{"format":"date-time","type":"string"},"warning":{"type":"string"}}}]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchV1BatchById","tags":["batch"],"summary":"Update draft or scheduled broadcast","description":"Updates a draft or a scheduled broadcast. Requires the broadcasts write permission.\n\nDraft: only fields present in the body change; send null to clear a nullable field. Setting audienceType or scheduledFor applies the same plan entitlements as creating a broadcast.\n\nScheduled: Edits a scheduled batch send that has not started. Omitted fields keep their stored value; `null` clears a field. The broadcast stays scheduled: `scheduledFor` must be in the future, and changing it, the AWS account or the channel moves the EventBridge schedule. Rejected with 409 within 60 seconds of the send time or once sending has started. scheduledFor and awsAccountId cannot be null.\n\nAny other status returns 409 with the current status (use the send/resume routes for live broadcasts).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"name":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"audienceType":{"description":"Audience type. Setting it replaces topicId and segmentId with the values sent (or null).","anyOf":[{"const":"all","type":"string"},{"const":"topic","type":"string"},{"const":"segment","type":"string"}]},"topicId":{"anyOf":[{"maxLength":36,"type":"string"},{"type":"null"}]},"segmentId":{"anyOf":[{"maxLength":36,"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"maxLength":998,"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"from":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"fromName":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"templateId":{"anyOf":[{"maxLength":36,"type":"string"},{"type":"null"}]},"htmlContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"variableMappings":{"anyOf":[{"type":"array","items":{"type":"object","required":["variableName","source"],"properties":{"variableName":{"type":"string"},"source":{"anyOf":[{"type":"object","required":["type","value"],"properties":{"type":{"const":"static","type":"string"},"value":{"type":"string"}}},{"type":"object","required":["type","field"],"properties":{"type":{"const":"contact","type":"string"},"field":{"type":"string"}}}]}}}},{"type":"null"}]},"body":{"anyOf":[{"maxLength":1600,"type":"string"},{"type":"null"}]},"senderId":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}]},"scheduledFor":{"description":"Schedule for the draft. null clears it.","anyOf":[{"description":"ISO 8601 datetime","type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"maxLength":36,"type":"string"},{"type":"null"}]},"totalRecipients":{"description":"Scheduled broadcasts only. Ignored for a draft.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"channel":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"name":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"audienceType":{"description":"Audience type. Setting it replaces topicId and segmentId with the values sent (or null).","anyOf":[{"const":"all","type":"string"},{"const":"topic","type":"string"},{"const":"segment","type":"string"}]},"topicId":{"anyOf":[{"maxLength":36,"type":"string"},{"type":"null"}]},"segmentId":{"anyOf":[{"maxLength":36,"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"maxLength":998,"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"from":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"fromName":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"templateId":{"anyOf":[{"maxLength":36,"type":"string"},{"type":"null"}]},"htmlContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"variableMappings":{"anyOf":[{"type":"array","items":{"type":"object","required":["variableName","source"],"properties":{"variableName":{"type":"string"},"source":{"anyOf":[{"type":"object","required":["type","value"],"properties":{"type":{"const":"static","type":"string"},"value":{"type":"string"}}},{"type":"object","required":["type","field"],"properties":{"type":{"const":"contact","type":"string"},"field":{"type":"string"}}}]}}}},{"type":"null"}]},"body":{"anyOf":[{"maxLength":1600,"type":"string"},{"type":"null"}]},"senderId":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}]},"scheduledFor":{"description":"Schedule for the draft. null clears it.","anyOf":[{"description":"ISO 8601 datetime","type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"maxLength":36,"type":"string"},{"type":"null"}]},"totalRecipients":{"description":"Scheduled broadcasts only. Ignored for a draft.","type":"number"}}}},"text/plain":{"schema":{"type":"object","properties":{"channel":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"name":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"audienceType":{"description":"Audience type. Setting it replaces topicId and segmentId with the values sent (or null).","anyOf":[{"const":"all","type":"string"},{"const":"topic","type":"string"},{"const":"segment","type":"string"}]},"topicId":{"anyOf":[{"maxLength":36,"type":"string"},{"type":"null"}]},"segmentId":{"anyOf":[{"maxLength":36,"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"maxLength":998,"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"from":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"fromName":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"templateId":{"anyOf":[{"maxLength":36,"type":"string"},{"type":"null"}]},"htmlContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"variableMappings":{"anyOf":[{"type":"array","items":{"type":"object","required":["variableName","source"],"properties":{"variableName":{"type":"string"},"source":{"anyOf":[{"type":"object","required":["type","value"],"properties":{"type":{"const":"static","type":"string"},"value":{"type":"string"}}},{"type":"object","required":["type","field"],"properties":{"type":{"const":"contact","type":"string"},"field":{"type":"string"}}}]}}}},{"type":"null"}]},"body":{"anyOf":[{"maxLength":1600,"type":"string"},{"type":"null"}]},"senderId":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}]},"scheduledFor":{"description":"Schedule for the draft. null clears it.","anyOf":[{"description":"ISO 8601 datetime","type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"maxLength":36,"type":"string"},{"type":"null"}]},"totalRecipients":{"description":"Scheduled broadcasts only. Ignored for a draft.","type":"number"}}}}}}}},"/v1/batch/{id}/recipients":{"get":{"parameters":[{"description":"Batch ID","schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true},{"schema":{"anyOf":[{"const":"pending","type":"string"},{"const":"queued","type":"string"},{"const":"sent","type":"string"},{"const":"delivered","type":"string"},{"const":"opened","type":"string"},{"const":"clicked","type":"string"},{"const":"bounced","type":"string"},{"const":"complained","type":"string"},{"const":"suppressed","type":"string"},{"const":"failed","type":"string"},{"const":"opted_out","type":"string"}]},"in":"query","name":"status","required":false},{"schema":{"type":"number","default":50,"minimum":1,"maximum":1000},"in":"query","name":"limit","required":false},{"schema":{"type":"number","default":0,"minimum":0},"in":"query","name":"offset","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["id","recipient","status","error","bounceType","bounceSubType","sentAt","createdAt"],"properties":{"id":{"type":"string"},"recipient":{"type":"string"},"status":{"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"bounceType":{"anyOf":[{"type":"string"},{"type":"null"}]},"bounceSubType":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}}}},"limit":{"type":"number"},"offset":{"type":"number"},"total":{"type":"number"}},"required":["data","limit","offset","total"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["id","recipient","status","error","bounceType","bounceSubType","sentAt","createdAt"],"properties":{"id":{"type":"string"},"recipient":{"type":"string"},"status":{"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"bounceType":{"anyOf":[{"type":"string"},{"type":"null"}]},"bounceSubType":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}}}},"limit":{"type":"number"},"offset":{"type":"number"},"total":{"type":"number"}},"required":["data","limit","offset","total"]}},"text/plain":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["id","recipient","status","error","bounceType","bounceSubType","sentAt","createdAt"],"properties":{"id":{"type":"string"},"recipient":{"type":"string"},"status":{"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"bounceType":{"anyOf":[{"type":"string"},{"type":"null"}]},"bounceSubType":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}}}},"limit":{"type":"number"},"offset":{"type":"number"},"total":{"type":"number"}},"required":["data","limit","offset","total"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1BatchByIdRecipients","tags":["batch"],"summary":"List batch recipients","description":"Returns per-recipient outcomes for a batch send. `limit` is capped at 1000 rows per page — this route returns JSON through Lambda, which has a response-size ceiling that a larger page could exceed."}},"/v1/batch/{id}/clicks":{"get":{"parameters":[{"description":"Batch ID","schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["url","count"],"properties":{"url":{"type":"string"},"count":{"type":"number"}}}},"unsubscribeCount":{"type":"number"},"totalDistinctUrls":{"type":"number"},"truncated":{"type":"boolean"}},"required":["data","unsubscribeCount","totalDistinctUrls","truncated"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["url","count"],"properties":{"url":{"type":"string"},"count":{"type":"number"}}}},"unsubscribeCount":{"type":"number"},"totalDistinctUrls":{"type":"number"},"truncated":{"type":"boolean"}},"required":["data","unsubscribeCount","totalDistinctUrls","truncated"]}},"text/plain":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["url","count"],"properties":{"url":{"type":"string"},"count":{"type":"number"}}}},"unsubscribeCount":{"type":"number"},"totalDistinctUrls":{"type":"number"},"truncated":{"type":"boolean"}},"required":["data","unsubscribeCount","totalDistinctUrls","truncated"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1BatchByIdClicks","tags":["batch"],"summary":"Clicked links","description":"Returns the top clicked links for a batch send, ordered by click count and capped at 50 URLs — `truncated` is true when more distinct URLs exist than are returned. Per-recipient unsubscribe and preference-centre links are aggregated into `unsubscribeCount` and excluded from `data`."}},"/v1/batch/{id}/send":{"post":{"parameters":[{"description":"Draft batch ID to promote","schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"201":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"warning":{"type":"string"}},"required":["id","status"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"warning":{"type":"string"}},"required":["id","status"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"warning":{"type":"string"}},"required":["id","status"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1BatchByIdSend","tags":["batch"],"summary":"Promote draft batch send","description":"Promotes an existing draft batch_send to an active send (queued or scheduled).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["awsAccountId","totalRecipients"],"properties":{"channel":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"name":{"maxLength":255,"type":"string"},"audienceType":{"anyOf":[{"const":"all","type":"string"},{"const":"topic","type":"string"},{"const":"segment","type":"string"}]},"topicId":{"maxLength":36,"type":"string"},"segmentId":{"maxLength":36,"type":"string"},"subject":{"maxLength":998,"type":"string"},"previewText":{"maxLength":500,"type":"string"},"from":{"maxLength":255,"type":"string"},"fromName":{"maxLength":100,"type":"string"},"replyTo":{"maxLength":255,"type":"string"},"templateId":{"maxLength":36,"type":"string"},"htmlContent":{"type":"string"},"variableMappings":{"type":"array","items":{"type":"object","required":["variableName","source"],"properties":{"variableName":{"type":"string"},"source":{"anyOf":[{"type":"object","required":["type","value"],"properties":{"type":{"const":"static","type":"string"},"value":{"type":"string"}}},{"type":"object","required":["type","field"],"properties":{"type":{"const":"contact","type":"string"},"field":{"type":"string"}}}]}}}},"body":{"maxLength":1600,"type":"string"},"senderId":{"maxLength":20,"type":"string"},"scheduledFor":{"format":"date-time","type":"string"},"awsAccountId":{"maxLength":36,"type":"string"},"totalRecipients":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["awsAccountId","totalRecipients"],"properties":{"channel":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"name":{"maxLength":255,"type":"string"},"audienceType":{"anyOf":[{"const":"all","type":"string"},{"const":"topic","type":"string"},{"const":"segment","type":"string"}]},"topicId":{"maxLength":36,"type":"string"},"segmentId":{"maxLength":36,"type":"string"},"subject":{"maxLength":998,"type":"string"},"previewText":{"maxLength":500,"type":"string"},"from":{"maxLength":255,"type":"string"},"fromName":{"maxLength":100,"type":"string"},"replyTo":{"maxLength":255,"type":"string"},"templateId":{"maxLength":36,"type":"string"},"htmlContent":{"type":"string"},"variableMappings":{"type":"array","items":{"type":"object","required":["variableName","source"],"properties":{"variableName":{"type":"string"},"source":{"anyOf":[{"type":"object","required":["type","value"],"properties":{"type":{"const":"static","type":"string"},"value":{"type":"string"}}},{"type":"object","required":["type","field"],"properties":{"type":{"const":"contact","type":"string"},"field":{"type":"string"}}}]}}}},"body":{"maxLength":1600,"type":"string"},"senderId":{"maxLength":20,"type":"string"},"scheduledFor":{"format":"date-time","type":"string"},"awsAccountId":{"maxLength":36,"type":"string"},"totalRecipients":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["awsAccountId","totalRecipients"],"properties":{"channel":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"name":{"maxLength":255,"type":"string"},"audienceType":{"anyOf":[{"const":"all","type":"string"},{"const":"topic","type":"string"},{"const":"segment","type":"string"}]},"topicId":{"maxLength":36,"type":"string"},"segmentId":{"maxLength":36,"type":"string"},"subject":{"maxLength":998,"type":"string"},"previewText":{"maxLength":500,"type":"string"},"from":{"maxLength":255,"type":"string"},"fromName":{"maxLength":100,"type":"string"},"replyTo":{"maxLength":255,"type":"string"},"templateId":{"maxLength":36,"type":"string"},"htmlContent":{"type":"string"},"variableMappings":{"type":"array","items":{"type":"object","required":["variableName","source"],"properties":{"variableName":{"type":"string"},"source":{"anyOf":[{"type":"object","required":["type","value"],"properties":{"type":{"const":"static","type":"string"},"value":{"type":"string"}}},{"type":"object","required":["type","field"],"properties":{"type":{"const":"contact","type":"string"},"field":{"type":"string"}}}]}}}},"body":{"maxLength":1600,"type":"string"},"senderId":{"maxLength":20,"type":"string"},"scheduledFor":{"format":"date-time","type":"string"},"awsAccountId":{"maxLength":36,"type":"string"},"totalRecipients":{"type":"number"}}}}}}}},"/v1/batch/{id}/resume":{"post":{"parameters":[{"description":"Batch ID to resume","schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1BatchByIdResume","tags":["batch"],"summary":"Resume batch send","description":"Resumes a 'processing' or 'failed' email batch from the last successfully completed chunk. Writes a resume entry to errorDetails and enqueues the next chunk.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fromChunkIndex":{"description":"Operator override — restart from this chunkIndex with a fresh cursor. Omit to use the durable heartbeat.","minimum":0,"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"fromChunkIndex":{"description":"Operator override — restart from this chunkIndex with a fresh cursor. Omit to use the durable heartbeat.","minimum":0,"type":"number"}}}},"text/plain":{"schema":{"type":"object","properties":{"fromChunkIndex":{"description":"Operator override — restart from this chunkIndex with a fresh cursor. Omit to use the durable heartbeat.","minimum":0,"type":"number"}}}}}}}},"/v1/batch/{id}/duplicate":{"post":{"parameters":[{"description":"Broadcast ID to copy","schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"ID of the new draft","type":"string"},"status":{"description":"Status of the new draft (always draft)","type":"string"},"name":{"description":"Name of the new draft, with a ' (copy)' suffix","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","status","name"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"ID of the new draft","type":"string"},"status":{"description":"Status of the new draft (always draft)","type":"string"},"name":{"description":"Name of the new draft, with a ' (copy)' suffix","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","status","name"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"ID of the new draft","type":"string"},"status":{"description":"Status of the new draft (always draft)","type":"string"},"name":{"description":"Name of the new draft, with a ' (copy)' suffix","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","status","name"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"operationId":"postV1BatchByIdDuplicate","tags":["batch"],"summary":"Duplicate broadcast","description":"Creates a new draft copy of a broadcast (any status) with ' (copy)' appended to its name. The copy keeps the content, audience and sender, but not the schedule. Requires the broadcasts write permission. Returns the new draft's ID."}},"/v1/segments/":{"get":{"parameters":[{"schema":{"type":"number","default":20,"minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"number","default":0,"minimum":0},"in":"query","name":"offset","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"segments":{"type":"array","items":{"type":"object","required":["id","name","description","memberCount","trackMembership","lastComputedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"memberCount":{"description":"Live count of contacts a broadcast to this segment would reach right now — never the cached column.","type":"number"},"trackMembership":{"type":"boolean"},"lastComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}},"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"}},"required":["segments","total","limit","offset"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"segments":{"type":"array","items":{"type":"object","required":["id","name","description","memberCount","trackMembership","lastComputedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"memberCount":{"description":"Live count of contacts a broadcast to this segment would reach right now — never the cached column.","type":"number"},"trackMembership":{"type":"boolean"},"lastComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}},"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"}},"required":["segments","total","limit","offset"]}},"text/plain":{"schema":{"type":"object","properties":{"segments":{"type":"array","items":{"type":"object","required":["id","name","description","memberCount","trackMembership","lastComputedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"memberCount":{"description":"Live count of contacts a broadcast to this segment would reach right now — never the cached column.","type":"number"},"trackMembership":{"type":"boolean"},"lastComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}},"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"}},"required":["segments","total","limit","offset"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1Segments","tags":["segments"],"summary":"List segments","description":"Lists the organization's segments with live sendable-recipient counts. Requires a Pro plan or higher."},"post":{"parameters":[],"responses":{"201":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"memberCount":{"type":"number"},"trackMembership":{"type":"boolean"},"lastComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","condition","memberCount","trackMembership","lastComputedAt","createdAt","updatedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"memberCount":{"type":"number"},"trackMembership":{"type":"boolean"},"lastComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","condition","memberCount","trackMembership","lastComputedAt","createdAt","updatedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"memberCount":{"type":"number"},"trackMembership":{"type":"boolean"},"lastComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","condition","memberCount","trackMembership","lastComputedAt","createdAt","updatedAt"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1Segments","tags":["segments"],"summary":"Create a segment","description":"Creates a segment. The condition is validated and snapshotted immediately — memberCount reflects live sendable recipients at creation time.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","condition"],"properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"description":{"type":"string"},"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"trackMembership":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","condition"],"properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"description":{"type":"string"},"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"trackMembership":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["name","condition"],"properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"description":{"type":"string"},"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"trackMembership":{"type":"boolean"}}}}}}}},"/v1/segments/{id}":{"get":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"memberCount":{"type":"number"},"trackMembership":{"type":"boolean"},"lastComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","condition","memberCount","trackMembership","lastComputedAt","createdAt","updatedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"memberCount":{"type":"number"},"trackMembership":{"type":"boolean"},"lastComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","condition","memberCount","trackMembership","lastComputedAt","createdAt","updatedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"memberCount":{"type":"number"},"trackMembership":{"type":"boolean"},"lastComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","condition","memberCount","trackMembership","lastComputedAt","createdAt","updatedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1SegmentsById","tags":["segments"],"summary":"Get a segment","description":"Returns a single segment, including its filter condition and live member count."},"patch":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"memberCount":{"type":"number"},"trackMembership":{"type":"boolean"},"lastComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","condition","memberCount","trackMembership","lastComputedAt","createdAt","updatedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"memberCount":{"type":"number"},"trackMembership":{"type":"boolean"},"lastComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","condition","memberCount","trackMembership","lastComputedAt","createdAt","updatedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"memberCount":{"type":"number"},"trackMembership":{"type":"boolean"},"lastComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","condition","memberCount","trackMembership","lastComputedAt","createdAt","updatedAt"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchV1SegmentsById","tags":["segments"],"summary":"Update a segment","description":"Partially updates a segment. Passing `condition` re-validates it and re-snapshots memberCount.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"description":{"type":"string"},"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"trackMembership":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"description":{"type":"string"},"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"trackMembership":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"description":{"type":"string"},"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"trackMembership":{"type":"boolean"}}}}}}},"delete":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteV1SegmentsById","tags":["segments"],"summary":"Delete a segment","description":"Deletes a segment. Refuses with 409 while a scheduled, queued, or processing broadcast still targets it."}},"/v1/segments/preview":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"},"sample":{"type":"array","items":{"type":"string"}}},"required":["count","sample"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"count":{"type":"number"},"sample":{"type":"array","items":{"type":"string"}}},"required":["count","sample"]}},"text/plain":{"schema":{"type":"object","properties":{"count":{"type":"number"},"sample":{"type":"array","items":{"type":"string"}}},"required":["count","sample"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1SegmentsPreview","tags":["segments"],"summary":"Preview a condition","description":"Counts and samples the audience an unsaved condition would reach, without creating a segment.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["condition"],"properties":{"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"limit":{"minimum":1,"maximum":100,"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["condition"],"properties":{"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"limit":{"minimum":1,"maximum":100,"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["condition"],"properties":{"condition":{"description":"Filter condition tree — see https://wraps.dev/docs/reference/segments for the shape."},"limit":{"minimum":1,"maximum":100,"type":"number"}}}}}}}},"/v1/api-keys/":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiKeys":{"type":"array","items":{"type":"object","required":["id","name","prefix","permissions","lastUsedAt","expiresAt","createdAt","createdBy"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"description":"Display prefix only, for example wraps_live_abcdefgh... The full key is never shown again after creation.","type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}}}}},"required":["apiKeys"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"apiKeys":{"type":"array","items":{"type":"object","required":["id","name","prefix","permissions","lastUsedAt","expiresAt","createdAt","createdBy"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"description":"Display prefix only, for example wraps_live_abcdefgh... The full key is never shown again after creation.","type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}}}}},"required":["apiKeys"]}},"text/plain":{"schema":{"type":"object","properties":{"apiKeys":{"type":"array","items":{"type":"object","required":["id","name","prefix","permissions","lastUsedAt","expiresAt","createdAt","createdBy"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"description":"Display prefix only, for example wraps_live_abcdefgh... The full key is never shown again after creation.","type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}}}}},"required":["apiKeys"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1Api-keys","tags":["api-keys"],"summary":"List API keys","description":"Lists the organization's API keys. Returns metadata only: the secret and its hash are never returned. Requires a dashboard or device-login session; API keys cannot call this route."},"post":{"parameters":[],"responses":{"201":{"content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"object","required":["id","name","prefix","permissions","lastUsedAt","expiresAt","createdAt","createdBy"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"description":"Display prefix only, for example wraps_live_abcdefgh... The full key is never shown again after creation.","type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}}},"secretKey":{"description":"The full API key. It is returned only in this response and cannot be retrieved again. Store it now.","type":"string"}},"required":["apiKey","secretKey"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"apiKey":{"type":"object","required":["id","name","prefix","permissions","lastUsedAt","expiresAt","createdAt","createdBy"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"description":"Display prefix only, for example wraps_live_abcdefgh... The full key is never shown again after creation.","type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}}},"secretKey":{"description":"The full API key. It is returned only in this response and cannot be retrieved again. Store it now.","type":"string"}},"required":["apiKey","secretKey"]}},"text/plain":{"schema":{"type":"object","properties":{"apiKey":{"type":"object","required":["id","name","prefix","permissions","lastUsedAt","expiresAt","createdAt","createdBy"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"description":"Display prefix only, for example wraps_live_abcdefgh... The full key is never shown again after creation.","type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}}},"secretKey":{"description":"The full API key. It is returned only in this response and cannot be retrieved again. Store it now.","type":"string"}},"required":["apiKey","secretKey"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1Api-keys","tags":["api-keys"],"summary":"Create an API key","description":"Creates an API key for the organization and returns the full secret once, in secretKey. Only the hash is stored. Requires a dashboard or device-login session; API keys cannot call this route.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"maxLength":200,"type":"string"},"type":{"anyOf":[{"const":"live","type":"string"},{"const":"test","type":"string"},{"const":"restricted","type":"string"}]},"permissions":{"anyOf":[{"type":"array","items":{"anyOf":[{"const":"contacts:read","type":"string"},{"const":"contacts:write","type":"string"},{"const":"topics:read","type":"string"},{"const":"topics:write","type":"string"},{"const":"segments:read","type":"string"},{"const":"segments:write","type":"string"},{"const":"campaigns:read","type":"string"},{"const":"campaigns:write","type":"string"},{"const":"workflows:read","type":"string"},{"const":"workflows:write","type":"string"},{"const":"analytics:read","type":"string"},{"const":"send:email","type":"string"}]}},{"const":"full","type":"string"},{"const":"readonly","type":"string"}]},"expiresInDays":{"minimum":1,"maximum":3650,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":3650,"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"maxLength":200,"type":"string"},"type":{"anyOf":[{"const":"live","type":"string"},{"const":"test","type":"string"},{"const":"restricted","type":"string"}]},"permissions":{"anyOf":[{"type":"array","items":{"anyOf":[{"const":"contacts:read","type":"string"},{"const":"contacts:write","type":"string"},{"const":"topics:read","type":"string"},{"const":"topics:write","type":"string"},{"const":"segments:read","type":"string"},{"const":"segments:write","type":"string"},{"const":"campaigns:read","type":"string"},{"const":"campaigns:write","type":"string"},{"const":"workflows:read","type":"string"},{"const":"workflows:write","type":"string"},{"const":"analytics:read","type":"string"},{"const":"send:email","type":"string"}]}},{"const":"full","type":"string"},{"const":"readonly","type":"string"}]},"expiresInDays":{"minimum":1,"maximum":3650,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":3650,"type":"integer"}]}}}},"text/plain":{"schema":{"type":"object","required":["name"],"properties":{"name":{"maxLength":200,"type":"string"},"type":{"anyOf":[{"const":"live","type":"string"},{"const":"test","type":"string"},{"const":"restricted","type":"string"}]},"permissions":{"anyOf":[{"type":"array","items":{"anyOf":[{"const":"contacts:read","type":"string"},{"const":"contacts:write","type":"string"},{"const":"topics:read","type":"string"},{"const":"topics:write","type":"string"},{"const":"segments:read","type":"string"},{"const":"segments:write","type":"string"},{"const":"campaigns:read","type":"string"},{"const":"campaigns:write","type":"string"},{"const":"workflows:read","type":"string"},{"const":"workflows:write","type":"string"},{"const":"analytics:read","type":"string"},{"const":"send:email","type":"string"}]}},{"const":"full","type":"string"},{"const":"readonly","type":"string"}]},"expiresInDays":{"minimum":1,"maximum":3650,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":3650,"type":"integer"}]}}}}}}}},"/v1/api-keys/{id}":{"delete":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true},{"description":"Must be true. Revoking a key cannot be undone and breaks every integration that uses it.","schema":{"type":"boolean"},"in":"query","name":"confirm","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteV1Api-keysById","tags":["api-keys"],"summary":"Revoke an API key","description":"Permanently revokes an API key. Requests that use it fail immediately. Requires confirm=true. Requires a dashboard or device-login session; API keys cannot call this route."}},"/v1/suppressions/":{"get":{"parameters":[{"schema":{"type":"string","maxLength":128},"in":"query","name":"awsAccountId","required":false},{"schema":{"anyOf":[{"const":"BOUNCE","type":"string"},{"const":"COMPLAINT","type":"string"}]},"in":"query","name":"reason","required":false},{"schema":{"minimum":1,"maximum":100,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":100,"type":"number"}]},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":8192},"in":"query","name":"cursor","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","required":["email","reason","lastUpdated","awsAccountId","region"],"properties":{"email":{"type":"string"},"reason":{"anyOf":[{"const":"BOUNCE","type":"string"},{"const":"COMPLAINT","type":"string"}]},"lastUpdated":{"type":"string"},"awsAccountId":{"type":"string"},"region":{"type":"string"}}}},"nextCursor":{"type":"string"},"hasMore":{"type":"boolean"},"deniedAccountIds":{"type":"array","items":{"type":"string"}},"unreachableAccountIds":{"type":"array","items":{"type":"string"}}},"required":["entries","hasMore","deniedAccountIds","unreachableAccountIds"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","required":["email","reason","lastUpdated","awsAccountId","region"],"properties":{"email":{"type":"string"},"reason":{"anyOf":[{"const":"BOUNCE","type":"string"},{"const":"COMPLAINT","type":"string"}]},"lastUpdated":{"type":"string"},"awsAccountId":{"type":"string"},"region":{"type":"string"}}}},"nextCursor":{"type":"string"},"hasMore":{"type":"boolean"},"deniedAccountIds":{"type":"array","items":{"type":"string"}},"unreachableAccountIds":{"type":"array","items":{"type":"string"}}},"required":["entries","hasMore","deniedAccountIds","unreachableAccountIds"]}},"text/plain":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","required":["email","reason","lastUpdated","awsAccountId","region"],"properties":{"email":{"type":"string"},"reason":{"anyOf":[{"const":"BOUNCE","type":"string"},{"const":"COMPLAINT","type":"string"}]},"lastUpdated":{"type":"string"},"awsAccountId":{"type":"string"},"region":{"type":"string"}}}},"nextCursor":{"type":"string"},"hasMore":{"type":"boolean"},"deniedAccountIds":{"type":"array","items":{"type":"string"}},"unreachableAccountIds":{"type":"array","items":{"type":"string"}}},"required":["entries","hasMore","deniedAccountIds","unreachableAccountIds"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"operationId":"getV1Suppressions","tags":["suppressions"],"summary":"List suppressed addresses","description":"Lists the SES account-level suppression list. Without awsAccountId it reads every AWS account connected to the org; with it, only that account (404 if the account is not in this org). Pass the nextCursor from a previous page unchanged to continue. Entries carry the AWS account they came from. Accounts that denied access or could not be reached are listed in deniedAccountIds and unreachableAccountIds. Requires awsAccounts:read."},"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"email":{"type":"string"},"awsAccountId":{"type":"string"},"alreadyPresent":{"type":"boolean"}},"required":["success","email","awsAccountId","alreadyPresent"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"email":{"type":"string"},"awsAccountId":{"type":"string"},"alreadyPresent":{"type":"boolean"}},"required":["success","email","awsAccountId","alreadyPresent"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"email":{"type":"string"},"awsAccountId":{"type":"string"},"alreadyPresent":{"type":"boolean"}},"required":["success","email","awsAccountId","alreadyPresent"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"operationId":"postV1Suppressions","tags":["suppressions"],"summary":"Add a suppressed address","description":"Adds one address to the SES suppression list of the given AWS account, so Wraps stops sending to it. The address is trimmed and lowercased. Repeat adds are idempotent: an address already suppressed (or already a COMPLAINT) returns alreadyPresent true and writes nothing new. A BOUNCE can be upgraded to COMPLAINT; a COMPLAINT is never downgraded. A matching contact is set to suppressed so broadcasts skip it. Undo with DELETE /v1/suppressions/:email?awsAccountId=...&confirm=true. Requires awsAccounts:write; API keys need contacts:write.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["awsAccountId","email","reason"],"properties":{"awsAccountId":{"minLength":1,"maxLength":128,"type":"string"},"email":{"description":"Email address to suppress.","type":"string"},"reason":{"description":"BOUNCE or COMPLAINT.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["awsAccountId","email","reason"],"properties":{"awsAccountId":{"minLength":1,"maxLength":128,"type":"string"},"email":{"description":"Email address to suppress.","type":"string"},"reason":{"description":"BOUNCE or COMPLAINT.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["awsAccountId","email","reason"],"properties":{"awsAccountId":{"minLength":1,"maxLength":128,"type":"string"},"email":{"description":"Email address to suppress.","type":"string"},"reason":{"description":"BOUNCE or COMPLAINT.","type":"string"}}}}}}}},"/v1/suppressions/bulk":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"anyOf":[{"type":"object","required":["email","success","alreadyPresent"],"properties":{"email":{"type":"string"},"success":{"const":true,"type":"boolean"},"alreadyPresent":{"type":"boolean"}}},{"type":"object","required":["email","success","error"],"properties":{"email":{"type":"string"},"success":{"const":false,"type":"boolean"},"error":{"type":"string"}}}]}}},"required":["results"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"anyOf":[{"type":"object","required":["email","success","alreadyPresent"],"properties":{"email":{"type":"string"},"success":{"const":true,"type":"boolean"},"alreadyPresent":{"type":"boolean"}}},{"type":"object","required":["email","success","error"],"properties":{"email":{"type":"string"},"success":{"const":false,"type":"boolean"},"error":{"type":"string"}}}]}}},"required":["results"]}},"text/plain":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"anyOf":[{"type":"object","required":["email","success","alreadyPresent"],"properties":{"email":{"type":"string"},"success":{"const":true,"type":"boolean"},"alreadyPresent":{"type":"boolean"}}},{"type":"object","required":["email","success","error"],"properties":{"email":{"type":"string"},"success":{"const":false,"type":"boolean"},"error":{"type":"string"}}}]}}},"required":["results"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1SuppressionsBulk","tags":["suppressions"],"summary":"Add many suppressed addresses","description":"Adds up to 100 addresses in one request, each with the same rules as POST /v1/suppressions. The response has one result per entry, in request order. An entry that fails (invalid address, an AWS account outside the org, SES denied, or an SES error) fails only itself; the rest still run. An empty list or more than 100 entries is refused with 400. Undo each address with DELETE /v1/suppressions/:email. Requires awsAccounts:write; API keys need contacts:write.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entries"],"properties":{"entries":{"description":"Between 1 and 100 entries. Each entry has its own awsAccountId.","type":"array","items":{"type":"object","required":["awsAccountId","email","reason"],"properties":{"awsAccountId":{"minLength":1,"maxLength":128,"type":"string"},"email":{"description":"Email address to suppress.","type":"string"},"reason":{"description":"BOUNCE or COMPLAINT.","type":"string"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["entries"],"properties":{"entries":{"description":"Between 1 and 100 entries. Each entry has its own awsAccountId.","type":"array","items":{"type":"object","required":["awsAccountId","email","reason"],"properties":{"awsAccountId":{"minLength":1,"maxLength":128,"type":"string"},"email":{"description":"Email address to suppress.","type":"string"},"reason":{"description":"BOUNCE or COMPLAINT.","type":"string"}}}}}}},"text/plain":{"schema":{"type":"object","required":["entries"],"properties":{"entries":{"description":"Between 1 and 100 entries. Each entry has its own awsAccountId.","type":"array","items":{"type":"object","required":["awsAccountId","email","reason"],"properties":{"awsAccountId":{"minLength":1,"maxLength":128,"type":"string"},"email":{"description":"Email address to suppress.","type":"string"},"reason":{"description":"BOUNCE or COMPLAINT.","type":"string"}}}}}}}}}}},"/v1/suppressions/{email}":{"delete":{"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":320},"in":"path","name":"email","required":true},{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"query","name":"awsAccountId","required":true},{"schema":{"type":"string"},"in":"query","name":"confirm","required":false},{"schema":{"type":"string"},"in":"query","name":"acknowledgedComplaint","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"email":{"type":"string"},"wasPresent":{"type":"boolean"}},"required":["success","email","wasPresent"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"email":{"type":"string"},"wasPresent":{"type":"boolean"}},"required":["success","email","wasPresent"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"email":{"type":"string"},"wasPresent":{"type":"boolean"}},"required":["success","email","wasPresent"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"502":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"operationId":"deleteV1SuppressionsByEmail","tags":["suppressions"],"summary":"Remove a suppressed address","description":"Removes one address from the SES suppression list of the given AWS account. Destructive: pass confirm=true, or the request is refused with 400 before anything changes. Addresses suppressed for a spam complaint also need acknowledgedComplaint=true (409 otherwise). Percent-encode the email in the path. A contact for this address whose status is suppressed becomes active again; other statuses are unchanged. Requires awsAccounts:write."}},"/v1/topics/":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"topics":{"type":"array","items":{"type":"object","required":["id","name","slug","description","public","doubleOptIn","subscriberCount","sendableCount","pendingCount","createdAt","updatedAt","createdBy"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"public":{"description":"Visible on the preference center.","type":"boolean"},"doubleOptIn":{"type":"boolean"},"subscriberCount":{"description":"Opted-in contacts, including ones a broadcast would not reach.","type":"number"},"sendableCount":{"description":"Subscribed contacts a broadcast to this topic would actually reach right now.","type":"number"},"pendingCount":{"description":"Waiting on a double opt-in confirmation. Broadcasts skip these.","type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}}}}},"required":["topics"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"topics":{"type":"array","items":{"type":"object","required":["id","name","slug","description","public","doubleOptIn","subscriberCount","sendableCount","pendingCount","createdAt","updatedAt","createdBy"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"public":{"description":"Visible on the preference center.","type":"boolean"},"doubleOptIn":{"type":"boolean"},"subscriberCount":{"description":"Opted-in contacts, including ones a broadcast would not reach.","type":"number"},"sendableCount":{"description":"Subscribed contacts a broadcast to this topic would actually reach right now.","type":"number"},"pendingCount":{"description":"Waiting on a double opt-in confirmation. Broadcasts skip these.","type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}}}}},"required":["topics"]}},"text/plain":{"schema":{"type":"object","properties":{"topics":{"type":"array","items":{"type":"object","required":["id","name","slug","description","public","doubleOptIn","subscriberCount","sendableCount","pendingCount","createdAt","updatedAt","createdBy"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"public":{"description":"Visible on the preference center.","type":"boolean"},"doubleOptIn":{"type":"boolean"},"subscriberCount":{"description":"Opted-in contacts, including ones a broadcast would not reach.","type":"number"},"sendableCount":{"description":"Subscribed contacts a broadcast to this topic would actually reach right now.","type":"number"},"pendingCount":{"description":"Waiting on a double opt-in confirmation. Broadcasts skip these.","type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}}}}},"required":["topics"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1Topics","tags":["topics"],"summary":"List topics","description":"Lists the organization's topics with subscriber, sendable and pending counts. Requires a Pro plan or higher."},"post":{"parameters":[],"responses":{"201":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"public":{"description":"Visible on the preference center.","type":"boolean"},"doubleOptIn":{"type":"boolean"},"subscriberCount":{"description":"Opted-in contacts, including ones a broadcast would not reach.","type":"number"},"sendableCount":{"description":"Subscribed contacts a broadcast to this topic would actually reach right now.","type":"number"},"pendingCount":{"description":"Waiting on a double opt-in confirmation. Broadcasts skip these.","type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}},"required":["id","name","slug","description","public","doubleOptIn","subscriberCount","sendableCount","pendingCount","createdAt","updatedAt","createdBy"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"public":{"description":"Visible on the preference center.","type":"boolean"},"doubleOptIn":{"type":"boolean"},"subscriberCount":{"description":"Opted-in contacts, including ones a broadcast would not reach.","type":"number"},"sendableCount":{"description":"Subscribed contacts a broadcast to this topic would actually reach right now.","type":"number"},"pendingCount":{"description":"Waiting on a double opt-in confirmation. Broadcasts skip these.","type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}},"required":["id","name","slug","description","public","doubleOptIn","subscriberCount","sendableCount","pendingCount","createdAt","updatedAt","createdBy"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"public":{"description":"Visible on the preference center.","type":"boolean"},"doubleOptIn":{"type":"boolean"},"subscriberCount":{"description":"Opted-in contacts, including ones a broadcast would not reach.","type":"number"},"sendableCount":{"description":"Subscribed contacts a broadcast to this topic would actually reach right now.","type":"number"},"pendingCount":{"description":"Waiting on a double opt-in confirmation. Broadcasts skip these.","type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}},"required":["id","name","slug","description","public","doubleOptIn","subscriberCount","sendableCount","pendingCount","createdAt","updatedAt","createdBy"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1Topics","tags":["topics"],"summary":"Create a topic","description":"Creates a topic. The slug is generated from the name unless one is passed; slugs are unique per organization.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"slug":{"minLength":1,"maxLength":200,"type":"string"},"description":{"type":"string"},"public":{"type":"boolean"},"doubleOptIn":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"slug":{"minLength":1,"maxLength":200,"type":"string"},"description":{"type":"string"},"public":{"type":"boolean"},"doubleOptIn":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"slug":{"minLength":1,"maxLength":200,"type":"string"},"description":{"type":"string"},"public":{"type":"boolean"},"doubleOptIn":{"type":"boolean"}}}}}}}},"/v1/topics/{id}":{"get":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"public":{"description":"Visible on the preference center.","type":"boolean"},"doubleOptIn":{"type":"boolean"},"subscriberCount":{"description":"Opted-in contacts, including ones a broadcast would not reach.","type":"number"},"sendableCount":{"description":"Subscribed contacts a broadcast to this topic would actually reach right now.","type":"number"},"pendingCount":{"description":"Waiting on a double opt-in confirmation. Broadcasts skip these.","type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}},"required":["id","name","slug","description","public","doubleOptIn","subscriberCount","sendableCount","pendingCount","createdAt","updatedAt","createdBy"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"public":{"description":"Visible on the preference center.","type":"boolean"},"doubleOptIn":{"type":"boolean"},"subscriberCount":{"description":"Opted-in contacts, including ones a broadcast would not reach.","type":"number"},"sendableCount":{"description":"Subscribed contacts a broadcast to this topic would actually reach right now.","type":"number"},"pendingCount":{"description":"Waiting on a double opt-in confirmation. Broadcasts skip these.","type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}},"required":["id","name","slug","description","public","doubleOptIn","subscriberCount","sendableCount","pendingCount","createdAt","updatedAt","createdBy"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"public":{"description":"Visible on the preference center.","type":"boolean"},"doubleOptIn":{"type":"boolean"},"subscriberCount":{"description":"Opted-in contacts, including ones a broadcast would not reach.","type":"number"},"sendableCount":{"description":"Subscribed contacts a broadcast to this topic would actually reach right now.","type":"number"},"pendingCount":{"description":"Waiting on a double opt-in confirmation. Broadcasts skip these.","type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}},"required":["id","name","slug","description","public","doubleOptIn","subscriberCount","sendableCount","pendingCount","createdAt","updatedAt","createdBy"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1TopicsById","tags":["topics"],"summary":"Get a topic","description":"Returns a single topic with its audience counts."},"patch":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"public":{"description":"Visible on the preference center.","type":"boolean"},"doubleOptIn":{"type":"boolean"},"subscriberCount":{"description":"Opted-in contacts, including ones a broadcast would not reach.","type":"number"},"sendableCount":{"description":"Subscribed contacts a broadcast to this topic would actually reach right now.","type":"number"},"pendingCount":{"description":"Waiting on a double opt-in confirmation. Broadcasts skip these.","type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}},"required":["id","name","slug","description","public","doubleOptIn","subscriberCount","sendableCount","pendingCount","createdAt","updatedAt","createdBy"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"public":{"description":"Visible on the preference center.","type":"boolean"},"doubleOptIn":{"type":"boolean"},"subscriberCount":{"description":"Opted-in contacts, including ones a broadcast would not reach.","type":"number"},"sendableCount":{"description":"Subscribed contacts a broadcast to this topic would actually reach right now.","type":"number"},"pendingCount":{"description":"Waiting on a double opt-in confirmation. Broadcasts skip these.","type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}},"required":["id","name","slug","description","public","doubleOptIn","subscriberCount","sendableCount","pendingCount","createdAt","updatedAt","createdBy"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"public":{"description":"Visible on the preference center.","type":"boolean"},"doubleOptIn":{"type":"boolean"},"subscriberCount":{"description":"Opted-in contacts, including ones a broadcast would not reach.","type":"number"},"sendableCount":{"description":"Subscribed contacts a broadcast to this topic would actually reach right now.","type":"number"},"pendingCount":{"description":"Waiting on a double opt-in confirmation. Broadcasts skip these.","type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdBy":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}}},{"type":"null"}]}},"required":["id","name","slug","description","public","doubleOptIn","subscriberCount","sendableCount","pendingCount","createdAt","updatedAt","createdBy"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchV1TopicsById","tags":["topics"],"summary":"Update a topic","description":"Partially updates a topic. Only the fields passed are changed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"slug":{"minLength":1,"maxLength":200,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"public":{"type":"boolean"},"doubleOptIn":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"slug":{"minLength":1,"maxLength":200,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"public":{"type":"boolean"},"doubleOptIn":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"slug":{"minLength":1,"maxLength":200,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"public":{"type":"boolean"},"doubleOptIn":{"type":"boolean"}}}}}}},"delete":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true},{"description":"Must be the string `true` to delete. Required.","schema":{"type":"string"},"in":"query","name":"confirm","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteV1TopicsById","tags":["topics"],"summary":"Delete a topic","description":"Deletes a topic and every subscription to it. Destructive: requires `confirm=true` in the query string or the request is refused with 400."}},"/v1/topics/{id}/subscribers":{"get":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true},{"schema":{"type":"number","default":1,"minimum":1},"in":"query","name":"page","required":false},{"schema":{"type":"number","default":50,"minimum":1,"maximum":100},"in":"query","name":"pageSize","required":false},{"schema":{"anyOf":[{"const":"subscribed","type":"string"},{"const":"pending","type":"string"},{"const":"unsubscribed","type":"string"}]},"in":"query","name":"status","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"subscribers":{"type":"array","items":{"type":"object","required":["contactId","email","status","subscribedAt","unsubscribedAt"],"properties":{"contactId":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"subscribedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"unsubscribedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["subscribers","total","page","pageSize"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"subscribers":{"type":"array","items":{"type":"object","required":["contactId","email","status","subscribedAt","unsubscribedAt"],"properties":{"contactId":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"subscribedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"unsubscribedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["subscribers","total","page","pageSize"]}},"text/plain":{"schema":{"type":"object","properties":{"subscribers":{"type":"array","items":{"type":"object","required":["contactId","email","status","subscribedAt","unsubscribedAt"],"properties":{"contactId":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"subscribedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"unsubscribedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["subscribers","total","page","pageSize"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1TopicsByIdSubscribers","tags":["topics"],"summary":"List topic subscribers","description":"Paginated subscribers of a topic, filterable by status. `pending` covers double opt-in contacts who have not confirmed yet."}},"/v1/brand-kits/":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"brandKits":{"type":"array","items":{"type":"object","required":["id","organizationId","name","logoUrl","primaryColor","secondaryColor","backgroundColor","textColor","fontFamily","headingFontFamily","buttonStyle","buttonRadius","companyName","companyAddress","socialLinks","sourceDomain","autoExtracted","isDefault","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"description":"Dashboard values: rounded, square or pill.","type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"True for exactly one kit per organization, when any exist.","type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}},"count":{"description":"Number of kits returned, which is every kit in the org.","type":"number"}},"required":["brandKits","count"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"brandKits":{"type":"array","items":{"type":"object","required":["id","organizationId","name","logoUrl","primaryColor","secondaryColor","backgroundColor","textColor","fontFamily","headingFontFamily","buttonStyle","buttonRadius","companyName","companyAddress","socialLinks","sourceDomain","autoExtracted","isDefault","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"description":"Dashboard values: rounded, square or pill.","type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"True for exactly one kit per organization, when any exist.","type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}},"count":{"description":"Number of kits returned, which is every kit in the org.","type":"number"}},"required":["brandKits","count"]}},"text/plain":{"schema":{"type":"object","properties":{"brandKits":{"type":"array","items":{"type":"object","required":["id","organizationId","name","logoUrl","primaryColor","secondaryColor","backgroundColor","textColor","fontFamily","headingFontFamily","buttonStyle","buttonRadius","companyName","companyAddress","socialLinks","sourceDomain","autoExtracted","isDefault","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"description":"Dashboard values: rounded, square or pill.","type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"True for exactly one kit per organization, when any exist.","type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}},"count":{"description":"Number of kits returned, which is every kit in the org.","type":"number"}},"required":["brandKits","count"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1Brand-kits","tags":["brand-kits"],"summary":"List brand kits","description":"Lists every brand kit in the organization in one response. Unpaginated: there is no limit or cursor, and `count` equals the number of kits returned. The default kit comes first, then the most recently updated."},"post":{"parameters":[],"responses":{"201":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"description":"Dashboard values: rounded, square or pill.","type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"True for exactly one kit per organization, when any exist.","type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","logoUrl","primaryColor","secondaryColor","backgroundColor","textColor","fontFamily","headingFontFamily","buttonStyle","buttonRadius","companyName","companyAddress","socialLinks","sourceDomain","autoExtracted","isDefault","createdAt","updatedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"description":"Dashboard values: rounded, square or pill.","type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"True for exactly one kit per organization, when any exist.","type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","logoUrl","primaryColor","secondaryColor","backgroundColor","textColor","fontFamily","headingFontFamily","buttonStyle","buttonRadius","companyName","companyAddress","socialLinks","sourceDomain","autoExtracted","isDefault","createdAt","updatedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"description":"Dashboard values: rounded, square or pill.","type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"True for exactly one kit per organization, when any exist.","type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","logoUrl","primaryColor","secondaryColor","backgroundColor","textColor","fontFamily","headingFontFamily","buttonStyle","buttonRadius","companyName","companyAddress","socialLinks","sourceDomain","autoExtracted","isDefault","createdAt","updatedAt"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1Brand-kits","tags":["brand-kits"],"summary":"Create a brand kit","description":"Creates a brand kit. A blank name becomes 'Untitled Brand Kit'. The first kit in the organization is the default; later kits become the default only when `isDefault` is true, which clears the previous default.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"The first kit in an organization is always the default. Otherwise pass true to make this kit the default.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"The first kit in an organization is always the default. Otherwise pass true to make this kit the default.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","properties":{"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"The first kit in an organization is always the default. Otherwise pass true to make this kit the default.","type":"boolean"}}}}}}}},"/v1/brand-kits/{id}":{"get":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"description":"Dashboard values: rounded, square or pill.","type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"True for exactly one kit per organization, when any exist.","type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","logoUrl","primaryColor","secondaryColor","backgroundColor","textColor","fontFamily","headingFontFamily","buttonStyle","buttonRadius","companyName","companyAddress","socialLinks","sourceDomain","autoExtracted","isDefault","createdAt","updatedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"description":"Dashboard values: rounded, square or pill.","type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"True for exactly one kit per organization, when any exist.","type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","logoUrl","primaryColor","secondaryColor","backgroundColor","textColor","fontFamily","headingFontFamily","buttonStyle","buttonRadius","companyName","companyAddress","socialLinks","sourceDomain","autoExtracted","isDefault","createdAt","updatedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"description":"Dashboard values: rounded, square or pill.","type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"True for exactly one kit per organization, when any exist.","type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","logoUrl","primaryColor","secondaryColor","backgroundColor","textColor","fontFamily","headingFontFamily","buttonStyle","buttonRadius","companyName","companyAddress","socialLinks","sourceDomain","autoExtracted","isDefault","createdAt","updatedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1Brand-kitsById","tags":["brand-kits"],"summary":"Get a brand kit","description":"Returns a single brand kit in the organization."},"patch":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"description":"Dashboard values: rounded, square or pill.","type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"True for exactly one kit per organization, when any exist.","type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","logoUrl","primaryColor","secondaryColor","backgroundColor","textColor","fontFamily","headingFontFamily","buttonStyle","buttonRadius","companyName","companyAddress","socialLinks","sourceDomain","autoExtracted","isDefault","createdAt","updatedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"description":"Dashboard values: rounded, square or pill.","type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"True for exactly one kit per organization, when any exist.","type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","logoUrl","primaryColor","secondaryColor","backgroundColor","textColor","fontFamily","headingFontFamily","buttonStyle","buttonRadius","companyName","companyAddress","socialLinks","sourceDomain","autoExtracted","isDefault","createdAt","updatedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"description":"Dashboard values: rounded, square or pill.","type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"True for exactly one kit per organization, when any exist.","type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","logoUrl","primaryColor","secondaryColor","backgroundColor","textColor","fontFamily","headingFontFamily","buttonStyle","buttonRadius","companyName","companyAddress","socialLinks","sourceDomain","autoExtracted","isDefault","createdAt","updatedAt"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchV1Brand-kitsById","tags":["brand-kits"],"summary":"Update a brand kit","description":"Partially updates a brand kit. Only the fields passed are changed. A blank name is refused with 400. To change the default, use POST /:id/default.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","properties":{"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"delete":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true},{"description":"Must be the string `true` to delete. Required.","schema":{"type":"string"},"in":"query","name":"confirm","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteV1Brand-kitsById","tags":["brand-kits"],"summary":"Delete a brand kit","description":"Deletes a brand kit. Destructive: requires `confirm=true` in the query string or the request is refused with 400. Deleting the default promotes another kit; templates that used the kit lose the link."}},"/v1/brand-kits/{id}/default":{"post":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"description":"Dashboard values: rounded, square or pill.","type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"True for exactly one kit per organization, when any exist.","type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","logoUrl","primaryColor","secondaryColor","backgroundColor","textColor","fontFamily","headingFontFamily","buttonStyle","buttonRadius","companyName","companyAddress","socialLinks","sourceDomain","autoExtracted","isDefault","createdAt","updatedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"description":"Dashboard values: rounded, square or pill.","type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"True for exactly one kit per organization, when any exist.","type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","logoUrl","primaryColor","secondaryColor","backgroundColor","textColor","fontFamily","headingFontFamily","buttonStyle","buttonRadius","companyName","companyAddress","socialLinks","sourceDomain","autoExtracted","isDefault","createdAt","updatedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryColor":{"type":"string"},"secondaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"fontFamily":{"type":"string"},"headingFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"buttonStyle":{"description":"Dashboard values: rounded, square or pill.","type":"string"},"buttonRadius":{"type":"string"},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"socialLinks":{"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"type":"string"},"url":{"type":"string"}}}},"sourceDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoExtracted":{"type":"boolean"},"isDefault":{"description":"True for exactly one kit per organization, when any exist.","type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","logoUrl","primaryColor","secondaryColor","backgroundColor","textColor","fontFamily","headingFontFamily","buttonStyle","buttonRadius","companyName","companyAddress","socialLinks","sourceDomain","autoExtracted","isDefault","createdAt","updatedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1Brand-kitsByIdDefault","tags":["brand-kits"],"summary":"Set the default brand kit","description":"Makes this brand kit the organization's only default. The previous default is cleared in the same transaction."}},"/v1/events/":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"contactCreated":{"description":"Whether a new contact was created","type":"boolean"},"workflowsTriggered":{"description":"Number of workflows triggered","type":"number"},"executionsResumed":{"description":"Number of executions resumed","type":"number"}},"required":["success","contactCreated","workflowsTriggered","executionsResumed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"contactCreated":{"description":"Whether a new contact was created","type":"boolean"},"workflowsTriggered":{"description":"Number of workflows triggered","type":"number"},"executionsResumed":{"description":"Number of executions resumed","type":"number"}},"required":["success","contactCreated","workflowsTriggered","executionsResumed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"contactCreated":{"description":"Whether a new contact was created","type":"boolean"},"workflowsTriggered":{"description":"Number of workflows triggered","type":"number"},"executionsResumed":{"description":"Number of executions resumed","type":"number"}},"required":["success","contactCreated","workflowsTriggered","executionsResumed"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1Events","summary":"Ingest event","description":"Send a custom event to trigger workflows and resume waiting executions","tags":["events"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"description":"Event name (e.g., 'purchase.completed')","maxLength":255,"type":"string"},"contactId":{"description":"Contact ID","maxLength":36,"type":"string"},"contactExternalId":{"description":"Contact externalId (alternative to contactId)","maxLength":255,"type":"string"},"contactEmail":{"description":"Contact email (alternative to contactId)","maxLength":255,"format":"email","type":"string"},"contactName":{"description":"Contact name (used when createIfMissing is true to set firstName)","maxLength":100,"type":"string"},"createIfMissing":{"description":"If true and contact doesn't exist, create a new contact with the provided email","default":false,"type":"boolean"},"properties":{"additionalProperties":true,"description":"Event properties","type":"object","properties":{}}},"additionalProperties":false}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"description":"Event name (e.g., 'purchase.completed')","maxLength":255,"type":"string"},"contactId":{"description":"Contact ID","maxLength":36,"type":"string"},"contactExternalId":{"description":"Contact externalId (alternative to contactId)","maxLength":255,"type":"string"},"contactEmail":{"description":"Contact email (alternative to contactId)","maxLength":255,"format":"email","type":"string"},"contactName":{"description":"Contact name (used when createIfMissing is true to set firstName)","maxLength":100,"type":"string"},"createIfMissing":{"description":"If true and contact doesn't exist, create a new contact with the provided email","default":false,"type":"boolean"},"properties":{"additionalProperties":true,"description":"Event properties","type":"object","properties":{}}},"additionalProperties":false}},"text/plain":{"schema":{"type":"object","required":["name"],"properties":{"name":{"description":"Event name (e.g., 'purchase.completed')","maxLength":255,"type":"string"},"contactId":{"description":"Contact ID","maxLength":36,"type":"string"},"contactExternalId":{"description":"Contact externalId (alternative to contactId)","maxLength":255,"type":"string"},"contactEmail":{"description":"Contact email (alternative to contactId)","maxLength":255,"format":"email","type":"string"},"contactName":{"description":"Contact name (used when createIfMissing is true to set firstName)","maxLength":100,"type":"string"},"createIfMissing":{"description":"If true and contact doesn't exist, create a new contact with the provided email","default":false,"type":"boolean"},"properties":{"additionalProperties":true,"description":"Event properties","type":"object","properties":{}}},"additionalProperties":false}}}}},"get":{"parameters":[{"description":"Page number (1-indexed)","schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Items per page (1-100, default 50)","schema":{"type":"string"},"in":"query","name":"pageSize","required":false},{"description":"Exact event name","schema":{"type":"string"},"in":"query","name":"eventName","required":false},{"description":"Case-insensitive match on event name, event data, or contact name/email (max 255)","schema":{"type":"string"},"in":"query","name":"search","required":false},{"description":"Case-insensitive contact email match","schema":{"type":"string"},"in":"query","name":"contactEmail","required":false},{"description":"ISO 8601 lower bound on createdAt","schema":{"type":"string"},"in":"query","name":"dateFrom","required":false},{"description":"ISO 8601 upper bound on createdAt","schema":{"type":"string"},"in":"query","name":"dateTo","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","required":["id","eventName","eventData","createdAt","contactId","contactEmail","contactFirstName","contactLastName"],"properties":{"id":{"type":"string"},"eventName":{"type":"string"},"eventData":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"createdAt":{"description":"ISO 8601 timestamp","type":"string"},"contactId":{"type":"string"},"contactEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactFirstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactLastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["events","total","page","pageSize"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","required":["id","eventName","eventData","createdAt","contactId","contactEmail","contactFirstName","contactLastName"],"properties":{"id":{"type":"string"},"eventName":{"type":"string"},"eventData":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"createdAt":{"description":"ISO 8601 timestamp","type":"string"},"contactId":{"type":"string"},"contactEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactFirstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactLastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["events","total","page","pageSize"]}},"text/plain":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","required":["id","eventName","eventData","createdAt","contactId","contactEmail","contactFirstName","contactLastName"],"properties":{"id":{"type":"string"},"eventName":{"type":"string"},"eventData":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"createdAt":{"description":"ISO 8601 timestamp","type":"string"},"contactId":{"type":"string"},"contactEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactFirstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactLastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["events","total","page","pageSize"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1Events","tags":["events"],"summary":"List events","description":"Paginated contact events for the organization, newest first. Requires contacts:read."}},"/v1/events/batch":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"processed":{"description":"Number of events processed","type":"number"},"workflowsTriggered":{"description":"Total workflows triggered","type":"number"},"executionsResumed":{"description":"Total executions resumed","type":"number"},"errors":{"description":"Error messages if any","type":"array","items":{"type":"string"}}},"required":["success","processed","workflowsTriggered","executionsResumed","errors"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"processed":{"description":"Number of events processed","type":"number"},"workflowsTriggered":{"description":"Total workflows triggered","type":"number"},"executionsResumed":{"description":"Total executions resumed","type":"number"},"errors":{"description":"Error messages if any","type":"array","items":{"type":"string"}}},"required":["success","processed","workflowsTriggered","executionsResumed","errors"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"processed":{"description":"Number of events processed","type":"number"},"workflowsTriggered":{"description":"Total workflows triggered","type":"number"},"executionsResumed":{"description":"Total executions resumed","type":"number"},"errors":{"description":"Error messages if any","type":"array","items":{"type":"string"}}},"required":["success","processed","workflowsTriggered","executionsResumed","errors"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1EventsBatch","summary":"Batch ingest events","description":"Process multiple events in a single request","tags":["events"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["events"],"properties":{"events":{"description":"List of events to process","maxItems":1000,"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"maxLength":255,"type":"string"},"contactId":{"maxLength":36,"type":"string"},"contactExternalId":{"maxLength":255,"type":"string"},"contactEmail":{"maxLength":255,"type":"string"},"properties":{"additionalProperties":true,"type":"object","properties":{}}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["events"],"properties":{"events":{"description":"List of events to process","maxItems":1000,"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"maxLength":255,"type":"string"},"contactId":{"maxLength":36,"type":"string"},"contactExternalId":{"maxLength":255,"type":"string"},"contactEmail":{"maxLength":255,"type":"string"},"properties":{"additionalProperties":true,"type":"object","properties":{}}}}}}}},"text/plain":{"schema":{"type":"object","required":["events"],"properties":{"events":{"description":"List of events to process","maxItems":1000,"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"maxLength":255,"type":"string"},"contactId":{"maxLength":36,"type":"string"},"contactExternalId":{"maxLength":255,"type":"string"},"contactEmail":{"maxLength":255,"type":"string"},"properties":{"additionalProperties":true,"type":"object","properties":{}}}}}}}}}}}},"/v1/events/analytics":{"get":{"parameters":[{"description":"Window in days: 7 or 30 (default 30)","schema":{"type":"string"},"in":"query","name":"days","required":false},{"description":"IANA timezone for day boundaries (default UTC; invalid values fall back to UTC)","schema":{"type":"string","maxLength":64},"in":"query","name":"timezone","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"totalEvents":{"type":"number"},"eventsThisPeriod":{"type":"number"},"activeContacts":{"type":"number"},"avgEventsPerContact":{"type":"number"},"dailyEvents":{"type":"array","items":{"type":"object","required":["date","count"],"properties":{"date":{"type":"string"},"count":{"type":"number"}}}},"topEventNames":{"type":"array","items":{"type":"object","required":["name","count"],"properties":{"name":{"type":"string"},"count":{"type":"number"}}}}},"required":["totalEvents","eventsThisPeriod","activeContacts","avgEventsPerContact","dailyEvents","topEventNames"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"totalEvents":{"type":"number"},"eventsThisPeriod":{"type":"number"},"activeContacts":{"type":"number"},"avgEventsPerContact":{"type":"number"},"dailyEvents":{"type":"array","items":{"type":"object","required":["date","count"],"properties":{"date":{"type":"string"},"count":{"type":"number"}}}},"topEventNames":{"type":"array","items":{"type":"object","required":["name","count"],"properties":{"name":{"type":"string"},"count":{"type":"number"}}}}},"required":["totalEvents","eventsThisPeriod","activeContacts","avgEventsPerContact","dailyEvents","topEventNames"]}},"text/plain":{"schema":{"type":"object","properties":{"totalEvents":{"type":"number"},"eventsThisPeriod":{"type":"number"},"activeContacts":{"type":"number"},"avgEventsPerContact":{"type":"number"},"dailyEvents":{"type":"array","items":{"type":"object","required":["date","count"],"properties":{"date":{"type":"string"},"count":{"type":"number"}}}},"topEventNames":{"type":"array","items":{"type":"object","required":["name","count"],"properties":{"name":{"type":"string"},"count":{"type":"number"}}}}},"required":["totalEvents","eventsThisPeriod","activeContacts","avgEventsPerContact","dailyEvents","topEventNames"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1EventsAnalytics","tags":["events"],"summary":"Event analytics","description":"Totals, period count, active contacts, a zero-filled daily series and top event names for the last 7 or 30 days. Requires contacts:read."}},"/v1/events/names":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"eventNames":{"type":"array","items":{"type":"string"}}},"required":["eventNames"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"eventNames":{"type":"array","items":{"type":"string"}}},"required":["eventNames"]}},"text/plain":{"schema":{"type":"object","properties":{"eventNames":{"type":"array","items":{"type":"string"}}},"required":["eventNames"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1EventsNames","tags":["events"],"summary":"List event names","description":"Distinct event names recorded for the organization, sorted. Requires contacts:read."}},"/v1/events/{id}":{"get":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventName":{"type":"string"},"eventData":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"createdAt":{"description":"ISO 8601 timestamp","type":"string"},"contactId":{"type":"string"},"contactEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactFirstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactLastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","eventName","eventData","createdAt","contactId","contactEmail","contactFirstName","contactLastName"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventName":{"type":"string"},"eventData":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"createdAt":{"description":"ISO 8601 timestamp","type":"string"},"contactId":{"type":"string"},"contactEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactFirstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactLastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","eventName","eventData","createdAt","contactId","contactEmail","contactFirstName","contactLastName"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventName":{"type":"string"},"eventData":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"createdAt":{"description":"ISO 8601 timestamp","type":"string"},"contactId":{"type":"string"},"contactEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactFirstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactLastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","eventName","eventData","createdAt","contactId","contactEmail","contactFirstName","contactLastName"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1EventsById","tags":["events"],"summary":"Get an event","description":"One contact event by id. Returns 404 when the event does not exist in this organization. Requires contacts:read."}},"/v1/workflows/{workflowId}/trigger":{"post":{"parameters":[{"description":"Workflow ID to trigger","schema":{"type":"string","maxLength":36},"in":"path","name":"workflowId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"contactId":{"type":"string"},"error":{"type":"string"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"contactId":{"type":"string"},"error":{"type":"string"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"contactId":{"type":"string"},"error":{"type":"string"}},"required":["success"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1WorkflowsByWorkflowIdTrigger","summary":"Trigger workflow","description":"Trigger a specific workflow for a contact. The workflow must have triggerType 'api' and be enabled.","tags":["workflows"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contactId":{"description":"Contact ID","maxLength":36,"type":"string"},"contactEmail":{"description":"Contact email (alternative to contactId)","maxLength":255,"type":"string"},"data":{"additionalProperties":true,"description":"Data to pass to the workflow","type":"object","properties":{}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"contactId":{"description":"Contact ID","maxLength":36,"type":"string"},"contactEmail":{"description":"Contact email (alternative to contactId)","maxLength":255,"type":"string"},"data":{"additionalProperties":true,"description":"Data to pass to the workflow","type":"object","properties":{}}}}},"text/plain":{"schema":{"type":"object","properties":{"contactId":{"description":"Contact ID","maxLength":36,"type":"string"},"contactEmail":{"description":"Contact email (alternative to contactId)","maxLength":255,"type":"string"},"data":{"additionalProperties":true,"description":"Data to pass to the workflow","type":"object","properties":{}}}}}}}}},"/v1/workflows/{workflowId}/trigger/batch":{"post":{"parameters":[{"description":"Workflow ID to trigger","schema":{"type":"string","maxLength":36},"in":"path","name":"workflowId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"triggered":{"description":"Number of contacts triggered","type":"number"},"errors":{"description":"Error messages if any","type":"array","items":{"type":"string"}},"error":{"type":"string"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"triggered":{"description":"Number of contacts triggered","type":"number"},"errors":{"description":"Error messages if any","type":"array","items":{"type":"string"}},"error":{"type":"string"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"triggered":{"description":"Number of contacts triggered","type":"number"},"errors":{"description":"Error messages if any","type":"array","items":{"type":"string"}},"error":{"type":"string"}},"required":["success"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1WorkflowsByWorkflowIdTriggerBatch","summary":"Batch trigger workflow","description":"Trigger a workflow for multiple contacts at once. Each contact can have its own data that gets merged with common data.","tags":["workflows"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contacts"],"properties":{"contacts":{"description":"List of contacts to trigger the workflow for","maxItems":1000,"type":"array","items":{"type":"object","properties":{"contactId":{"maxLength":36,"type":"string"},"contactEmail":{"maxLength":255,"type":"string"},"data":{"additionalProperties":true,"type":"object","properties":{}}}}},"data":{"additionalProperties":true,"description":"Common data to pass to all workflow triggers","type":"object","properties":{}}}}},"multipart/form-data":{"schema":{"type":"object","required":["contacts"],"properties":{"contacts":{"description":"List of contacts to trigger the workflow for","maxItems":1000,"type":"array","items":{"type":"object","properties":{"contactId":{"maxLength":36,"type":"string"},"contactEmail":{"maxLength":255,"type":"string"},"data":{"additionalProperties":true,"type":"object","properties":{}}}}},"data":{"additionalProperties":true,"description":"Common data to pass to all workflow triggers","type":"object","properties":{}}}}},"text/plain":{"schema":{"type":"object","required":["contacts"],"properties":{"contacts":{"description":"List of contacts to trigger the workflow for","maxItems":1000,"type":"array","items":{"type":"object","properties":{"contactId":{"maxLength":36,"type":"string"},"contactEmail":{"maxLength":255,"type":"string"},"data":{"additionalProperties":true,"type":"object","properties":{}}}}},"data":{"additionalProperties":true,"description":"Common data to pass to all workflow triggers","type":"object","properties":{}}}}}}}}},"/v1/workflows/executions/{executionId}/retry":{"post":{"parameters":[{"description":"Execution ID to retry","schema":{"type":"string","maxLength":36},"in":"path","name":"executionId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"error":{"type":"string"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"error":{"type":"string"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"error":{"type":"string"}},"required":["success"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1WorkflowsExecutionsByExecutionIdRetry","summary":"Retry failed execution","description":"Retry a failed workflow execution from the step where it failed. Completed steps are preserved.","tags":["workflows"]}},"/v1/workflows/executions/{executionId}/cancel":{"post":{"parameters":[{"description":"Execution ID to cancel","schema":{"type":"string","maxLength":36},"in":"path","name":"executionId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1WorkflowsExecutionsByExecutionIdCancel","summary":"Cancel workflow execution","description":"Cancel an active workflow execution. Cleans up schedulers and adjusts workflow stats.","tags":["workflows"]}},"/webhooks/ses/{awsAccountNumber}":{"post":{"parameters":[{"description":"12-digit AWS account ID","schema":{"type":"string","minLength":12,"maxLength":12,"pattern":"^[0-9]{12}$"},"in":"path","name":"awsAccountNumber","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"description":"Processing status","type":"string"},"eventType":{"type":"string"},"messageId":{"type":"string"},"reason":{"type":"string"}},"required":["status"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"status":{"description":"Processing status","type":"string"},"eventType":{"type":"string"},"messageId":{"type":"string"},"reason":{"type":"string"}},"required":["status"]}},"text/plain":{"schema":{"type":"object","properties":{"status":{"description":"Processing status","type":"string"},"eventType":{"type":"string"},"messageId":{"type":"string"},"reason":{"type":"string"}},"required":["status"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"string"}},"required":["error"]}}}}},"operationId":"postWebhooksSesByAwsAccountNumber","tags":["webhooks"],"summary":"Receive SES events","description":"Webhook endpoint for receiving SES events from EventBridge API Destination. The awsAccountNumber is the 12-digit AWS account ID."}},"/unsubscribe/{token}":{"post":{"parameters":[{"description":"Unsubscribe token","schema":{"type":"string","maxLength":500},"in":"path","name":"token","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"contactId":{"type":"string"},"topicId":{"type":"string"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"contactId":{"type":"string"},"topicId":{"type":"string"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"contactId":{"type":"string"},"topicId":{"type":"string"}},"required":["success"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postUnsubscribeByToken","tags":["unsubscribe"],"summary":"One-click unsubscribe (RFC 8058)","description":"Processes unsubscribe requests. Supports RFC 8058 one-click unsubscribe via POST with body 'List-Unsubscribe=One-Click'. Returns 200 OK directly (no redirects per RFC 8058 spec).","requestBody":{"required":true,"content":{"application/json":{"schema":{}},"multipart/form-data":{"schema":{}},"text/plain":{"schema":{}}}}},"get":{"parameters":[{"description":"Unsubscribe token","schema":{"type":"string","maxLength":500},"in":"path","name":"token","required":true}],"operationId":"getUnsubscribeByToken","tags":["unsubscribe"],"summary":"Unsubscribe confirmation page","description":"Shows a confirmation page for users who click the unsubscribe link in emails. Displays a form to confirm the unsubscribe action.","responses":{"200":{"description":"HTML confirmation page","content":{"text/html":{"schema":{"type":"string"}}}},"400":{"description":"HTML error page (invalid or expired token)","content":{"text/html":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"HTML error page (contact not found)","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/preference-events/":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"subscribed":{"type":"number"},"unsubscribed":{"type":"number"}},"required":["success","subscribed","unsubscribed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"subscribed":{"type":"number"},"unsubscribed":{"type":"number"}},"required":["success","subscribed","unsubscribed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"subscribed":{"type":"number"},"unsubscribed":{"type":"number"}},"required":["success","subscribed","unsubscribed"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1Preference-events","tags":["unsubscribe"],"summary":"Emit workflow events for preference center changes","description":"Called by the preference center after DB writes to emit topic_subscribed/topic_unsubscribed workflow events. Authenticated via unsubscribe JWT token.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token","contactId","organizationId","changes"],"properties":{"token":{"type":"string"},"contactId":{"type":"string"},"organizationId":{"type":"string"},"changes":{"type":"array","items":{"type":"object","required":["topicId","action"],"properties":{"topicId":{"type":"string"},"topicName":{"type":"string"},"action":{"anyOf":[{"const":"subscribed","type":"string"},{"const":"unsubscribed","type":"string"}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["token","contactId","organizationId","changes"],"properties":{"token":{"type":"string"},"contactId":{"type":"string"},"organizationId":{"type":"string"},"changes":{"type":"array","items":{"type":"object","required":["topicId","action"],"properties":{"topicId":{"type":"string"},"topicName":{"type":"string"},"action":{"anyOf":[{"const":"subscribed","type":"string"},{"const":"unsubscribed","type":"string"}]}}}}}}},"text/plain":{"schema":{"type":"object","required":["token","contactId","organizationId","changes"],"properties":{"token":{"type":"string"},"contactId":{"type":"string"},"organizationId":{"type":"string"},"changes":{"type":"array","items":{"type":"object","required":["topicId","action"],"properties":{"topicId":{"type":"string"},"topicName":{"type":"string"},"action":{"anyOf":[{"const":"subscribed","type":"string"},{"const":"unsubscribed","type":"string"}]}}}}}}}}}}},"/v1/templates/push":{"post":{"parameters":[],"responses":{"200":{"description":"Template written","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Template id","type":"string"},"slug":{"description":"Template slug","type":"string"},"status":{"description":"Every template a push writes is published","const":"PUBLISHED","type":"string"},"updatedAt":{"description":"ISO 8601 time the template was written","type":"string"},"remoteHash":{"description":"The sourceHash that was pushed, echoed back","type":"string"}},"required":["id","slug","status","updatedAt","remoteHash"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Template id","type":"string"},"slug":{"description":"Template slug","type":"string"},"status":{"description":"Every template a push writes is published","const":"PUBLISHED","type":"string"},"updatedAt":{"description":"ISO 8601 time the template was written","type":"string"},"remoteHash":{"description":"The sourceHash that was pushed, echoed back","type":"string"}},"required":["id","slug","status","updatedAt","remoteHash"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Template id","type":"string"},"slug":{"description":"Template slug","type":"string"},"status":{"description":"Every template a push writes is published","const":"PUBLISHED","type":"string"},"updatedAt":{"description":"ISO 8601 time the template was written","type":"string"},"remoteHash":{"description":"The sourceHash that was pushed, echoed back","type":"string"}},"required":["id","slug","status","updatedAt","remoteHash"]}}}},"201":{"description":"Template written","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Template id","type":"string"},"slug":{"description":"Template slug","type":"string"},"status":{"description":"Every template a push writes is published","const":"PUBLISHED","type":"string"},"updatedAt":{"description":"ISO 8601 time the template was written","type":"string"},"remoteHash":{"description":"The sourceHash that was pushed, echoed back","type":"string"}},"required":["id","slug","status","updatedAt","remoteHash"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Template id","type":"string"},"slug":{"description":"Template slug","type":"string"},"status":{"description":"Every template a push writes is published","const":"PUBLISHED","type":"string"},"updatedAt":{"description":"ISO 8601 time the template was written","type":"string"},"remoteHash":{"description":"The sourceHash that was pushed, echoed back","type":"string"}},"required":["id","slug","status","updatedAt","remoteHash"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Template id","type":"string"},"slug":{"description":"Template slug","type":"string"},"status":{"description":"Every template a push writes is published","const":"PUBLISHED","type":"string"},"updatedAt":{"description":"ISO 8601 time the template was written","type":"string"},"remoteHash":{"description":"The sourceHash that was pushed, echoed back","type":"string"}},"required":["id","slug","status","updatedAt","remoteHash"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1TemplatesPush","tags":["templates"],"summary":"Push a template from CLI","description":"Upserts a template compiled from React Email source. Used by `wraps push`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","source","compiledHtml","compiledText","subject","emailType","variables","sourceHash","sesTemplateName"],"properties":{"slug":{"description":"Template slug (filename without extension)","type":"string"},"source":{"description":"React Email TSX source code","type":"string"},"compiledHtml":{"description":"Compiled HTML output","type":"string"},"compiledText":{"description":"Compiled plain text output","type":"string"},"subject":{"description":"Email subject line","type":"string"},"previewText":{"description":"Preview/preheader text","type":"string"},"emailType":{"description":"Email type for compliance","anyOf":[{"const":"marketing","type":"string"},{"const":"transactional","type":"string"}]},"channel":{"description":"Template channel (default: email)","anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"variables":{"description":"Template variables","type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"fallback":{"type":"string"}}}},"sourceHash":{"description":"SHA256 hash of source file","type":"string"},"sesTemplateName":{"description":"SES template name","type":"string"},"cliProjectPath":{"description":"Path in project (e.g. templates/welcome.tsx)","type":"string"},"force":{"description":"Force overwrite even if edited on dashboard","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","source","compiledHtml","compiledText","subject","emailType","variables","sourceHash","sesTemplateName"],"properties":{"slug":{"description":"Template slug (filename without extension)","type":"string"},"source":{"description":"React Email TSX source code","type":"string"},"compiledHtml":{"description":"Compiled HTML output","type":"string"},"compiledText":{"description":"Compiled plain text output","type":"string"},"subject":{"description":"Email subject line","type":"string"},"previewText":{"description":"Preview/preheader text","type":"string"},"emailType":{"description":"Email type for compliance","anyOf":[{"const":"marketing","type":"string"},{"const":"transactional","type":"string"}]},"channel":{"description":"Template channel (default: email)","anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"variables":{"description":"Template variables","type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"fallback":{"type":"string"}}}},"sourceHash":{"description":"SHA256 hash of source file","type":"string"},"sesTemplateName":{"description":"SES template name","type":"string"},"cliProjectPath":{"description":"Path in project (e.g. templates/welcome.tsx)","type":"string"},"force":{"description":"Force overwrite even if edited on dashboard","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["slug","source","compiledHtml","compiledText","subject","emailType","variables","sourceHash","sesTemplateName"],"properties":{"slug":{"description":"Template slug (filename without extension)","type":"string"},"source":{"description":"React Email TSX source code","type":"string"},"compiledHtml":{"description":"Compiled HTML output","type":"string"},"compiledText":{"description":"Compiled plain text output","type":"string"},"subject":{"description":"Email subject line","type":"string"},"previewText":{"description":"Preview/preheader text","type":"string"},"emailType":{"description":"Email type for compliance","anyOf":[{"const":"marketing","type":"string"},{"const":"transactional","type":"string"}]},"channel":{"description":"Template channel (default: email)","anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"variables":{"description":"Template variables","type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"fallback":{"type":"string"}}}},"sourceHash":{"description":"SHA256 hash of source file","type":"string"},"sesTemplateName":{"description":"SES template name","type":"string"},"cliProjectPath":{"description":"Path in project (e.g. templates/welcome.tsx)","type":"string"},"force":{"description":"Force overwrite even if edited on dashboard","type":"boolean"}}}}}}}},"/v1/templates/push/batch":{"post":{"parameters":[],"responses":{"200":{"description":"Every template in the batch written","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"description":"One entry per pushed template (empty for an empty batch)","type":"array","items":{"type":"object","required":["slug","id","status"],"properties":{"slug":{"description":"Template slug","type":"string"},"id":{"description":"Template id","type":"string"},"status":{"description":"Every template a push writes is published","const":"PUBLISHED","type":"string"}}}}},"required":["results"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"results":{"description":"One entry per pushed template (empty for an empty batch)","type":"array","items":{"type":"object","required":["slug","id","status"],"properties":{"slug":{"description":"Template slug","type":"string"},"id":{"description":"Template id","type":"string"},"status":{"description":"Every template a push writes is published","const":"PUBLISHED","type":"string"}}}}},"required":["results"]}},"text/plain":{"schema":{"type":"object","properties":{"results":{"description":"One entry per pushed template (empty for an empty batch)","type":"array","items":{"type":"object","required":["slug","id","status"],"properties":{"slug":{"description":"Template slug","type":"string"},"id":{"description":"Template id","type":"string"},"status":{"description":"Every template a push writes is published","const":"PUBLISHED","type":"string"}}}}},"required":["results"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1TemplatesPushBatch","tags":["templates"],"summary":"Push multiple templates from CLI","description":"Batch upsert templates compiled from React Email source.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["templates"],"properties":{"templates":{"type":"array","items":{"type":"object","required":["slug","source","compiledHtml","compiledText","subject","emailType","variables","sourceHash","sesTemplateName"],"properties":{"slug":{"type":"string"},"source":{"type":"string"},"compiledHtml":{"type":"string"},"compiledText":{"type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"emailType":{"anyOf":[{"const":"marketing","type":"string"},{"const":"transactional","type":"string"}]},"channel":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"variables":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"fallback":{"type":"string"}}}},"sourceHash":{"type":"string"},"sesTemplateName":{"type":"string"},"cliProjectPath":{"type":"string"},"force":{"type":"boolean"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["templates"],"properties":{"templates":{"type":"array","items":{"type":"object","required":["slug","source","compiledHtml","compiledText","subject","emailType","variables","sourceHash","sesTemplateName"],"properties":{"slug":{"type":"string"},"source":{"type":"string"},"compiledHtml":{"type":"string"},"compiledText":{"type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"emailType":{"anyOf":[{"const":"marketing","type":"string"},{"const":"transactional","type":"string"}]},"channel":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"variables":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"fallback":{"type":"string"}}}},"sourceHash":{"type":"string"},"sesTemplateName":{"type":"string"},"cliProjectPath":{"type":"string"},"force":{"type":"boolean"}}}}}}},"text/plain":{"schema":{"type":"object","required":["templates"],"properties":{"templates":{"type":"array","items":{"type":"object","required":["slug","source","compiledHtml","compiledText","subject","emailType","variables","sourceHash","sesTemplateName"],"properties":{"slug":{"type":"string"},"source":{"type":"string"},"compiledHtml":{"type":"string"},"compiledText":{"type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"emailType":{"anyOf":[{"const":"marketing","type":"string"},{"const":"transactional","type":"string"}]},"channel":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"variables":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"fallback":{"type":"string"}}}},"sourceHash":{"type":"string"},"sesTemplateName":{"type":"string"},"cliProjectPath":{"type":"string"},"force":{"type":"boolean"}}}}}}}}}}},"/v1/templates/pull":{"get":{"parameters":[{"description":"Page size. Omit for the legacy unpaginated behaviour the CLI relies on — every template in one response, no nextCursor.","schema":{"type":"number","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"description":"Opaque cursor from a previous page's nextCursor","schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"description":"Set to false to omit the TSX source from every row (sourceHash still lets a caller diff).","schema":{"type":"boolean","default":true},"in":"query","name":"source","required":false}],"responses":{"200":{"description":"Code-pushed templates","content":{"application/json":{"schema":{"type":"object","properties":{"templates":{"description":"Code-pushed templates that have source","type":"array","items":{"type":"object","required":["id","slug","subject","emailType","channel","variables","sourceHash","status","updatedAt","lastEditedFrom"],"properties":{"id":{"description":"Template id","type":"string"},"slug":{"description":"Template slug (filename without extension)","anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"description":"Email subject line","anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"description":"Email type for compliance","anyOf":[{"const":"marketing","type":"string"},{"const":"transactional","type":"string"}]},"channel":{"description":"Template channel: email or sms","type":"string"},"variables":{"description":"Template variables, each { name: string, fallback?: string }. Items are not validated: the column is unconstrained jsonb.","anyOf":[{"type":"array","items":{}},{"type":"null"}]},"sourceHash":{"description":"SHA256 hash of the pushed source file","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Template status","anyOf":[{"const":"DRAFT","type":"string"},{"const":"PUBLISHED","type":"string"},{"const":"ARCHIVED","type":"string"}]},"updatedAt":{"description":"ISO 8601 time of the last write","type":"string"},"lastEditedFrom":{"description":"Where the template was last edited: cli, dashboard or api","anyOf":[{"type":"string"},{"type":"null"}]},"source":{"description":"React Email TSX source. Absent when `source=false`. Rows with no source are filtered out, so it is never null in practice.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"nextCursor":{"description":"Cursor for the next page, null on the last page. Present only when `limit` is set.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["templates"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"templates":{"description":"Code-pushed templates that have source","type":"array","items":{"type":"object","required":["id","slug","subject","emailType","channel","variables","sourceHash","status","updatedAt","lastEditedFrom"],"properties":{"id":{"description":"Template id","type":"string"},"slug":{"description":"Template slug (filename without extension)","anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"description":"Email subject line","anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"description":"Email type for compliance","anyOf":[{"const":"marketing","type":"string"},{"const":"transactional","type":"string"}]},"channel":{"description":"Template channel: email or sms","type":"string"},"variables":{"description":"Template variables, each { name: string, fallback?: string }. Items are not validated: the column is unconstrained jsonb.","anyOf":[{"type":"array","items":{}},{"type":"null"}]},"sourceHash":{"description":"SHA256 hash of the pushed source file","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Template status","anyOf":[{"const":"DRAFT","type":"string"},{"const":"PUBLISHED","type":"string"},{"const":"ARCHIVED","type":"string"}]},"updatedAt":{"description":"ISO 8601 time of the last write","type":"string"},"lastEditedFrom":{"description":"Where the template was last edited: cli, dashboard or api","anyOf":[{"type":"string"},{"type":"null"}]},"source":{"description":"React Email TSX source. Absent when `source=false`. Rows with no source are filtered out, so it is never null in practice.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"nextCursor":{"description":"Cursor for the next page, null on the last page. Present only when `limit` is set.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["templates"]}},"text/plain":{"schema":{"type":"object","properties":{"templates":{"description":"Code-pushed templates that have source","type":"array","items":{"type":"object","required":["id","slug","subject","emailType","channel","variables","sourceHash","status","updatedAt","lastEditedFrom"],"properties":{"id":{"description":"Template id","type":"string"},"slug":{"description":"Template slug (filename without extension)","anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"description":"Email subject line","anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"description":"Email type for compliance","anyOf":[{"const":"marketing","type":"string"},{"const":"transactional","type":"string"}]},"channel":{"description":"Template channel: email or sms","type":"string"},"variables":{"description":"Template variables, each { name: string, fallback?: string }. Items are not validated: the column is unconstrained jsonb.","anyOf":[{"type":"array","items":{}},{"type":"null"}]},"sourceHash":{"description":"SHA256 hash of the pushed source file","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Template status","anyOf":[{"const":"DRAFT","type":"string"},{"const":"PUBLISHED","type":"string"},{"const":"ARCHIVED","type":"string"}]},"updatedAt":{"description":"ISO 8601 time of the last write","type":"string"},"lastEditedFrom":{"description":"Where the template was last edited: cli, dashboard or api","anyOf":[{"type":"string"},{"type":"null"}]},"source":{"description":"React Email TSX source. Absent when `source=false`. Rows with no source are filtered out, so it is never null in practice.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"nextCursor":{"description":"Cursor for the next page, null on the last page. Present only when `limit` is set.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["templates"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1TemplatesPull","tags":["templates"],"summary":"Pull templates for CLI sync","description":"Returns code-pushed templates with their React Email source. With no `limit`, returns every template in one response (the CLI's push/pull protocol depends on this). Pass `limit` to opt into cursor pagination — the response then includes `nextCursor` (null on the last page). `source=false` omits the `source` field from every row."}},"/v1/templates/":{"get":{"parameters":[{"schema":{"type":"number","default":20,"minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"schema":{"anyOf":[{"const":"DRAFT","type":"string"},{"const":"PUBLISHED","type":"string"},{"const":"ARCHIVED","type":"string"}]},"in":"query","name":"status","required":false},{"schema":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"in":"query","name":"channel","required":false},{"schema":{"type":"string","maxLength":200},"in":"query","name":"search","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["id","name","description","subject","previewText","emailType","channel","status","slug","publishedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","nextCursor"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["id","name","description","subject","previewText","emailType","channel","status","slug","publishedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","nextCursor"]}},"text/plain":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["id","name","description","subject","previewText","emailType","channel","status","slug","publishedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","nextCursor"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1Templates","tags":["templates"],"summary":"List templates","description":"Lists templates for the organization, paginated (cursor-based) and optionally filtered by status, channel, or a name search. Never returns source, content, compiledHtml, compiledText, createdBy, or lastEditedBy — use GET /:id for the full record."},"post":{"parameters":[],"responses":{"201":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sourceHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{"type":"array","items":{}},"lastEditedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledHtml":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledText":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","description","subject","previewText","emailType","channel","status","slug","publishedAt","createdAt","updatedAt","sourceHash","variables","lastEditedFrom"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sourceHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{"type":"array","items":{}},"lastEditedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledHtml":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledText":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","description","subject","previewText","emailType","channel","status","slug","publishedAt","createdAt","updatedAt","sourceHash","variables","lastEditedFrom"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sourceHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{"type":"array","items":{}},"lastEditedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledHtml":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledText":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","description","subject","previewText","emailType","channel","status","slug","publishedAt","createdAt","updatedAt","sourceHash","variables","lastEditedFrom"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1Templates","tags":["templates"],"summary":"Create a template","description":"Creates a DRAFT template. The API does not compile TSX — pass compiledHtml/compiledText if you have them, or publish will refuse the template until it's compiled. Always created as react-email format.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"slug":{"pattern":"^[a-z0-9-]{1,100}$","type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"description":{"type":"string"},"emailType":{"anyOf":[{"const":"marketing","type":"string"},{"const":"transactional","type":"string"}]},"channel":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"source":{"description":"React Email TSX source","type":"string"},"compiledHtml":{"type":"string"},"compiledText":{"type":"string"},"variables":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"fallback":{"type":"string"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"slug":{"pattern":"^[a-z0-9-]{1,100}$","type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"description":{"type":"string"},"emailType":{"anyOf":[{"const":"marketing","type":"string"},{"const":"transactional","type":"string"}]},"channel":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"source":{"description":"React Email TSX source","type":"string"},"compiledHtml":{"type":"string"},"compiledText":{"type":"string"},"variables":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"fallback":{"type":"string"}}}}}}},"text/plain":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"slug":{"pattern":"^[a-z0-9-]{1,100}$","type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"description":{"type":"string"},"emailType":{"anyOf":[{"const":"marketing","type":"string"},{"const":"transactional","type":"string"}]},"channel":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"source":{"description":"React Email TSX source","type":"string"},"compiledHtml":{"type":"string"},"compiledText":{"type":"string"},"variables":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"fallback":{"type":"string"}}}}}}}}}},"delete":{"parameters":[{"description":"Must be the string true","schema":{"type":"string"},"in":"query","name":"confirm","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"description":"Number of templates deleted","type":"number"},"notFound":{"description":"Ids that are not templates of this organization (skipped, nothing deleted for them)","type":"array","items":{"type":"string"}}},"required":["deleted","notFound"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"deleted":{"description":"Number of templates deleted","type":"number"},"notFound":{"description":"Ids that are not templates of this organization (skipped, nothing deleted for them)","type":"array","items":{"type":"string"}}},"required":["deleted","notFound"]}},"text/plain":{"schema":{"type":"object","properties":{"deleted":{"description":"Number of templates deleted","type":"number"},"notFound":{"description":"Ids that are not templates of this organization (skipped, nothing deleted for them)","type":"array","items":{"type":"string"}}},"required":["deleted","notFound"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"blockingIds":{"description":"Template ids that a draft, scheduled, queued or processing broadcast, or an enabled workflow, uses","type":"array","items":{"type":"string"}}},"required":["error","blockingIds"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"},"blockingIds":{"description":"Template ids that a draft, scheduled, queued or processing broadcast, or an enabled workflow, uses","type":"array","items":{"type":"string"}}},"required":["error","blockingIds"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"},"blockingIds":{"description":"Template ids that a draft, scheduled, queued or processing broadcast, or an enabled workflow, uses","type":"array","items":{"type":"string"}}},"required":["error","blockingIds"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteV1Templates","tags":["templates"],"summary":"Bulk delete templates","description":"Deletes up to 100 templates in one request (body { ids }), org-scoped. Destructive: pass confirm=true, or the request is refused with 400. All-or-nothing: if any template is still used by a draft, scheduled, queued or processing broadcast, or an enabled workflow, the whole request returns 409 with blockingIds and deletes nothing. Ids that are not templates of this organization are listed in notFound and skipped. Requires templates delete permission (campaigns:write for API keys).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"description":"Template IDs to delete (1-100)","type":"array","items":{"maxLength":36,"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"description":"Template IDs to delete (1-100)","type":"array","items":{"maxLength":36,"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"description":"Template IDs to delete (1-100)","type":"array","items":{"maxLength":36,"type":"string"}}}}}}}}},"/v1/templates/{id}":{"get":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true},{"schema":{"type":"boolean","default":true},"in":"query","name":"source","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sourceHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{"type":"array","items":{}},"lastEditedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledHtml":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledText":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","description","subject","previewText","emailType","channel","status","slug","publishedAt","createdAt","updatedAt","sourceHash","variables","lastEditedFrom"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sourceHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{"type":"array","items":{}},"lastEditedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledHtml":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledText":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","description","subject","previewText","emailType","channel","status","slug","publishedAt","createdAt","updatedAt","sourceHash","variables","lastEditedFrom"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sourceHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{"type":"array","items":{}},"lastEditedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledHtml":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledText":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","description","subject","previewText","emailType","channel","status","slug","publishedAt","createdAt","updatedAt","sourceHash","variables","lastEditedFrom"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1TemplatesById","tags":["templates"],"summary":"Get a template","description":"Returns full template detail, org-scoped. `source=false` omits source, compiledHtml, and compiledText — sourceHash is still returned so a caller can tell whether the source changed."},"patch":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sourceHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{"type":"array","items":{}},"lastEditedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledHtml":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledText":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","description","subject","previewText","emailType","channel","status","slug","publishedAt","createdAt","updatedAt","sourceHash","variables","lastEditedFrom"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sourceHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{"type":"array","items":{}},"lastEditedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledHtml":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledText":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","description","subject","previewText","emailType","channel","status","slug","publishedAt","createdAt","updatedAt","sourceHash","variables","lastEditedFrom"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sourceHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{"type":"array","items":{}},"lastEditedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledHtml":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledText":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","description","subject","previewText","emailType","channel","status","slug","publishedAt","createdAt","updatedAt","sourceHash","variables","lastEditedFrom"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"lastEditedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}},"required":["error","message","lastEditedFrom","updatedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"lastEditedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}},"required":["error","message","lastEditedFrom","updatedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"lastEditedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}},"required":["error","message","lastEditedFrom","updatedAt"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchV1TemplatesById","tags":["templates"],"summary":"Update a template","description":"Partial update, org-scoped. Last-write-wins unless ifUnmodifiedSince is sent. When source changes, a new templateVersion row is written (skipped if the source is unchanged from the latest version).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"description":{"type":"string"},"emailType":{"anyOf":[{"const":"marketing","type":"string"},{"const":"transactional","type":"string"}]},"channel":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"source":{"description":"React Email TSX source","type":"string"},"compiledHtml":{"type":"string"},"compiledText":{"type":"string"},"variables":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"fallback":{"type":"string"}}}},"ifUnmodifiedSince":{"format":"date-time","description":"Optimistic-concurrency guard. When present and the stored updatedAt is later, the update is rejected with 409 instead of overwriting.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"description":{"type":"string"},"emailType":{"anyOf":[{"const":"marketing","type":"string"},{"const":"transactional","type":"string"}]},"channel":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"source":{"description":"React Email TSX source","type":"string"},"compiledHtml":{"type":"string"},"compiledText":{"type":"string"},"variables":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"fallback":{"type":"string"}}}},"ifUnmodifiedSince":{"format":"date-time","description":"Optimistic-concurrency guard. When present and the stored updatedAt is later, the update is rejected with 409 instead of overwriting.","type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"description":{"type":"string"},"emailType":{"anyOf":[{"const":"marketing","type":"string"},{"const":"transactional","type":"string"}]},"channel":{"anyOf":[{"const":"email","type":"string"},{"const":"sms","type":"string"}]},"source":{"description":"React Email TSX source","type":"string"},"compiledHtml":{"type":"string"},"compiledText":{"type":"string"},"variables":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"fallback":{"type":"string"}}}},"ifUnmodifiedSince":{"format":"date-time","description":"Optimistic-concurrency guard. When present and the stored updatedAt is later, the update is rejected with 409 instead of overwriting.","type":"string"}}}}}}},"delete":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true},{"description":"Must be the string true","schema":{"type":"string"},"in":"query","name":"confirm","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"blockingIds":{"description":"Template ids that a draft, scheduled, queued or processing broadcast, or an enabled workflow, uses","type":"array","items":{"type":"string"}}},"required":["error","blockingIds"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"},"blockingIds":{"description":"Template ids that a draft, scheduled, queued or processing broadcast, or an enabled workflow, uses","type":"array","items":{"type":"string"}}},"required":["error","blockingIds"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"},"blockingIds":{"description":"Template ids that a draft, scheduled, queued or processing broadcast, or an enabled workflow, uses","type":"array","items":{"type":"string"}}},"required":["error","blockingIds"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteV1TemplatesById","tags":["templates"],"summary":"Delete a template","description":"Deletes one template, org-scoped, along with its versions. Destructive: pass confirm=true, or the request is refused with 400 before anything changes. Refused with 409 (and nothing deleted) while a draft, scheduled, queued or processing broadcast (a paused broadcast counts as processing), or an enabled workflow (a send_email or send_sms step, or a cascade channel), still uses the template; blockingIds lists the template ids that are blocked. Completed, failed and cancelled broadcasts, and draft, paused and archived workflows, do not block. A published SES copy is removed best-effort from the org's AWS accounts. Requires templates delete permission (campaigns:write for API keys)."}},"/v1/templates/{id}/publish":{"post":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"sesTemplateName":{"type":"string"},"publishedAt":{"type":"string"}},"required":["success","sesTemplateName","publishedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"sesTemplateName":{"type":"string"},"publishedAt":{"type":"string"}},"required":["success","sesTemplateName","publishedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"sesTemplateName":{"type":"string"},"publishedAt":{"type":"string"}},"required":["success","sesTemplateName","publishedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1TemplatesByIdPublish","tags":["templates"],"summary":"Publish a template to SES","description":"Creates or updates the SES email template for this template's compiledHtml/compiledText, then marks it PUBLISHED. Requires compiledHtml — the API does not compile TSX, so provide it via PATCH first if it isn't already set.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"awsAccountId":{"description":"AWS account row id","maxLength":36,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"awsAccountId":{"description":"AWS account row id","maxLength":36,"type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"awsAccountId":{"description":"AWS account row id","maxLength":36,"type":"string"}}}}}}}},"/v1/templates/{id}/duplicate":{"post":{"parameters":[{"schema":{"type":"string","maxLength":36},"in":"path","name":"id","required":true}],"responses":{"201":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sourceHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{"type":"array","items":{}},"lastEditedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledHtml":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledText":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","description","subject","previewText","emailType","channel","status","slug","publishedAt","createdAt","updatedAt","sourceHash","variables","lastEditedFrom"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sourceHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{"type":"array","items":{}},"lastEditedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledHtml":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledText":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","description","subject","previewText","emailType","channel","status","slug","publishedAt","createdAt","updatedAt","sourceHash","variables","lastEditedFrom"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailType":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sourceHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{"type":"array","items":{}},"lastEditedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledHtml":{"anyOf":[{"type":"string"},{"type":"null"}]},"compiledText":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","description","subject","previewText","emailType","channel","status","slug","publishedAt","createdAt","updatedAt","sourceHash","variables","lastEditedFrom"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1TemplatesByIdDuplicate","tags":["templates"],"summary":"Duplicate a template","description":"Copies name (with \" (Copy)\" appended), content, and channel/previewText (the dashboard's duplicate route omits these two — fixed here). slug, sesTemplateName, and publishedAt are never copied; the duplicate is always a DRAFT."}},"/v1/workflows/push":{"post":{"parameters":[],"responses":{"200":{"description":"Workflow written","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Workflow id","type":"string"},"slug":{"description":"Workflow slug","type":"string"},"status":{"description":"Workflow status after the push: draft, enabled or paused (a schedule that could not be registered leaves it draft)","anyOf":[{"const":"draft","type":"string"},{"const":"enabled","type":"string"},{"const":"paused","type":"string"},{"const":"archived","type":"string"}]},"updatedAt":{"description":"ISO 8601 time the workflow was written","type":"string"},"remoteHash":{"description":"The sourceHash that was pushed, echoed back","type":"string"},"scheduleError":{"description":"Why the schedule could not be registered; set only then, and the workflow was saved as draft","type":"string"}},"required":["id","slug","status","updatedAt","remoteHash"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Workflow id","type":"string"},"slug":{"description":"Workflow slug","type":"string"},"status":{"description":"Workflow status after the push: draft, enabled or paused (a schedule that could not be registered leaves it draft)","anyOf":[{"const":"draft","type":"string"},{"const":"enabled","type":"string"},{"const":"paused","type":"string"},{"const":"archived","type":"string"}]},"updatedAt":{"description":"ISO 8601 time the workflow was written","type":"string"},"remoteHash":{"description":"The sourceHash that was pushed, echoed back","type":"string"},"scheduleError":{"description":"Why the schedule could not be registered; set only then, and the workflow was saved as draft","type":"string"}},"required":["id","slug","status","updatedAt","remoteHash"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Workflow id","type":"string"},"slug":{"description":"Workflow slug","type":"string"},"status":{"description":"Workflow status after the push: draft, enabled or paused (a schedule that could not be registered leaves it draft)","anyOf":[{"const":"draft","type":"string"},{"const":"enabled","type":"string"},{"const":"paused","type":"string"},{"const":"archived","type":"string"}]},"updatedAt":{"description":"ISO 8601 time the workflow was written","type":"string"},"remoteHash":{"description":"The sourceHash that was pushed, echoed back","type":"string"},"scheduleError":{"description":"Why the schedule could not be registered; set only then, and the workflow was saved as draft","type":"string"}},"required":["id","slug","status","updatedAt","remoteHash"]}}}},"201":{"description":"Workflow written","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Workflow id","type":"string"},"slug":{"description":"Workflow slug","type":"string"},"status":{"description":"Workflow status after the push: draft, enabled or paused (a schedule that could not be registered leaves it draft)","anyOf":[{"const":"draft","type":"string"},{"const":"enabled","type":"string"},{"const":"paused","type":"string"},{"const":"archived","type":"string"}]},"updatedAt":{"description":"ISO 8601 time the workflow was written","type":"string"},"remoteHash":{"description":"The sourceHash that was pushed, echoed back","type":"string"},"scheduleError":{"description":"Why the schedule could not be registered; set only then, and the workflow was saved as draft","type":"string"}},"required":["id","slug","status","updatedAt","remoteHash"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Workflow id","type":"string"},"slug":{"description":"Workflow slug","type":"string"},"status":{"description":"Workflow status after the push: draft, enabled or paused (a schedule that could not be registered leaves it draft)","anyOf":[{"const":"draft","type":"string"},{"const":"enabled","type":"string"},{"const":"paused","type":"string"},{"const":"archived","type":"string"}]},"updatedAt":{"description":"ISO 8601 time the workflow was written","type":"string"},"remoteHash":{"description":"The sourceHash that was pushed, echoed back","type":"string"},"scheduleError":{"description":"Why the schedule could not be registered; set only then, and the workflow was saved as draft","type":"string"}},"required":["id","slug","status","updatedAt","remoteHash"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Workflow id","type":"string"},"slug":{"description":"Workflow slug","type":"string"},"status":{"description":"Workflow status after the push: draft, enabled or paused (a schedule that could not be registered leaves it draft)","anyOf":[{"const":"draft","type":"string"},{"const":"enabled","type":"string"},{"const":"paused","type":"string"},{"const":"archived","type":"string"}]},"updatedAt":{"description":"ISO 8601 time the workflow was written","type":"string"},"remoteHash":{"description":"The sourceHash that was pushed, echoed back","type":"string"},"scheduleError":{"description":"Why the schedule could not be registered; set only then, and the workflow was saved as draft","type":"string"}},"required":["id","slug","status","updatedAt","remoteHash"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1WorkflowsPush","tags":["workflows"],"summary":"Push a workflow from CLI","description":"Upserts a workflow parsed from TypeScript source. Used by `wraps email workflows push`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","name","sourceTs","sourceHash","steps","transitions","triggerType"],"properties":{"slug":{"description":"Workflow slug (filename without extension)","type":"string"},"name":{"description":"Workflow display name","type":"string"},"description":{"description":"Workflow description","type":"string"},"sourceTs":{"description":"Original TypeScript source code","type":"string"},"sourceHash":{"description":"SHA256 hash of source file","type":"string"},"steps":{"description":"Flat array of workflow steps","type":"array","items":{"type":"object","required":["id","type","name","position","config"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"config":{}}}},"transitions":{"description":"Flat array of step transitions","type":"array","items":{"type":"object","required":["id","fromStepId","toStepId"],"properties":{"id":{"type":"string"},"fromStepId":{"type":"string"},"toStepId":{"type":"string"},"condition":{"type":"object","required":["branch"],"properties":{"branch":{"type":"string"}}}}}},"triggerType":{"description":"Trigger type","type":"string"},"triggerConfig":{"description":"Trigger configuration"},"settings":{"type":"object","properties":{"allowReentry":{"type":"boolean"},"reentryDelaySeconds":{"type":"number"},"maxConcurrentExecutions":{"type":"number"},"contactCooldownSeconds":{"type":"number"}}},"defaults":{"type":"object","properties":{"from":{"type":"string"},"fromName":{"type":"string"},"replyTo":{"type":"string"},"senderId":{"type":"string"}}},"cliProjectPath":{"description":"Path in project (e.g. workflows/onboarding.ts)","type":"string"},"force":{"description":"Force overwrite even if edited on dashboard","type":"boolean"},"draft":{"description":"Push as draft without enabling the workflow","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","name","sourceTs","sourceHash","steps","transitions","triggerType"],"properties":{"slug":{"description":"Workflow slug (filename without extension)","type":"string"},"name":{"description":"Workflow display name","type":"string"},"description":{"description":"Workflow description","type":"string"},"sourceTs":{"description":"Original TypeScript source code","type":"string"},"sourceHash":{"description":"SHA256 hash of source file","type":"string"},"steps":{"description":"Flat array of workflow steps","type":"array","items":{"type":"object","required":["id","type","name","position","config"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"config":{}}}},"transitions":{"description":"Flat array of step transitions","type":"array","items":{"type":"object","required":["id","fromStepId","toStepId"],"properties":{"id":{"type":"string"},"fromStepId":{"type":"string"},"toStepId":{"type":"string"},"condition":{"type":"object","required":["branch"],"properties":{"branch":{"type":"string"}}}}}},"triggerType":{"description":"Trigger type","type":"string"},"triggerConfig":{"description":"Trigger configuration"},"settings":{"type":"object","properties":{"allowReentry":{"type":"boolean"},"reentryDelaySeconds":{"type":"number"},"maxConcurrentExecutions":{"type":"number"},"contactCooldownSeconds":{"type":"number"}}},"defaults":{"type":"object","properties":{"from":{"type":"string"},"fromName":{"type":"string"},"replyTo":{"type":"string"},"senderId":{"type":"string"}}},"cliProjectPath":{"description":"Path in project (e.g. workflows/onboarding.ts)","type":"string"},"force":{"description":"Force overwrite even if edited on dashboard","type":"boolean"},"draft":{"description":"Push as draft without enabling the workflow","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["slug","name","sourceTs","sourceHash","steps","transitions","triggerType"],"properties":{"slug":{"description":"Workflow slug (filename without extension)","type":"string"},"name":{"description":"Workflow display name","type":"string"},"description":{"description":"Workflow description","type":"string"},"sourceTs":{"description":"Original TypeScript source code","type":"string"},"sourceHash":{"description":"SHA256 hash of source file","type":"string"},"steps":{"description":"Flat array of workflow steps","type":"array","items":{"type":"object","required":["id","type","name","position","config"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"config":{}}}},"transitions":{"description":"Flat array of step transitions","type":"array","items":{"type":"object","required":["id","fromStepId","toStepId"],"properties":{"id":{"type":"string"},"fromStepId":{"type":"string"},"toStepId":{"type":"string"},"condition":{"type":"object","required":["branch"],"properties":{"branch":{"type":"string"}}}}}},"triggerType":{"description":"Trigger type","type":"string"},"triggerConfig":{"description":"Trigger configuration"},"settings":{"type":"object","properties":{"allowReentry":{"type":"boolean"},"reentryDelaySeconds":{"type":"number"},"maxConcurrentExecutions":{"type":"number"},"contactCooldownSeconds":{"type":"number"}}},"defaults":{"type":"object","properties":{"from":{"type":"string"},"fromName":{"type":"string"},"replyTo":{"type":"string"},"senderId":{"type":"string"}}},"cliProjectPath":{"description":"Path in project (e.g. workflows/onboarding.ts)","type":"string"},"force":{"description":"Force overwrite even if edited on dashboard","type":"boolean"},"draft":{"description":"Push as draft without enabling the workflow","type":"boolean"}}}}}}}},"/v1/workflows/push/batch":{"post":{"parameters":[],"responses":{"200":{"description":"Every workflow in the batch written","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"description":"One entry per pushed workflow (empty for an empty batch)","type":"array","items":{"type":"object","required":["slug","id","status"],"properties":{"slug":{"description":"Workflow slug","type":"string"},"id":{"description":"Workflow id","type":"string"},"status":{"description":"Workflow status after the push: draft, enabled or paused (a schedule that could not be registered leaves it draft)","anyOf":[{"const":"draft","type":"string"},{"const":"enabled","type":"string"},{"const":"paused","type":"string"},{"const":"archived","type":"string"}]},"scheduleError":{"description":"Why the schedule could not be registered; set only then, and the workflow was saved as draft","type":"string"}}}}},"required":["results"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"results":{"description":"One entry per pushed workflow (empty for an empty batch)","type":"array","items":{"type":"object","required":["slug","id","status"],"properties":{"slug":{"description":"Workflow slug","type":"string"},"id":{"description":"Workflow id","type":"string"},"status":{"description":"Workflow status after the push: draft, enabled or paused (a schedule that could not be registered leaves it draft)","anyOf":[{"const":"draft","type":"string"},{"const":"enabled","type":"string"},{"const":"paused","type":"string"},{"const":"archived","type":"string"}]},"scheduleError":{"description":"Why the schedule could not be registered; set only then, and the workflow was saved as draft","type":"string"}}}}},"required":["results"]}},"text/plain":{"schema":{"type":"object","properties":{"results":{"description":"One entry per pushed workflow (empty for an empty batch)","type":"array","items":{"type":"object","required":["slug","id","status"],"properties":{"slug":{"description":"Workflow slug","type":"string"},"id":{"description":"Workflow id","type":"string"},"status":{"description":"Workflow status after the push: draft, enabled or paused (a schedule that could not be registered leaves it draft)","anyOf":[{"const":"draft","type":"string"},{"const":"enabled","type":"string"},{"const":"paused","type":"string"},{"const":"archived","type":"string"}]},"scheduleError":{"description":"Why the schedule could not be registered; set only then, and the workflow was saved as draft","type":"string"}}}}},"required":["results"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1WorkflowsPushBatch","tags":["workflows"],"summary":"Push multiple workflows from CLI","description":"Batch upsert workflows parsed from TypeScript source.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["workflows"],"properties":{"workflows":{"type":"array","items":{"type":"object","required":["slug","name","sourceTs","sourceHash","steps","transitions","triggerType"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"sourceTs":{"type":"string"},"sourceHash":{"type":"string"},"steps":{"type":"array","items":{"type":"object","required":["id","type","name","position","config"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"config":{}}}},"transitions":{"type":"array","items":{"type":"object","required":["id","fromStepId","toStepId"],"properties":{"id":{"type":"string"},"fromStepId":{"type":"string"},"toStepId":{"type":"string"},"condition":{"type":"object","required":["branch"],"properties":{"branch":{"type":"string"}}}}}},"triggerType":{"type":"string"},"triggerConfig":{},"settings":{"type":"object","properties":{"allowReentry":{"type":"boolean"},"reentryDelaySeconds":{"type":"number"},"maxConcurrentExecutions":{"type":"number"},"contactCooldownSeconds":{"type":"number"}}},"defaults":{"type":"object","properties":{"from":{"type":"string"},"fromName":{"type":"string"},"replyTo":{"type":"string"},"senderId":{"type":"string"}}},"cliProjectPath":{"type":"string"},"force":{"type":"boolean"},"draft":{"type":"boolean"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["workflows"],"properties":{"workflows":{"type":"array","items":{"type":"object","required":["slug","name","sourceTs","sourceHash","steps","transitions","triggerType"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"sourceTs":{"type":"string"},"sourceHash":{"type":"string"},"steps":{"type":"array","items":{"type":"object","required":["id","type","name","position","config"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"config":{}}}},"transitions":{"type":"array","items":{"type":"object","required":["id","fromStepId","toStepId"],"properties":{"id":{"type":"string"},"fromStepId":{"type":"string"},"toStepId":{"type":"string"},"condition":{"type":"object","required":["branch"],"properties":{"branch":{"type":"string"}}}}}},"triggerType":{"type":"string"},"triggerConfig":{},"settings":{"type":"object","properties":{"allowReentry":{"type":"boolean"},"reentryDelaySeconds":{"type":"number"},"maxConcurrentExecutions":{"type":"number"},"contactCooldownSeconds":{"type":"number"}}},"defaults":{"type":"object","properties":{"from":{"type":"string"},"fromName":{"type":"string"},"replyTo":{"type":"string"},"senderId":{"type":"string"}}},"cliProjectPath":{"type":"string"},"force":{"type":"boolean"},"draft":{"type":"boolean"}}}}}}},"text/plain":{"schema":{"type":"object","required":["workflows"],"properties":{"workflows":{"type":"array","items":{"type":"object","required":["slug","name","sourceTs","sourceHash","steps","transitions","triggerType"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"sourceTs":{"type":"string"},"sourceHash":{"type":"string"},"steps":{"type":"array","items":{"type":"object","required":["id","type","name","position","config"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"config":{}}}},"transitions":{"type":"array","items":{"type":"object","required":["id","fromStepId","toStepId"],"properties":{"id":{"type":"string"},"fromStepId":{"type":"string"},"toStepId":{"type":"string"},"condition":{"type":"object","required":["branch"],"properties":{"branch":{"type":"string"}}}}}},"triggerType":{"type":"string"},"triggerConfig":{},"settings":{"type":"object","properties":{"allowReentry":{"type":"boolean"},"reentryDelaySeconds":{"type":"number"},"maxConcurrentExecutions":{"type":"number"},"contactCooldownSeconds":{"type":"number"}}},"defaults":{"type":"object","properties":{"from":{"type":"string"},"fromName":{"type":"string"},"replyTo":{"type":"string"},"senderId":{"type":"string"}}},"cliProjectPath":{"type":"string"},"force":{"type":"boolean"},"draft":{"type":"boolean"}}}}}}}}}}},"/v1/workflows/pull":{"get":{"responses":{"200":{"description":"Code-pushed workflows","content":{"application/json":{"schema":{"type":"object","properties":{"workflows":{"description":"Workflows pushed from the CLI","type":"array","items":{"type":"object","required":["id","slug","name","description","sourceTs","sourceHash","status","triggerType","triggerConfig","steps","transitions","updatedAt","lastEditedFrom"],"properties":{"id":{"description":"Workflow id","type":"string"},"slug":{"description":"Workflow slug (rows without a slug are never returned)","type":"string"},"name":{"description":"Workflow display name","type":"string"},"description":{"description":"Workflow description","anyOf":[{"type":"string"},{"type":"null"}]},"sourceTs":{"description":"Original TypeScript source code","anyOf":[{"type":"string"},{"type":"null"}]},"sourceHash":{"description":"SHA256 hash of the pushed source file","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Workflow status","anyOf":[{"const":"draft","type":"string"},{"const":"enabled","type":"string"},{"const":"paused","type":"string"},{"const":"archived","type":"string"}]},"triggerType":{"description":"Trigger type","anyOf":[{"type":"string"},{"type":"null"}]},"triggerConfig":{"description":"Trigger configuration","anyOf":[{"additionalProperties":true,"type":"object","properties":{"eventName":{"anyOf":[{"type":"string"},{"type":"null"}]},"segmentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"schedule":{"description":"Cron expression","anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"topicId":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"steps":{"description":"Flat array of workflow steps","anyOf":[{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","type","name"],"properties":{"id":{"type":"string"},"type":{"description":"Step type, e.g. send_email or delay","type":"string"},"name":{"type":"string"},"position":{"description":"Canvas position","anyOf":[{"additionalProperties":true,"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},{"type":"null"}]},"config":{"description":"Step configuration, shape depends on type"},"cascadeGroupId":{"description":"Cascade group this step belongs to","anyOf":[{"type":"string"},{"type":"null"}]},"cascadeChannels":{"description":"Cascade reconstruction metadata, first step of a group. Each item is { type: email | sms, id?, templateId?, body?, engagement?, waitDuration? }; items are not validated.","anyOf":[{"type":"array","items":{}},{"type":"null"}]}}}},{"type":"null"}]},"transitions":{"description":"Flat array of step transitions","anyOf":[{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","fromStepId","toStepId"],"properties":{"id":{"type":"string"},"fromStepId":{"type":"string"},"toStepId":{"type":"string"},"condition":{"anyOf":[{"additionalProperties":true,"type":"object","required":["branch"],"properties":{"branch":{"type":"string"}}},{"type":"null"}]}}}},{"type":"null"}]},"updatedAt":{"description":"ISO 8601 time of the last write","type":"string"},"lastEditedFrom":{"description":"Where the workflow was last edited: cli or dashboard","anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["workflows"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"workflows":{"description":"Workflows pushed from the CLI","type":"array","items":{"type":"object","required":["id","slug","name","description","sourceTs","sourceHash","status","triggerType","triggerConfig","steps","transitions","updatedAt","lastEditedFrom"],"properties":{"id":{"description":"Workflow id","type":"string"},"slug":{"description":"Workflow slug (rows without a slug are never returned)","type":"string"},"name":{"description":"Workflow display name","type":"string"},"description":{"description":"Workflow description","anyOf":[{"type":"string"},{"type":"null"}]},"sourceTs":{"description":"Original TypeScript source code","anyOf":[{"type":"string"},{"type":"null"}]},"sourceHash":{"description":"SHA256 hash of the pushed source file","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Workflow status","anyOf":[{"const":"draft","type":"string"},{"const":"enabled","type":"string"},{"const":"paused","type":"string"},{"const":"archived","type":"string"}]},"triggerType":{"description":"Trigger type","anyOf":[{"type":"string"},{"type":"null"}]},"triggerConfig":{"description":"Trigger configuration","anyOf":[{"additionalProperties":true,"type":"object","properties":{"eventName":{"anyOf":[{"type":"string"},{"type":"null"}]},"segmentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"schedule":{"description":"Cron expression","anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"topicId":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"steps":{"description":"Flat array of workflow steps","anyOf":[{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","type","name"],"properties":{"id":{"type":"string"},"type":{"description":"Step type, e.g. send_email or delay","type":"string"},"name":{"type":"string"},"position":{"description":"Canvas position","anyOf":[{"additionalProperties":true,"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},{"type":"null"}]},"config":{"description":"Step configuration, shape depends on type"},"cascadeGroupId":{"description":"Cascade group this step belongs to","anyOf":[{"type":"string"},{"type":"null"}]},"cascadeChannels":{"description":"Cascade reconstruction metadata, first step of a group. Each item is { type: email | sms, id?, templateId?, body?, engagement?, waitDuration? }; items are not validated.","anyOf":[{"type":"array","items":{}},{"type":"null"}]}}}},{"type":"null"}]},"transitions":{"description":"Flat array of step transitions","anyOf":[{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","fromStepId","toStepId"],"properties":{"id":{"type":"string"},"fromStepId":{"type":"string"},"toStepId":{"type":"string"},"condition":{"anyOf":[{"additionalProperties":true,"type":"object","required":["branch"],"properties":{"branch":{"type":"string"}}},{"type":"null"}]}}}},{"type":"null"}]},"updatedAt":{"description":"ISO 8601 time of the last write","type":"string"},"lastEditedFrom":{"description":"Where the workflow was last edited: cli or dashboard","anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["workflows"]}},"text/plain":{"schema":{"type":"object","properties":{"workflows":{"description":"Workflows pushed from the CLI","type":"array","items":{"type":"object","required":["id","slug","name","description","sourceTs","sourceHash","status","triggerType","triggerConfig","steps","transitions","updatedAt","lastEditedFrom"],"properties":{"id":{"description":"Workflow id","type":"string"},"slug":{"description":"Workflow slug (rows without a slug are never returned)","type":"string"},"name":{"description":"Workflow display name","type":"string"},"description":{"description":"Workflow description","anyOf":[{"type":"string"},{"type":"null"}]},"sourceTs":{"description":"Original TypeScript source code","anyOf":[{"type":"string"},{"type":"null"}]},"sourceHash":{"description":"SHA256 hash of the pushed source file","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"Workflow status","anyOf":[{"const":"draft","type":"string"},{"const":"enabled","type":"string"},{"const":"paused","type":"string"},{"const":"archived","type":"string"}]},"triggerType":{"description":"Trigger type","anyOf":[{"type":"string"},{"type":"null"}]},"triggerConfig":{"description":"Trigger configuration","anyOf":[{"additionalProperties":true,"type":"object","properties":{"eventName":{"anyOf":[{"type":"string"},{"type":"null"}]},"segmentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"schedule":{"description":"Cron expression","anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"topicId":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"steps":{"description":"Flat array of workflow steps","anyOf":[{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","type","name"],"properties":{"id":{"type":"string"},"type":{"description":"Step type, e.g. send_email or delay","type":"string"},"name":{"type":"string"},"position":{"description":"Canvas position","anyOf":[{"additionalProperties":true,"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},{"type":"null"}]},"config":{"description":"Step configuration, shape depends on type"},"cascadeGroupId":{"description":"Cascade group this step belongs to","anyOf":[{"type":"string"},{"type":"null"}]},"cascadeChannels":{"description":"Cascade reconstruction metadata, first step of a group. Each item is { type: email | sms, id?, templateId?, body?, engagement?, waitDuration? }; items are not validated.","anyOf":[{"type":"array","items":{}},{"type":"null"}]}}}},{"type":"null"}]},"transitions":{"description":"Flat array of step transitions","anyOf":[{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","fromStepId","toStepId"],"properties":{"id":{"type":"string"},"fromStepId":{"type":"string"},"toStepId":{"type":"string"},"condition":{"anyOf":[{"additionalProperties":true,"type":"object","required":["branch"],"properties":{"branch":{"type":"string"}}},{"type":"null"}]}}}},{"type":"null"}]},"updatedAt":{"description":"ISO 8601 time of the last write","type":"string"},"lastEditedFrom":{"description":"Where the workflow was last edited: cli or dashboard","anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["workflows"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1WorkflowsPull","tags":["workflows"],"summary":"Pull workflows for CLI sync","description":"Returns all workflows pushed from CLI with their TypeScript source. Requires the `workflows` read permission (`workflows:read` for API keys)."}},"/v1/workflows/":{"get":{"parameters":[{"schema":{"type":"number","default":1,"minimum":1},"in":"query","name":"page","required":false},{"schema":{"type":"number","default":50,"minimum":1,"maximum":100},"in":"query","name":"pageSize","required":false},{"schema":{"type":"string","maxLength":255},"in":"query","name":"search","required":false},{"schema":{"anyOf":[{"const":"draft","type":"string"},{"const":"enabled","type":"string"},{"const":"paused","type":"string"},{"const":"archived","type":"string"}]},"in":"query","name":"status","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"workflows":{"type":"array","items":{"additionalProperties":true,"description":"Workflow row. Extra columns are passed through.","type":"object","required":["id","organizationId","name","description","status","triggerType","version","totalExecutions","activeExecutions","completedExecutions","failedExecutions","createdBy","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"triggerType":{"anyOf":[{"type":"string"},{"type":"null"}]},"triggerConfig":{},"steps":{},"transitions":{},"version":{"type":"number"},"totalExecutions":{"type":"number"},"activeExecutions":{"type":"number"},"completedExecutions":{"type":"number"},"failedExecutions":{"type":"number"},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdByUser":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}}},{"type":"null"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["workflows","total","page","pageSize"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"workflows":{"type":"array","items":{"additionalProperties":true,"description":"Workflow row. Extra columns are passed through.","type":"object","required":["id","organizationId","name","description","status","triggerType","version","totalExecutions","activeExecutions","completedExecutions","failedExecutions","createdBy","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"triggerType":{"anyOf":[{"type":"string"},{"type":"null"}]},"triggerConfig":{},"steps":{},"transitions":{},"version":{"type":"number"},"totalExecutions":{"type":"number"},"activeExecutions":{"type":"number"},"completedExecutions":{"type":"number"},"failedExecutions":{"type":"number"},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdByUser":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}}},{"type":"null"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["workflows","total","page","pageSize"]}},"text/plain":{"schema":{"type":"object","properties":{"workflows":{"type":"array","items":{"additionalProperties":true,"description":"Workflow row. Extra columns are passed through.","type":"object","required":["id","organizationId","name","description","status","triggerType","version","totalExecutions","activeExecutions","completedExecutions","failedExecutions","createdBy","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"triggerType":{"anyOf":[{"type":"string"},{"type":"null"}]},"triggerConfig":{},"steps":{},"transitions":{},"version":{"type":"number"},"totalExecutions":{"type":"number"},"activeExecutions":{"type":"number"},"completedExecutions":{"type":"number"},"failedExecutions":{"type":"number"},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdByUser":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}}},{"type":"null"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["workflows","total","page","pageSize"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1Workflows","tags":["workflows"],"summary":"List workflows","description":"Paginated workflows for the org, newest first. Optional `search` matches the name (case-insensitive) and `status` filters by status. Requires the `workflows` read permission."}},"/v1/workflows/{workflowId}":{"get":{"parameters":[{"schema":{"type":"string","maxLength":64},"in":"path","name":"workflowId","required":true}],"responses":{"200":{"description":"Workflow row. Extra columns are passed through.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"triggerType":{"anyOf":[{"type":"string"},{"type":"null"}]},"triggerConfig":{},"steps":{},"transitions":{},"version":{"type":"number"},"totalExecutions":{"type":"number"},"activeExecutions":{"type":"number"},"completedExecutions":{"type":"number"},"failedExecutions":{"type":"number"},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdByUser":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}}},{"type":"null"}]}},"required":["id","organizationId","name","description","status","triggerType","version","totalExecutions","activeExecutions","completedExecutions","failedExecutions","createdBy","createdAt","updatedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"triggerType":{"anyOf":[{"type":"string"},{"type":"null"}]},"triggerConfig":{},"steps":{},"transitions":{},"version":{"type":"number"},"totalExecutions":{"type":"number"},"activeExecutions":{"type":"number"},"completedExecutions":{"type":"number"},"failedExecutions":{"type":"number"},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdByUser":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}}},{"type":"null"}]}},"required":["id","organizationId","name","description","status","triggerType","version","totalExecutions","activeExecutions","completedExecutions","failedExecutions","createdBy","createdAt","updatedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"triggerType":{"anyOf":[{"type":"string"},{"type":"null"}]},"triggerConfig":{},"steps":{},"transitions":{},"version":{"type":"number"},"totalExecutions":{"type":"number"},"activeExecutions":{"type":"number"},"completedExecutions":{"type":"number"},"failedExecutions":{"type":"number"},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"createdByUser":{"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}}},{"type":"null"}]}},"required":["id","organizationId","name","description","status","triggerType","version","totalExecutions","activeExecutions","completedExecutions","failedExecutions","createdBy","createdAt","updatedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1WorkflowsByWorkflowId","tags":["workflows"],"summary":"Get a workflow","description":"One workflow by id, scoped to the org. 404 if it does not exist or belongs to another org. Requires the `workflows` read permission."}},"/v1/workflows/{workflowId}/executions":{"get":{"parameters":[{"schema":{"type":"string","maxLength":64},"in":"path","name":"workflowId","required":true},{"schema":{"type":"number","default":1,"minimum":1},"in":"query","name":"page","required":false},{"schema":{"type":"number","default":50,"minimum":1,"maximum":100},"in":"query","name":"pageSize","required":false},{"schema":{"anyOf":[{"const":"pending","type":"string"},{"const":"active","type":"string"},{"const":"paused","type":"string"},{"const":"waiting","type":"string"},{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"cancelled","type":"string"}]},"in":"query","name":"status","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"executions":{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","workflowId","contactId","organizationId","status","currentStepId","startedAt","completedAt","createdAt","updatedAt","contact"],"properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"contactId":{"type":"string"},"organizationId":{"type":"string"},"status":{"type":"string"},"currentStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"contact":{"anyOf":[{"type":"object","required":["id","email","firstName","lastName"],"properties":{"id":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["executions","total","page","pageSize"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"executions":{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","workflowId","contactId","organizationId","status","currentStepId","startedAt","completedAt","createdAt","updatedAt","contact"],"properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"contactId":{"type":"string"},"organizationId":{"type":"string"},"status":{"type":"string"},"currentStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"contact":{"anyOf":[{"type":"object","required":["id","email","firstName","lastName"],"properties":{"id":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["executions","total","page","pageSize"]}},"text/plain":{"schema":{"type":"object","properties":{"executions":{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","workflowId","contactId","organizationId","status","currentStepId","startedAt","completedAt","createdAt","updatedAt","contact"],"properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"contactId":{"type":"string"},"organizationId":{"type":"string"},"status":{"type":"string"},"currentStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"contact":{"anyOf":[{"type":"object","required":["id","email","firstName","lastName"],"properties":{"id":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["executions","total","page","pageSize"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1WorkflowsByWorkflowIdExecutions","tags":["workflows"],"summary":"List workflow executions","description":"Paginated executions of one workflow, newest first, each with its contact. 404 if the workflow is not in the org. Requires the `workflows` read permission."}},"/v1/workflows/executions/{executionId}":{"get":{"parameters":[{"schema":{"type":"string","maxLength":64},"in":"path","name":"executionId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"contactId":{"type":"string"},"organizationId":{"type":"string"},"status":{"type":"string"},"currentStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"contact":{"anyOf":[{"type":"object","required":["id","email","firstName","lastName"],"properties":{"id":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"workflow":{"anyOf":[{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}},{"type":"null"}]},"stepExecutions":{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","executionId","stepId","stepType","status","createdAt"],"properties":{"id":{"type":"string"},"executionId":{"type":"string"},"stepId":{"type":"string"},"stepType":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string"}}}},"stepEngagement":{"type":"object","patternProperties":{"^(.*)$":{}}}},"required":["id","workflowId","contactId","organizationId","status","currentStepId","startedAt","completedAt","createdAt","updatedAt","contact","workflow","stepExecutions"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"contactId":{"type":"string"},"organizationId":{"type":"string"},"status":{"type":"string"},"currentStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"contact":{"anyOf":[{"type":"object","required":["id","email","firstName","lastName"],"properties":{"id":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"workflow":{"anyOf":[{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}},{"type":"null"}]},"stepExecutions":{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","executionId","stepId","stepType","status","createdAt"],"properties":{"id":{"type":"string"},"executionId":{"type":"string"},"stepId":{"type":"string"},"stepType":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string"}}}},"stepEngagement":{"type":"object","patternProperties":{"^(.*)$":{}}}},"required":["id","workflowId","contactId","organizationId","status","currentStepId","startedAt","completedAt","createdAt","updatedAt","contact","workflow","stepExecutions"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"contactId":{"type":"string"},"organizationId":{"type":"string"},"status":{"type":"string"},"currentStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"contact":{"anyOf":[{"type":"object","required":["id","email","firstName","lastName"],"properties":{"id":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"workflow":{"anyOf":[{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}},{"type":"null"}]},"stepExecutions":{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","executionId","stepId","stepType","status","createdAt"],"properties":{"id":{"type":"string"},"executionId":{"type":"string"},"stepId":{"type":"string"},"stepType":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string"}}}},"stepEngagement":{"type":"object","patternProperties":{"^(.*)$":{}}}},"required":["id","workflowId","contactId","organizationId","status","currentStepId","startedAt","completedAt","createdAt","updatedAt","contact","workflow","stepExecutions"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1WorkflowsExecutionsByExecutionId","tags":["workflows"],"summary":"Get a workflow execution","description":"One execution with its step trace, contact, workflow name and per-step engagement. 404 if it does not exist or belongs to another org. Requires the `workflows` read permission."}},"/tools/email-check":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"domain":{"type":"string"},"checkedAt":{"type":"string"},"duration":{"type":"number"},"score":{"type":"object","required":["grade","score","maxScore","breakdown"],"properties":{"grade":{"type":"string"},"score":{"type":"number"},"maxScore":{"type":"number"},"breakdown":{"additionalProperties":true,"type":"object","properties":{}}}},"spf":{"type":"object","required":["exists","valid","record","lookupCount","lookupLimit","allMechanism","includes","hasPtr","warnings"],"properties":{"exists":{"type":"boolean"},"valid":{"type":"boolean"},"record":{"anyOf":[{"type":"string"},{"type":"null"}]},"lookupCount":{"type":"number"},"lookupLimit":{"type":"number"},"allMechanism":{"anyOf":[{"type":"string"},{"type":"null"}]},"includes":{"type":"array","items":{"type":"string"}},"hasPtr":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}}}},"dkim":{"type":"object","required":["found","selectorsFound","selectorsChecked","warnings"],"properties":{"found":{"type":"boolean"},"selectorsFound":{"type":"array","items":{"type":"object","required":["selector","keyType","keyBits","testMode"],"properties":{"selector":{"type":"string"},"keyType":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyBits":{"anyOf":[{"type":"number"},{"type":"null"}]},"testMode":{"type":"boolean"}}}},"selectorsChecked":{"type":"number"},"warnings":{"type":"array","items":{"type":"string"}}}},"dmarc":{"type":"object","required":["exists","valid","record","policy","subdomainPolicy","nonExistentSubdomainPolicy","testing","reportingEnabled","pct","alignmentSpf","alignmentDkim","ruaAddresses","warnings"],"properties":{"exists":{"type":"boolean"},"valid":{"type":"boolean"},"record":{"anyOf":[{"type":"string"},{"type":"null"}]},"policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"subdomainPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"nonExistentSubdomainPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"testing":{"type":"boolean"},"reportingEnabled":{"type":"boolean"},"pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"alignmentSpf":{"anyOf":[{"type":"string"},{"type":"null"}]},"alignmentDkim":{"anyOf":[{"type":"string"},{"type":"null"}]},"ruaAddresses":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}},"mx":{"type":"object","required":["exists","hasRedundancy","records"],"properties":{"exists":{"type":"boolean"},"hasRedundancy":{"type":"boolean"},"records":{"type":"array","items":{"type":"object","required":["exchange","priority","resolves","ipv4Count","ipv6Count"],"properties":{"exchange":{"type":"string"},"priority":{"type":"number"},"resolves":{"type":"boolean"},"ipv4Count":{"type":"number"},"ipv6Count":{"type":"number"}}}}}},"domainAge":{"type":"object","required":["ageInDays","createdAt","expiresAt","daysUntilExpiry","registrar","source","privacyEnabled"],"properties":{"ageInDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"anyOf":[{"type":"number"},{"type":"null"}]},"registrar":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"privacyEnabled":{"type":"boolean"}}},"ipv6":{"type":"object","required":["mxHasIpv6","spfIncludesIpv6","mxIpv6Count"],"properties":{"mxHasIpv6":{"type":"boolean"},"spfIncludesIpv6":{"type":"boolean"},"mxIpv6Count":{"type":"number"}}},"reverseDns":{"type":"object","required":["allHavePtr","allConfirm","count"],"properties":{"allHavePtr":{"type":"boolean"},"allConfirm":{"type":"boolean"},"count":{"type":"number"}}},"blacklist":{"type":"object","required":["checked","overallClean","domainListings","ipListings"],"properties":{"checked":{"type":"boolean"},"overallClean":{"type":"boolean"},"quickMode":{"type":"boolean"},"summary":{"type":"object","required":["state","headline","detail","lists","lookups","unanswered","unansweredLists","unansweredDetails"],"properties":{"state":{"type":"string"},"headline":{"type":"string"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}]},"lists":{"anyOf":[{"type":"number"},{"type":"null"}]},"lookups":{"type":"number"},"unanswered":{"type":"number"},"unansweredLists":{"type":"array","items":{"type":"string"}},"unansweredDetails":{"type":"array","items":{"type":"object","required":["list","reason"],"properties":{"list":{"type":"string"},"reason":{"type":"string"}}}}}},"domainListings":{"type":"array","items":{"type":"object","required":["blacklist","priority","delistUrl"],"properties":{"blacklist":{"type":"string"},"priority":{"type":"string"},"delistUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"ipListings":{"type":"array","items":{"type":"object","required":["blacklist","priority","target","delistUrl"],"properties":{"blacklist":{"type":"string"},"priority":{"type":"string"},"target":{"type":"string"},"delistUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"issues":{"type":"array","items":{"type":"object","required":["check","reason","points","severity"],"properties":{"check":{"type":"string"},"reason":{"type":"string"},"points":{"type":"number"},"severity":{"type":"string"}}}},"bonuses":{"type":"array","items":{"type":"object","required":["check","reason","points"],"properties":{"check":{"type":"string"},"reason":{"type":"string"},"points":{"type":"number"}}}},"error":{"type":"string"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"domain":{"type":"string"},"checkedAt":{"type":"string"},"duration":{"type":"number"},"score":{"type":"object","required":["grade","score","maxScore","breakdown"],"properties":{"grade":{"type":"string"},"score":{"type":"number"},"maxScore":{"type":"number"},"breakdown":{"additionalProperties":true,"type":"object","properties":{}}}},"spf":{"type":"object","required":["exists","valid","record","lookupCount","lookupLimit","allMechanism","includes","hasPtr","warnings"],"properties":{"exists":{"type":"boolean"},"valid":{"type":"boolean"},"record":{"anyOf":[{"type":"string"},{"type":"null"}]},"lookupCount":{"type":"number"},"lookupLimit":{"type":"number"},"allMechanism":{"anyOf":[{"type":"string"},{"type":"null"}]},"includes":{"type":"array","items":{"type":"string"}},"hasPtr":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}}}},"dkim":{"type":"object","required":["found","selectorsFound","selectorsChecked","warnings"],"properties":{"found":{"type":"boolean"},"selectorsFound":{"type":"array","items":{"type":"object","required":["selector","keyType","keyBits","testMode"],"properties":{"selector":{"type":"string"},"keyType":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyBits":{"anyOf":[{"type":"number"},{"type":"null"}]},"testMode":{"type":"boolean"}}}},"selectorsChecked":{"type":"number"},"warnings":{"type":"array","items":{"type":"string"}}}},"dmarc":{"type":"object","required":["exists","valid","record","policy","subdomainPolicy","nonExistentSubdomainPolicy","testing","reportingEnabled","pct","alignmentSpf","alignmentDkim","ruaAddresses","warnings"],"properties":{"exists":{"type":"boolean"},"valid":{"type":"boolean"},"record":{"anyOf":[{"type":"string"},{"type":"null"}]},"policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"subdomainPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"nonExistentSubdomainPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"testing":{"type":"boolean"},"reportingEnabled":{"type":"boolean"},"pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"alignmentSpf":{"anyOf":[{"type":"string"},{"type":"null"}]},"alignmentDkim":{"anyOf":[{"type":"string"},{"type":"null"}]},"ruaAddresses":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}},"mx":{"type":"object","required":["exists","hasRedundancy","records"],"properties":{"exists":{"type":"boolean"},"hasRedundancy":{"type":"boolean"},"records":{"type":"array","items":{"type":"object","required":["exchange","priority","resolves","ipv4Count","ipv6Count"],"properties":{"exchange":{"type":"string"},"priority":{"type":"number"},"resolves":{"type":"boolean"},"ipv4Count":{"type":"number"},"ipv6Count":{"type":"number"}}}}}},"domainAge":{"type":"object","required":["ageInDays","createdAt","expiresAt","daysUntilExpiry","registrar","source","privacyEnabled"],"properties":{"ageInDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"anyOf":[{"type":"number"},{"type":"null"}]},"registrar":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"privacyEnabled":{"type":"boolean"}}},"ipv6":{"type":"object","required":["mxHasIpv6","spfIncludesIpv6","mxIpv6Count"],"properties":{"mxHasIpv6":{"type":"boolean"},"spfIncludesIpv6":{"type":"boolean"},"mxIpv6Count":{"type":"number"}}},"reverseDns":{"type":"object","required":["allHavePtr","allConfirm","count"],"properties":{"allHavePtr":{"type":"boolean"},"allConfirm":{"type":"boolean"},"count":{"type":"number"}}},"blacklist":{"type":"object","required":["checked","overallClean","domainListings","ipListings"],"properties":{"checked":{"type":"boolean"},"overallClean":{"type":"boolean"},"quickMode":{"type":"boolean"},"summary":{"type":"object","required":["state","headline","detail","lists","lookups","unanswered","unansweredLists","unansweredDetails"],"properties":{"state":{"type":"string"},"headline":{"type":"string"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}]},"lists":{"anyOf":[{"type":"number"},{"type":"null"}]},"lookups":{"type":"number"},"unanswered":{"type":"number"},"unansweredLists":{"type":"array","items":{"type":"string"}},"unansweredDetails":{"type":"array","items":{"type":"object","required":["list","reason"],"properties":{"list":{"type":"string"},"reason":{"type":"string"}}}}}},"domainListings":{"type":"array","items":{"type":"object","required":["blacklist","priority","delistUrl"],"properties":{"blacklist":{"type":"string"},"priority":{"type":"string"},"delistUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"ipListings":{"type":"array","items":{"type":"object","required":["blacklist","priority","target","delistUrl"],"properties":{"blacklist":{"type":"string"},"priority":{"type":"string"},"target":{"type":"string"},"delistUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"issues":{"type":"array","items":{"type":"object","required":["check","reason","points","severity"],"properties":{"check":{"type":"string"},"reason":{"type":"string"},"points":{"type":"number"},"severity":{"type":"string"}}}},"bonuses":{"type":"array","items":{"type":"object","required":["check","reason","points"],"properties":{"check":{"type":"string"},"reason":{"type":"string"},"points":{"type":"number"}}}},"error":{"type":"string"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"domain":{"type":"string"},"checkedAt":{"type":"string"},"duration":{"type":"number"},"score":{"type":"object","required":["grade","score","maxScore","breakdown"],"properties":{"grade":{"type":"string"},"score":{"type":"number"},"maxScore":{"type":"number"},"breakdown":{"additionalProperties":true,"type":"object","properties":{}}}},"spf":{"type":"object","required":["exists","valid","record","lookupCount","lookupLimit","allMechanism","includes","hasPtr","warnings"],"properties":{"exists":{"type":"boolean"},"valid":{"type":"boolean"},"record":{"anyOf":[{"type":"string"},{"type":"null"}]},"lookupCount":{"type":"number"},"lookupLimit":{"type":"number"},"allMechanism":{"anyOf":[{"type":"string"},{"type":"null"}]},"includes":{"type":"array","items":{"type":"string"}},"hasPtr":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}}}},"dkim":{"type":"object","required":["found","selectorsFound","selectorsChecked","warnings"],"properties":{"found":{"type":"boolean"},"selectorsFound":{"type":"array","items":{"type":"object","required":["selector","keyType","keyBits","testMode"],"properties":{"selector":{"type":"string"},"keyType":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyBits":{"anyOf":[{"type":"number"},{"type":"null"}]},"testMode":{"type":"boolean"}}}},"selectorsChecked":{"type":"number"},"warnings":{"type":"array","items":{"type":"string"}}}},"dmarc":{"type":"object","required":["exists","valid","record","policy","subdomainPolicy","nonExistentSubdomainPolicy","testing","reportingEnabled","pct","alignmentSpf","alignmentDkim","ruaAddresses","warnings"],"properties":{"exists":{"type":"boolean"},"valid":{"type":"boolean"},"record":{"anyOf":[{"type":"string"},{"type":"null"}]},"policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"subdomainPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"nonExistentSubdomainPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"testing":{"type":"boolean"},"reportingEnabled":{"type":"boolean"},"pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"alignmentSpf":{"anyOf":[{"type":"string"},{"type":"null"}]},"alignmentDkim":{"anyOf":[{"type":"string"},{"type":"null"}]},"ruaAddresses":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}},"mx":{"type":"object","required":["exists","hasRedundancy","records"],"properties":{"exists":{"type":"boolean"},"hasRedundancy":{"type":"boolean"},"records":{"type":"array","items":{"type":"object","required":["exchange","priority","resolves","ipv4Count","ipv6Count"],"properties":{"exchange":{"type":"string"},"priority":{"type":"number"},"resolves":{"type":"boolean"},"ipv4Count":{"type":"number"},"ipv6Count":{"type":"number"}}}}}},"domainAge":{"type":"object","required":["ageInDays","createdAt","expiresAt","daysUntilExpiry","registrar","source","privacyEnabled"],"properties":{"ageInDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"anyOf":[{"type":"number"},{"type":"null"}]},"registrar":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"privacyEnabled":{"type":"boolean"}}},"ipv6":{"type":"object","required":["mxHasIpv6","spfIncludesIpv6","mxIpv6Count"],"properties":{"mxHasIpv6":{"type":"boolean"},"spfIncludesIpv6":{"type":"boolean"},"mxIpv6Count":{"type":"number"}}},"reverseDns":{"type":"object","required":["allHavePtr","allConfirm","count"],"properties":{"allHavePtr":{"type":"boolean"},"allConfirm":{"type":"boolean"},"count":{"type":"number"}}},"blacklist":{"type":"object","required":["checked","overallClean","domainListings","ipListings"],"properties":{"checked":{"type":"boolean"},"overallClean":{"type":"boolean"},"quickMode":{"type":"boolean"},"summary":{"type":"object","required":["state","headline","detail","lists","lookups","unanswered","unansweredLists","unansweredDetails"],"properties":{"state":{"type":"string"},"headline":{"type":"string"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}]},"lists":{"anyOf":[{"type":"number"},{"type":"null"}]},"lookups":{"type":"number"},"unanswered":{"type":"number"},"unansweredLists":{"type":"array","items":{"type":"string"}},"unansweredDetails":{"type":"array","items":{"type":"object","required":["list","reason"],"properties":{"list":{"type":"string"},"reason":{"type":"string"}}}}}},"domainListings":{"type":"array","items":{"type":"object","required":["blacklist","priority","delistUrl"],"properties":{"blacklist":{"type":"string"},"priority":{"type":"string"},"delistUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"ipListings":{"type":"array","items":{"type":"object","required":["blacklist","priority","target","delistUrl"],"properties":{"blacklist":{"type":"string"},"priority":{"type":"string"},"target":{"type":"string"},"delistUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"issues":{"type":"array","items":{"type":"object","required":["check","reason","points","severity"],"properties":{"check":{"type":"string"},"reason":{"type":"string"},"points":{"type":"number"},"severity":{"type":"string"}}}},"bonuses":{"type":"array","items":{"type":"object","required":["check","reason","points"],"properties":{"check":{"type":"string"},"reason":{"type":"string"},"points":{"type":"number"}}}},"error":{"type":"string"}},"required":["success"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postToolsEmail-check","tags":["tools"],"summary":"Check email deliverability","description":"Comprehensive email deliverability check for any domain. Returns SPF, DKIM, DMARC status and a grade. Optionally provide DKIM selectors for providers like AWS SES that use random selectors.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":3,"maxLength":255,"description":"Domain to check","type":"string"},"quick":{"description":"Quick mode: fewer DKIM selectors and the 10-list blacklist set. Skips blacklists unless skipBlacklists is false.","type":"boolean"},"skipBlacklists":{"description":"Skip blacklist checks. Defaults to the value of quick. Send false with quick to check the domain against 5 lists and its IPv4 mail servers against 10.","type":"boolean"},"dkimSelector":{"maxLength":100,"description":"Single DKIM selector to check","type":"string"},"dkimSelectors":{"description":"Multiple DKIM selectors to check","type":"array","items":{"maxLength":100,"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":3,"maxLength":255,"description":"Domain to check","type":"string"},"quick":{"description":"Quick mode: fewer DKIM selectors and the 10-list blacklist set. Skips blacklists unless skipBlacklists is false.","type":"boolean"},"skipBlacklists":{"description":"Skip blacklist checks. Defaults to the value of quick. Send false with quick to check the domain against 5 lists and its IPv4 mail servers against 10.","type":"boolean"},"dkimSelector":{"maxLength":100,"description":"Single DKIM selector to check","type":"string"},"dkimSelectors":{"description":"Multiple DKIM selectors to check","type":"array","items":{"maxLength":100,"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":3,"maxLength":255,"description":"Domain to check","type":"string"},"quick":{"description":"Quick mode: fewer DKIM selectors and the 10-list blacklist set. Skips blacklists unless skipBlacklists is false.","type":"boolean"},"skipBlacklists":{"description":"Skip blacklist checks. Defaults to the value of quick. Send false with quick to check the domain against 5 lists and its IPv4 mail servers against 10.","type":"boolean"},"dkimSelector":{"maxLength":100,"description":"Single DKIM selector to check","type":"string"},"dkimSelectors":{"description":"Multiple DKIM selectors to check","type":"array","items":{"maxLength":100,"type":"string"}}}}}}}}},"/tools/email-check/{domain}":{"get":{"parameters":[{"description":"Domain to check","schema":{"type":"string","maxLength":255},"in":"path","name":"domain","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"domain":{"type":"string"},"checkedAt":{"type":"string"},"duration":{"type":"number"},"score":{"type":"object","required":["grade","score","maxScore","breakdown"],"properties":{"grade":{"type":"string"},"score":{"type":"number"},"maxScore":{"type":"number"},"breakdown":{"additionalProperties":true,"type":"object","properties":{}}}},"spf":{"type":"object","required":["exists","valid","record","lookupCount","lookupLimit","allMechanism","includes","hasPtr","warnings"],"properties":{"exists":{"type":"boolean"},"valid":{"type":"boolean"},"record":{"anyOf":[{"type":"string"},{"type":"null"}]},"lookupCount":{"type":"number"},"lookupLimit":{"type":"number"},"allMechanism":{"anyOf":[{"type":"string"},{"type":"null"}]},"includes":{"type":"array","items":{"type":"string"}},"hasPtr":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}}}},"dkim":{"type":"object","required":["found","selectorsFound","selectorsChecked","warnings"],"properties":{"found":{"type":"boolean"},"selectorsFound":{"type":"array","items":{"type":"object","required":["selector","keyType","keyBits","testMode"],"properties":{"selector":{"type":"string"},"keyType":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyBits":{"anyOf":[{"type":"number"},{"type":"null"}]},"testMode":{"type":"boolean"}}}},"selectorsChecked":{"type":"number"},"warnings":{"type":"array","items":{"type":"string"}}}},"dmarc":{"type":"object","required":["exists","valid","record","policy","subdomainPolicy","nonExistentSubdomainPolicy","testing","reportingEnabled","pct","alignmentSpf","alignmentDkim","ruaAddresses","warnings"],"properties":{"exists":{"type":"boolean"},"valid":{"type":"boolean"},"record":{"anyOf":[{"type":"string"},{"type":"null"}]},"policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"subdomainPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"nonExistentSubdomainPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"testing":{"type":"boolean"},"reportingEnabled":{"type":"boolean"},"pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"alignmentSpf":{"anyOf":[{"type":"string"},{"type":"null"}]},"alignmentDkim":{"anyOf":[{"type":"string"},{"type":"null"}]},"ruaAddresses":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}},"mx":{"type":"object","required":["exists","hasRedundancy","records"],"properties":{"exists":{"type":"boolean"},"hasRedundancy":{"type":"boolean"},"records":{"type":"array","items":{"type":"object","required":["exchange","priority","resolves","ipv4Count","ipv6Count"],"properties":{"exchange":{"type":"string"},"priority":{"type":"number"},"resolves":{"type":"boolean"},"ipv4Count":{"type":"number"},"ipv6Count":{"type":"number"}}}}}},"domainAge":{"type":"object","required":["ageInDays","createdAt","expiresAt","daysUntilExpiry","registrar","source","privacyEnabled"],"properties":{"ageInDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"anyOf":[{"type":"number"},{"type":"null"}]},"registrar":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"privacyEnabled":{"type":"boolean"}}},"ipv6":{"type":"object","required":["mxHasIpv6","spfIncludesIpv6","mxIpv6Count"],"properties":{"mxHasIpv6":{"type":"boolean"},"spfIncludesIpv6":{"type":"boolean"},"mxIpv6Count":{"type":"number"}}},"reverseDns":{"type":"object","required":["allHavePtr","allConfirm","count"],"properties":{"allHavePtr":{"type":"boolean"},"allConfirm":{"type":"boolean"},"count":{"type":"number"}}},"blacklist":{"type":"object","required":["checked","overallClean","domainListings","ipListings"],"properties":{"checked":{"type":"boolean"},"overallClean":{"type":"boolean"},"quickMode":{"type":"boolean"},"summary":{"type":"object","required":["state","headline","detail","lists","lookups","unanswered","unansweredLists","unansweredDetails"],"properties":{"state":{"type":"string"},"headline":{"type":"string"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}]},"lists":{"anyOf":[{"type":"number"},{"type":"null"}]},"lookups":{"type":"number"},"unanswered":{"type":"number"},"unansweredLists":{"type":"array","items":{"type":"string"}},"unansweredDetails":{"type":"array","items":{"type":"object","required":["list","reason"],"properties":{"list":{"type":"string"},"reason":{"type":"string"}}}}}},"domainListings":{"type":"array","items":{"type":"object","required":["blacklist","priority","delistUrl"],"properties":{"blacklist":{"type":"string"},"priority":{"type":"string"},"delistUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"ipListings":{"type":"array","items":{"type":"object","required":["blacklist","priority","target","delistUrl"],"properties":{"blacklist":{"type":"string"},"priority":{"type":"string"},"target":{"type":"string"},"delistUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"issues":{"type":"array","items":{"type":"object","required":["check","reason","points","severity"],"properties":{"check":{"type":"string"},"reason":{"type":"string"},"points":{"type":"number"},"severity":{"type":"string"}}}},"bonuses":{"type":"array","items":{"type":"object","required":["check","reason","points"],"properties":{"check":{"type":"string"},"reason":{"type":"string"},"points":{"type":"number"}}}},"error":{"type":"string"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"domain":{"type":"string"},"checkedAt":{"type":"string"},"duration":{"type":"number"},"score":{"type":"object","required":["grade","score","maxScore","breakdown"],"properties":{"grade":{"type":"string"},"score":{"type":"number"},"maxScore":{"type":"number"},"breakdown":{"additionalProperties":true,"type":"object","properties":{}}}},"spf":{"type":"object","required":["exists","valid","record","lookupCount","lookupLimit","allMechanism","includes","hasPtr","warnings"],"properties":{"exists":{"type":"boolean"},"valid":{"type":"boolean"},"record":{"anyOf":[{"type":"string"},{"type":"null"}]},"lookupCount":{"type":"number"},"lookupLimit":{"type":"number"},"allMechanism":{"anyOf":[{"type":"string"},{"type":"null"}]},"includes":{"type":"array","items":{"type":"string"}},"hasPtr":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}}}},"dkim":{"type":"object","required":["found","selectorsFound","selectorsChecked","warnings"],"properties":{"found":{"type":"boolean"},"selectorsFound":{"type":"array","items":{"type":"object","required":["selector","keyType","keyBits","testMode"],"properties":{"selector":{"type":"string"},"keyType":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyBits":{"anyOf":[{"type":"number"},{"type":"null"}]},"testMode":{"type":"boolean"}}}},"selectorsChecked":{"type":"number"},"warnings":{"type":"array","items":{"type":"string"}}}},"dmarc":{"type":"object","required":["exists","valid","record","policy","subdomainPolicy","nonExistentSubdomainPolicy","testing","reportingEnabled","pct","alignmentSpf","alignmentDkim","ruaAddresses","warnings"],"properties":{"exists":{"type":"boolean"},"valid":{"type":"boolean"},"record":{"anyOf":[{"type":"string"},{"type":"null"}]},"policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"subdomainPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"nonExistentSubdomainPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"testing":{"type":"boolean"},"reportingEnabled":{"type":"boolean"},"pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"alignmentSpf":{"anyOf":[{"type":"string"},{"type":"null"}]},"alignmentDkim":{"anyOf":[{"type":"string"},{"type":"null"}]},"ruaAddresses":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}},"mx":{"type":"object","required":["exists","hasRedundancy","records"],"properties":{"exists":{"type":"boolean"},"hasRedundancy":{"type":"boolean"},"records":{"type":"array","items":{"type":"object","required":["exchange","priority","resolves","ipv4Count","ipv6Count"],"properties":{"exchange":{"type":"string"},"priority":{"type":"number"},"resolves":{"type":"boolean"},"ipv4Count":{"type":"number"},"ipv6Count":{"type":"number"}}}}}},"domainAge":{"type":"object","required":["ageInDays","createdAt","expiresAt","daysUntilExpiry","registrar","source","privacyEnabled"],"properties":{"ageInDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"anyOf":[{"type":"number"},{"type":"null"}]},"registrar":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"privacyEnabled":{"type":"boolean"}}},"ipv6":{"type":"object","required":["mxHasIpv6","spfIncludesIpv6","mxIpv6Count"],"properties":{"mxHasIpv6":{"type":"boolean"},"spfIncludesIpv6":{"type":"boolean"},"mxIpv6Count":{"type":"number"}}},"reverseDns":{"type":"object","required":["allHavePtr","allConfirm","count"],"properties":{"allHavePtr":{"type":"boolean"},"allConfirm":{"type":"boolean"},"count":{"type":"number"}}},"blacklist":{"type":"object","required":["checked","overallClean","domainListings","ipListings"],"properties":{"checked":{"type":"boolean"},"overallClean":{"type":"boolean"},"quickMode":{"type":"boolean"},"summary":{"type":"object","required":["state","headline","detail","lists","lookups","unanswered","unansweredLists","unansweredDetails"],"properties":{"state":{"type":"string"},"headline":{"type":"string"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}]},"lists":{"anyOf":[{"type":"number"},{"type":"null"}]},"lookups":{"type":"number"},"unanswered":{"type":"number"},"unansweredLists":{"type":"array","items":{"type":"string"}},"unansweredDetails":{"type":"array","items":{"type":"object","required":["list","reason"],"properties":{"list":{"type":"string"},"reason":{"type":"string"}}}}}},"domainListings":{"type":"array","items":{"type":"object","required":["blacklist","priority","delistUrl"],"properties":{"blacklist":{"type":"string"},"priority":{"type":"string"},"delistUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"ipListings":{"type":"array","items":{"type":"object","required":["blacklist","priority","target","delistUrl"],"properties":{"blacklist":{"type":"string"},"priority":{"type":"string"},"target":{"type":"string"},"delistUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"issues":{"type":"array","items":{"type":"object","required":["check","reason","points","severity"],"properties":{"check":{"type":"string"},"reason":{"type":"string"},"points":{"type":"number"},"severity":{"type":"string"}}}},"bonuses":{"type":"array","items":{"type":"object","required":["check","reason","points"],"properties":{"check":{"type":"string"},"reason":{"type":"string"},"points":{"type":"number"}}}},"error":{"type":"string"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"domain":{"type":"string"},"checkedAt":{"type":"string"},"duration":{"type":"number"},"score":{"type":"object","required":["grade","score","maxScore","breakdown"],"properties":{"grade":{"type":"string"},"score":{"type":"number"},"maxScore":{"type":"number"},"breakdown":{"additionalProperties":true,"type":"object","properties":{}}}},"spf":{"type":"object","required":["exists","valid","record","lookupCount","lookupLimit","allMechanism","includes","hasPtr","warnings"],"properties":{"exists":{"type":"boolean"},"valid":{"type":"boolean"},"record":{"anyOf":[{"type":"string"},{"type":"null"}]},"lookupCount":{"type":"number"},"lookupLimit":{"type":"number"},"allMechanism":{"anyOf":[{"type":"string"},{"type":"null"}]},"includes":{"type":"array","items":{"type":"string"}},"hasPtr":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}}}},"dkim":{"type":"object","required":["found","selectorsFound","selectorsChecked","warnings"],"properties":{"found":{"type":"boolean"},"selectorsFound":{"type":"array","items":{"type":"object","required":["selector","keyType","keyBits","testMode"],"properties":{"selector":{"type":"string"},"keyType":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyBits":{"anyOf":[{"type":"number"},{"type":"null"}]},"testMode":{"type":"boolean"}}}},"selectorsChecked":{"type":"number"},"warnings":{"type":"array","items":{"type":"string"}}}},"dmarc":{"type":"object","required":["exists","valid","record","policy","subdomainPolicy","nonExistentSubdomainPolicy","testing","reportingEnabled","pct","alignmentSpf","alignmentDkim","ruaAddresses","warnings"],"properties":{"exists":{"type":"boolean"},"valid":{"type":"boolean"},"record":{"anyOf":[{"type":"string"},{"type":"null"}]},"policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"subdomainPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"nonExistentSubdomainPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"testing":{"type":"boolean"},"reportingEnabled":{"type":"boolean"},"pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"alignmentSpf":{"anyOf":[{"type":"string"},{"type":"null"}]},"alignmentDkim":{"anyOf":[{"type":"string"},{"type":"null"}]},"ruaAddresses":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}},"mx":{"type":"object","required":["exists","hasRedundancy","records"],"properties":{"exists":{"type":"boolean"},"hasRedundancy":{"type":"boolean"},"records":{"type":"array","items":{"type":"object","required":["exchange","priority","resolves","ipv4Count","ipv6Count"],"properties":{"exchange":{"type":"string"},"priority":{"type":"number"},"resolves":{"type":"boolean"},"ipv4Count":{"type":"number"},"ipv6Count":{"type":"number"}}}}}},"domainAge":{"type":"object","required":["ageInDays","createdAt","expiresAt","daysUntilExpiry","registrar","source","privacyEnabled"],"properties":{"ageInDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"anyOf":[{"type":"number"},{"type":"null"}]},"registrar":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"privacyEnabled":{"type":"boolean"}}},"ipv6":{"type":"object","required":["mxHasIpv6","spfIncludesIpv6","mxIpv6Count"],"properties":{"mxHasIpv6":{"type":"boolean"},"spfIncludesIpv6":{"type":"boolean"},"mxIpv6Count":{"type":"number"}}},"reverseDns":{"type":"object","required":["allHavePtr","allConfirm","count"],"properties":{"allHavePtr":{"type":"boolean"},"allConfirm":{"type":"boolean"},"count":{"type":"number"}}},"blacklist":{"type":"object","required":["checked","overallClean","domainListings","ipListings"],"properties":{"checked":{"type":"boolean"},"overallClean":{"type":"boolean"},"quickMode":{"type":"boolean"},"summary":{"type":"object","required":["state","headline","detail","lists","lookups","unanswered","unansweredLists","unansweredDetails"],"properties":{"state":{"type":"string"},"headline":{"type":"string"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}]},"lists":{"anyOf":[{"type":"number"},{"type":"null"}]},"lookups":{"type":"number"},"unanswered":{"type":"number"},"unansweredLists":{"type":"array","items":{"type":"string"}},"unansweredDetails":{"type":"array","items":{"type":"object","required":["list","reason"],"properties":{"list":{"type":"string"},"reason":{"type":"string"}}}}}},"domainListings":{"type":"array","items":{"type":"object","required":["blacklist","priority","delistUrl"],"properties":{"blacklist":{"type":"string"},"priority":{"type":"string"},"delistUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"ipListings":{"type":"array","items":{"type":"object","required":["blacklist","priority","target","delistUrl"],"properties":{"blacklist":{"type":"string"},"priority":{"type":"string"},"target":{"type":"string"},"delistUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"issues":{"type":"array","items":{"type":"object","required":["check","reason","points","severity"],"properties":{"check":{"type":"string"},"reason":{"type":"string"},"points":{"type":"number"},"severity":{"type":"string"}}}},"bonuses":{"type":"array","items":{"type":"object","required":["check","reason","points"],"properties":{"check":{"type":"string"},"reason":{"type":"string"},"points":{"type":"number"}}}},"error":{"type":"string"}},"required":["success"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getToolsEmail-checkByDomain","tags":["tools"],"summary":"Check email deliverability (GET)","description":"Quick email deliverability check for any domain via GET request."}},"/v1/workflow-schedules/{workflowId}/enable":{"post":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"workflowId","required":true}],"responses":{"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1Workflow-schedulesByWorkflowIdEnable","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cronExpression"],"properties":{"cronExpression":{"type":"string"},"timezone":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["cronExpression"],"properties":{"cronExpression":{"type":"string"},"timezone":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["cronExpression"],"properties":{"cronExpression":{"type":"string"},"timezone":{"type":"string"}}}}}}}},"/v1/workflow-schedules/{workflowId}/disable":{"post":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"workflowId","required":true}],"responses":{"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1Workflow-schedulesByWorkflowIdDisable"}},"/v1/workflow-schedules/{workflowId}":{"put":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"workflowId","required":true}],"responses":{"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"putV1Workflow-schedulesByWorkflowId","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cronExpression"],"properties":{"cronExpression":{"type":"string"},"timezone":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["cronExpression"],"properties":{"cronExpression":{"type":"string"},"timezone":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["cronExpression"],"properties":{"cronExpression":{"type":"string"},"timezone":{"type":"string"}}}}}}}},"/v1/agents/":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"agents":{"type":"array","items":{"type":"object","required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}},"required":["agents"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"agents":{"type":"array","items":{"type":"object","required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}},"required":["agents"]}},"text/plain":{"schema":{"type":"object","properties":{"agents":{"type":"array","items":{"type":"object","required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}},"required":["agents"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1Agents","tags":["agents"],"summary":"List agents"},"post":{"parameters":[],"responses":{"201":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1Agents","tags":["agents"],"summary":"Create an agent","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","emailAddress","domain"],"properties":{"name":{"minLength":1,"maxLength":100,"type":"string"},"emailAddress":{"format":"email","maxLength":255,"type":"string"},"domain":{"minLength":1,"maxLength":255,"type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","emailAddress","domain"],"properties":{"name":{"minLength":1,"maxLength":100,"type":"string"},"emailAddress":{"format":"email","maxLength":255,"type":"string"},"domain":{"minLength":1,"maxLength":255,"type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}}}}},"text/plain":{"schema":{"type":"object","required":["name","emailAddress","domain"],"properties":{"name":{"minLength":1,"maxLength":100,"type":"string"},"emailAddress":{"format":"email","maxLength":255,"type":"string"},"domain":{"minLength":1,"maxLength":255,"type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}}}}}}}}},"/v1/agents/{id}":{"get":{"parameters":[{"schema":{"type":"string","maxLength":255},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1AgentsById","tags":["agents"],"summary":"Get an agent"}},"/v1/agents/{id}/kill":{"post":{"parameters":[{"schema":{"type":"string","maxLength":255},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"type":"object","required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}},"syncStatus":{"anyOf":[{"const":"synced","type":"string"},{"const":"skipped","type":"string"},{"const":"failed","type":"string"}]},"warning":{"type":"string"}},"required":["agent","syncStatus"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"agent":{"type":"object","required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}},"syncStatus":{"anyOf":[{"const":"synced","type":"string"},{"const":"skipped","type":"string"},{"const":"failed","type":"string"}]},"warning":{"type":"string"}},"required":["agent","syncStatus"]}},"text/plain":{"schema":{"type":"object","properties":{"agent":{"type":"object","required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}},"syncStatus":{"anyOf":[{"const":"synced","type":"string"},{"const":"skipped","type":"string"},{"const":"failed","type":"string"}]},"warning":{"type":"string"}},"required":["agent","syncStatus"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1AgentsByIdKill","tags":["agents"],"summary":"Kill an agent"}},"/v1/agents/{id}/policy":{"patch":{"parameters":[{"schema":{"type":"string","maxLength":255},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"type":"object","required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}},"syncStatus":{"anyOf":[{"const":"synced","type":"string"},{"const":"skipped","type":"string"},{"const":"failed","type":"string"}]},"warning":{"type":"string"}},"required":["agent","syncStatus"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"agent":{"type":"object","required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}},"syncStatus":{"anyOf":[{"const":"synced","type":"string"},{"const":"skipped","type":"string"},{"const":"failed","type":"string"}]},"warning":{"type":"string"}},"required":["agent","syncStatus"]}},"text/plain":{"schema":{"type":"object","properties":{"agent":{"type":"object","required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}},"syncStatus":{"anyOf":[{"const":"synced","type":"string"},{"const":"skipped","type":"string"},{"const":"failed","type":"string"}]},"warning":{"type":"string"}},"required":["agent","syncStatus"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchV1AgentsByIdPolicy","tags":["agents"],"summary":"Replace an agent's send policy","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}}}}}}},"/v1/agents/{id}/policy-sync":{"post":{"parameters":[{"schema":{"type":"string","maxLength":255},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"type":"object","required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}},"syncStatus":{"anyOf":[{"const":"synced","type":"string"},{"const":"skipped","type":"string"},{"const":"failed","type":"string"}]},"warning":{"type":"string"}},"required":["agent","syncStatus"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"agent":{"type":"object","required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}},"syncStatus":{"anyOf":[{"const":"synced","type":"string"},{"const":"skipped","type":"string"},{"const":"failed","type":"string"}]},"warning":{"type":"string"}},"required":["agent","syncStatus"]}},"text/plain":{"schema":{"type":"object","properties":{"agent":{"type":"object","required":["id","organizationId","name","emailAddress","domain","status","policy","credentialUserArn","enforcerFunctionArn","awsAccountId","createdBy","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"emailAddress":{"type":"string"},"domain":{"type":"string"},"status":{"description":"ACTIVE or KILLED","type":"string"},"policy":{"type":"object","required":["maxPerHour","maxPerDay","allowedRecipients","allowedRecipientDomains"],"properties":{"maxPerHour":{"minimum":0,"description":"Max sends per rolling hour (0 flags every send)","type":"number"},"maxPerDay":{"minimum":0,"description":"Max sends per rolling day (0 flags every send)","type":"number"},"allowedRecipients":{"maxItems":100,"description":"Exact recipient addresses always allowed","type":"array","items":{"maxLength":320,"type":"string"}},"allowedRecipientDomains":{"maxItems":100,"description":"Recipient domains always allowed","type":"array","items":{"maxLength":320,"type":"string"}}}},"credentialUserArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"enforcerFunctionArn":{"anyOf":[{"type":"string"},{"type":"null"}]},"awsAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}},"syncStatus":{"anyOf":[{"const":"synced","type":"string"},{"const":"skipped","type":"string"},{"const":"failed","type":"string"}]},"warning":{"type":"string"}},"required":["agent","syncStatus"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1AgentsByIdPolicy-sync","tags":["agents"],"summary":"Sync agent deploy outputs","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"credentialUserArn":{"maxLength":512,"type":"string"},"enforcerFunctionArn":{"maxLength":512,"type":"string"},"awsAccountId":{"maxLength":255,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"credentialUserArn":{"maxLength":512,"type":"string"},"enforcerFunctionArn":{"maxLength":512,"type":"string"},"awsAccountId":{"maxLength":255,"type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"credentialUserArn":{"maxLength":512,"type":"string"},"enforcerFunctionArn":{"maxLength":512,"type":"string"},"awsAccountId":{"maxLength":255,"type":"string"}}}}}}}},"/v1/agents/approvals":{"get":{"parameters":[{"schema":{"anyOf":[{"const":"PENDING","type":"string"},{"const":"APPROVED","type":"string"},{"const":"REJECTED","type":"string"},{"const":"SENT","type":"string"},{"const":"FAILED","type":"string"}]},"in":"query","name":"status","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"approvals":{"type":"array","items":{"type":"object","required":["id","organizationId","agentId","payload","reason","status","decidedBy","decidedAt","messageId","errorMessage","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string"},"payload":{"type":"object","required":["from","to","subject"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"replyTo":{"type":"string"},"inReplyTo":{"type":"string"},"references":{"type":"string"}}},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}},"required":["approvals"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"approvals":{"type":"array","items":{"type":"object","required":["id","organizationId","agentId","payload","reason","status","decidedBy","decidedAt","messageId","errorMessage","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string"},"payload":{"type":"object","required":["from","to","subject"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"replyTo":{"type":"string"},"inReplyTo":{"type":"string"},"references":{"type":"string"}}},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}},"required":["approvals"]}},"text/plain":{"schema":{"type":"object","properties":{"approvals":{"type":"array","items":{"type":"object","required":["id","organizationId","agentId","payload","reason","status","decidedBy","decidedAt","messageId","errorMessage","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string"},"payload":{"type":"object","required":["from","to","subject"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"replyTo":{"type":"string"},"inReplyTo":{"type":"string"},"references":{"type":"string"}}},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}},"required":["approvals"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1AgentsApprovals","tags":["agents"],"summary":"List the approval queue"}},"/v1/agents/approvals/{id}/approve":{"post":{"parameters":[{"schema":{"type":"string","maxLength":255},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string"},"payload":{"type":"object","required":["from","to","subject"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"replyTo":{"type":"string"},"inReplyTo":{"type":"string"},"references":{"type":"string"}}},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","organizationId","agentId","payload","reason","status","decidedBy","decidedAt","messageId","errorMessage","createdAt","updatedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string"},"payload":{"type":"object","required":["from","to","subject"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"replyTo":{"type":"string"},"inReplyTo":{"type":"string"},"references":{"type":"string"}}},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","organizationId","agentId","payload","reason","status","decidedBy","decidedAt","messageId","errorMessage","createdAt","updatedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string"},"payload":{"type":"object","required":["from","to","subject"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"replyTo":{"type":"string"},"inReplyTo":{"type":"string"},"references":{"type":"string"}}},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","organizationId","agentId","payload","reason","status","decidedBy","decidedAt","messageId","errorMessage","createdAt","updatedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1AgentsApprovalsByIdApprove","tags":["agents"],"summary":"Approve a pending send"}},"/v1/agents/approvals/{id}/reject":{"post":{"parameters":[{"schema":{"type":"string","maxLength":255},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string"},"payload":{"type":"object","required":["from","to","subject"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"replyTo":{"type":"string"},"inReplyTo":{"type":"string"},"references":{"type":"string"}}},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","organizationId","agentId","payload","reason","status","decidedBy","decidedAt","messageId","errorMessage","createdAt","updatedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string"},"payload":{"type":"object","required":["from","to","subject"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"replyTo":{"type":"string"},"inReplyTo":{"type":"string"},"references":{"type":"string"}}},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","organizationId","agentId","payload","reason","status","decidedBy","decidedAt","messageId","errorMessage","createdAt","updatedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string"},"payload":{"type":"object","required":["from","to","subject"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"replyTo":{"type":"string"},"inReplyTo":{"type":"string"},"references":{"type":"string"}}},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","organizationId","agentId","payload","reason","status","decidedBy","decidedAt","messageId","errorMessage","createdAt","updatedAt"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"404":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Error message","type":"string"}},"required":["error"]}}}},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postV1AgentsApprovalsByIdReject","tags":["agents"],"summary":"Reject a pending send"}},"/v1/audit-logs/":{"get":{"parameters":[{"schema":{"type":"string","maxLength":4},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":512},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"action","required":false},{"schema":{"type":"string","maxLength":255},"in":"query","name":"actorId","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"dateFrom","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"dateTo","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["id","organizationId","userId","actorEmail","action","resource","resourceId","metadata","ipAddress","userAgent","createdAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"actorEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"type":"string"},"resource":{"type":"string"},"resourceId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"ipAddress":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"userAgent":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}}}},"nextCursor":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"retentionDays":{"type":"number"},"canExtend":{"type":"boolean"}},"required":["data","nextCursor","retentionDays","canExtend"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["id","organizationId","userId","actorEmail","action","resource","resourceId","metadata","ipAddress","userAgent","createdAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"actorEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"type":"string"},"resource":{"type":"string"},"resourceId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"ipAddress":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"userAgent":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}}}},"nextCursor":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"retentionDays":{"type":"number"},"canExtend":{"type":"boolean"}},"required":["data","nextCursor","retentionDays","canExtend"]}},"text/plain":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["id","organizationId","userId","actorEmail","action","resource","resourceId","metadata","ipAddress","userAgent","createdAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"actorEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"type":"string"},"resource":{"type":"string"},"resourceId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"ipAddress":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"userAgent":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}}}},"nextCursor":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"retentionDays":{"type":"number"},"canExtend":{"type":"boolean"}},"required":["data","nextCursor","retentionDays","canExtend"]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1Audit-logs","tags":["audit-logs"],"summary":"List audit log entries","description":"Newest first, keyset-paginated (limit 1-100, default 50; pass nextCursor back unchanged as cursor). Filter with action, actorId, dateFrom and dateTo. Only rows inside the plan's history window are returned; retentionDays states that window and canExtend says whether a higher plan lengthens it. Requires the orgSettings read permission and the owner or admin role."}},"/v1/audit-logs/export":{"get":{"parameters":[{"schema":{"type":"string","maxLength":4},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":512},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"action","required":false},{"schema":{"type":"string","maxLength":255},"in":"query","name":"actorId","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"dateFrom","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"dateTo","required":false},{"schema":{"type":"string","maxLength":8},"in":"query","name":"format","required":false}],"responses":{"200":{"anyOf":[{"type":"object","required":["logs","total","truncated"],"properties":{"logs":{"type":"array","items":{"type":"object","required":["id","organizationId","userId","actorEmail","action","resource","resourceId","metadata","ipAddress","userAgent","createdAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"actorEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"type":"string"},"resource":{"type":"string"},"resourceId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"ipAddress":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"userAgent":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}}}},"total":{"type":"number"},"truncated":{"type":"boolean"}}},{"description":"CSV document when format=csv","type":"string"}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["logs","total","truncated"],"properties":{"logs":{"type":"array","items":{"type":"object","required":["id","organizationId","userId","actorEmail","action","resource","resourceId","metadata","ipAddress","userAgent","createdAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"actorEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"type":"string"},"resource":{"type":"string"},"resourceId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"ipAddress":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"userAgent":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}}}},"total":{"type":"number"},"truncated":{"type":"boolean"}}},{"description":"CSV document when format=csv","type":"string"}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["logs","total","truncated"],"properties":{"logs":{"type":"array","items":{"type":"object","required":["id","organizationId","userId","actorEmail","action","resource","resourceId","metadata","ipAddress","userAgent","createdAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"actorEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"type":"string"},"resource":{"type":"string"},"resourceId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"ipAddress":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"userAgent":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}}}},"total":{"type":"number"},"truncated":{"type":"boolean"}}},{"description":"CSV document when format=csv","type":"string"}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["logs","total","truncated"],"properties":{"logs":{"type":"array","items":{"type":"object","required":["id","organizationId","userId","actorEmail","action","resource","resourceId","metadata","ipAddress","userAgent","createdAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"actorEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"type":"string"},"resource":{"type":"string"},"resourceId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"ipAddress":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"userAgent":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}}}},"total":{"type":"number"},"truncated":{"type":"boolean"}}},{"description":"CSV document when format=csv","type":"string"}]}}}},"400":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getV1Audit-logsExport","tags":["audit-logs"],"summary":"Export audit log entries","description":"Same filters and plan window as the list. format=json (default) returns { logs, total, truncated }; format=csv returns text/csv with the dashboard's columns and X-Total-Count / X-Truncated headers. Up to 50,000 rows are returned; truncated is true when more matched. Requires the orgSettings read permission, the owner or admin role, and the Business plan (or a licence). Each export writes one audit_log.exported row."}},"/v1/agents/webhook":{"post":{"parameters":[],"operationId":"postV1AgentsWebhook","tags":["agents"],"summary":"Agent enforcer callback","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["agentId","event","payload"],"properties":{"agentId":{"maxLength":255,"type":"string"},"event":{"anyOf":[{"const":"pending_approval","type":"string"},{"const":"blocked","type":"string"}]},"payload":{"type":"object","required":["from","to","subject"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"replyTo":{"type":"string"},"inReplyTo":{"type":"string"},"references":{"type":"string"}}},"reason":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["agentId","event","payload"],"properties":{"agentId":{"maxLength":255,"type":"string"},"event":{"anyOf":[{"const":"pending_approval","type":"string"},{"const":"blocked","type":"string"}]},"payload":{"type":"object","required":["from","to","subject"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"replyTo":{"type":"string"},"inReplyTo":{"type":"string"},"references":{"type":"string"}}},"reason":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["agentId","event","payload"],"properties":{"agentId":{"maxLength":255,"type":"string"},"event":{"anyOf":[{"const":"pending_approval","type":"string"},{"const":"blocked","type":"string"}]},"payload":{"type":"object","required":["from","to","subject"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"replyTo":{"type":"string"},"inReplyTo":{"type":"string"},"references":{"type":"string"}}},"reason":{"type":"string"}}}}}},"responses":{"200":{},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}