{"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":"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":"email-logs","description":"Email delivery log inspection"},{"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/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":[],"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":{}}}}}}},"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"}}},"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}],"operationId":"deleteV1ConnectionsById","tags":["connections"],"summary":"Disconnect an AWS account","description":"Clears the webhook secret for the connection. The account record is preserved.","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/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/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).","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":"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":{"$ref":"#/components/responses/Forbidden"},"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":"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":"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":"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":{"$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":"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":{"$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"]}}}},"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":"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":"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":"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":{"$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":"deleteV1ContactsById","tags":["contacts"],"summary":"Delete contact","description":"Deletes a single contact"}},"/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":{"$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":"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/":{"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":{"$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":"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":{"$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":"deleteV1BatchById","tags":["batch"],"summary":"Cancel batch send","description":"Cancels a scheduled or queued batch send. If scheduled, also deletes the EventBridge schedule."}},"/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":{"$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":"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}],"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"}}}}}},"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/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":{"$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":"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":{"$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":"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":{"$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"]}}}},"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":{"$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":"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/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}}}}}},"/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/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":{"$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":"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":{"$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":"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":{"$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":"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":{"$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":"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":[],"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"}}}}}},"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/templates/push/batch":{"post":{"parameters":[],"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"}}}}}}}}},"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/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}],"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.","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/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":{"$ref":"#/components/responses/Forbidden"},"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"}}}}}}}}}}},"/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":{"$ref":"#/components/responses/Forbidden"},"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"}}}}}}}},"/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":{"$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":"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":{"$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":"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":[],"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"}}}}}},"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/workflows/push/batch":{"post":{"parameters":[],"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"}}}}}}}}},"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/workflows/pull":{"get":{"operationId":"getV1WorkflowsPull","tags":["workflows"],"summary":"Pull workflows for CLI sync","description":"Returns all workflows pushed from CLI with their TypeScript source.","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"}}}},"/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"},"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"},"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"},"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 (skip blacklist checks)","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 (skip blacklist checks)","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 (skip blacklist checks)","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"},"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"},"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"},"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}],"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"}}}}}},"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/workflow-schedules/{workflowId}/disable":{"post":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"workflowId","required":true}],"operationId":"postV1Workflow-schedulesByWorkflowIdDisable","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/workflow-schedules/{workflowId}":{"put":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"workflowId","required":true}],"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"}}}}}},"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/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-sync":{"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"},"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":{"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/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"}}}}}}