{"openapi":"3.1.0","info":{"title":"RavenRelay public email API","version":"1.0.0","description":"Bearer-key sending and reading API with session-authenticated template management. Other dashboard management is outside this contract. Free allowance: 5,000 accepted To/CC/BCC recipient sends per workspace per UTC month, shared across all projects and real development deliveries. Unlimited connected domains; no added branding; no RavenRelay daily quota. Production requires activation. Development keys deliver only to exact verified recipient domains connected to their project, with 15 accepted requests per minute and 1,000 recipient sends per key per UTC month. Provider limits also apply. Never expose keys in browser code."},"servers":[{"url":"https://api-production-1c6a.up.railway.app"}],"security":[{"apiKey":[]}],"paths":{"/v1/templates":{"get":{"operationId":"listTemplates","summary":"List project templates","security":[{"session":[]}],"parameters":[{"name":"projectId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"}}],"responses":{"200":{"description":"Template page","content":{"application/json":{"schema":{"type":"object","properties":{"templates":{"type":"array","items":{"$ref":"#/components/schemas/TemplateSummary"}},"next_cursor":{"type":["string","null"]}},"required":["templates","next_cursor"]}}}},"400":{"description":"Invalid input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Dashboard session required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Project membership or write role required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Template not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Slug already exists or revision is stale.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid template variables.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createTemplate","summary":"Create a project template","security":[{"session":[]}],"parameters":[{"name":"projectId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateContent"}}}},"responses":{"201":{"description":"Created template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"description":"Invalid input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Dashboard session required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Project membership or write role required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Template not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Slug already exists or revision is stale.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid template variables.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/templates/{id}":{"get":{"operationId":"getTemplate","summary":"Read a project template","security":[{"session":[]}],"parameters":[{"name":"projectId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"}}],"responses":{"200":{"description":"Template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"description":"Invalid input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Dashboard session required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Project membership or write role required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Template not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Slug already exists or revision is stale.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid template variables.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateTemplate","summary":"Replace template content with revision check","security":[{"session":[]}],"parameters":[{"name":"projectId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateUpdate"}}}},"responses":{"200":{"description":"Updated template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"description":"Invalid input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Dashboard session required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Project membership or write role required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Template not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Slug already exists or revision is stale.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid template variables.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteTemplate","summary":"Delete template; accepted sends retain their content","security":[{"session":[]}],"parameters":[{"name":"projectId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"}}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}}}},"400":{"description":"Invalid input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Dashboard session required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Project membership or write role required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Template not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Slug already exists or revision is stale.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid template variables.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/templates/preview":{"post":{"operationId":"previewTemplate","summary":"Render a sanitized preview without sending","security":[{"session":[]}],"parameters":[{"name":"projectId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplatePreview"}}}},"responses":{"200":{"description":"Rendered preview","content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"}},"required":["subject"]}}}},"400":{"description":"Invalid input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Dashboard session required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Project membership or write role required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Template not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Slug already exists or revision is stale.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid template variables.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/emails":{"post":{"operationId":"sendEmail","summary":"Queue an email","description":"Requires email:send. At most 50 total To/CC/BCC recipients and 10 MiB for the complete JSON request. Any workspace-suppressed recipient blocks the whole message. A 202 queued response is not delivery confirmation. Idempotent replays do not add monthly usage; accepted replays and suppressions count toward request rate limits.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[ -~]+$"},"description":"Stable key per logical send. Reuse only with an unchanged payload."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SendEmail"},{"$ref":"#/components/schemas/TemplateSend"}]}}}},"responses":{"202":{"description":"Queued or suppressed; no synchronous delivery guarantee.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendResult"}}}},"400":{"description":"Invalid query or identifier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions or inactive workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Template slug not found in this project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency key reused with a different payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Complete JSON request exceeds 10 MiB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Sender domain unverified, sender disallowed or a development recipient domain is not allowed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rate or monthly recipient quota exceeded. Rate-limit message states the wait in seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listEmails","summary":"List project emails","description":"email:read keys can read their project; email:send keys can read emails they created. Bodies and BCC are omitted. Cursor pagination, newest first.","parameters":[{"name":"sender","in":"query","description":"Exact sender email address.","schema":{"type":"string"}},{"name":"domain","in":"query","description":"Exact sender domain (subdomains excluded).","schema":{"type":"string"}},{"name":"after","in":"query","description":"Inclusive accepted timestamp.","schema":{"type":"string","format":"date-time"}},{"name":"before","in":"query","description":"Exclusive accepted timestamp.","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"}},{"name":"status","in":"query","schema":{"$ref":"#/components/schemas/Status"}},{"name":"recipient","in":"query","schema":{"type":"string","maxLength":254},"description":"Exact normalized To address; does not search CC or BCC."}],"responses":{"200":{"description":"One page of email summaries.","content":{"application/json":{"schema":{"type":"object","properties":{"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmailSummary"}},"next_cursor":{"type":["string","null"]}},"required":["emails","next_cursor"]}}}},"400":{"description":"Invalid query or identifier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions or inactive workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Cursor email not found in the key’s scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/emails/{id}":{"get":{"operationId":"getEmail","summary":"Read an email and its timeline","description":"Same scope as listEmails. Bodies and BCC are omitted, including BCC recipient outcomes.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"}}],"responses":{"200":{"description":"Email details and timeline.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailDetail"}}}},"400":{"description":"Invalid query or identifier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions or inactive workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Email not found in this key’s scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"emailEvent":{"post":{"operationId":"receiveEmailEvent","summary":"Receive a signed delivery event at your configured HTTPS endpoint","security":[],"description":"HMAC-SHA256 with the literal UTF-8 endpoint secret over timestamp + '.' + raw request bytes; signature is v1=<hex>. Verify in constant time with a five-minute timestamp tolerance before parsing. Durably deduplicate payload id and tolerate out-of-order events. Retry intervals: 1m, 5m, 15m, 1h, 6h, 24h (seven total attempts). Development deliveries include data.test_mode=true. BCC is omitted. Redirects are not followed.","parameters":[{"name":"RavenRelay-Event-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"RavenRelay-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"RavenRelay-Signature","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Receiver durably accepted or already processed the event. Any 2xx acknowledges it."},"default":{"description":"Non-2xx or network failure triggers retries; unsafe destinations stop immediately."}}}}},"components":{"securitySchemes":{"session":{"type":"apiKey","in":"cookie","name":"__Host-rr_session","description":"Authenticated dashboard session (__Host-rr_session in production, rr_session locally). Browser writes also require the configured dashboard Origin."},"apiKey":{"type":"http","scheme":"bearer","description":"Server-side rr_test_ development or rr_live_ production API key; not a JWT."}},"schemas":{"TemplateVariables":{"type":"object","maxProperties":100,"propertyNames":{"pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$"},"additionalProperties":{"oneOf":[{"type":"string","maxLength":10000},{"type":"number"},{"type":"boolean"}]}},"TemplateContent":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"slug":{"type":"string","maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"subject":{"type":"string","minLength":1,"maxLength":998,"pattern":"^[^\\r\\n]+$"},"html":{"type":["string","null"],"maxLength":1000000},"text":{"type":["string","null"],"maxLength":1000000}},"required":["name","slug","subject"],"additionalProperties":false,"anyOf":[{"required":["html"],"properties":{"html":{"type":"string","minLength":1}}},{"required":["text"],"properties":{"text":{"type":"string","minLength":1}}}]},"TemplateUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"slug":{"type":"string","maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"subject":{"type":"string","minLength":1,"maxLength":998,"pattern":"^[^\\r\\n]+$"},"html":{"type":["string","null"],"maxLength":1000000},"text":{"type":["string","null"],"maxLength":1000000},"revision":{"type":"integer","minimum":1}},"required":["name","slug","subject","revision"],"additionalProperties":false},"TemplateSummary":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"subject":{"type":"string"},"revision":{"type":"integer"},"variables":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","name","slug","subject","revision","variables","createdAt","updatedAt"]},"Template":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"slug":{"type":"string","maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"subject":{"type":"string","minLength":1,"maxLength":998,"pattern":"^[^\\r\\n]+$"},"html":{"type":["string","null"],"maxLength":1000000},"text":{"type":["string","null"],"maxLength":1000000},"id":{"type":"string"},"projectId":{"type":"string"},"revision":{"type":"integer"},"variables":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","slug","subject","html","text","id","projectId","revision","variables","createdAt","updatedAt"]},"TemplatePreview":{"type":"object","properties":{"subject":{"type":"string","minLength":1,"maxLength":998,"pattern":"^[^\\r\\n]+$"},"html":{"type":["string","null"],"maxLength":1000000},"text":{"type":["string","null"],"maxLength":1000000},"variables":{"$ref":"#/components/schemas/TemplateVariables"}},"required":["subject"],"additionalProperties":false},"TemplateSend":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/Mailbox"},"to":{"oneOf":[{"$ref":"#/components/schemas/Mailbox"},{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"#/components/schemas/Mailbox"}}]},"cc":{"oneOf":[{"$ref":"#/components/schemas/Mailbox"},{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"#/components/schemas/Mailbox"}}]},"bcc":{"oneOf":[{"$ref":"#/components/schemas/Mailbox"},{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"#/components/schemas/Mailbox"}}]},"reply_to":{"$ref":"#/components/schemas/Mailbox"},"template":{"type":"string","maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"variables":{"$ref":"#/components/schemas/TemplateVariables"},"headers":{"$ref":"#/components/schemas/SendEmail/properties/headers"},"tags":{"$ref":"#/components/schemas/SendEmail/properties/tags"},"metadata":{"type":"object","additionalProperties":true}},"required":["from","to","template"],"additionalProperties":false},"Mailbox":{"type":"string","maxLength":320,"pattern":"^[^\\r\\n]+$","description":"Bare email address (maximum 254 characters) or Name <address>. Surrounding whitespace is trimmed."},"Status":{"type":"string","enum":["queued","processing","sent","failed","rejected","suppressed","simulated","delayed","delivered","hard_bounced","soft_bounced","complained"]},"SendEmail":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/Mailbox"},"to":{"oneOf":[{"$ref":"#/components/schemas/Mailbox"},{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"#/components/schemas/Mailbox"}}]},"cc":{"oneOf":[{"$ref":"#/components/schemas/Mailbox"},{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"#/components/schemas/Mailbox"}}]},"bcc":{"oneOf":[{"$ref":"#/components/schemas/Mailbox"},{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"#/components/schemas/Mailbox"}}]},"reply_to":{"$ref":"#/components/schemas/Mailbox"},"subject":{"type":"string","minLength":1,"maxLength":998,"pattern":"^[^\\r\\n]+$"},"html":{"type":"string","maxLength":10000000},"text":{"type":"string","maxLength":10000000},"headers":{"type":"object","propertyNames":{"pattern":"^[A-Za-z0-9-]+$"},"additionalProperties":{"type":"string","maxLength":998,"pattern":"^[^\\r\\n]*$"},"description":"Reserved headers are forbidden: names beginning with from, to, cc, bcc, subject, content-, mime-, reply-to, return-path, received, dkim-, authorization (case-insensitive)."},"tags":{"type":"object","maxProperties":20,"propertyNames":{"minLength":1,"maxLength":128,"pattern":"^(?!rr_)[A-Za-z0-9_-]+$"},"additionalProperties":{"type":"string","maxLength":256,"pattern":"^[A-Za-z0-9_-]*$"}},"metadata":{"type":"object","additionalProperties":true}},"required":["from","to","subject"],"additionalProperties":false,"anyOf":[{"required":["html"],"properties":{"html":{"minLength":1}}},{"required":["text"],"properties":{"text":{"minLength":1}}}]},"SendResult":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","suppressed"]},"test_mode":{"type":"boolean"},"reason":{"type":"string"}},"required":["id","status","test_mode"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","examples":["validation_error","invalid_api_key","domain_not_verified","test_recipient_not_allowed","quota_exceeded","rate_limit_exceeded","idempotency_conflict"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"EmailSummary":{"type":"object","properties":{"id":{"type":"string"},"fromAddress":{"type":"string"},"toAddresses":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"status":{"$ref":"#/components/schemas/Status"},"testMode":{"type":"boolean"},"failureCode":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"sentAt":{"type":["string","null"],"format":"date-time"}},"required":["id","fromAddress","toAddresses","subject","status","testMode","failureCode","createdAt","sentAt"]},"EmailDetail":{"type":"object","properties":{"id":{"type":"string"},"fromAddress":{"type":"string"},"subject":{"type":"string"},"status":{"$ref":"#/components/schemas/Status"},"testMode":{"type":"boolean"},"failureCode":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"sentAt":{"type":["string","null"],"format":"date-time"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"reply_to":{"type":["string","null"]},"providerMessageId":{"type":["string","null"]},"deliveredAt":{"type":["string","null"],"format":"date-time"},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"status":{"$ref":"#/components/schemas/Status"},"occurredAt":{"type":"string","format":"date-time"}},"required":["address","status","occurredAt"]}},"webhookDeliveries":{"type":"array","maxItems":100,"items":{"type":"object","properties":{"id":{"type":"string"},"eventId":{"type":"string"},"status":{"type":"string"},"nextAttemptAt":{"type":["string","null"],"format":"date-time"},"attemptLogs":{"type":"array","items":{"type":"object","properties":{"number":{"type":"integer"},"httpStatus":{"type":["integer","null"]},"errorCode":{"type":["string","null"]},"durationMs":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"}},"required":["number","httpStatus","errorCode","durationMs","createdAt"]}}},"required":["id","eventId","status","nextAttemptAt","attemptLogs"]}},"metadata":{"type":"object","additionalProperties":true},"tags":{"type":"object","additionalProperties":{"type":"string"}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"payload":{"type":"object","additionalProperties":true}},"required":["id","type","occurredAt","payload"]}}},"required":["id","fromAddress","subject","status","testMode","failureCode","createdAt","sentAt","to","cc","reply_to","providerMessageId","deliveredAt","recipients","webhookDeliveries","metadata","tags","events"]},"WebhookEvent":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["email.sent","email.delivered","email.bounced","email.complained","email.rejected","email.failed","email.delayed","email.suppressed"]},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"email_id":{"type":"string"},"project_id":{"type":"string"},"test_mode":{"type":"boolean"},"status":{"$ref":"#/components/schemas/Status"},"recipients":{"type":"array","items":{"type":"string"}},"provider_message_id":{"type":["string","null"]},"bounce_type":{"type":"string"},"complaint_type":{"type":"string"},"delay_type":{"type":"string"},"reason":{"type":"string"}},"required":["email_id","project_id","test_mode","status","recipients","provider_message_id"]}},"required":["id","type","created_at","data"]}}}}