From 1312d480c16020d869cdcb09758b6b8f74b73d8d Mon Sep 17 00:00:00 2001 From: dielduarte <5679671+dielduarte@users.noreply.github.com> Date: Mon, 20 Jul 2026 18:53:02 +0000 Subject: [PATCH] chore: update resend.json --- resend.json | 8093 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 5314 insertions(+), 2779 deletions(-) diff --git a/resend.json b/resend.json index 5b5c391..9ac5911 100644 --- a/resend.json +++ b/resend.json @@ -44,6 +44,10 @@ "name": "Webhooks", "description": "Create and manage Webhooks through the Resend API." }, + { + "name": "Webhook Events", + "description": "Real-time event notifications delivered to your registered webhook endpoint. Each delivery is signed using Svix headers (`svix-id`, `svix-timestamp`, `svix-signature`); verify them before acting on the payload." + }, { "name": "Templates", "description": "Create and manage Templates through the Resend API." @@ -64,6 +68,10 @@ "name": "Contact Properties", "description": "Create and manage Contact Properties through the Resend API." }, + { + "name": "Suppressions", + "description": "Create and manage Suppressions through the Resend API." + }, { "name": "Logs", "description": "Retrieve API request logs through the Resend API." @@ -75,6 +83,10 @@ { "name": "Events", "description": "Create and manage Events through the Resend API." + }, + { + "name": "OAuth", + "description": "List and manage OAuth grants through the Resend API." } ], "paths": { @@ -760,6 +772,110 @@ } } }, + "/domains/claim": { + "post": { + "tags": [ + "Domains" + ], + "summary": "Claim a domain", + "description": "Start a claim for a domain that another Resend account has already verified. The domain is recreated under your account with fresh DKIM keys, so the previous account's DNS records cannot be reused. Returns a TXT record to add to your DNS to prove ownership. Uses the same request body as creating a domain.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateDomainClaimRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Claim created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DomainClaim" + } + } + } + }, + "200": { + "description": "An identical pending claim already existed and was returned unchanged.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DomainClaim" + } + } + } + } + } + } + }, + "/domains/{domain_id}/claim": { + "get": { + "tags": [ + "Domains" + ], + "summary": "Retrieve a domain claim", + "description": "Retrieve the latest claim for the placeholder domain created by the claim.", + "parameters": [ + { + "name": "domain_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the placeholder domain created by the claim." + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DomainClaim" + } + } + } + } + } + } + }, + "/domains/{domain_id}/claim/verify": { + "post": { + "tags": [ + "Domains" + ], + "summary": "Verify a domain claim", + "description": "Trigger asynchronous DNS verification and ownership transfer for a domain claim. The claim stays `pending` while verification runs; poll the retrieve endpoint for status. Once `completed`, the transferred domain has new DKIM records that must be added to DNS and verified via the standard domain verify endpoint.", + "parameters": [ + { + "name": "domain_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the placeholder domain created by the claim." + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DomainClaim" + } + } + } + } + } + } + }, "/api-keys": { "post": { "tags": [ @@ -849,6 +965,68 @@ } } }, + "/oauth/grants": { + "get": { + "tags": [ + "OAuth" + ], + "summary": "Retrieve a list of OAuth grants", + "parameters": [ + { + "$ref": "#/components/parameters/PaginationLimit" + }, + { + "$ref": "#/components/parameters/PaginationAfter" + }, + { + "$ref": "#/components/parameters/PaginationBefore" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOAuthGrantsResponse" + } + } + } + } + } + } + }, + "/oauth/grants/{oauth_grant_id}": { + "delete": { + "tags": [ + "OAuth" + ], + "summary": "Revoke an OAuth grant", + "parameters": [ + { + "name": "oauth_grant_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The OAuth grant ID." + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RevokeOAuthGrantResponse" + } + } + } + } + } + } + }, "/templates": { "post": { "tags": [ @@ -1249,6 +1427,112 @@ } } }, + "/contacts/imports": { + "post": { + "tags": [ + "Contacts" + ], + "summary": "Create a contact import", + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/CreateContactImportOptions" + } + } + } + }, + "responses": { + "201": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateContactImportResponseSuccess" + } + } + } + } + } + }, + "get": { + "tags": [ + "Contacts" + ], + "summary": "Retrieve a list of contact imports", + "parameters": [ + { + "name": "status", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "queued", + "in_progress", + "completed", + "failed" + ] + }, + "description": "Filter contact imports by status." + }, + { + "$ref": "#/components/parameters/PaginationLimit" + }, + { + "$ref": "#/components/parameters/PaginationAfter" + }, + { + "$ref": "#/components/parameters/PaginationBefore" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListContactImportsResponseSuccess" + } + } + } + } + } + } + }, + "/contacts/imports/{id}": { + "get": { + "tags": [ + "Contacts" + ], + "summary": "Retrieve a single contact import", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + }, + "description": "The Contact Import ID." + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetContactImportResponseSuccess" + } + } + } + } + } + } + }, "/contacts/{id}": { "get": { "tags": [ @@ -2891,348 +3175,2390 @@ } } } - } - }, - "components": { - "securitySchemes": { - "bearerAuth": { - "type": "http", - "scheme": "bearer" - } }, - "parameters": { - "PaginationLimit": { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 100 - }, - "description": "Number of items to return." - }, - "PaginationAfter": { - "in": "query", - "name": "after", - "required": false, - "schema": { - "type": "string" + "/suppressions": { + "post": { + "tags": [ + "Suppressions" + ], + "summary": "Create a suppression", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSuppressionOptions" + } + } + } }, - "description": "Return items after this cursor." + "responses": { + "201": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSuppressionResponseSuccess" + } + } + } + } + } }, - "PaginationBefore": { - "in": "query", - "name": "before", - "required": false, - "schema": { - "type": "string" + "get": { + "tags": [ + "Suppressions" + ], + "summary": "Retrieve a list of suppressions", + "parameters": [ + { + "name": "origin", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "bounce", + "complaint", + "manual" + ] + }, + "description": "Filter suppressions by origin." + }, + { + "$ref": "#/components/parameters/PaginationLimit" + }, + { + "$ref": "#/components/parameters/PaginationAfter" + }, + { + "$ref": "#/components/parameters/PaginationBefore" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListSuppressionsResponseSuccess" + } + } + } + } + } + } + }, + "/suppressions/batch/add": { + "post": { + "tags": [ + "Suppressions" + ], + "summary": "Add up to 100 suppressions at once", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchAddSuppressionsOptions" + } + } + } }, - "description": "Return items before this cursor." + "responses": { + "201": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchAddSuppressionsResponseSuccess" + } + } + } + } + } } }, - "schemas": { - "SendEmailRequest": { + "/suppressions/batch/remove": { + "post": { + "tags": [ + "Suppressions" + ], + "summary": "Remove up to 100 suppressions at once", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRemoveSuppressionsOptions" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRemoveSuppressionsResponseSuccess" + } + } + } + } + } + } + }, + "/suppressions/{suppression}": { + "get": { + "tags": [ + "Suppressions" + ], + "summary": "Retrieve a single suppression by ID or email", + "parameters": [ + { + "name": "suppression", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The Suppression ID or email address." + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetSuppressionResponseSuccess" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Suppressions" + ], + "summary": "Remove a single suppression by ID or email", + "parameters": [ + { + "name": "suppression", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The Suppression ID or email address." + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemoveSuppressionResponseSuccess" + } + } + } + } + } + } + } + }, + "webhooks": { + "email.sent": { + "post": { + "summary": "Email sent", + "description": "Occurs whenever the API request was successful. Resend will attempt to deliver the message to the recipient's mail server.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmailSentEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "email.delivered": { + "post": { + "summary": "Email delivered", + "description": "Occurs whenever Resend successfully delivered the email to the recipient's mail server.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmailDeliveredEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "email.delivery_delayed": { + "post": { + "summary": "Email delivery delayed", + "description": "Occurs whenever the email couldn't be delivered due to a temporary issue, such as the recipient's inbox being full or the receiving server experiencing a transient issue.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmailDeliveryDelayedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "email.bounced": { + "post": { + "summary": "Email bounced", + "description": "Occurs whenever the recipient's mail server permanently rejected the email.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmailBouncedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "email.complained": { + "post": { + "summary": "Email complained", + "description": "Occurs whenever the email was successfully delivered, but the recipient marked it as spam.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmailComplainedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "email.opened": { + "post": { + "summary": "Email opened", + "description": "Occurs whenever the recipient opened the email. Requires open tracking to be enabled.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmailOpenedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "email.clicked": { + "post": { + "summary": "Email clicked", + "description": "Occurs whenever the recipient clicks on an email link. Requires click tracking to be enabled.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmailClickedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "email.failed": { + "post": { + "summary": "Email failed", + "description": "Occurs whenever the email failed to send due to an error such as invalid recipients, API key problems, domain verification issues, email quota limits, or other sending failures.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmailFailedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "email.scheduled": { + "post": { + "summary": "Email scheduled", + "description": "Occurs whenever the email is scheduled to be sent.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmailScheduledEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "email.suppressed": { + "post": { + "summary": "Email suppressed", + "description": "Occurs whenever the email is suppressed by Resend, such as when the recipient's address is on the account-level suppression list.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmailSuppressedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "email.received": { + "post": { + "summary": "Email received", + "description": "Occurs whenever Resend successfully receives an inbound email on a receiving domain.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmailReceivedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "contact.created": { + "post": { + "summary": "Contact created", + "description": "Occurs whenever a contact was successfully created. Note: when importing multiple contacts via CSV, this event is not triggered.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContactCreatedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "contact.updated": { + "post": { + "summary": "Contact updated", + "description": "Occurs whenever a contact was successfully updated.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContactUpdatedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "contact.deleted": { + "post": { + "summary": "Contact deleted", + "description": "Occurs whenever a contact was successfully deleted.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContactDeletedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "domain.created": { + "post": { + "summary": "Domain created", + "description": "Occurs when a domain was successfully created.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DomainCreatedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "domain.updated": { + "post": { + "summary": "Domain updated", + "description": "Occurs when a domain was successfully updated.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DomainUpdatedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + }, + "domain.deleted": { + "post": { + "summary": "Domain deleted", + "description": "Occurs when a domain was successfully deleted.", + "tags": [ + "Webhook Events" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DomainDeletedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2xx status code to acknowledge receipt of the event." + } + } + } + } + }, + "components": { + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer" + } + }, + "parameters": { + "PaginationLimit": { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 100 + }, + "description": "Number of items to return." + }, + "PaginationAfter": { + "in": "query", + "name": "after", + "required": false, + "schema": { + "type": "string" + }, + "description": "Return items after this cursor." + }, + "PaginationBefore": { + "in": "query", + "name": "before", + "required": false, + "schema": { + "type": "string" + }, + "description": "Return items before this cursor." + } + }, + "schemas": { + "SendEmailRequest": { + "type": "object", + "required": [ + "from", + "to", + "subject" + ], + "properties": { + "from": { + "type": "string", + "description": "Sender email address. To include a friendly name, use the format \"Your Name \"." + }, + "to": { + "description": "Recipient email address. For multiple addresses, send as an array of strings. Max 50.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "maxItems": 50 + } + ] + }, + "subject": { + "type": "string", + "description": "Email subject." + }, + "bcc": { + "description": "Bcc recipient email address. For multiple addresses, send as an array of strings.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "cc": { + "description": "Cc recipient email address. For multiple addresses, send as an array of strings.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "reply_to": { + "description": "Reply-to email address. For multiple addresses, send as an array of strings.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "html": { + "type": "string", + "description": "The HTML version of the message." + }, + "text": { + "type": "string", + "description": "The plain text version of the message." + }, + "template": { + "allOf": [ + { + "$ref": "#/components/schemas/EmailTemplateInput" + }, + { + "description": "Use a published template to send the email. If provided, do not include html or text." + } + ] + }, + "headers": { + "type": "object", + "description": "Custom headers to add to the email." + }, + "scheduled_at": { + "type": "string", + "description": "Schedule email to be sent later. The date should be in ISO 8601 format." + }, + "attachments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Attachment" + } + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Tag" + } + }, + "topic_id": { + "type": "string", + "description": "The topic ID to scope the email to. If the recipient is a contact and opted-in to the topic, the email is sent. If opted-out, the email is not sent. If the recipient is not a contact, the email is sent if the topic's default subscription is opt_in." + } + } + }, + "Attachment": { + "type": "object", + "properties": { + "content": { + "type": "string", + "format": "binary", + "description": "Content of an attached file." + }, + "filename": { + "type": "string", + "description": "Name of attached file." + }, + "path": { + "type": "string", + "description": "Path where the attachment file is hosted" + }, + "content_type": { + "type": "string", + "description": "Optional content type for the attachment, if not set it will be derived from the filename property" + }, + "content_id": { + "type": "string", + "description": "Content ID for embedding inline images using cid references (e.g., cid:image001)." + } + } + }, + "Tag": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the email tag. It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-). It can contain no more than 256 characters." + }, + "value": { + "type": "string", + "description": "The value of the email tag.It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-). It can contain no more than 256 characters." + } + } + }, + "EmailTemplateInput": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The id of the published email template." + }, + "variables": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "description": "Template variables object with key/value pairs.", + "example": { + "variableName": "Sign up now", + "variableName2": 123 + } + } + }, + "required": [ + "id" + ] + }, + "SendEmailResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the sent email." + } + } + }, + "UpdateEmailOptions": { + "type": "object", + "properties": { + "scheduled_at": { + "type": "string", + "description": "Schedule email to be sent later. The date should be in ISO 8601 format." + } + } + }, + "Email": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "The type of object.", + "example": "email" + }, + "id": { + "type": "string", + "description": "The ID of the email.", + "example": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c" + }, + "message_id": { + "type": "string", + "description": "The Message-ID header value of the email.", + "example": "<202301010000.4ef9a417@email.example.com>" + }, + "to": { + "type": "array", + "items": { + "type": "string", + "description": "The email addresses of the recipients." + }, + "example": [ + "delivered@resend.dev" + ] + }, + "from": { + "type": "string", + "description": "The email address of the sender.", + "example": "Acme " + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "The date and time the email was created.", + "example": "2023-04-03T22:13:42.674981+00:00" + }, + "subject": { + "type": "string", + "description": "The subject line of the email.", + "example": "Hello World" + }, + "html": { + "type": "string", + "description": "The HTML body of the email.", + "example": "Congrats on sending your first email!" + }, + "text": { + "type": "string", + "description": "The plain text body of the email." + }, + "bcc": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The email addresses of the blind carbon copy recipients." + }, + "cc": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The email addresses of the carbon copy recipients." + }, + "reply_to": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The email addresses to which replies should be sent." + }, + "last_event": { + "type": "string", + "description": "The status of the email.", + "enum": [ + "bounced", + "canceled", + "clicked", + "complained", + "delivered", + "delivery_delayed", + "failed", + "opened", + "queued", + "scheduled", + "sent", + "suppressed" + ], + "example": "delivered" + }, + "bounce": { + "type": "object", + "description": "Details about the bounce, present only when `last_event` is `bounced`.", + "properties": { + "message": { + "type": [ + "string", + "null" + ], + "description": "A human-readable message describing the bounce." + }, + "type": { + "type": [ + "string", + "null" + ], + "enum": [ + "Undetermined", + "Transient", + "Permanent", + null + ], + "description": "The type of bounce, as reported by AWS SES.", + "example": "Permanent" + }, + "subType": { + "type": [ + "string", + "null" + ], + "enum": [ + "Undetermined", + "General", + "NoEmail", + "MailboxFull", + "MessageTooLarge", + "ContentRejected", + "AttachmentRejected", + null + ], + "description": "The subtype of the bounce, as reported by AWS SES.", + "example": "General" + }, + "diagnosticCode": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Diagnostic codes returned by the receiving mail server for each bounced recipient." + } + } + } + } + }, + "ListEmailsResponse": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "Type of the response object.", + "example": "list" + }, + "has_more": { + "type": "boolean", + "description": "Indicates if there are more results available.", + "example": false + }, + "data": { + "type": "array", + "description": "Array containing email information.", + "items": { + "$ref": "#/components/schemas/Email" + } + } + } + }, + "CreateBatchEmailsResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the sent email." + } + } + } + } + } + }, + "DomainCapabilities": { + "type": "object", + "description": "Configure the domain capabilities for sending and receiving emails. At least one capability must be enabled.", + "properties": { + "sending": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "description": "Enable or disable sending emails from this domain." + }, + "receiving": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "description": "Enable or disable receiving emails to this domain." + } + } + }, + "CreateDomainRequest": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the domain you want to create." + }, + "region": { + "type": "string", + "enum": [ + "us-east-1", + "eu-west-1", + "sa-east-1", + "ap-northeast-1" + ], + "default": "us-east-1", + "description": "The region where emails will be sent from. Possible values are us-east-1 | eu-west-1 | sa-east-1 | ap-northeast-1" + }, + "custom_return_path": { + "type": "string", + "description": "For advanced use cases, choose a subdomain for the Return-Path address. Defaults to 'send' (i.e., send.yourdomain.tld)." + }, + "open_tracking": { + "type": "boolean", + "description": "Track the open rate of each email." + }, + "click_tracking": { + "type": "boolean", + "description": "Track clicks within the body of each HTML email." + }, + "tls": { + "type": "string", + "enum": [ + "opportunistic", + "enforced" + ], + "default": "opportunistic", + "description": "TLS mode. Opportunistic attempts secure connection but falls back to unencrypted. Enforced requires TLS or email won't be sent." + }, + "capabilities": { + "$ref": "#/components/schemas/DomainCapabilities" + }, + "tracking_subdomain": { + "type": "string", + "description": "The subdomain to use for click and open tracking." + } + } + }, + "CreateDomainResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the domain." + }, + "name": { + "type": "string", + "description": "The name of the domain." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "The date and time the domain was created." + }, + "status": { + "type": "string", + "enum": [ + "pending", + "verified", + "failed", + "not_started", + "partially_verified", + "partially_failed" + ], + "description": "The status of the domain." + }, + "capabilities": { + "$ref": "#/components/schemas/DomainCapabilities" + }, + "records": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DomainRecord" + } + }, + "region": { + "type": "string", + "description": "The region where the domain is hosted." + }, + "open_tracking": { + "type": "boolean", + "description": "Whether open tracking is enabled for this domain." + }, + "click_tracking": { + "type": "boolean", + "description": "Whether click tracking is enabled for this domain." + }, + "tracking_subdomain": { + "type": "string", + "description": "The subdomain used for click and open tracking." + } + } + }, + "UpdateDomainOptions": { + "type": "object", + "properties": { + "open_tracking": { + "type": "boolean", + "description": "Track the open rate of each email." + }, + "click_tracking": { + "type": "boolean", + "description": "Track clicks within the body of each HTML email." + }, + "tls": { + "type": "string", + "description": "enforced | opportunistic.", + "default": "opportunistic" + }, + "capabilities": { + "$ref": "#/components/schemas/DomainCapabilities" + }, + "tracking_subdomain": { + "type": "string", + "description": "The subdomain to use for click and open tracking." + } + } + }, + "DomainRecord": { + "type": "object", + "properties": { + "record": { + "type": "string", + "enum": [ + "SPF", + "DKIM", + "Receiving", + "Tracking", + "TrackingCAA" + ], + "description": "The type of record (SPF for sending, DKIM for sending, Receiving for inbound emails, Tracking & TrackingCAA for click and open tracking)." + }, + "name": { + "type": "string", + "description": "The name of the DNS record." + }, + "type": { + "type": "string", + "enum": [ + "MX", + "TXT", + "CNAME", + "CAA" + ], + "description": "The DNS record type." + }, + "ttl": { + "type": "string", + "description": "The time to live for the record." + }, + "status": { + "type": "string", + "enum": [ + "pending", + "verified", + "failed", + "temporary_failure", + "not_started" + ], + "description": "The status of the record." + }, + "value": { + "type": "string", + "description": "The value of the record." + }, + "priority": { + "type": "integer", + "description": "The priority of the record (only applicable for MX records)." + } + } + }, + "Domain": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "The type of object.", + "example": "domain" + }, + "id": { + "type": "string", + "description": "The ID of the domain.", + "example": "d91cd9bd-1176-453e-8fc1-35364d380206" + }, + "name": { + "type": "string", + "description": "The name of the domain.", + "example": "example.com" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "verified", + "failed", + "not_started", + "partially_verified", + "partially_failed" + ], + "description": "The status of the domain.", + "example": "not_started" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "The date and time the domain was created.", + "example": "2023-04-26T20:21:26.347412+00:00" + }, + "region": { + "type": "string", + "description": "The region where the domain is hosted.", + "example": "us-east-1" + }, + "open_tracking": { + "type": "boolean", + "description": "Whether open tracking is enabled for this domain." + }, + "click_tracking": { + "type": "boolean", + "description": "Whether click tracking is enabled for this domain." + }, + "tracking_subdomain": { + "type": "string", + "description": "The subdomain used for click and open tracking." + }, + "capabilities": { + "$ref": "#/components/schemas/DomainCapabilities" + }, + "records": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DomainRecord" + } + } + } + }, + "CreateDomainClaimRequest": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the domain you want to claim." + }, + "region": { + "type": "string", + "enum": [ + "us-east-1", + "eu-west-1", + "sa-east-1", + "ap-northeast-1" + ], + "default": "us-east-1", + "description": "The region where emails will be sent from. Possible values are us-east-1 | eu-west-1 | sa-east-1 | ap-northeast-1" + }, + "custom_return_path": { + "type": "string", + "default": "send", + "description": "For advanced use cases, choose a subdomain for the Return-Path address. Defaults to 'send' (i.e., send.yourdomain.tld)." + }, + "open_tracking": { + "type": "boolean", + "description": "Track the open rate of each email." + }, + "click_tracking": { + "type": "boolean", + "description": "Track clicks within the body of each HTML email." + }, + "tracking_subdomain": { + "type": "string", + "description": "The subdomain to use for click and open tracking." + } + } + }, + "DomainClaimRecord": { + "type": "object", + "description": "The TXT record to add to your DNS to prove ownership of the claimed domain.", + "properties": { + "type": { + "type": "string", + "enum": [ + "TXT" + ], + "description": "The DNS record type. Always TXT for domain claims.", + "example": "TXT" + }, + "name": { + "type": "string", + "description": "The name of the DNS record (the domain being claimed).", + "example": "example.com" + }, + "value": { + "type": "string", + "description": "The value of the TXT record.", + "example": "resend-domain-verification=abc123" + }, + "ttl": { + "type": "string", + "description": "The time to live for the record.", + "example": "Auto" + } + } + }, + "DomainClaim": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "The type of object.", + "example": "domain_claim" + }, + "id": { + "type": "string", + "description": "The ID of the claim.", + "example": "d91cd9bd-1176-453e-8fc1-35364d380206" + }, + "name": { + "type": "string", + "description": "The name of the domain being claimed.", + "example": "example.com" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "verified", + "completed", + "blocked", + "expired", + "superseded", + "canceled", + "failed" + ], + "description": "The status of the claim.", + "example": "pending" + }, + "domain_id": { + "type": [ + "string", + "null" + ], + "description": "The ID of the placeholder domain created for the claim.", + "example": "a1b2c3d4-1176-453e-8fc1-35364d380206" + }, + "region": { + "type": [ + "string", + "null" + ], + "enum": [ + "us-east-1", + "eu-west-1", + "sa-east-1", + "ap-northeast-1", + null + ], + "description": "The region where the claimed domain will send from.", + "example": "us-east-1" + }, + "record": { + "$ref": "#/components/schemas/DomainClaimRecord" + }, + "blocked_reason": { + "type": [ + "string", + "null" + ], + "enum": [ + "grace_period", + "recent_owner_activity", + "pending_scheduled_emails", + null + ], + "description": "Why the claim is currently blocked, if applicable.", + "example": null + }, + "failure_reason": { + "type": [ + "string", + "null" + ], + "description": "Why the claim failed, if applicable.", + "example": null + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "The date and time the claim was created.", + "example": "2023-04-26T20:21:26.347412+00:00" + }, + "expires_at": { + "type": "string", + "format": "date-time", + "description": "The date and time the claim expires if not verified.", + "example": "2023-05-03T20:21:26.347412+00:00" + } + } + }, + "VerifyDomainResponse": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "The type of object.", + "example": "domain" + }, + "id": { + "type": "string", + "description": "The ID of the domain.", + "example": "d91cd9bd-1176-453e-8fc1-35364d380206" + } + } + }, + "ListDomainsResponse": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "Type of the response object.", + "example": "list" + }, + "has_more": { + "type": "boolean", + "description": "Indicates if there are more results available.", + "example": false + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ListDomainsItem" + } + } + } + }, + "ListDomainsItem": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the domain.", + "example": "d91cd9bd-1176-453e-8fc1-35364d380206" + }, + "name": { + "type": "string", + "description": "The name of the domain.", + "example": "example.com" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "verified", + "failed", + "not_started", + "partially_verified", + "partially_failed" + ], + "description": "The status of the domain.", + "example": "not_started" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "The date and time the domain was created.", + "example": "2023-04-26T20:21:26.347412+00:00" + }, + "region": { + "type": "string", + "description": "The region where the domain is hosted.", + "example": "us-east-1" + }, + "capabilities": { + "$ref": "#/components/schemas/DomainCapabilities" + } + } + }, + "UpdateDomainResponseSuccess": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the updated domain.", + "example": "d91cd9bd-1176-453e-8fc1-35364d380206" + }, + "object": { + "type": "string", + "description": "The object type representing the updated domain.", + "example": "domain" + } + } + }, + "DeleteDomainResponse": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "The type of object.", + "example": "domain" + }, + "id": { + "type": "string", + "description": "The ID of the domain.", + "example": "d91cd9bd-1176-453e-8fc1-35364d380206" + }, + "deleted": { + "type": "boolean", + "description": "Indicates whether the domain was deleted successfully.", + "example": true + } + } + }, + "CreateApiKeyRequest": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The API key name." + }, + "permission": { + "type": "string", + "enum": [ + "full_access", + "sending_access" + ], + "description": "The API key can have full access to Resend’s API or be only restricted to send emails. * full_access - Can create, delete, get, and update any resource. * sending_access - Can only send emails." + }, + "domain_id": { + "type": "string", + "description": "Restrict an API key to send emails only from a specific domain. Only used when the permission is sending_access." + } + } + }, + "CreateApiKeyResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the API key." + }, + "token": { + "type": "string", + "description": "The token of the API key." + } + } + }, + "ListApiKeysResponse": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "Type of the response object.", + "example": "list" + }, + "has_more": { + "type": "boolean", + "description": "Indicates if there are more results available.", + "example": false + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApiKey" + } + } + } + }, + "ApiKey": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the API key." + }, + "name": { + "type": "string", + "description": "The name of the API key." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "The date and time the API key was created." + }, + "last_used_at": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "The date and time the API key was last used." + } + } + }, + "ListOAuthGrantsResponse": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "Type of the response object.", + "example": "list" + }, + "has_more": { + "type": "boolean", + "description": "Indicates if there are more results available.", + "example": false + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OAuthGrant" + } + } + } + }, + "OAuthGrant": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the OAuth grant." + }, + "client_id": { + "type": "string", + "description": "The ID of the OAuth client the grant was issued to." + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The scopes granted to the OAuth client." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "The date and time the OAuth grant was created." + }, + "revoked_at": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "The date and time the OAuth grant was revoked, or null if it is still active." + }, + "revoked_reason": { + "type": [ + "string", + "null" + ], + "description": "The reason the OAuth grant was revoked, or null if it is still active." + }, + "client": { + "type": "object", + "description": "The OAuth client the grant was issued to.", + "properties": { + "name": { + "type": "string", + "description": "The name of the OAuth client." + }, + "logo_uri": { + "type": [ + "string", + "null" + ], + "description": "The URL of the OAuth client's logo." + } + } + } + } + }, + "RevokeOAuthGrantResponse": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "The type of object.", + "example": "oauth_grant" + }, + "id": { + "type": "string", + "description": "The ID of the OAuth grant." + }, + "revoked_at": { + "type": "string", + "format": "date-time", + "description": "The date and time the OAuth grant was revoked." + }, + "revoked_reason": { + "type": "string", + "description": "The reason the OAuth grant was revoked." + } + } + }, + "DeleteApiKeyResponse": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "The type of object.", + "example": "api_key" + }, + "id": { + "type": "string", + "description": "The ID of the API key." + }, + "deleted": { + "type": "boolean", + "description": "Indicates whether the API key was successfully deleted.", + "example": true + } + } + }, + "CreateAudienceOptions": { + "type": "object", + "deprecated": true, + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the audience you want to create." + } + } + }, + "CreateAudienceResponseSuccess": { + "type": "object", + "deprecated": true, + "properties": { + "id": { + "type": "string", + "description": "The ID of the audience.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + }, + "object": { + "type": "string", + "description": "The object of the audience.", + "example": "audience" + }, + "name": { + "type": "string", + "description": "The name of the audience.", + "example": "Registered Users" + } + } + }, + "GetAudienceResponseSuccess": { + "type": "object", + "deprecated": true, + "properties": { + "id": { + "type": "string", + "description": "The ID of the audience.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + }, + "object": { + "type": "string", + "description": "The object of the audience.", + "example": "audience" + }, + "name": { + "type": "string", + "description": "The name of the audience.", + "example": "Registered Users" + }, + "created_at": { + "type": "string", + "description": "The date that the object was created.", + "example": "2023-10-06T22:59:55.977Z" + } + } + }, + "RemoveAudienceResponseSuccess": { + "type": "object", + "deprecated": true, + "properties": { + "id": { + "type": "string", + "description": "The ID of the audience.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + }, + "object": { + "type": "string", + "description": "The object of the audience.", + "example": "audience" + }, + "deleted": { + "type": "boolean", + "description": "The deleted attribute indicates that the corresponding audience has been deleted.", + "example": true + } + } + }, + "ListAudiencesResponseSuccess": { + "type": "object", + "deprecated": true, + "properties": { + "object": { + "type": "string", + "description": "Type of the response object.", + "example": "list" + }, + "data": { + "type": "array", + "description": "Array containing audience information.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the audience.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + }, + "name": { + "type": "string", + "description": "Name of the audience.", + "example": "Registered Users" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the audience was created.", + "example": "2023-10-06T22:59:55.977Z" + } + } + } + } + } + }, + "CreateContactOptions": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string", + "description": "Email address of the contact.", + "example": "steve.wozniak@gmail.com" + }, + "first_name": { + "type": "string", + "description": "First name of the contact.", + "example": "Steve" + }, + "last_name": { + "type": "string", + "description": "Last name of the contact.", + "example": "Wozniak" + }, + "unsubscribed": { + "type": "boolean", + "description": "The Contact's global subscription status. If set to true, the contact will be unsubscribed from all Broadcasts.", + "example": false + }, + "properties": { + "type": "object", + "additionalProperties": true, + "description": "A map of custom property keys and values to create." + }, + "segments": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array of segment IDs to add the contact to." + }, + "topics": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The topic ID." + }, + "subscription": { + "type": "string", + "enum": [ + "opt_in", + "opt_out" + ], + "description": "The subscription status for this topic." + } + } + }, + "description": "Array of topic subscriptions for the contact." + }, + "audience_id": { + "type": "string", + "description": "Unique identifier of the audience to which the contact belongs.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf", + "deprecated": true + } + } + }, + "CreateContactResponseSuccess": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "Type of the response object.", + "example": "contact" + }, + "id": { + "type": "string", + "description": "Unique identifier for the created contact.", + "example": "479e3145-dd38-476b-932c-529ceb705947" + } + } + }, + "GetContactResponseSuccess": { "type": "object", - "required": [ - "from", - "to", - "subject" - ], "properties": { - "from": { + "object": { "type": "string", - "description": "Sender email address. To include a friendly name, use the format \"Your Name \"." + "description": "Type of the response object.", + "example": "contact" }, - "to": { - "description": "Recipient email address. For multiple addresses, send as an array of strings. Max 50.", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "maxItems": 50 - } - ] + "id": { + "type": "string", + "description": "Unique identifier for the contact.", + "example": "e169aa45-1ecf-4183-9955-b1499d5701d3" }, - "subject": { + "email": { "type": "string", - "description": "Email subject." + "description": "Email address of the contact.", + "example": "steve.wozniak@gmail.com" }, - "bcc": { - "description": "Bcc recipient email address. For multiple addresses, send as an array of strings.", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "first_name": { + "type": "string", + "description": "First name of the contact.", + "example": "Steve" }, - "cc": { - "description": "Cc recipient email address. For multiple addresses, send as an array of strings.", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "last_name": { + "type": "string", + "description": "Last name of the contact.", + "example": "Wozniak" }, - "reply_to": { - "description": "Reply-to email address. For multiple addresses, send as an array of strings.", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the contact was created.", + "example": "2023-10-06T23:47:56.678Z" }, - "html": { + "unsubscribed": { + "type": "boolean", + "description": "Indicates if the contact is unsubscribed.", + "example": false + }, + "properties": { + "type": "object", + "additionalProperties": true, + "description": "A map of custom property keys and values." + } + } + }, + "UpdateContactOptions": { + "type": "object", + "properties": { + "email": { "type": "string", - "description": "The HTML version of the message." + "description": "Email address of the contact.", + "example": "steve.wozniak@gmail.com" }, - "text": { + "first_name": { "type": "string", - "description": "The plain text version of the message." + "description": "First name of the contact.", + "example": "Steve" }, - "template": { - "allOf": [ - { - "$ref": "#/components/schemas/EmailTemplateInput" - }, - { - "description": "Use a published template to send the email. If provided, do not include html or text." - } - ] + "last_name": { + "type": "string", + "description": "Last name of the contact.", + "example": "Wozniak" }, - "headers": { + "unsubscribed": { + "type": "boolean", + "description": "The Contact's global subscription status. If set to true, the contact will be unsubscribed from all Broadcasts.", + "example": false + }, + "properties": { "type": "object", - "description": "Custom headers to add to the email." + "additionalProperties": true, + "description": "A map of custom property keys and values to update." + } + } + }, + "UpdateContactResponseSuccess": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "Type of the response object.", + "example": "contact" }, - "scheduled_at": { + "id": { "type": "string", - "description": "Schedule email to be sent later. The date should be in ISO 8601 format." + "description": "Unique identifier for the updated contact.", + "example": "479e3145-dd38-476b-932c-529ceb705947" + } + } + }, + "RemoveContactResponseSuccess": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "Type of the response object.", + "example": "contact" }, - "attachments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Attachment" - } + "id": { + "type": "string", + "description": "Unique identifier for the removed contact.", + "example": "520784e2-887d-4c25-b53c-4ad46ad38100" }, - "tags": { + "deleted": { + "type": "boolean", + "description": "Indicates whether the contact was successfully deleted.", + "example": true + } + } + }, + "ListContactsResponseSuccess": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "Type of the response object.", + "example": "list" + }, + "data": { "type": "array", + "description": "Array containing contact information.", "items": { - "$ref": "#/components/schemas/Tag" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the contact.", + "example": "e169aa45-1ecf-4183-9955-b1499d5701d3" + }, + "email": { + "type": "string", + "description": "Email address of the contact.", + "example": "steve.wozniak@gmail.com" + }, + "first_name": { + "type": "string", + "description": "First name of the contact.", + "example": "Steve" + }, + "last_name": { + "type": "string", + "description": "Last name of the contact.", + "example": "Wozniak" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the contact was created.", + "example": "2023-10-06T23:47:56.678Z" + }, + "unsubscribed": { + "type": "boolean", + "description": "Indicates if the contact is unsubscribed.", + "example": false + } + } } - }, - "topic_id": { - "type": "string", - "description": "The topic ID to scope the email to. If the recipient is a contact and opted-in to the topic, the email is sent. If opted-out, the email is not sent. If the recipient is not a contact, the email is sent if the topic's default subscription is opt_in." } } }, - "Attachment": { + "CreateContactImportOptions": { "type": "object", + "required": [ + "file" + ], "properties": { - "content": { + "file": { "type": "string", "format": "binary", - "description": "Content of an attached file." + "description": "CSV file to import. Maximum size is 50MB." }, - "filename": { + "column_map": { "type": "string", - "description": "Name of attached file." + "description": "JSON-encoded object mapping contact fields and custom property keys to CSV column names. Supports `email`, `first_name`, `last_name`, `unsubscribed`, and `properties`. Custom property mappings can include `type` as `string`, `number`, or `boolean`; defaults to `string`.", + "example": "{\"email\":\"Email\",\"first_name\":\"First Name\",\"last_name\":\"Last Name\",\"unsubscribed\":\"Unsubscribed\",\"properties\":{\"plan\":{\"column\":\"Plan\",\"type\":\"string\"}}}" }, - "path": { + "on_conflict": { "type": "string", - "description": "Path where the attachment file is hosted" + "enum": [ + "upsert", + "skip" + ], + "default": "skip", + "description": "Strategy to use when an imported contact already exists.", + "example": "skip" }, - "content_type": { + "segments": { "type": "string", - "description": "Optional content type for the attachment, if not set it will be derived from the filename property" + "description": "JSON-encoded array of segments to add imported contacts to.", + "example": "[{\"id\":\"78261eea-8f8b-4381-83c6-79fa7120f1cf\"}]" }, - "content_id": { + "topics": { "type": "string", - "description": "Content ID for embedding inline images using cid references (e.g., cid:image001)." + "description": "JSON-encoded array of topic subscriptions to apply to imported contacts. Each `subscription` must be `opt_in` or `opt_out`.", + "example": "[{\"id\":\"b6d24b8e-af0b-4c3c-be0c-359bbd97381e\",\"subscription\":\"opt_in\"}]" } } }, - "Tag": { + "CreateContactImportResponseSuccess": { "type": "object", "properties": { - "name": { + "object": { "type": "string", - "description": "The name of the email tag. It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-). It can contain no more than 256 characters." + "description": "Type of the response object.", + "example": "contact_import" }, - "value": { + "id": { "type": "string", - "description": "The value of the email tag.It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-). It can contain no more than 256 characters." + "format": "uuid", + "description": "Unique identifier for the created contact import.", + "example": "479e3145-dd38-476b-932c-529ceb705947" } } }, - "EmailTemplateInput": { + "ContactImportCounts": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "The id of the published email template." + "total": { + "type": "integer", + "description": "Total number of rows processed by the import.", + "example": 100 }, - "variables": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - } - ] - }, - "description": "Template variables object with key/value pairs.", - "example": { - "variableName": "Sign up now", - "variableName2": 123 - } + "created": { + "type": "integer", + "description": "Number of contacts created by the import.", + "example": 80 + }, + "updated": { + "type": "integer", + "description": "Number of contacts updated by the import.", + "example": 10 + }, + "skipped": { + "type": "integer", + "description": "Number of rows skipped by the import.", + "example": 5 + }, + "failed": { + "type": "integer", + "description": "Number of rows that failed during the import.", + "example": 5 } - }, - "required": [ - "id" - ] + } }, - "SendEmailResponse": { + "ContactImport": { "type": "object", "properties": { + "object": { + "type": "string", + "description": "Type of the response object.", + "example": "contact_import" + }, "id": { "type": "string", - "description": "The ID of the sent email." + "format": "uuid", + "description": "Unique identifier for the contact import.", + "example": "479e3145-dd38-476b-932c-529ceb705947" + }, + "status": { + "type": "string", + "enum": [ + "queued", + "in_progress", + "completed", + "failed" + ], + "description": "Current status of the contact import.", + "example": "completed" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the contact import was created.", + "example": "2023-10-06T23:47:56.678Z" + }, + "completed_at": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "Timestamp indicating when the contact import completed.", + "example": "2023-10-06T23:50:56.678Z" + }, + "counts": { + "$ref": "#/components/schemas/ContactImportCounts" } } }, - "UpdateEmailOptions": { + "GetContactImportResponseSuccess": { + "allOf": [ + { + "$ref": "#/components/schemas/ContactImport" + } + ] + }, + "ListContactImportsResponseSuccess": { "type": "object", "properties": { - "scheduled_at": { + "object": { "type": "string", - "description": "Schedule email to be sent later. The date should be in ISO 8601 format." + "description": "Type of the response object.", + "example": "list" + }, + "has_more": { + "type": "boolean", + "description": "Indicates if there are more results available.", + "example": false + }, + "data": { + "type": "array", + "description": "Array containing contact imports.", + "items": { + "$ref": "#/components/schemas/ContactImport" + } } } }, - "Email": { + "CreateBroadcastOptions": { "type": "object", + "required": [ + "from", + "subject", + "segment_id" + ], "properties": { - "object": { + "name": { "type": "string", - "description": "The type of object.", - "example": "email" + "description": "Name of the broadcast." }, - "id": { + "segment_id": { "type": "string", - "description": "The ID of the email.", - "example": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c" + "description": "Unique identifier of the segment this broadcast will be sent to." }, - "message_id": { + "audience_id": { "type": "string", - "description": "The Message-ID header value of the email.", - "example": "<202301010000.4ef9a417@email.example.com>" - }, - "to": { - "type": "array", - "items": { - "type": "string", - "description": "The email addresses of the recipients." - }, - "example": [ - "delivered@resend.dev" - ] + "description": "Use `segment_id` instead. Unique identifier of the segment this broadcast will be sent to.", + "deprecated": true }, "from": { "type": "string", - "description": "The email address of the sender.", - "example": "Acme " + "description": "The email address of the sender." }, - "created_at": { + "subject": { "type": "string", - "format": "date-time", - "description": "The date and time the email was created.", - "example": "2023-04-03T22:13:42.674981+00:00" + "description": "The subject line of the email." }, - "subject": { + "reply_to": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The email addresses to which replies should be sent." + }, + "preview_text": { "type": "string", - "description": "The subject line of the email.", - "example": "Hello World" + "description": "The preview text of the email.", + "example": "Here are our announcements" }, "html": { "type": "string", - "description": "The HTML body of the email.", - "example": "Congrats on sending your first email!" + "description": "The HTML version of the message." }, "text": { "type": "string", - "description": "The plain text body of the email." + "description": "The plain text version of the message." }, - "bcc": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The email addresses of the blind carbon copy recipients." + "topic_id": { + "type": "string", + "description": "The topic ID that the broadcast will be scoped to." }, - "cc": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The email addresses of the carbon copy recipients." + "send": { + "type": "boolean", + "description": "Whether to send the broadcast immediately or keep it as a draft.\n" }, - "reply_to": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The email addresses to which replies should be sent." + "scheduled_at": { + "type": "string", + "description": "Schedule time to send the broadcast. Can only be used if `send` is true.\n" + } + } + }, + "CreateBroadcastResponseSuccess": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the broadcast.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" }, - "last_event": { + "object": { "type": "string", - "description": "The status of the email.", - "enum": [ - "bounced", - "canceled", - "clicked", - "complained", - "delivered", - "delivery_delayed", - "failed", - "opened", - "queued", - "scheduled", - "sent", - "suppressed" - ], - "example": "delivered" + "description": "The object type of the response.", + "example": "broadcast" } } }, - "ListEmailsResponse": { + "ListBroadcastsResponseSuccess": { "type": "object", "properties": { "object": { @@ -3247,1287 +5573,1393 @@ }, "data": { "type": "array", - "description": "Array containing email information.", - "items": { - "$ref": "#/components/schemas/Email" - } - } - } - }, - "CreateBatchEmailsResponse": { - "type": "object", - "properties": { - "data": { - "type": "array", + "description": "Array containing broadcast information.", "items": { "type": "object", "properties": { "id": { "type": "string", - "description": "The ID of the sent email." + "description": "Unique identifier for the broadcast.", + "example": "e169aa45-1ecf-4183-9955-b1499d5701d3" + }, + "name": { + "type": "string", + "description": "Name of the broadcast.", + "example": "November announcements" + }, + "audience_id": { + "type": "string", + "description": "Deprecated. Use segment_id instead.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf", + "deprecated": true + }, + "segment_id": { + "type": "string", + "description": "Unique identifier of the segment this broadcast will be sent to.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + }, + "status": { + "type": "string", + "description": "The status of the broadcast.", + "example": "draft" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the broadcast was created.", + "example": "2023-10-06T22:59:55.977Z" + }, + "scheduled_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the broadcast is scheduled to be sent.", + "example": "2023-10-06T22:59:55.977Z" + }, + "sent_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the broadcast was sent.", + "example": "2023-10-06T22:59:55.977Z" + }, + "topic_id": { + "type": "string", + "description": "The topic ID that the broadcast is scoped to.", + "example": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e" } } } } } }, - "DomainCapabilities": { + "GetBroadcastResponseSuccess": { "type": "object", - "description": "Configure the domain capabilities for sending and receiving emails. At least one capability must be enabled.", "properties": { - "sending": { + "id": { "type": "string", - "enum": [ - "enabled", - "disabled" - ], - "description": "Enable or disable sending emails from this domain." + "description": "Unique identifier for the broadcast.", + "example": "e169aa45-1ecf-4183-9955-b1499d5701d3" }, - "receiving": { - "type": "string", - "enum": [ - "enabled", - "disabled" - ], - "description": "Enable or disable receiving emails to this domain." - } - } - }, - "CreateDomainRequest": { - "type": "object", - "required": [ - "name" - ], - "properties": { "name": { "type": "string", - "description": "The name of the domain you want to create." + "description": "Name of the broadcast.", + "example": "November announcements" }, - "region": { - "type": "string", - "enum": [ - "us-east-1", - "eu-west-1", - "sa-east-1", - "ap-northeast-1" + "audience_id": { + "type": [ + "string", + "null" ], - "default": "us-east-1", - "description": "The region where emails will be sent from. Possible values are us-east-1 | eu-west-1 | sa-east-1 | ap-northeast-1" - }, - "custom_return_path": { - "type": "string", - "description": "For advanced use cases, choose a subdomain for the Return-Path address. Defaults to 'send' (i.e., send.yourdomain.tld)." - }, - "open_tracking": { - "type": "boolean", - "description": "Track the open rate of each email." - }, - "click_tracking": { - "type": "boolean", - "description": "Track clicks within the body of each HTML email." + "description": "Deprecated: use `segment_id` instead. Unique identifier of the segment this broadcast will be sent to.", + "deprecated": true }, - "tls": { - "type": "string", - "enum": [ - "opportunistic", - "enforced" + "segment_id": { + "type": [ + "string", + "null" ], - "default": "opportunistic", - "description": "TLS mode. Opportunistic attempts secure connection but falls back to unencrypted. Enforced requires TLS or email won't be sent." - }, - "capabilities": { - "$ref": "#/components/schemas/DomainCapabilities" - }, - "tracking_subdomain": { - "type": "string", - "description": "The subdomain to use for click and open tracking." - } - } - }, - "CreateDomainResponse": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the domain." - }, - "name": { - "type": "string", - "description": "The name of the domain." + "description": "Unique identifier of the segment this broadcast will be sent to." }, - "created_at": { + "from": { "type": "string", - "format": "date-time", - "description": "The date and time the domain was created." + "description": "The email address of the sender.", + "example": "Acme " }, - "status": { + "subject": { "type": "string", - "enum": [ - "pending", - "verified", - "failed", - "not_started", - "partially_verified", - "partially_failed" - ], - "description": "The status of the domain." - }, - "capabilities": { - "$ref": "#/components/schemas/DomainCapabilities" + "description": "The subject line of the email.", + "example": "Hello World" }, - "records": { + "reply_to": { "type": "array", "items": { - "$ref": "#/components/schemas/DomainRecord" - } + "type": "string" + }, + "description": "The email addresses to which replies should be sent." }, - "region": { + "preview_text": { "type": "string", - "description": "The region where the domain is hosted." - }, - "open_tracking": { - "type": "boolean", - "description": "Whether open tracking is enabled for this domain." - }, - "click_tracking": { - "type": "boolean", - "description": "Whether click tracking is enabled for this domain." + "description": "The preview text of the email.", + "example": "Here are our announcements" }, - "tracking_subdomain": { + "status": { "type": "string", - "description": "The subdomain used for click and open tracking." - } - } - }, - "UpdateDomainOptions": { - "type": "object", - "properties": { - "open_tracking": { - "type": "boolean", - "description": "Track the open rate of each email." - }, - "click_tracking": { - "type": "boolean", - "description": "Track clicks within the body of each HTML email." + "description": "The status of the broadcast.", + "example": "draft" }, - "tls": { + "created_at": { "type": "string", - "description": "enforced | opportunistic.", - "default": "opportunistic" - }, - "capabilities": { - "$ref": "#/components/schemas/DomainCapabilities" + "format": "date-time", + "description": "Timestamp indicating when the broadcast was created.", + "example": "2023-10-06T22:59:55.977Z" }, - "tracking_subdomain": { - "type": "string", - "description": "The subdomain to use for click and open tracking." - } - } - }, - "DomainRecord": { - "type": "object", - "properties": { - "record": { + "scheduled_at": { "type": "string", - "enum": [ - "SPF", - "DKIM", - "Receiving", - "Tracking", - "TrackingCAA" - ], - "description": "The type of record (SPF for sending, DKIM for sending, Receiving for inbound emails, Tracking & TrackingCAA for click and open tracking)." + "format": "date-time", + "description": "Timestamp indicating when the broadcast is scheduled to be sent.", + "example": "2023-10-06T22:59:55.977Z" }, - "name": { + "sent_at": { "type": "string", - "description": "The name of the DNS record." + "format": "date-time", + "description": "Timestamp indicating when the broadcast was sent.", + "example": "2023-10-06T22:59:55.977Z" }, - "type": { - "type": "string", - "enum": [ - "MX", - "TXT", - "CNAME", - "CAA" + "text": { + "type": [ + "string", + "null" ], - "description": "The DNS record type." - }, - "ttl": { - "type": "string", - "description": "The time to live for the record." + "description": "The plain text version of the broadcast content.", + "example": "Hello {{{FIRST_NAME|there}}}!" }, - "status": { - "type": "string", - "enum": [ - "pending", - "verified", - "failed", - "temporary_failure", - "not_started" + "html": { + "type": [ + "string", + "null" ], - "description": "The status of the record." - }, - "value": { - "type": "string", - "description": "The value of the record." + "description": "The HTML version of the broadcast content.", + "example": "

Hello {{{FIRST_NAME|there}}}!

" }, - "priority": { - "type": "integer", - "description": "The priority of the record (only applicable for MX records)." + "topic_id": { + "type": [ + "string", + "null" + ], + "description": "The topic ID that the broadcast is scoped to.", + "example": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e" } } }, - "Domain": { + "UpdateBroadcastOptions": { "type": "object", "properties": { - "object": { - "type": "string", - "description": "The type of object.", - "example": "domain" - }, - "id": { + "name": { "type": "string", - "description": "The ID of the domain.", - "example": "d91cd9bd-1176-453e-8fc1-35364d380206" + "description": "Name of the broadcast." }, - "name": { + "audience_id": { "type": "string", - "description": "The name of the domain.", - "example": "example.com" + "description": "Use `segment_id` instead. Unique identifier of the audience this broadcast will be sent to.", + "deprecated": true }, - "status": { + "segment_id": { "type": "string", - "enum": [ - "pending", - "verified", - "failed", - "not_started", - "partially_verified", - "partially_failed" - ], - "description": "The status of the domain.", - "example": "not_started" + "description": "Unique identifier of the segment this broadcast will be sent to." }, - "created_at": { + "from": { "type": "string", - "format": "date-time", - "description": "The date and time the domain was created.", - "example": "2023-04-26T20:21:26.347412+00:00" + "description": "The email address of the sender." }, - "region": { + "subject": { "type": "string", - "description": "The region where the domain is hosted.", - "example": "us-east-1" + "description": "The subject line of the email." }, - "open_tracking": { - "type": "boolean", - "description": "Whether open tracking is enabled for this domain." + "reply_to": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The email addresses to which replies should be sent." }, - "click_tracking": { - "type": "boolean", - "description": "Whether click tracking is enabled for this domain." + "preview_text": { + "type": "string", + "description": "The preview text of the email." }, - "tracking_subdomain": { + "html": { "type": "string", - "description": "The subdomain used for click and open tracking." + "description": "The HTML version of the message." }, - "capabilities": { - "$ref": "#/components/schemas/DomainCapabilities" + "text": { + "type": "string", + "description": "The plain text version of the message." }, - "records": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DomainRecord" - } + "topic_id": { + "type": "string", + "description": "The topic ID that the broadcast will be scoped to." } } }, - "VerifyDomainResponse": { + "UpdateBroadcastResponseSuccess": { "type": "object", "properties": { - "object": { + "id": { "type": "string", - "description": "The type of object.", - "example": "domain" + "description": "The ID of the broadcast.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" }, - "id": { + "object": { "type": "string", - "description": "The ID of the domain.", - "example": "d91cd9bd-1176-453e-8fc1-35364d380206" + "description": "The object type of the response.", + "example": "broadcast" } } }, - "ListDomainsResponse": { + "RemoveBroadcastResponseSuccess": { "type": "object", "properties": { + "id": { + "type": "string", + "description": "The ID of the broadcast.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + }, "object": { "type": "string", "description": "Type of the response object.", - "example": "list" + "example": "broadcast" }, - "has_more": { + "deleted": { "type": "boolean", - "description": "Indicates if there are more results available.", - "example": false - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ListDomainsItem" - } + "description": "The deleted attribute indicates that the corresponding broadcast has been deleted.", + "example": true } } }, - "ListDomainsItem": { + "SendBroadcastOptions": { + "type": "object", + "properties": { + "scheduled_at": { + "type": "string", + "description": "Schedule email to be sent later. The date should be in ISO 8601 format." + } + } + }, + "SendBroadcastResponseSuccess": { "type": "object", "properties": { "id": { "type": "string", - "description": "The ID of the domain.", - "example": "d91cd9bd-1176-453e-8fc1-35364d380206" + "description": "The ID of the broadcast.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + } + } + }, + "RetrievedAttachment": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "The type of object.", + "example": "attachment" }, - "name": { + "id": { "type": "string", - "description": "The name of the domain.", - "example": "example.com" + "format": "uuid", + "description": "The ID of the attachment.", + "example": "660e8400-e29b-41d4-a716-446655440000" }, - "status": { + "filename": { "type": "string", - "enum": [ - "pending", - "verified", - "failed", - "not_started", - "partially_verified", - "partially_failed" - ], - "description": "The status of the domain.", - "example": "not_started" + "nullable": true, + "description": "The filename of the attachment.", + "example": "document.pdf" }, - "created_at": { + "content_type": { "type": "string", - "format": "date-time", - "description": "The date and time the domain was created.", - "example": "2023-04-26T20:21:26.347412+00:00" + "description": "The MIME type of the attachment.", + "example": "application/pdf" }, - "region": { + "content_id": { "type": "string", - "description": "The region where the domain is hosted.", - "example": "us-east-1" + "description": "The content ID for inline attachments.", + "example": "img001" }, - "capabilities": { - "$ref": "#/components/schemas/DomainCapabilities" - } - } - }, - "UpdateDomainResponseSuccess": { - "type": "object", - "properties": { - "id": { + "content_disposition": { "type": "string", - "description": "The ID of the updated domain.", - "example": "d91cd9bd-1176-453e-8fc1-35364d380206" + "nullable": true, + "enum": [ + "inline", + "attachment" + ], + "description": "How the attachment should be displayed.", + "example": "attachment" }, - "object": { + "download_url": { "type": "string", - "description": "The object type representing the updated domain.", - "example": "domain" + "description": "Signed URL to download the attachment content.", + "example": "https://cloudfront.example.com/path?Signature=..." + }, + "expires_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the download URL expires.", + "example": "2024-10-27T18:30:00.000Z" + }, + "size": { + "type": "integer", + "description": "Size of the attachment in bytes.", + "example": 2048 } } }, - "DeleteDomainResponse": { + "ListAttachmentsResponse": { "type": "object", "properties": { "object": { "type": "string", - "description": "The type of object.", - "example": "domain" - }, - "id": { - "type": "string", - "description": "The ID of the domain.", - "example": "d91cd9bd-1176-453e-8fc1-35364d380206" + "description": "Type of the response object.", + "example": "list" }, - "deleted": { + "has_more": { "type": "boolean", - "description": "Indicates whether the domain was deleted successfully.", - "example": true + "description": "Indicates if there are more results available.", + "example": false + }, + "data": { + "type": "array", + "description": "Array containing attachment information.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The ID of the attachment.", + "example": "660e8400-e29b-41d4-a716-446655440000" + }, + "filename": { + "type": "string", + "nullable": true, + "description": "The filename of the attachment.", + "example": "document.pdf" + }, + "content_type": { + "type": "string", + "description": "The MIME type of the attachment.", + "example": "application/pdf" + }, + "content_id": { + "type": "string", + "description": "The content ID for inline attachments.", + "example": "img001" + }, + "content_disposition": { + "type": "string", + "nullable": true, + "enum": [ + "inline", + "attachment" + ], + "description": "How the attachment should be displayed.", + "example": "attachment" + }, + "download_url": { + "type": "string", + "description": "Signed URL to download the attachment content.", + "example": "https://cloudfront.example.com/path?Signature=..." + }, + "expires_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the download URL expires.", + "example": "2024-10-27T18:30:00.000Z" + }, + "size": { + "type": "integer", + "description": "Size of the attachment in bytes.", + "example": 2048 + } + } + } } } }, - "CreateApiKeyRequest": { + "GetReceivedEmailResponse": { "type": "object", - "required": [ - "name" - ], "properties": { - "name": { - "type": "string", - "description": "The API key name." - }, - "permission": { + "object": { "type": "string", - "enum": [ - "full_access", - "sending_access" - ], - "description": "The API key can have full access to Resend’s API or be only restricted to send emails. * full_access - Can create, delete, get, and update any resource. * sending_access - Can only send emails." + "description": "The type of object.", + "example": "email" }, - "domain_id": { - "type": "string", - "description": "Restrict an API key to send emails only from a specific domain. Only used when the permission is sending_access." - } - } - }, - "CreateApiKeyResponse": { - "type": "object", - "properties": { "id": { "type": "string", - "description": "The ID of the API key." - }, - "token": { - "type": "string", - "description": "The token of the API key." - } - } - }, - "ListApiKeysResponse": { - "type": "object", - "properties": { - "object": { - "type": "string", - "description": "Type of the response object.", - "example": "list" - }, - "has_more": { - "type": "boolean", - "description": "Indicates if there are more results available.", - "example": false + "format": "uuid", + "description": "The ID of the received email.", + "example": "550e8400-e29b-41d4-a716-446655440000" }, - "data": { + "to": { "type": "array", "items": { - "$ref": "#/components/schemas/ApiKey" - } - } - } - }, - "ApiKey": { - "type": "object", - "properties": { - "id": { + "type": "string" + }, + "description": "The recipient email addresses.", + "example": [ + "delivered@resend.dev" + ] + }, + "from": { "type": "string", - "description": "The ID of the API key." + "description": "The sender email address.", + "example": "sender@example.com" }, - "name": { + "subject": { "type": "string", - "description": "The name of the API key." + "description": "The email subject.", + "example": "Hello World" }, - "created_at": { + "message_id": { "type": "string", - "format": "date-time", - "description": "The date and time the API key was created." + "description": "The unique message ID from the email headers.", + "example": "" }, - "last_used_at": { + "bcc": { "type": [ - "string", + "array", "null" ], - "format": "date-time", - "description": "The date and time the API key was last used." - } - } - }, - "DeleteApiKeyResponse": { - "type": "object", - "properties": { - "object": { - "type": "string", - "description": "The type of object.", - "example": "api_key" - }, - "id": { - "type": "string", - "description": "The ID of the API key." + "items": { + "type": "string" + }, + "description": "The BCC recipients.", + "example": [] }, - "deleted": { - "type": "boolean", - "description": "Indicates whether the API key was successfully deleted.", - "example": true - } - } - }, - "CreateAudienceOptions": { - "type": "object", - "deprecated": true, - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "description": "The name of the audience you want to create." - } - } - }, - "CreateAudienceResponseSuccess": { - "type": "object", - "deprecated": true, - "properties": { - "id": { - "type": "string", - "description": "The ID of the audience.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + "cc": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + }, + "description": "The CC recipients.", + "example": [] }, - "object": { - "type": "string", - "description": "The object of the audience.", - "example": "audience" + "reply_to": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + }, + "description": "The reply-to addresses.", + "example": [] }, - "name": { - "type": "string", - "description": "The name of the audience.", - "example": "Registered Users" - } - } - }, - "GetAudienceResponseSuccess": { - "type": "object", - "deprecated": true, - "properties": { - "id": { - "type": "string", - "description": "The ID of the audience.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + "html": { + "type": [ + "string", + "null" + ], + "description": "The HTML content of the email.", + "example": "

Email content

" }, - "object": { - "type": "string", - "description": "The object of the audience.", - "example": "audience" + "text": { + "type": [ + "string", + "null" + ], + "description": "The plain text content of the email.", + "example": "Email content" }, - "name": { - "type": "string", - "description": "The name of the audience.", - "example": "Registered Users" + "headers": { + "type": [ + "object", + "null" + ], + "description": "The email headers.", + "example": { + "X-Custom-Header": "value" + } }, "created_at": { "type": "string", - "description": "The date that the object was created.", - "example": "2023-10-06T22:59:55.977Z" - } - } - }, - "RemoveAudienceResponseSuccess": { - "type": "object", - "deprecated": true, - "properties": { - "id": { - "type": "string", - "description": "The ID of the audience.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" - }, - "object": { - "type": "string", - "description": "The object of the audience.", - "example": "audience" + "format": "date-time", + "description": "Timestamp when the email was received.", + "example": "2023-10-06:23:47:56.678Z" }, - "deleted": { - "type": "boolean", - "description": "The deleted attribute indicates that the corresponding audience has been deleted.", - "example": true + "attachments": { + "type": "array", + "description": "Array of attachments.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The ID of the attachment." + }, + "filename": { + "type": "string", + "nullable": true, + "description": "The filename of the attachment." + }, + "content_type": { + "type": "string", + "description": "The MIME type of the attachment." + }, + "content_id": { + "type": "string", + "description": "The content ID for inline attachments." + }, + "content_disposition": { + "type": "string", + "nullable": true, + "enum": [ + "inline", + "attachment" + ], + "description": "How the attachment should be displayed." + }, + "size": { + "type": "integer", + "description": "Size of the attachment in bytes." + } + } + } } } }, - "ListAudiencesResponseSuccess": { + "ListReceivedEmailsResponse": { "type": "object", - "deprecated": true, "properties": { "object": { "type": "string", "description": "Type of the response object.", "example": "list" }, + "has_more": { + "type": "boolean", + "description": "Indicates if there are more results available.", + "example": false + }, "data": { "type": "array", - "description": "Array containing audience information.", + "description": "Array containing received email information.", "items": { "type": "object", "properties": { "id": { "type": "string", - "description": "Unique identifier for the audience.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + "format": "uuid", + "description": "The ID of the received email.", + "example": "550e8400-e29b-41d4-a716-446655440000" }, - "name": { + "to": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The recipient email addresses.", + "example": [ + "delivered@resend.dev" + ] + }, + "from": { "type": "string", - "description": "Name of the audience.", - "example": "Registered Users" + "description": "The sender email address.", + "example": "sender@example.com" + }, + "subject": { + "type": [ + "string", + "null" + ], + "description": "The email subject.", + "example": "Hello World" + }, + "message_id": { + "type": "string", + "description": "The unique message ID from the email headers.", + "example": "" + }, + "bcc": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + }, + "description": "The BCC recipients." + }, + "cc": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + }, + "description": "The CC recipients." + }, + "reply_to": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + }, + "description": "The reply-to addresses." }, "created_at": { "type": "string", "format": "date-time", - "description": "Timestamp indicating when the audience was created.", - "example": "2023-10-06T22:59:55.977Z" + "description": "Timestamp when the email was received.", + "example": "2023-10-06T23:47:56.678Z" + }, + "attachments": { + "type": "array", + "description": "Array of attachments for this email.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The ID of the attachment." + }, + "filename": { + "type": "string", + "nullable": true, + "description": "The filename of the attachment." + }, + "content_type": { + "type": "string", + "description": "The MIME type of the attachment." + }, + "content_id": { + "type": "string", + "description": "The content ID for inline attachments." + }, + "content_disposition": { + "type": "string", + "nullable": true, + "enum": [ + "inline", + "attachment" + ], + "description": "How the attachment should be displayed." + }, + "size": { + "type": "integer", + "description": "Size of the attachment in bytes." + } + } + } } } } } } }, - "CreateContactOptions": { + "CreateWebhookRequest": { "type": "object", "required": [ - "email" + "endpoint", + "events" ], "properties": { - "email": { - "type": "string", - "description": "Email address of the contact.", - "example": "steve.wozniak@gmail.com" - }, - "first_name": { - "type": "string", - "description": "First name of the contact.", - "example": "Steve" - }, - "last_name": { + "endpoint": { "type": "string", - "description": "Last name of the contact.", - "example": "Wozniak" - }, - "unsubscribed": { - "type": "boolean", - "description": "The Contact's global subscription status. If set to true, the contact will be unsubscribed from all Broadcasts.", - "example": false - }, - "properties": { - "type": "object", - "additionalProperties": true, - "description": "A map of custom property keys and values to create." + "description": "The URL where webhook events will be sent.", + "example": "https://webhook.example.com/handler" }, - "segments": { + "events": { "type": "array", "items": { "type": "string" }, - "description": "Array of segment IDs to add the contact to." + "minItems": 1, + "description": "Array of event types to subscribe to.", + "example": [ + "email.sent", + "email.delivered", + "email.bounced", + "email.suppressed" + ] + } + } + }, + "CreateWebhookResponse": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "The type of object.", + "example": "webhook" }, - "topics": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The topic ID." - }, - "subscription": { - "type": "string", - "enum": [ - "opt_in", - "opt_out" - ], - "description": "The subscription status for this topic." - } - } - }, - "description": "Array of topic subscriptions for the contact." + "id": { + "type": "string", + "format": "uuid", + "description": "The ID of the webhook.", + "example": "479e3145-dd38-476b-932c-529ceb705947" }, - "audience_id": { + "signing_secret": { "type": "string", - "description": "Unique identifier of the audience to which the contact belongs.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf", - "deprecated": true + "description": "The secret key used to verify webhook payloads.", + "example": "whsec_..." } } }, - "CreateContactResponseSuccess": { + "GetWebhookResponse": { "type": "object", "properties": { "object": { "type": "string", - "description": "Type of the response object.", - "example": "contact" + "description": "The type of object.", + "example": "webhook" + }, + "id": { + "type": "string", + "format": "uuid", + "description": "The ID of the webhook.", + "example": "479e3145-dd38-476b-932c-529ceb705947" + }, + "endpoint": { + "type": "string", + "description": "The URL where webhook events are sent.", + "example": "https://webhook.example.com/handler" + }, + "events": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + }, + "description": "Array of event types subscribed to.", + "example": [ + "email.sent", + "email.delivered" + ] + }, + "status": { + "type": "string", + "description": "The status of the webhook.", + "example": "enabled" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the webhook was created.", + "example": "2023-10-06T23:47:56.678Z" }, - "id": { + "signing_secret": { "type": "string", - "description": "Unique identifier for the created contact.", - "example": "479e3145-dd38-476b-932c-529ceb705947" + "description": "The secret key used to verify webhook payloads.", + "example": "whsec_..." } } }, - "GetContactResponseSuccess": { + "ListWebhooksResponse": { "type": "object", "properties": { "object": { "type": "string", "description": "Type of the response object.", - "example": "contact" - }, - "id": { - "type": "string", - "description": "Unique identifier for the contact.", - "example": "e169aa45-1ecf-4183-9955-b1499d5701d3" - }, - "email": { - "type": "string", - "description": "Email address of the contact.", - "example": "steve.wozniak@gmail.com" - }, - "first_name": { - "type": "string", - "description": "First name of the contact.", - "example": "Steve" - }, - "last_name": { - "type": "string", - "description": "Last name of the contact.", - "example": "Wozniak" - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the contact was created.", - "example": "2023-10-06T23:47:56.678Z" + "example": "list" }, - "unsubscribed": { + "has_more": { "type": "boolean", - "description": "Indicates if the contact is unsubscribed.", + "description": "Indicates if there are more results available.", "example": false }, - "properties": { - "type": "object", - "additionalProperties": true, - "description": "A map of custom property keys and values." + "data": { + "type": "array", + "description": "Array containing webhook information.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The ID of the webhook.", + "example": "479e3145-dd38-476b-932c-529ceb705947" + }, + "endpoint": { + "type": "string", + "description": "The URL where webhook events are sent.", + "example": "https://webhook.example.com/handler" + }, + "events": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + }, + "description": "Array of event types subscribed to.", + "example": [ + "email.sent" + ] + }, + "status": { + "type": "string", + "description": "The status of the webhook.", + "example": "enabled" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the webhook was created.", + "example": "2023-10-06T23:47:56.678Z" + } + } + } } } }, - "UpdateContactOptions": { + "UpdateWebhookRequest": { "type": "object", "properties": { - "email": { + "endpoint": { "type": "string", - "description": "Email address of the contact.", - "example": "steve.wozniak@gmail.com" + "description": "The URL where webhook events will be sent.", + "example": "https://webhook.example.com/new-handler" }, - "first_name": { - "type": "string", - "description": "First name of the contact.", - "example": "Steve" + "events": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "description": "Array of event types to subscribe to.", + "example": [ + "email.sent", + "email.delivered" + ] }, - "last_name": { + "status": { "type": "string", - "description": "Last name of the contact.", - "example": "Wozniak" - }, - "unsubscribed": { - "type": "boolean", - "description": "The Contact's global subscription status. If set to true, the contact will be unsubscribed from all Broadcasts.", - "example": false - }, - "properties": { - "type": "object", - "additionalProperties": true, - "description": "A map of custom property keys and values to update." + "enum": [ + "enabled", + "disabled" + ], + "description": "The status of the webhook.", + "example": "enabled" } } }, - "UpdateContactResponseSuccess": { + "UpdateWebhookResponse": { "type": "object", "properties": { "object": { "type": "string", - "description": "Type of the response object.", - "example": "contact" + "description": "The type of object.", + "example": "webhook" }, "id": { "type": "string", - "description": "Unique identifier for the updated contact.", + "format": "uuid", + "description": "The ID of the updated webhook.", "example": "479e3145-dd38-476b-932c-529ceb705947" } } }, - "RemoveContactResponseSuccess": { + "DeleteWebhookResponse": { "type": "object", "properties": { "object": { "type": "string", - "description": "Type of the response object.", - "example": "contact" + "description": "The type of object.", + "example": "webhook" }, "id": { "type": "string", - "description": "Unique identifier for the removed contact.", - "example": "520784e2-887d-4c25-b53c-4ad46ad38100" + "format": "uuid", + "description": "The ID of the deleted webhook.", + "example": "479e3145-dd38-476b-932c-529ceb705947" }, "deleted": { "type": "boolean", - "description": "Indicates whether the contact was successfully deleted.", + "description": "Indicates whether the webhook was successfully deleted.", "example": true } } }, - "ListContactsResponseSuccess": { + "TemplateVariable": { "type": "object", "properties": { - "object": { + "id": { "type": "string", - "description": "Type of the response object.", - "example": "list" + "description": "The ID of the template variable." }, - "data": { - "type": "array", - "description": "Array containing contact information.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the contact.", - "example": "e169aa45-1ecf-4183-9955-b1499d5701d3" - }, - "email": { - "type": "string", - "description": "Email address of the contact.", - "example": "steve.wozniak@gmail.com" - }, - "first_name": { - "type": "string", - "description": "First name of the contact.", - "example": "Steve" - }, - "last_name": { - "type": "string", - "description": "Last name of the contact.", - "example": "Wozniak" - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the contact was created.", - "example": "2023-10-06T23:47:56.678Z" - }, - "unsubscribed": { - "type": "boolean", - "description": "Indicates if the contact is unsubscribed.", - "example": false - } + "key": { + "type": "string", + "description": "The key of the variable." + }, + "type": { + "type": "string", + "description": "The type of the variable.", + "enum": [ + "string", + "number", + "boolean", + "object", + "list" + ] + }, + "fallback_value": { + "description": "The fallback value of the variable.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "object" + }, + { + "type": "array", + "items": {} + } + ] + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the variable was created." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the variable was last updated." + } + }, + "required": [ + "key", + "type" + ] + }, + "TemplateVariableInput": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "The key of the variable." + }, + "type": { + "type": "string", + "description": "The type of the variable.", + "enum": [ + "string", + "number", + "boolean", + "object", + "list" + ] + }, + "fallback_value": { + "description": "The fallback value of the variable.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "object" + }, + { + "type": "array", + "items": {} } - } + ] } - } + }, + "required": [ + "key", + "type" + ] }, - "CreateBroadcastOptions": { + "Template": { "type": "object", - "required": [ - "from", - "subject", - "segment_id" - ], "properties": { - "name": { + "object": { "type": "string", - "description": "Name of the broadcast." + "description": "The type of object.", + "example": "template" }, - "segment_id": { + "id": { "type": "string", - "description": "Unique identifier of the segment this broadcast will be sent to." + "description": "The ID of the template." }, - "audience_id": { + "current_version_id": { "type": "string", - "description": "Use `segment_id` instead. Unique identifier of the segment this broadcast will be sent to.", - "deprecated": true + "description": "The ID of the current version of the template." + }, + "name": { + "type": "string", + "description": "The name of the template." + }, + "alias": { + "type": "string", + "description": "The alias of the template." }, "from": { "type": "string", - "description": "The email address of the sender." + "description": "Sender email address. To include a friendly name, use the format \"Your Name \"." }, "subject": { "type": "string", - "description": "The subject line of the email." + "description": "Email subject." }, "reply_to": { - "type": "array", + "type": [ + "array", + "null" + ], "items": { "type": "string" }, - "description": "The email addresses to which replies should be sent." - }, - "preview_text": { - "type": "string", - "description": "The preview text of the email.", - "example": "Here are our announcements" + "description": "Reply-to email addresses." }, "html": { "type": "string", - "description": "The HTML version of the message." + "description": "The HTML version of the template." }, "text": { "type": "string", - "description": "The plain text version of the message." - }, - "topic_id": { - "type": "string", - "description": "The topic ID that the broadcast will be scoped to." + "description": "The plain text version of the template." }, - "send": { - "type": "boolean", - "description": "Whether to send the broadcast immediately or keep it as a draft.\n" + "variables": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TemplateVariable" + } }, - "scheduled_at": { - "type": "string", - "description": "Schedule time to send the broadcast. Can only be used if `send` is true.\n" - } - } - }, - "CreateBroadcastResponseSuccess": { - "type": "object", - "properties": { - "id": { + "created_at": { "type": "string", - "description": "The ID of the broadcast.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + "format": "date-time", + "description": "Timestamp indicating when the template was created." }, - "object": { + "updated_at": { "type": "string", - "description": "The object type of the response.", - "example": "broadcast" - } - } - }, - "ListBroadcastsResponseSuccess": { - "type": "object", - "properties": { - "object": { + "format": "date-time", + "description": "Timestamp indicating when the template was last updated." + }, + "status": { "type": "string", - "description": "Type of the response object.", - "example": "list" + "description": "The publication status of the template.", + "enum": [ + "draft", + "published" + ] }, - "has_more": { - "type": "boolean", - "description": "Indicates if there are more results available.", - "example": false + "published_at": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "Timestamp indicating when the template was published." }, - "data": { - "type": "array", - "description": "Array containing broadcast information.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the broadcast.", - "example": "e169aa45-1ecf-4183-9955-b1499d5701d3" - }, - "name": { - "type": "string", - "description": "Name of the broadcast.", - "example": "November announcements" - }, - "audience_id": { - "type": "string", - "description": "Deprecated. Use segment_id instead.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf", - "deprecated": true - }, - "segment_id": { - "type": "string", - "description": "Unique identifier of the segment this broadcast will be sent to.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" - }, - "status": { - "type": "string", - "description": "The status of the broadcast.", - "example": "draft" - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the broadcast was created.", - "example": "2023-10-06T22:59:55.977Z" - }, - "scheduled_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the broadcast is scheduled to be sent.", - "example": "2023-10-06T22:59:55.977Z" - }, - "sent_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the broadcast was sent.", - "example": "2023-10-06T22:59:55.977Z" - }, - "topic_id": { - "type": "string", - "description": "The topic ID that the broadcast is scoped to.", - "example": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e" - } - } - } + "has_unpublished_versions": { + "type": "boolean", + "description": "Indicates whether the template has unpublished versions." } } }, - "GetBroadcastResponseSuccess": { + "TemplateListItem": { "type": "object", "properties": { "id": { "type": "string", - "description": "Unique identifier for the broadcast.", - "example": "e169aa45-1ecf-4183-9955-b1499d5701d3" + "description": "The ID of the template." }, "name": { "type": "string", - "description": "Name of the broadcast.", - "example": "November announcements" + "description": "The name of the template." }, - "audience_id": { - "type": [ - "string", - "null" - ], - "description": "Deprecated: use `segment_id` instead. Unique identifier of the segment this broadcast will be sent to.", - "deprecated": true + "status": { + "type": "string", + "description": "The publication status of the template.", + "enum": [ + "draft", + "published" + ] }, - "segment_id": { + "published_at": { "type": [ "string", "null" ], - "description": "Unique identifier of the segment this broadcast will be sent to." + "format": "date-time", + "description": "Timestamp indicating when the template was published." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the template was created." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the template was last updated." + }, + "alias": { + "type": "string", + "description": "The alias of the template." + } + } + }, + "CreateTemplateRequest": { + "type": "object", + "required": [ + "name", + "html" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the template." + }, + "alias": { + "type": "string", + "description": "The alias of the template." }, "from": { "type": "string", - "description": "The email address of the sender.", - "example": "Acme " + "description": "Sender email address. To include a friendly name, use the format \"Your Name \"." }, "subject": { "type": "string", - "description": "The subject line of the email.", - "example": "Hello World" + "description": "Email subject." }, "reply_to": { "type": "array", "items": { "type": "string" }, - "description": "The email addresses to which replies should be sent." + "description": "Reply-to email addresses." }, - "preview_text": { + "html": { "type": "string", - "description": "The preview text of the email.", - "example": "Here are our announcements" + "description": "The HTML version of the template." }, - "status": { + "text": { "type": "string", - "description": "The status of the broadcast.", - "example": "draft" + "description": "The plain text version of the template." }, - "created_at": { + "variables": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TemplateVariableInput" + } + } + } + }, + "CreateTemplateResponseSuccess": { + "type": "object", + "properties": { + "id": { "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the broadcast was created.", - "example": "2023-10-06T22:59:55.977Z" + "description": "The ID of the template." }, - "scheduled_at": { + "object": { "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the broadcast is scheduled to be sent.", - "example": "2023-10-06T22:59:55.977Z" - }, - "sent_at": { + "description": "The object type of the response.", + "example": "template" + } + } + }, + "ListTemplatesResponseSuccess": { + "type": "object", + "properties": { + "object": { "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the broadcast was sent.", - "example": "2023-10-06T22:59:55.977Z" - }, - "text": { - "type": [ - "string", - "null" - ], - "description": "The plain text version of the broadcast content.", - "example": "Hello {{{FIRST_NAME|there}}}!" + "description": "Type of the response object.", + "example": "list" }, - "html": { - "type": [ - "string", - "null" - ], - "description": "The HTML version of the broadcast content.", - "example": "

Hello {{{FIRST_NAME|there}}}!

" + "data": { + "type": "array", + "description": "Array containing templates information.", + "items": { + "$ref": "#/components/schemas/TemplateListItem" + } }, - "topic_id": { - "type": [ - "string", - "null" - ], - "description": "The topic ID that the broadcast is scoped to.", - "example": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e" + "has_more": { + "type": "boolean", + "description": "Indicates if there are more templates to retrieve." } } }, - "UpdateBroadcastOptions": { + "UpdateTemplateOptions": { "type": "object", "properties": { "name": { "type": "string", - "description": "Name of the broadcast." - }, - "audience_id": { - "type": "string", - "description": "Use `segment_id` instead. Unique identifier of the audience this broadcast will be sent to.", - "deprecated": true + "description": "The name of the template." }, - "segment_id": { + "alias": { "type": "string", - "description": "Unique identifier of the segment this broadcast will be sent to." + "description": "The alias of the template." }, "from": { "type": "string", - "description": "The email address of the sender." + "description": "Sender email address. To include a friendly name, use the format \"Your Name \"." }, "subject": { "type": "string", - "description": "The subject line of the email." + "description": "Email subject." }, "reply_to": { "type": "array", "items": { "type": "string" }, - "description": "The email addresses to which replies should be sent." - }, - "preview_text": { - "type": "string", - "description": "The preview text of the email." + "description": "Reply-to email addresses." }, "html": { "type": "string", - "description": "The HTML version of the message." + "description": "The HTML version of the template." }, "text": { "type": "string", - "description": "The plain text version of the message." + "description": "The plain text version of the template." }, - "topic_id": { - "type": "string", - "description": "The topic ID that the broadcast will be scoped to." + "variables": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TemplateVariableInput" + } } } }, - "UpdateBroadcastResponseSuccess": { + "UpdateTemplateResponseSuccess": { "type": "object", "properties": { "id": { "type": "string", - "description": "The ID of the broadcast.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + "description": "The ID of the template." }, "object": { "type": "string", "description": "The object type of the response.", - "example": "broadcast" + "example": "template" } } }, - "RemoveBroadcastResponseSuccess": { + "RemoveTemplateResponseSuccess": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "The ID of the broadcast.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" - }, "object": { "type": "string", "description": "Type of the response object.", - "example": "broadcast" + "example": "template" + }, + "id": { + "type": "string", + "description": "The ID of the template." }, "deleted": { "type": "boolean", - "description": "The deleted attribute indicates that the corresponding broadcast has been deleted.", + "description": "Indicates whether the template was successfully deleted.", "example": true } } }, - "SendBroadcastOptions": { + "PublishTemplateResponseSuccess": { "type": "object", "properties": { - "scheduled_at": { + "id": { "type": "string", - "description": "Schedule email to be sent later. The date should be in ISO 8601 format." + "description": "The ID of the template." + }, + "object": { + "type": "string", + "description": "The object type of the response.", + "example": "template" } } }, - "SendBroadcastResponseSuccess": { + "DuplicateTemplateResponseSuccess": { "type": "object", "properties": { "id": { "type": "string", - "description": "The ID of the broadcast.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + "description": "The ID of the duplicated template." + }, + "object": { + "type": "string", + "description": "The object type of the response.", + "example": "template" } } }, - "RetrievedAttachment": { + "CreateSegmentOptions": { "type": "object", + "required": [ + "name" + ], "properties": { - "object": { + "name": { "type": "string", - "description": "The type of object.", - "example": "attachment" + "description": "The name of the segment." }, - "id": { + "audience_id": { "type": "string", - "format": "uuid", - "description": "The ID of the attachment.", - "example": "660e8400-e29b-41d4-a716-446655440000" + "description": "The ID of the audience this segment belongs to.", + "deprecated": true }, - "filename": { + "filter": { + "type": "object", + "description": "Filter conditions for the segment." + } + } + }, + "CreateSegmentResponseSuccess": { + "type": "object", + "properties": { + "id": { "type": "string", - "description": "The filename of the attachment.", - "example": "document.pdf" + "description": "The ID of the segment.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" }, - "content_type": { + "object": { "type": "string", - "description": "The MIME type of the attachment.", - "example": "application/pdf" + "description": "The object type of the response.", + "example": "segment" + } + } + }, + "GetSegmentResponseSuccess": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the segment.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" }, - "content_id": { + "object": { "type": "string", - "description": "The content ID for inline attachments.", - "example": "img001" + "description": "The object type.", + "example": "segment" }, - "content_disposition": { + "name": { "type": "string", - "enum": [ - "inline", - "attachment" - ], - "description": "How the attachment should be displayed.", - "example": "attachment" + "description": "The name of the segment.", + "example": "Active Users" }, - "download_url": { + "audience_id": { "type": "string", - "description": "Signed URL to download the attachment content.", - "example": "https://cloudfront.example.com/path?Signature=..." + "description": "The ID of the audience this segment belongs to.", + "deprecated": true }, - "expires_at": { + "filter": { + "type": "object", + "description": "Filter conditions for the segment." + }, + "created_at": { "type": "string", "format": "date-time", - "description": "Timestamp when the download URL expires.", - "example": "2024-10-27T18:30:00.000Z" - }, - "size": { - "type": "integer", - "description": "Size of the attachment in bytes.", - "example": 2048 + "description": "Timestamp indicating when the segment was created." } } }, - "ListAttachmentsResponse": { + "ListSegmentsResponseSuccess": { "type": "object", "properties": { "object": { @@ -4537,211 +6969,154 @@ }, "has_more": { "type": "boolean", - "description": "Indicates if there are more results available.", - "example": false + "description": "Indicates if there are more results available." }, "data": { "type": "array", - "description": "Array containing attachment information.", + "description": "Array containing segment information.", "items": { "type": "object", "properties": { "id": { "type": "string", - "format": "uuid", - "description": "The ID of the attachment.", - "example": "660e8400-e29b-41d4-a716-446655440000" - }, - "filename": { - "type": "string", - "description": "The filename of the attachment.", - "example": "document.pdf" - }, - "content_type": { - "type": "string", - "description": "The MIME type of the attachment.", - "example": "application/pdf" - }, - "content_id": { - "type": "string", - "description": "The content ID for inline attachments.", - "example": "img001" + "description": "Unique identifier for the segment." }, - "content_disposition": { + "name": { "type": "string", - "enum": [ - "inline", - "attachment" - ], - "description": "How the attachment should be displayed.", - "example": "attachment" + "description": "Name of the segment." }, - "download_url": { + "audience_id": { "type": "string", - "description": "Signed URL to download the attachment content.", - "example": "https://cloudfront.example.com/path?Signature=..." + "description": "The ID of the audience this segment belongs to.", + "deprecated": true }, - "expires_at": { + "created_at": { "type": "string", "format": "date-time", - "description": "Timestamp when the download URL expires.", - "example": "2024-10-27T18:30:00.000Z" - }, - "size": { - "type": "integer", - "description": "Size of the attachment in bytes.", - "example": 2048 + "description": "Timestamp indicating when the segment was created." } } } } } }, - "GetReceivedEmailResponse": { + "RemoveSegmentResponseSuccess": { "type": "object", "properties": { - "object": { - "type": "string", - "description": "The type of object.", - "example": "email" - }, "id": { "type": "string", - "format": "uuid", - "description": "The ID of the received email.", - "example": "550e8400-e29b-41d4-a716-446655440000" + "description": "The ID of the segment.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The recipient email addresses.", - "example": [ - "delivered@resend.dev" - ] + "object": { + "type": "string", + "description": "The object type.", + "example": "segment" }, - "from": { + "deleted": { + "type": "boolean", + "description": "Indicates whether the segment was successfully deleted.", + "example": true + } + } + }, + "CreateTopicOptions": { + "type": "object", + "required": [ + "name", + "default_subscription" + ], + "properties": { + "name": { "type": "string", - "description": "The sender email address.", - "example": "sender@example.com" + "description": "The name of the topic. Max 50 characters.", + "maxLength": 50 }, - "subject": { + "default_subscription": { "type": "string", - "description": "The email subject.", - "example": "Hello World" + "enum": [ + "opt_in", + "opt_out" + ], + "description": "The default subscription status for the topic. Cannot be changed after creation." }, - "message_id": { + "description": { "type": "string", - "description": "The unique message ID from the email headers.", - "example": "" + "description": "A description of the topic. Max 200 characters.", + "maxLength": 200 }, - "bcc": { - "type": [ - "array", - "null" + "visibility": { + "type": "string", + "enum": [ + "public", + "private" ], - "items": { - "type": "string" - }, - "description": "The BCC recipients.", - "example": [] + "default": "private", + "description": "The visibility of the topic. Public topics are visible to all contacts on the unsubscribe page. Private topics are only visible to opted-in contacts." + } + } + }, + "CreateTopicResponseSuccess": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the topic.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" }, - "cc": { - "type": [ - "array", - "null" - ], - "items": { - "type": "string" - }, - "description": "The CC recipients.", - "example": [] + "object": { + "type": "string", + "description": "The object type of the response.", + "example": "topic" + } + } + }, + "GetTopicResponseSuccess": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the topic.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" }, - "reply_to": { - "type": [ - "array", - "null" - ], - "items": { - "type": "string" - }, - "description": "The reply-to addresses.", - "example": [] + "object": { + "type": "string", + "description": "The object type.", + "example": "topic" }, - "html": { - "type": [ - "string", - "null" - ], - "description": "The HTML content of the email.", - "example": "

Email content

" + "name": { + "type": "string", + "description": "The name of the topic.", + "example": "Newsletter" }, - "text": { - "type": [ - "string", - "null" - ], - "description": "The plain text content of the email.", - "example": "Email content" + "description": { + "type": "string", + "description": "A description of the topic." }, - "headers": { - "type": [ - "object", - "null" + "default_subscription": { + "type": "string", + "enum": [ + "opt_in", + "opt_out" ], - "description": "The email headers.", - "example": { - "X-Custom-Header": "value" - } + "description": "The default subscription status for the topic." }, - "created_at": { + "visibility": { "type": "string", - "format": "date-time", - "description": "Timestamp when the email was received.", - "example": "2023-10-06:23:47:56.678Z" - }, - "attachments": { - "type": "array", - "description": "Array of attachments.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The ID of the attachment." - }, - "filename": { - "type": "string", - "description": "The filename of the attachment." - }, - "content_type": { - "type": "string", - "description": "The MIME type of the attachment." - }, - "content_id": { - "type": "string", - "description": "The content ID for inline attachments." - }, - "content_disposition": { - "type": "string", - "enum": [ - "inline", - "attachment" - ], - "description": "How the attachment should be displayed." - }, - "size": { - "type": "integer", - "description": "Size of the attachment in bytes." - } - } - } + "enum": [ + "public", + "private" + ], + "description": "The visibility of the topic." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the topic was created." } } }, - "ListReceivedEmailsResponse": { + "ListTopicsResponseSuccess": { "type": "object", "properties": { "object": { @@ -4751,229 +7126,200 @@ }, "has_more": { "type": "boolean", - "description": "Indicates if there are more results available.", - "example": false + "description": "Indicates if there are more results available." }, "data": { "type": "array", - "description": "Array containing received email information.", + "description": "Array containing topic information.", "items": { "type": "object", "properties": { "id": { "type": "string", - "format": "uuid", - "description": "The ID of the received email.", - "example": "550e8400-e29b-41d4-a716-446655440000" - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The recipient email addresses.", - "example": [ - "delivered@resend.dev" - ] + "description": "Unique identifier for the topic." }, - "from": { + "name": { "type": "string", - "description": "The sender email address.", - "example": "sender@example.com" - }, - "subject": { - "type": [ - "string", - "null" - ], - "description": "The email subject.", - "example": "Hello World" + "description": "Name of the topic." }, - "message_id": { + "description": { "type": "string", - "description": "The unique message ID from the email headers.", - "example": "" - }, - "bcc": { - "type": [ - "array", - "null" - ], - "items": { - "type": "string" - }, - "description": "The BCC recipients." + "description": "A description of the topic." }, - "cc": { - "type": [ - "array", - "null" + "default_subscription": { + "type": "string", + "enum": [ + "opt_in", + "opt_out" ], - "items": { - "type": "string" - }, - "description": "The CC recipients." + "description": "The default subscription status for the topic." }, - "reply_to": { - "type": [ - "array", - "null" + "visibility": { + "type": "string", + "enum": [ + "public", + "private" ], - "items": { - "type": "string" - }, - "description": "The reply-to addresses." + "description": "The visibility of the topic." }, "created_at": { "type": "string", "format": "date-time", - "description": "Timestamp when the email was received.", - "example": "2023-10-06T23:47:56.678Z" - }, - "attachments": { - "type": "array", - "description": "Array of attachments for this email.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The ID of the attachment." - }, - "filename": { - "type": "string", - "description": "The filename of the attachment." - }, - "content_type": { - "type": "string", - "description": "The MIME type of the attachment." - }, - "content_id": { - "type": "string", - "description": "The content ID for inline attachments." - }, - "content_disposition": { - "type": "string", - "enum": [ - "inline", - "attachment" - ], - "description": "How the attachment should be displayed." - }, - "size": { - "type": "integer", - "description": "Size of the attachment in bytes." - } - } - } + "description": "Timestamp indicating when the topic was created." } } } } } }, - "CreateWebhookRequest": { + "UpdateTopicOptions": { "type": "object", - "required": [ - "endpoint", - "events" - ], "properties": { - "endpoint": { + "name": { "type": "string", - "description": "The URL where webhook events will be sent.", - "example": "https://webhook.example.com/handler" + "description": "The name of the topic. Max 50 characters.", + "maxLength": 50 }, - "events": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "description": "Array of event types to subscribe to.", - "example": [ - "email.sent", - "email.delivered", - "email.bounced", - "email.suppressed" - ] + "description": { + "type": "string", + "description": "A description of the topic. Max 200 characters.", + "maxLength": 200 + }, + "visibility": { + "type": "string", + "enum": [ + "public", + "private" + ], + "description": "The visibility of the topic." } } }, - "CreateWebhookResponse": { + "UpdateTopicResponseSuccess": { "type": "object", "properties": { + "id": { + "type": "string", + "description": "The ID of the topic.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + }, "object": { "type": "string", - "description": "The type of object.", - "example": "webhook" + "description": "The object type.", + "example": "topic" + } + } + }, + "RemoveTopicResponseSuccess": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the topic.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + }, + "object": { + "type": "string", + "description": "The object type.", + "example": "topic" + }, + "deleted": { + "type": "boolean", + "description": "Indicates whether the topic was successfully deleted.", + "example": true + } + } + }, + "CreateContactPropertyOptions": { + "type": "object", + "required": [ + "key", + "type" + ], + "properties": { + "key": { + "type": "string", + "description": "The property key. Max length is 50 characters. Only alphanumeric characters and underscores are allowed." + }, + "type": { + "type": "string", + "enum": [ + "string", + "number" + ], + "description": "The property type." }, + "fallback_value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "description": "The default value to use when the property is not set for a contact. Must match the type specified in the type field." + } + } + }, + "CreateContactPropertyResponseSuccess": { + "type": "object", + "properties": { "id": { "type": "string", - "format": "uuid", - "description": "The ID of the webhook.", - "example": "479e3145-dd38-476b-932c-529ceb705947" + "description": "The ID of the contact property.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" }, - "signing_secret": { + "object": { "type": "string", - "description": "The secret key used to verify webhook payloads.", - "example": "whsec_..." + "description": "The object type of the response.", + "example": "contact_property" } } }, - "GetWebhookResponse": { + "GetContactPropertyResponseSuccess": { "type": "object", "properties": { "object": { "type": "string", - "description": "The type of object.", - "example": "webhook" + "description": "The object type.", + "example": "contact_property" }, "id": { "type": "string", - "format": "uuid", - "description": "The ID of the webhook.", - "example": "479e3145-dd38-476b-932c-529ceb705947" + "description": "The ID of the contact property.", + "example": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e" + }, + "key": { + "type": "string", + "description": "The property key.", + "example": "company_name" }, - "endpoint": { + "type": { "type": "string", - "description": "The URL where webhook events are sent.", - "example": "https://webhook.example.com/handler" + "description": "The property type.", + "example": "string" }, - "events": { - "type": [ - "array", - "null" + "fallback_value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } ], - "items": { - "type": "string" - }, - "description": "Array of event types subscribed to.", - "example": [ - "email.sent", - "email.delivered" - ] - }, - "status": { - "type": "string", - "description": "The status of the webhook.", - "example": "enabled" + "description": "The default value when the property is not set for a contact.", + "example": "Acme Corp" }, "created_at": { "type": "string", "format": "date-time", - "description": "Timestamp indicating when the webhook was created.", - "example": "2023-10-06T23:47:56.678Z" - }, - "signing_secret": { - "type": "string", - "description": "The secret key used to verify webhook payloads.", - "example": "whsec_..." + "description": "Timestamp indicating when the contact property was created." } } }, - "ListWebhooksResponse": { + "ListContactPropertiesResponseSuccess": { "type": "object", "properties": { "object": { @@ -4983,770 +7329,883 @@ }, "has_more": { "type": "boolean", - "description": "Indicates if there are more results available.", - "example": false + "description": "Indicates if there are more results available." }, "data": { "type": "array", - "description": "Array containing webhook information.", + "description": "Array containing contact property information.", "items": { "type": "object", "properties": { "id": { "type": "string", - "format": "uuid", - "description": "The ID of the webhook.", - "example": "479e3145-dd38-476b-932c-529ceb705947" + "description": "Unique identifier for the contact property." }, - "endpoint": { + "key": { "type": "string", - "description": "The URL where webhook events are sent.", - "example": "https://webhook.example.com/handler" - }, - "events": { - "type": [ - "array", - "null" - ], - "items": { - "type": "string" - }, - "description": "Array of event types subscribed to.", - "example": [ - "email.sent" - ] + "description": "The property key." }, - "status": { + "type": { "type": "string", - "description": "The status of the webhook.", - "example": "enabled" + "description": "The property type." + }, + "fallback_value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "description": "The default value when the property is not set for a contact." }, "created_at": { "type": "string", "format": "date-time", - "description": "Timestamp indicating when the webhook was created.", - "example": "2023-10-06T23:47:56.678Z" + "description": "Timestamp indicating when the contact property was created." } } } } } }, - "UpdateWebhookRequest": { + "UpdateContactPropertyOptions": { "type": "object", "properties": { - "endpoint": { - "type": "string", - "description": "The URL where webhook events will be sent.", - "example": "https://webhook.example.com/new-handler" - }, - "events": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "description": "Array of event types to subscribe to.", - "example": [ - "email.sent", - "email.delivered" - ] - }, - "status": { - "type": "string", - "enum": [ - "enabled", - "disabled" + "fallback_value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } ], - "description": "The status of the webhook.", - "example": "enabled" + "description": "The default value to use when the property is not set for a contact. Must match the type of the property." } } }, - "UpdateWebhookResponse": { + "UpdateContactPropertyResponseSuccess": { "type": "object", "properties": { - "object": { + "id": { "type": "string", - "description": "The type of object.", - "example": "webhook" + "description": "The ID of the contact property.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" }, - "id": { + "object": { "type": "string", - "format": "uuid", - "description": "The ID of the updated webhook.", - "example": "479e3145-dd38-476b-932c-529ceb705947" + "description": "The object type.", + "example": "contact_property" } } }, - "DeleteWebhookResponse": { + "RemoveContactPropertyResponseSuccess": { "type": "object", "properties": { - "object": { + "id": { "type": "string", - "description": "The type of object.", - "example": "webhook" + "description": "The ID of the contact property.", + "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" }, - "id": { + "object": { "type": "string", - "format": "uuid", - "description": "The ID of the deleted webhook.", - "example": "479e3145-dd38-476b-932c-529ceb705947" + "description": "The object type.", + "example": "contact_property" }, "deleted": { "type": "boolean", - "description": "Indicates whether the webhook was successfully deleted.", + "description": "Indicates whether the contact property was successfully deleted.", "example": true } } }, - "TemplateVariable": { + "AddContactToSegmentResponseSuccess": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "The ID of the template variable." - }, - "key": { - "type": "string", - "description": "The key of the variable." - }, - "type": { + "object": { "type": "string", - "description": "The type of the variable.", - "enum": [ - "string", - "number", - "boolean", - "object", - "list" - ] - }, - "fallback_value": { - "description": "The fallback value of the variable.", - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "object" - }, - { - "type": "array", - "items": {} - } - ] + "description": "The object type.", + "example": "contact_segment" }, - "created_at": { + "contact_id": { "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the variable was created." + "description": "The ID of the contact." }, - "updated_at": { + "segment_id": { "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the variable was last updated." + "description": "The ID of the segment." } - }, - "required": [ - "key", - "type" - ] + } }, - "TemplateVariableInput": { + "ListContactSegmentsResponseSuccess": { "type": "object", "properties": { - "key": { + "object": { "type": "string", - "description": "The key of the variable." + "description": "Type of the response object.", + "example": "list" }, - "type": { - "type": "string", - "description": "The type of the variable.", - "enum": [ - "string", - "number", - "boolean", - "object", - "list" - ] + "has_more": { + "type": "boolean", + "description": "Indicates if there are more results available." }, - "fallback_value": { - "description": "The fallback value of the variable.", - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "object" - }, - { - "type": "array", - "items": {} + "data": { + "type": "array", + "description": "Array containing segment information for this contact.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the segment." + }, + "name": { + "type": "string", + "description": "Name of the segment." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the contact was added to the segment." + } } - ] + } } - }, - "required": [ - "key", - "type" - ] + } }, - "Template": { + "RemoveContactFromSegmentResponseSuccess": { "type": "object", "properties": { "object": { "type": "string", - "description": "The type of object.", - "example": "template" - }, - "id": { - "type": "string", - "description": "The ID of the template." - }, - "current_version_id": { - "type": "string", - "description": "The ID of the current version of the template." + "description": "The object type.", + "example": "contact_segment" }, - "name": { + "contact_id": { "type": "string", - "description": "The name of the template." + "description": "The ID of the contact." }, - "alias": { + "segment_id": { "type": "string", - "description": "The alias of the template." + "description": "The ID of the segment." }, - "from": { + "deleted": { + "type": "boolean", + "description": "Indicates whether the contact was successfully removed from the segment.", + "example": true + } + } + }, + "GetContactTopicsResponseSuccess": { + "type": "object", + "properties": { + "object": { "type": "string", - "description": "Sender email address. To include a friendly name, use the format \"Your Name \"." + "description": "Type of the response object.", + "example": "list" }, - "subject": { - "type": "string", - "description": "Email subject." + "has_more": { + "type": "boolean", + "description": "Indicates if there are more results available." }, - "reply_to": { - "type": [ - "array", - "null" - ], + "data": { + "type": "array", + "description": "Array containing topic subscriptions for this contact.", "items": { - "type": "string" - }, - "description": "Reply-to email addresses." - }, - "html": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the topic." + }, + "name": { + "type": "string", + "description": "Name of the topic." + }, + "description": { + "type": "string", + "description": "Description of the topic." + }, + "subscription": { + "type": "string", + "enum": [ + "opt_in", + "opt_out" + ], + "description": "The subscription status for this topic." + } + } + } + } + } + }, + "UpdateContactTopicsOptions": { + "type": "object", + "required": [ + "topics" + ], + "properties": { + "topics": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the topic." + }, + "subscription": { + "type": "string", + "enum": [ + "opt_in", + "opt_out" + ], + "description": "The subscription status (opt_in or opt_out)." + } + } + } + } + } + }, + "UpdateContactTopicsResponseSuccess": { + "type": "object", + "properties": { + "object": { "type": "string", - "description": "The HTML version of the template." + "description": "The object type.", + "example": "contact_topics" }, - "text": { + "contact_id": { "type": "string", - "description": "The plain text version of the template." + "description": "The ID of the contact." }, - "variables": { + "topics": { "type": "array", + "description": "Array of updated topic subscriptions.", "items": { - "$ref": "#/components/schemas/TemplateVariable" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the topic." + }, + "subscription": { + "type": "string", + "enum": [ + "opt_in", + "opt_out" + ], + "description": "The subscription status." + } + } } + } + } + }, + "LogSummary": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The log ID." }, "created_at": { "type": "string", "format": "date-time", - "description": "Timestamp indicating when the template was created." + "description": "The date the log was created." }, - "updated_at": { + "endpoint": { "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the template was last updated." + "description": "The API endpoint that was called." }, - "status": { + "method": { "type": "string", - "description": "The publication status of the template.", "enum": [ - "draft", - "published" - ] + "GET", + "POST", + "PUT", + "DELETE", + "PATCH", + "OPTIONS" + ], + "description": "The HTTP method used." }, - "published_at": { + "response_status": { + "type": "integer", + "description": "The HTTP status code of the response." + }, + "user_agent": { "type": [ "string", "null" ], - "format": "date-time", - "description": "Timestamp indicating when the template was published." - }, - "has_unpublished_versions": { - "type": "boolean", - "description": "Indicates whether the template has unpublished versions." + "description": "The user agent of the request." } } }, - "TemplateListItem": { + "Log": { "type": "object", "properties": { + "object": { + "type": "string", + "description": "Type of the response object.", + "example": "log" + }, "id": { "type": "string", - "description": "The ID of the template." + "format": "uuid", + "description": "The log ID." }, - "name": { + "created_at": { "type": "string", - "description": "The name of the template." + "format": "date-time", + "description": "The date the log was created." }, - "status": { + "endpoint": { + "type": "string", + "description": "The API endpoint that was called." + }, + "method": { "type": "string", - "description": "The publication status of the template.", "enum": [ - "draft", - "published" - ] + "GET", + "POST", + "PUT", + "DELETE", + "PATCH", + "OPTIONS" + ], + "description": "The HTTP method used." }, - "published_at": { + "response_status": { + "type": "integer", + "description": "The HTTP status code of the response." + }, + "user_agent": { + "type": [ + "string", + "null" + ], + "description": "The user agent of the request." + }, + "request_body": { "type": [ - "string", + "object", "null" ], - "format": "date-time", - "description": "Timestamp indicating when the template was published." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the template was created." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the template was last updated." + "description": "The request body sent to the API." }, - "alias": { - "type": "string", - "description": "The alias of the template." + "response_body": { + "type": [ + "object", + "null" + ], + "description": "The response body returned by the API." } } }, - "CreateTemplateRequest": { + "ListLogsResponse": { "type": "object", - "required": [ - "name", - "html" - ], "properties": { - "name": { - "type": "string", - "description": "The name of the template." - }, - "alias": { - "type": "string", - "description": "The alias of the template." - }, - "from": { - "type": "string", - "description": "Sender email address. To include a friendly name, use the format \"Your Name \"." - }, - "subject": { - "type": "string", - "description": "Email subject." - }, - "reply_to": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Reply-to email addresses." - }, - "html": { + "object": { "type": "string", - "description": "The HTML version of the template." + "description": "Type of the response object.", + "example": "list" }, - "text": { - "type": "string", - "description": "The plain text version of the template." + "has_more": { + "type": "boolean", + "description": "Indicates if there are more results available.", + "example": false }, - "variables": { + "data": { "type": "array", + "description": "Array containing log information.", "items": { - "$ref": "#/components/schemas/TemplateVariableInput" + "$ref": "#/components/schemas/LogSummary" } } } }, - "CreateTemplateResponseSuccess": { + "AutomationStep": { "type": "object", + "description": "A step in an automation workflow. The `config` object varies based on the step `type`.", + "required": [ + "key", + "type", + "config" + ], "properties": { - "id": { + "key": { "type": "string", - "description": "The ID of the template." + "description": "A unique key for this step within the automation graph." }, - "object": { + "type": { "type": "string", - "description": "The object type of the response.", - "example": "template" + "enum": [ + "trigger", + "send_email", + "delay", + "wait_for_event", + "condition", + "contact_update", + "contact_delete", + "add_to_segment" + ], + "description": "The type of automation step." + }, + "config": { + "type": "object", + "description": "Configuration for the step. Shape depends on `type`: - **trigger**: `{ event_name: string }` - **send_email**: `{ template: { id: string, variables?: object }, subject?: string, from?: string, reply_to?: string }` - **delay**: `{ duration: string }` — a human-readable duration (e.g. `\"30 minutes\"`) - **wait_for_event**: `{ event_name: string, timeout?: string, filter_rule?: object }` — `timeout` is a human-readable duration (e.g. `\"1 hour\"`) - **condition**: A rule tree with `type` (`rule`, `and`, `or`), `field`, `operator`, and `value` - **contact_update**: `{ first_name?: string|object, last_name?: string|object, unsubscribed?: boolean|object, properties?: object }` - **contact_delete**: `{}` - **add_to_segment**: `{ segment_id: string }`\n" } } }, - "ListTemplatesResponseSuccess": { + "AutomationStepResponse": { "type": "object", + "description": "A step as returned when retrieving an automation.", "properties": { - "object": { + "key": { "type": "string", - "description": "Type of the response object.", - "example": "list" + "description": "The unique key of this step within the automation graph." }, - "data": { - "type": "array", - "description": "Array containing templates information.", - "items": { - "$ref": "#/components/schemas/TemplateListItem" - } + "type": { + "type": "string", + "enum": [ + "trigger", + "send_email", + "delay", + "wait_for_event", + "condition", + "contact_update", + "contact_delete", + "add_to_segment" + ], + "description": "The type of automation step." }, - "has_more": { - "type": "boolean", - "description": "Indicates if there are more templates to retrieve." + "config": { + "type": "object", + "description": "Configuration for the step. Shape depends on `type`. For `delay` steps, config contains `{ duration: string }` with a human-readable duration (e.g. `\"30 minutes\"`). For `wait_for_event` steps, config contains `{ event_name: string, timeout?: string, filter_rule?: object }` where `timeout` is a human-readable duration.\n" } } }, - "UpdateTemplateOptions": { + "AutomationConnection": { "type": "object", + "description": "A connection between two steps in the automation graph.", + "required": [ + "from", + "to" + ], "properties": { - "name": { + "from": { "type": "string", - "description": "The name of the template." + "description": "The `key` of the source step." }, - "alias": { + "to": { "type": "string", - "description": "The alias of the template." + "description": "The `key` of the target step." }, - "from": { + "type": { "type": "string", - "description": "Sender email address. To include a friendly name, use the format \"Your Name \"." + "enum": [ + "default", + "condition_met", + "condition_not_met", + "timeout", + "event_received" + ], + "default": "default", + "description": "The type of connection. Defaults to `default`." + } + } + }, + "CreateAutomationRequest": { + "type": "object", + "required": [ + "name", + "steps", + "connections" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "The name of the automation." }, - "subject": { + "status": { "type": "string", - "description": "Email subject." + "enum": [ + "enabled", + "disabled" + ], + "default": "disabled", + "description": "The initial status of the automation. Defaults to `disabled`." }, - "reply_to": { + "steps": { "type": "array", + "minItems": 1, + "maxItems": 150, + "description": "The steps that compose the automation workflow. Must include at least one `trigger` step.", "items": { - "type": "string" - }, - "description": "Reply-to email addresses." - }, - "html": { - "type": "string", - "description": "The HTML version of the template." - }, - "text": { - "type": "string", - "description": "The plain text version of the template." + "$ref": "#/components/schemas/AutomationStep" + } }, - "variables": { + "connections": { "type": "array", + "description": "The connections between steps in the automation graph.", "items": { - "$ref": "#/components/schemas/TemplateVariableInput" + "$ref": "#/components/schemas/AutomationConnection" } } } }, - "UpdateTemplateResponseSuccess": { + "CreateAutomationResponse": { "type": "object", "properties": { - "id": { + "object": { "type": "string", - "description": "The ID of the template." + "description": "Type of the response object.", + "example": "automation" }, - "object": { + "id": { "type": "string", - "description": "The object type of the response.", - "example": "template" + "description": "The ID of the created automation." } } }, - "RemoveTemplateResponseSuccess": { + "Automation": { "type": "object", "properties": { "object": { "type": "string", "description": "Type of the response object.", - "example": "template" + "example": "automation" }, "id": { "type": "string", - "description": "The ID of the template." + "description": "The ID of the automation." }, - "deleted": { - "type": "boolean", - "description": "Indicates whether the template was successfully deleted.", - "example": true + "name": { + "type": "string", + "description": "The name of the automation." + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "description": "The current status of the automation." + }, + "created_at": { + "type": "string", + "description": "The date and time the automation was created." + }, + "updated_at": { + "type": "string", + "description": "The date and time the automation was last updated." + }, + "steps": { + "type": "array", + "description": "The steps in the active version of the automation.", + "items": { + "$ref": "#/components/schemas/AutomationStepResponse" + } + }, + "connections": { + "type": "array", + "description": "The connections between steps in the active version of the automation.", + "items": { + "$ref": "#/components/schemas/AutomationConnection" + } } } }, - "PublishTemplateResponseSuccess": { + "AutomationListItem": { "type": "object", "properties": { "id": { "type": "string", - "description": "The ID of the template." + "description": "The ID of the automation." }, - "object": { + "name": { "type": "string", - "description": "The object type of the response.", - "example": "template" + "description": "The name of the automation." + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "description": "The current status of the automation." + }, + "created_at": { + "type": "string", + "description": "The date and time the automation was created." + }, + "updated_at": { + "type": "string", + "description": "The date and time the automation was last updated." } } }, - "DuplicateTemplateResponseSuccess": { + "ListAutomationsResponse": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "The ID of the duplicated template." - }, "object": { "type": "string", - "description": "The object type of the response.", - "example": "template" + "description": "Type of the response object.", + "example": "list" + }, + "has_more": { + "type": "boolean", + "description": "Indicates if there are more results available." + }, + "data": { + "type": "array", + "description": "Array of automations.", + "items": { + "$ref": "#/components/schemas/AutomationListItem" + } } } }, - "CreateSegmentOptions": { + "PatchAutomationRequest": { "type": "object", - "required": [ - "name" - ], + "description": "At least one of `name`, `status`, or `steps` and `connections` must be provided. When updating the workflow graph, both `steps` and `connections` must be provided together.\n", "properties": { "name": { "type": "string", - "description": "The name of the segment." + "minLength": 1, + "description": "The name of the automation." }, - "audience_id": { + "status": { "type": "string", - "description": "The ID of the audience this segment belongs to.", - "deprecated": true + "enum": [ + "enabled", + "disabled" + ], + "description": "The status of the automation." }, - "filter": { - "type": "object", - "description": "Filter conditions for the segment." + "steps": { + "type": "array", + "minItems": 1, + "maxItems": 150, + "description": "The steps that compose the automation workflow. Must be provided together with `connections`.", + "items": { + "$ref": "#/components/schemas/AutomationStep" + } + }, + "connections": { + "type": "array", + "description": "The connections between steps in the automation graph. Must be provided together with `steps`.", + "items": { + "$ref": "#/components/schemas/AutomationConnection" + } } } }, - "CreateSegmentResponseSuccess": { + "PatchAutomationResponse": { "type": "object", "properties": { - "id": { + "object": { "type": "string", - "description": "The ID of the segment.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + "description": "Type of the response object.", + "example": "automation" }, - "object": { + "id": { "type": "string", - "description": "The object type of the response.", - "example": "segment" + "description": "The ID of the updated automation." } } }, - "GetSegmentResponseSuccess": { + "DeleteAutomationResponse": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "The ID of the segment.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" - }, "object": { "type": "string", - "description": "The object type.", - "example": "segment" - }, - "name": { - "type": "string", - "description": "The name of the segment.", - "example": "Active Users" + "description": "Type of the response object.", + "example": "automation" }, - "audience_id": { + "id": { "type": "string", - "description": "The ID of the audience this segment belongs to.", - "deprecated": true - }, - "filter": { - "type": "object", - "description": "Filter conditions for the segment." + "description": "The ID of the deleted automation." }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the segment was created." + "deleted": { + "type": "boolean", + "description": "Indicates whether the automation was successfully deleted.", + "example": true } } }, - "ListSegmentsResponseSuccess": { + "StopAutomationResponse": { "type": "object", "properties": { "object": { "type": "string", "description": "Type of the response object.", - "example": "list" - }, - "has_more": { - "type": "boolean", - "description": "Indicates if there are more results available." + "example": "automation" }, - "data": { - "type": "array", - "description": "Array containing segment information.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the segment." - }, - "name": { - "type": "string", - "description": "Name of the segment." - }, - "audience_id": { - "type": "string", - "description": "The ID of the audience this segment belongs to.", - "deprecated": true - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the segment was created." - } - } - } - } - } - }, - "RemoveSegmentResponseSuccess": { - "type": "object", - "properties": { "id": { "type": "string", - "description": "The ID of the segment.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + "description": "The ID of the stopped automation." }, - "object": { + "status": { "type": "string", - "description": "The object type.", - "example": "segment" - }, - "deleted": { - "type": "boolean", - "description": "Indicates whether the segment was successfully deleted.", - "example": true + "description": "The status of the automation after stopping.", + "example": "disabled" } } }, - "CreateTopicOptions": { + "AutomationRunStep": { "type": "object", - "required": [ - "name", - "default_subscription" - ], + "description": "A step execution within an automation run.", "properties": { - "name": { + "key": { "type": "string", - "description": "The name of the topic. Max 50 characters.", - "maxLength": 50 + "description": "The key of the automation step." }, - "default_subscription": { + "type": { "type": "string", "enum": [ - "opt_in", - "opt_out" + "trigger", + "send_email", + "delay", + "wait_for_event", + "condition", + "contact_update", + "contact_delete", + "add_to_segment" ], - "description": "The default subscription status for the topic. Cannot be changed after creation." + "description": "The type of automation step." }, - "description": { + "status": { "type": "string", - "description": "A description of the topic. Max 200 characters.", - "maxLength": 200 + "description": "The execution status of this step." }, - "visibility": { - "type": "string", - "enum": [ - "public", - "private" + "started_at": { + "type": [ + "string", + "null" ], - "default": "private", - "description": "The visibility of the topic. Public topics are visible to all contacts on the unsubscribe page. Private topics are only visible to opted-in contacts." + "description": "The date and time the step started executing." + }, + "completed_at": { + "type": [ + "string", + "null" + ], + "description": "The date and time the step completed executing." + }, + "output": { + "type": [ + "object", + "null" + ], + "description": "The output produced by the step, if any." + }, + "error": { + "type": [ + "object", + "null" + ], + "description": "The error produced by the step, if any." + }, + "created_at": { + "type": "string", + "description": "The date and time the step record was created." } } }, - "CreateTopicResponseSuccess": { + "AutomationRun": { "type": "object", "properties": { + "object": { + "type": "string", + "description": "Type of the response object.", + "example": "automation_run" + }, "id": { "type": "string", - "description": "The ID of the topic.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + "description": "The ID of the automation run." }, - "object": { + "status": { "type": "string", - "description": "The object type of the response.", - "example": "topic" + "enum": [ + "running", + "completed", + "failed", + "cancelled" + ], + "description": "The current status of the automation run." + }, + "started_at": { + "type": [ + "string", + "null" + ], + "description": "The date and time the run started." + }, + "completed_at": { + "type": [ + "string", + "null" + ], + "description": "The date and time the run completed." + }, + "created_at": { + "type": "string", + "description": "The date and time the run was created." + }, + "steps": { + "type": "array", + "description": "The steps executed in this run, sorted in graph order.", + "items": { + "$ref": "#/components/schemas/AutomationRunStep" + } } } }, - "GetTopicResponseSuccess": { + "AutomationRunListItem": { "type": "object", "properties": { "id": { "type": "string", - "description": "The ID of the topic.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" - }, - "object": { - "type": "string", - "description": "The object type.", - "example": "topic" - }, - "name": { - "type": "string", - "description": "The name of the topic.", - "example": "Newsletter" - }, - "description": { - "type": "string", - "description": "A description of the topic." + "description": "The ID of the automation run." }, - "default_subscription": { + "status": { "type": "string", "enum": [ - "opt_in", - "opt_out" + "running", + "completed", + "failed", + "cancelled" ], - "description": "The default subscription status for the topic." + "description": "The current status of the automation run." }, - "visibility": { - "type": "string", - "enum": [ - "public", - "private" + "started_at": { + "type": [ + "string", + "null" ], - "description": "The visibility of the topic." + "description": "The date and time the run started." + }, + "completed_at": { + "type": [ + "string", + "null" + ], + "description": "The date and time the run completed." }, "created_at": { "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the topic was created." + "description": "The date and time the run was created." } } }, - "ListTopicsResponseSuccess": { + "ListAutomationRunsResponse": { "type": "object", "properties": { "object": { @@ -5760,196 +8219,117 @@ }, "data": { "type": "array", - "description": "Array containing topic information.", + "description": "Array of automation runs.", "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the topic." - }, - "name": { - "type": "string", - "description": "Name of the topic." - }, - "description": { - "type": "string", - "description": "A description of the topic." - }, - "default_subscription": { - "type": "string", - "enum": [ - "opt_in", - "opt_out" - ], - "description": "The default subscription status for the topic." - }, - "visibility": { - "type": "string", - "enum": [ - "public", - "private" - ], - "description": "The visibility of the topic." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the topic was created." - } - } + "$ref": "#/components/schemas/AutomationRunListItem" } } } }, - "UpdateTopicOptions": { + "Event": { "type": "object", "properties": { - "name": { + "object": { "type": "string", - "description": "The name of the topic. Max 50 characters.", - "maxLength": 50 + "description": "Type of the response object.", + "example": "event" }, - "description": { + "id": { "type": "string", - "description": "A description of the topic. Max 200 characters.", - "maxLength": 200 + "format": "uuid", + "description": "The event ID." }, - "visibility": { + "name": { "type": "string", - "enum": [ - "public", - "private" + "description": "The event name." + }, + "schema": { + "type": [ + "object", + "null" ], - "description": "The visibility of the topic." - } - } - }, - "UpdateTopicResponseSuccess": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the topic.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + "description": "A flat key/type map defining the event payload schema. Supported types are `string`, `number`, `boolean`, and `date`." }, - "object": { + "created_at": { "type": "string", - "description": "The object type.", - "example": "topic" + "description": "The date and time the event was created." + }, + "updated_at": { + "type": [ + "string", + "null" + ], + "description": "The date and time the event was last updated." } } }, - "RemoveTopicResponseSuccess": { + "EventSummary": { "type": "object", "properties": { "id": { "type": "string", - "description": "The ID of the topic.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + "format": "uuid", + "description": "The event ID." }, - "object": { + "name": { "type": "string", - "description": "The object type.", - "example": "topic" + "description": "The event name." }, - "deleted": { - "type": "boolean", - "description": "Indicates whether the topic was successfully deleted.", - "example": true - } - } - }, - "CreateContactPropertyOptions": { - "type": "object", - "required": [ - "key", - "type" - ], - "properties": { - "key": { - "type": "string", - "description": "The property key. Max length is 50 characters. Only alphanumeric characters and underscores are allowed." + "schema": { + "type": [ + "object", + "null" + ], + "description": "A flat key/type map defining the event payload schema. Supported types are `string`, `number`, `boolean`, and `date`." }, - "type": { + "created_at": { "type": "string", - "enum": [ - "string", - "number" - ], - "description": "The property type." + "description": "The date and time the event was created." }, - "fallback_value": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - } + "updated_at": { + "type": [ + "string", + "null" ], - "description": "The default value to use when the property is not set for a contact. Must match the type specified in the type field." + "description": "The date and time the event was last updated." } } }, - "CreateContactPropertyResponseSuccess": { + "CreateEventRequest": { "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the contact property.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" - }, - "object": { + "required": [ + "name" + ], + "properties": { + "name": { "type": "string", - "description": "The object type of the response.", - "example": "contact_property" + "description": "The name of the event. Cannot start with the reserved `resend:` prefix." + }, + "schema": { + "type": [ + "object", + "null" + ], + "description": "An optional flat key/type map defining the event payload schema. Supported types are `string`, `number`, `boolean`, and `date`." } } }, - "GetContactPropertyResponseSuccess": { + "CreateEventResponse": { "type": "object", "properties": { "object": { "type": "string", - "description": "The object type.", - "example": "contact_property" + "description": "Type of the response object.", + "example": "event" }, "id": { "type": "string", - "description": "The ID of the contact property.", - "example": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e" - }, - "key": { - "type": "string", - "description": "The property key.", - "example": "company_name" - }, - "type": { - "type": "string", - "description": "The property type.", - "example": "string" - }, - "fallback_value": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - } - ], - "description": "The default value when the property is not set for a contact.", - "example": "Acme Corp" - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the contact property was created." + "format": "uuid", + "description": "The ID of the created event." } } }, - "ListContactPropertiesResponseSuccess": { + "ListEventsResponse": { "type": "object", "properties": { "object": { @@ -5959,1116 +8339,1271 @@ }, "has_more": { "type": "boolean", - "description": "Indicates if there are more results available." + "description": "Indicates if there are more results available.", + "example": false }, "data": { "type": "array", - "description": "Array containing contact property information.", + "description": "Array containing event information.", "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the contact property." - }, - "key": { - "type": "string", - "description": "The property key." - }, - "type": { - "type": "string", - "description": "The property type." - }, - "fallback_value": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - } - ], - "description": "The default value when the property is not set for a contact." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the contact property was created." - } - } + "$ref": "#/components/schemas/EventSummary" } } } }, - "UpdateContactPropertyOptions": { + "UpdateEventRequest": { "type": "object", + "required": [ + "schema" + ], "properties": { - "fallback_value": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - } + "schema": { + "type": [ + "object", + "null" ], - "description": "The default value to use when the property is not set for a contact. Must match the type of the property." + "description": "A flat key/type map defining the event payload schema. Set to `null` to clear the schema. Supported types are `string`, `number`, `boolean`, and `date`." } } }, - "UpdateContactPropertyResponseSuccess": { + "UpdateEventResponse": { "type": "object", "properties": { - "id": { + "object": { "type": "string", - "description": "The ID of the contact property.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + "description": "Type of the response object.", + "example": "event" }, - "object": { + "id": { "type": "string", - "description": "The object type.", - "example": "contact_property" + "format": "uuid", + "description": "The ID of the updated event." } } }, - "RemoveContactPropertyResponseSuccess": { + "RemoveEventResponse": { "type": "object", "properties": { - "id": { + "object": { "type": "string", - "description": "The ID of the contact property.", - "example": "78261eea-8f8b-4381-83c6-79fa7120f1cf" + "description": "Type of the response object.", + "example": "event" }, - "object": { + "id": { "type": "string", - "description": "The object type.", - "example": "contact_property" + "format": "uuid", + "description": "The ID of the deleted event." }, "deleted": { "type": "boolean", - "description": "Indicates whether the contact property was successfully deleted.", + "description": "Indicates whether the event was deleted.", "example": true } } }, - "AddContactToSegmentResponseSuccess": { + "SendEventRequest": { "type": "object", + "required": [ + "event" + ], "properties": { - "object": { + "event": { "type": "string", - "description": "The object type.", - "example": "contact_segment" + "description": "The name of the event to send." }, "contact_id": { "type": "string", - "description": "The ID of the contact." + "format": "uuid", + "description": "The ID of the contact to associate with this event. Exactly one of `contact_id` or `email` must be provided." }, - "segment_id": { + "email": { "type": "string", - "description": "The ID of the segment." + "format": "email", + "description": "The email address to associate with this event. Exactly one of `contact_id` or `email` must be provided." + }, + "payload": { + "type": "object", + "additionalProperties": true, + "description": "An optional payload of key/value pairs to include with the event." } } }, - "ListContactSegmentsResponseSuccess": { + "SendEventResponse": { "type": "object", "properties": { "object": { "type": "string", "description": "Type of the response object.", - "example": "list" - }, - "has_more": { - "type": "boolean", - "description": "Indicates if there are more results available." + "example": "event" }, - "data": { - "type": "array", - "description": "Array containing segment information for this contact.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the segment." - }, - "name": { - "type": "string", - "description": "Name of the segment." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp indicating when the contact was added to the segment." - } - } - } + "event": { + "type": "string", + "description": "The name of the event that was sent." } } }, - "RemoveContactFromSegmentResponseSuccess": { + "WebhookEventBounce": { "type": "object", + "required": [ + "diagnosticCode", + "message", + "subType", + "type" + ], "properties": { - "object": { - "type": "string", - "description": "The object type.", - "example": "contact_segment" + "diagnosticCode": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array of SMTP diagnostic responses from the receiving server, one entry per recipient (e.g., `smtp; 550 5.1.1 user unknown`)." }, - "contact_id": { + "message": { "type": "string", - "description": "The ID of the contact." + "description": "Detailed bounce message describing why the email bounced." }, - "segment_id": { + "subType": { "type": "string", - "description": "The ID of the segment." + "enum": [ + "Undetermined", + "General", + "NoEmail", + "MailboxFull", + "MessageTooLarge", + "ContentRejected", + "AttachmentRejected" + ], + "description": "Bounce sub-type." }, - "deleted": { - "type": "boolean", - "description": "Indicates whether the contact was successfully removed from the segment.", - "example": true + "type": { + "type": "string", + "enum": [ + "Undetermined", + "Transient", + "Permanent" + ], + "description": "Bounce type." } } }, - "GetContactTopicsResponseSuccess": { + "WebhookEventClick": { "type": "object", + "required": [ + "ipAddress", + "link", + "timestamp", + "userAgent" + ], "properties": { - "object": { + "ipAddress": { "type": "string", - "description": "Type of the response object.", - "example": "list" + "description": "IP address of the user who clicked the link." }, - "has_more": { - "type": "boolean", - "description": "Indicates if there are more results available." + "link": { + "type": "string", + "description": "The URL that was clicked." }, - "data": { - "type": "array", - "description": "Array containing topic subscriptions for this contact.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the topic." - }, - "name": { - "type": "string", - "description": "Name of the topic." - }, - "description": { - "type": "string", - "description": "Description of the topic." - }, - "subscription": { - "type": "string", - "enum": [ - "opt_in", - "opt_out" - ], - "description": "The subscription status for this topic." - } - } - } + "timestamp": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the click occurred." + }, + "userAgent": { + "type": "string", + "description": "User agent string of the browser that clicked the link." } } }, - "UpdateContactTopicsOptions": { + "WebhookEventFailed": { "type": "object", "required": [ - "topics" + "reason" ], "properties": { - "topics": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the topic." - }, - "subscription": { - "type": "string", - "enum": [ - "opt_in", - "opt_out" - ], - "description": "The subscription status (opt_in or opt_out)." - } - } - } + "reason": { + "type": "string", + "description": "Reason for the email failure (e.g., `reached_daily_quota`)." } } }, - "UpdateContactTopicsResponseSuccess": { + "WebhookEventSuppressed": { "type": "object", + "required": [ + "diagnosticCode", + "message", + "reason", + "type" + ], "properties": { - "object": { + "diagnosticCode": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array of SMTP diagnostic responses from the receiving server, one entry per recipient." + }, + "message": { "type": "string", - "description": "The object type.", - "example": "contact_topics" + "description": "Detailed suppression message describing why the email was suppressed." }, - "contact_id": { + "reason": { "type": "string", - "description": "The ID of the contact." + "enum": [ + "previous_bounce", + "previous_complaint" + ], + "description": "Reason the address is suppressed." }, - "topics": { - "type": "array", - "description": "Array of updated topic subscriptions.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the topic." - }, - "subscription": { - "type": "string", - "enum": [ - "opt_in", - "opt_out" - ], - "description": "The subscription status." - } - } - } + "type": { + "type": "string", + "enum": [ + "Suppressed", + "OnAccountSuppressionList" + ], + "description": "Suppression type." } } }, - "LogSummary": { + "WebhookEventAttachment": { "type": "object", + "required": [ + "id" + ], "properties": { "id": { "type": "string", - "format": "uuid", - "description": "The log ID." + "description": "Unique identifier for the attachment." }, - "created_at": { + "filename": { "type": "string", - "format": "date-time", - "description": "The date the log was created." + "description": "The filename of the attachment." }, - "endpoint": { + "content_type": { "type": "string", - "description": "The API endpoint that was called." + "description": "The MIME type of the attachment." }, - "method": { + "content_disposition": { "type": "string", - "enum": [ - "GET", - "POST", - "PUT", - "DELETE", - "PATCH", - "OPTIONS" - ], - "description": "The HTTP method used." - }, - "response_status": { - "type": "integer", - "description": "The HTTP status code of the response." + "description": "The content disposition (e.g., `inline` or `attachment`)." }, - "user_agent": { - "type": [ - "string", - "null" - ], - "description": "The user agent of the request." + "content_id": { + "type": "string", + "description": "Content-ID header used for referencing inline images." } } }, - "Log": { + "WebhookDomainRecord": { "type": "object", + "required": [ + "record", + "name", + "value", + "type", + "ttl", + "status" + ], "properties": { - "object": { - "type": "string", - "description": "Type of the response object.", - "example": "log" - }, - "id": { + "record": { "type": "string", - "format": "uuid", - "description": "The log ID." + "enum": [ + "SPF", + "DKIM", + "Receiving MX", + "Tracking", + "TrackingCAA" + ], + "description": "The purpose of the DNS record (SPF and DKIM for sending; Receiving MX for inbound emails; Tracking and TrackingCAA for click and open tracking)." }, - "created_at": { + "name": { "type": "string", - "format": "date-time", - "description": "The date the log was created." + "description": "DNS record name or subdomain." }, - "endpoint": { + "value": { "type": "string", - "description": "The API endpoint that was called." + "description": "DNS record value to be set." }, - "method": { + "type": { "type": "string", "enum": [ - "GET", - "POST", - "PUT", - "DELETE", - "PATCH", - "OPTIONS" + "MX", + "TXT", + "CNAME", + "CAA" ], - "description": "The HTTP method used." - }, - "response_status": { - "type": "integer", - "description": "The HTTP status code of the response." + "description": "DNS record type." }, - "user_agent": { - "type": [ - "string", - "null" - ], - "description": "The user agent of the request." + "ttl": { + "type": "string", + "description": "Time to live for the DNS record (e.g., `Auto`, `60`)." }, - "request_body": { - "type": [ - "object", - "null" + "status": { + "type": "string", + "enum": [ + "pending", + "verified", + "failed", + "temporary_failure", + "not_started" ], - "description": "The request body sent to the API." + "description": "Verification status of this specific record." }, - "response_body": { - "type": [ - "object", - "null" - ], - "description": "The response body returned by the API." + "priority": { + "type": "integer", + "description": "Priority value (only applicable for MX records)." } } }, - "ListLogsResponse": { + "OutboundEmailEventData": { "type": "object", + "required": [ + "email_id", + "created_at", + "from", + "to", + "subject" + ], "properties": { - "object": { + "email_id": { "type": "string", - "description": "Type of the response object.", - "example": "list" + "description": "Unique identifier for the email." }, - "has_more": { - "type": "boolean", - "description": "Indicates if there are more results available.", - "example": false + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the email was created." }, - "data": { + "from": { + "type": "string", + "description": "Sender email address and name in the format `Name `." + }, + "to": { "type": "array", - "description": "Array containing log information.", "items": { - "$ref": "#/components/schemas/LogSummary" - } + "type": "string" + }, + "description": "Array of impacted recipient email addresses." + }, + "subject": { + "type": "string", + "description": "Email subject line." + }, + "broadcast_id": { + "type": "string", + "description": "Unique identifier for the broadcast campaign, if applicable." + }, + "template_id": { + "type": "string", + "description": "Unique identifier for the template used, if applicable." + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Tag key-value pairs associated with the email." + }, + "headers": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "description": "Custom headers included with the email (omitted when no custom headers are set)." } } }, - "AutomationStep": { - "type": "object", - "description": "A step in an automation workflow. The `config` object varies based on the step `type`.", - "required": [ - "key", - "type", - "config" - ], - "properties": { - "key": { - "type": "string", - "description": "A unique key for this step within the automation graph." + "EmailBouncedEventData": { + "allOf": [ + { + "$ref": "#/components/schemas/OutboundEmailEventData" }, - "type": { - "type": "string", - "enum": [ - "trigger", - "send_email", - "delay", - "wait_for_event", - "condition", - "contact_update", - "contact_delete", - "add_to_segment" + { + "type": "object", + "required": [ + "bounce" ], - "description": "The type of automation step." + "properties": { + "bounce": { + "$ref": "#/components/schemas/WebhookEventBounce" + } + } + } + ] + }, + "EmailClickedEventData": { + "allOf": [ + { + "$ref": "#/components/schemas/OutboundEmailEventData" }, - "config": { + { "type": "object", - "description": "Configuration for the step. Shape depends on `type`: - **trigger**: `{ event_name: string }` - **send_email**: `{ template: { id: string, variables?: object }, subject?: string, from?: string, reply_to?: string }` - **delay**: `{ duration: string }` — a human-readable duration (e.g. `\"30 minutes\"`) - **wait_for_event**: `{ event_name: string, timeout?: string, filter_rule?: object }` — `timeout` is a human-readable duration (e.g. `\"1 hour\"`) - **condition**: A rule tree with `type` (`rule`, `and`, `or`), `field`, `operator`, and `value` - **contact_update**: `{ first_name?: string|object, last_name?: string|object, unsubscribed?: boolean|object, properties?: object }` - **contact_delete**: `{}` - **add_to_segment**: `{ segment_id: string }`\n" + "required": [ + "click" + ], + "properties": { + "click": { + "$ref": "#/components/schemas/WebhookEventClick" + } + } } - } + ] }, - "AutomationStepResponse": { - "type": "object", - "description": "A step as returned when retrieving an automation.", - "properties": { - "key": { - "type": "string", - "description": "The unique key of this step within the automation graph." + "EmailFailedEventData": { + "allOf": [ + { + "$ref": "#/components/schemas/OutboundEmailEventData" }, - "type": { - "type": "string", - "enum": [ - "trigger", - "send_email", - "delay", - "wait_for_event", - "condition", - "contact_update", - "contact_delete", - "add_to_segment" + { + "type": "object", + "required": [ + "failed" ], - "description": "The type of automation step." + "properties": { + "failed": { + "$ref": "#/components/schemas/WebhookEventFailed" + } + } + } + ] + }, + "EmailSuppressedEventData": { + "allOf": [ + { + "$ref": "#/components/schemas/OutboundEmailEventData" }, - "config": { + { "type": "object", - "description": "Configuration for the step. Shape depends on `type`. For `delay` steps, config contains `{ duration: string }` with a human-readable duration (e.g. `\"30 minutes\"`). For `wait_for_event` steps, config contains `{ event_name: string, timeout?: string, filter_rule?: object }` where `timeout` is a human-readable duration.\n" + "required": [ + "suppressed" + ], + "properties": { + "suppressed": { + "$ref": "#/components/schemas/WebhookEventSuppressed" + } + } } - } + ] }, - "AutomationConnection": { + "EmailReceivedEventData": { "type": "object", - "description": "A connection between two steps in the automation graph.", "required": [ + "email_id", + "created_at", "from", - "to" + "to", + "subject", + "message_id", + "bcc", + "cc", + "attachments" ], "properties": { + "email_id": { + "type": "string", + "description": "Unique identifier for the email." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the email was received." + }, "from": { "type": "string", - "description": "The `key` of the source step." + "description": "Sender email address." }, "to": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array of recipient email addresses." + }, + "subject": { "type": "string", - "description": "The `key` of the target step." + "description": "Email subject line." }, - "type": { + "message_id": { "type": "string", - "enum": [ - "default", - "condition_met", - "condition_not_met", - "timeout", - "event_received" - ], - "default": "default", - "description": "The type of connection. Defaults to `default`." + "description": "The unique message ID from the email headers." + }, + "bcc": { + "type": "array", + "items": { + "type": "string" + }, + "description": "BCC recipients." + }, + "cc": { + "type": "array", + "items": { + "type": "string" + }, + "description": "CC recipients." + }, + "attachments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WebhookEventAttachment" + }, + "description": "Array of attachment metadata." } } }, - "CreateAutomationRequest": { + "ContactEventData": { "type": "object", "required": [ - "name", - "steps", - "connections" + "id", + "created_at", + "updated_at", + "email", + "unsubscribed" ], "properties": { - "name": { + "id": { "type": "string", - "minLength": 1, - "description": "The name of the automation." + "description": "Unique identifier for the contact." }, - "status": { + "audience_id": { "type": "string", - "enum": [ - "enabled", - "disabled" - ], - "default": "disabled", - "description": "The initial status of the automation. Defaults to `disabled`." + "description": "Unique identifier for the audience this contact belongs to." }, - "steps": { + "segment_ids": { "type": "array", - "minItems": 1, - "maxItems": 150, - "description": "The steps that compose the automation workflow. Must include at least one `trigger` step.", "items": { - "$ref": "#/components/schemas/AutomationStep" - } + "type": "string" + }, + "description": "Array of segment IDs the contact belongs to." }, - "connections": { - "type": "array", - "description": "The connections between steps in the automation graph.", - "items": { - "$ref": "#/components/schemas/AutomationConnection" - } - } - } - }, - "CreateAutomationResponse": { - "type": "object", - "properties": { - "object": { + "created_at": { "type": "string", - "description": "Type of the response object.", - "example": "automation" + "format": "date-time", + "description": "Timestamp when the contact was created." }, - "id": { + "updated_at": { "type": "string", - "description": "The ID of the created automation." + "format": "date-time", + "description": "Timestamp when the contact was last updated." + }, + "email": { + "type": "string", + "description": "Contact's email address." + }, + "first_name": { + "type": "string", + "description": "Contact's first name." + }, + "last_name": { + "type": "string", + "description": "Contact's last name." + }, + "unsubscribed": { + "type": "boolean", + "description": "Whether the contact has unsubscribed from all emails sent from your team." } } }, - "Automation": { + "DomainEventData": { "type": "object", + "required": [ + "id", + "name", + "status", + "created_at", + "region", + "records" + ], "properties": { - "object": { - "type": "string", - "description": "Type of the response object.", - "example": "automation" - }, "id": { "type": "string", - "description": "The ID of the automation." + "description": "Unique identifier for the domain." }, "name": { "type": "string", - "description": "The name of the automation." + "description": "The domain name (e.g., `example.com`)." }, "status": { "type": "string", "enum": [ - "enabled", - "disabled" + "verified", + "partially_verified", + "partially_failed", + "failed", + "pending", + "not_started" ], - "description": "The current status of the automation." + "description": "Aggregated verification status of the domain." }, "created_at": { "type": "string", - "description": "The date and time the automation was created." + "format": "date-time", + "description": "Timestamp when the domain was created." }, - "updated_at": { + "region": { "type": "string", - "description": "The date and time the automation was last updated." + "enum": [ + "us-east-1", + "eu-west-1", + "sa-east-1", + "ap-northeast-1" + ], + "description": "AWS region where the domain is configured." }, - "steps": { + "records": { "type": "array", - "description": "The steps in the active version of the automation.", "items": { - "$ref": "#/components/schemas/AutomationStepResponse" - } + "$ref": "#/components/schemas/WebhookDomainRecord" + }, + "description": "DNS records required for domain verification." + } + } + }, + "EmailSentEvent": { + "type": "object", + "required": [ + "type", + "created_at", + "data" + ], + "properties": { + "type": { + "type": "string", + "const": "email.sent", + "description": "The event type." }, - "connections": { - "type": "array", - "description": "The connections between steps in the active version of the automation.", - "items": { - "$ref": "#/components/schemas/AutomationConnection" - } + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the event was emitted." + }, + "data": { + "$ref": "#/components/schemas/OutboundEmailEventData" } } }, - "AutomationListItem": { + "EmailDeliveredEvent": { "type": "object", + "required": [ + "type", + "created_at", + "data" + ], "properties": { - "id": { + "type": { "type": "string", - "description": "The ID of the automation." + "const": "email.delivered", + "description": "The event type." }, - "name": { + "created_at": { "type": "string", - "description": "The name of the automation." + "format": "date-time", + "description": "Timestamp when the event was emitted." }, - "status": { + "data": { + "$ref": "#/components/schemas/OutboundEmailEventData" + } + } + }, + "EmailDeliveryDelayedEvent": { + "type": "object", + "required": [ + "type", + "created_at", + "data" + ], + "properties": { + "type": { "type": "string", - "enum": [ - "enabled", - "disabled" - ], - "description": "The current status of the automation." + "const": "email.delivery_delayed", + "description": "The event type." }, "created_at": { "type": "string", - "description": "The date and time the automation was created." + "format": "date-time", + "description": "Timestamp when the event was emitted." }, - "updated_at": { + "data": { + "$ref": "#/components/schemas/OutboundEmailEventData" + } + } + }, + "EmailBouncedEvent": { + "type": "object", + "required": [ + "type", + "created_at", + "data" + ], + "properties": { + "type": { "type": "string", - "description": "The date and time the automation was last updated." + "const": "email.bounced", + "description": "The event type." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the event was emitted." + }, + "data": { + "$ref": "#/components/schemas/EmailBouncedEventData" } } }, - "ListAutomationsResponse": { + "EmailComplainedEvent": { "type": "object", + "required": [ + "type", + "created_at", + "data" + ], "properties": { - "object": { + "type": { "type": "string", - "description": "Type of the response object.", - "example": "list" + "const": "email.complained", + "description": "The event type." }, - "has_more": { - "type": "boolean", - "description": "Indicates if there are more results available." + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the event was emitted." }, "data": { - "type": "array", - "description": "Array of automations.", - "items": { - "$ref": "#/components/schemas/AutomationListItem" - } + "$ref": "#/components/schemas/OutboundEmailEventData" } } }, - "PatchAutomationRequest": { + "EmailOpenedEvent": { "type": "object", - "description": "At least one of `name`, `status`, or `steps` and `connections` must be provided. When updating the workflow graph, both `steps` and `connections` must be provided together.\n", + "required": [ + "type", + "created_at", + "data" + ], "properties": { - "name": { + "type": { "type": "string", - "minLength": 1, - "description": "The name of the automation." + "const": "email.opened", + "description": "The event type." }, - "status": { + "created_at": { "type": "string", - "enum": [ - "enabled", - "disabled" - ], - "description": "The status of the automation." - }, - "steps": { - "type": "array", - "minItems": 1, - "maxItems": 150, - "description": "The steps that compose the automation workflow. Must be provided together with `connections`.", - "items": { - "$ref": "#/components/schemas/AutomationStep" - } + "format": "date-time", + "description": "Timestamp when the event was emitted." }, - "connections": { - "type": "array", - "description": "The connections between steps in the automation graph. Must be provided together with `steps`.", - "items": { - "$ref": "#/components/schemas/AutomationConnection" - } + "data": { + "$ref": "#/components/schemas/OutboundEmailEventData" } } }, - "PatchAutomationResponse": { + "EmailClickedEvent": { "type": "object", + "required": [ + "type", + "created_at", + "data" + ], "properties": { - "object": { + "type": { "type": "string", - "description": "Type of the response object.", - "example": "automation" + "const": "email.clicked", + "description": "The event type." }, - "id": { + "created_at": { "type": "string", - "description": "The ID of the updated automation." + "format": "date-time", + "description": "Timestamp when the event was emitted." + }, + "data": { + "$ref": "#/components/schemas/EmailClickedEventData" } } }, - "DeleteAutomationResponse": { + "EmailFailedEvent": { "type": "object", + "required": [ + "type", + "created_at", + "data" + ], "properties": { - "object": { + "type": { "type": "string", - "description": "Type of the response object.", - "example": "automation" + "const": "email.failed", + "description": "The event type." }, - "id": { + "created_at": { "type": "string", - "description": "The ID of the deleted automation." + "format": "date-time", + "description": "Timestamp when the event was emitted." }, - "deleted": { - "type": "boolean", - "description": "Indicates whether the automation was successfully deleted.", - "example": true + "data": { + "$ref": "#/components/schemas/EmailFailedEventData" } } }, - "StopAutomationResponse": { + "EmailScheduledEvent": { "type": "object", + "required": [ + "type", + "created_at", + "data" + ], "properties": { - "object": { + "type": { "type": "string", - "description": "Type of the response object.", - "example": "automation" + "const": "email.scheduled", + "description": "The event type." }, - "id": { + "created_at": { "type": "string", - "description": "The ID of the stopped automation." + "format": "date-time", + "description": "Timestamp when the event was emitted." }, - "status": { - "type": "string", - "description": "The status of the automation after stopping.", - "example": "disabled" + "data": { + "$ref": "#/components/schemas/OutboundEmailEventData" } } }, - "AutomationRunStep": { + "EmailSuppressedEvent": { "type": "object", - "description": "A step execution within an automation run.", + "required": [ + "type", + "created_at", + "data" + ], "properties": { - "key": { - "type": "string", - "description": "The key of the automation step." - }, "type": { "type": "string", - "enum": [ - "trigger", - "send_email", - "delay", - "wait_for_event", - "condition", - "contact_update", - "contact_delete", - "add_to_segment" - ], - "description": "The type of automation step." - }, - "status": { - "type": "string", - "description": "The execution status of this step." - }, - "started_at": { - "type": [ - "string", - "null" - ], - "description": "The date and time the step started executing." - }, - "completed_at": { - "type": [ - "string", - "null" - ], - "description": "The date and time the step completed executing." - }, - "output": { - "type": [ - "object", - "null" - ], - "description": "The output produced by the step, if any." - }, - "error": { - "type": [ - "object", - "null" - ], - "description": "The error produced by the step, if any." + "const": "email.suppressed", + "description": "The event type." }, "created_at": { "type": "string", - "description": "The date and time the step record was created." + "format": "date-time", + "description": "Timestamp when the event was emitted." + }, + "data": { + "$ref": "#/components/schemas/EmailSuppressedEventData" } } }, - "AutomationRun": { + "EmailReceivedEvent": { "type": "object", + "required": [ + "type", + "created_at", + "data" + ], "properties": { - "object": { + "type": { "type": "string", - "description": "Type of the response object.", - "example": "automation_run" + "const": "email.received", + "description": "The event type." }, - "id": { + "created_at": { "type": "string", - "description": "The ID of the automation run." + "format": "date-time", + "description": "Timestamp when the event was emitted." }, - "status": { + "data": { + "$ref": "#/components/schemas/EmailReceivedEventData" + } + } + }, + "ContactCreatedEvent": { + "type": "object", + "required": [ + "type", + "created_at", + "data" + ], + "properties": { + "type": { "type": "string", - "enum": [ - "running", - "completed", - "failed", - "cancelled" - ], - "description": "The current status of the automation run." - }, - "started_at": { - "type": [ - "string", - "null" - ], - "description": "The date and time the run started." - }, - "completed_at": { - "type": [ - "string", - "null" - ], - "description": "The date and time the run completed." + "const": "contact.created", + "description": "The event type." }, "created_at": { "type": "string", - "description": "The date and time the run was created." + "format": "date-time", + "description": "Timestamp when the event was emitted." }, - "steps": { - "type": "array", - "description": "The steps executed in this run, sorted in graph order.", - "items": { - "$ref": "#/components/schemas/AutomationRunStep" - } + "data": { + "$ref": "#/components/schemas/ContactEventData" } } }, - "AutomationRunListItem": { + "ContactUpdatedEvent": { "type": "object", + "required": [ + "type", + "created_at", + "data" + ], "properties": { - "id": { - "type": "string", - "description": "The ID of the automation run." - }, - "status": { + "type": { "type": "string", - "enum": [ - "running", - "completed", - "failed", - "cancelled" - ], - "description": "The current status of the automation run." - }, - "started_at": { - "type": [ - "string", - "null" - ], - "description": "The date and time the run started." - }, - "completed_at": { - "type": [ - "string", - "null" - ], - "description": "The date and time the run completed." + "const": "contact.updated", + "description": "The event type." }, "created_at": { "type": "string", - "description": "The date and time the run was created." + "format": "date-time", + "description": "Timestamp when the event was emitted." + }, + "data": { + "$ref": "#/components/schemas/ContactEventData" } } }, - "ListAutomationRunsResponse": { + "ContactDeletedEvent": { "type": "object", + "required": [ + "type", + "created_at", + "data" + ], "properties": { - "object": { + "type": { "type": "string", - "description": "Type of the response object.", - "example": "list" + "const": "contact.deleted", + "description": "The event type." }, - "has_more": { - "type": "boolean", - "description": "Indicates if there are more results available." + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the event was emitted." }, "data": { - "type": "array", - "description": "Array of automation runs.", - "items": { - "$ref": "#/components/schemas/AutomationRunListItem" - } + "$ref": "#/components/schemas/ContactEventData" } } }, - "Event": { + "DomainCreatedEvent": { "type": "object", + "required": [ + "type", + "created_at", + "data" + ], "properties": { - "object": { + "type": { "type": "string", - "description": "Type of the response object.", - "example": "event" + "const": "domain.created", + "description": "The event type." }, - "id": { + "created_at": { "type": "string", - "format": "uuid", - "description": "The event ID." + "format": "date-time", + "description": "Timestamp when the event was emitted." }, - "name": { + "data": { + "$ref": "#/components/schemas/DomainEventData" + } + } + }, + "DomainUpdatedEvent": { + "type": "object", + "required": [ + "type", + "created_at", + "data" + ], + "properties": { + "type": { "type": "string", - "description": "The event name." - }, - "schema": { - "type": [ - "object", - "null" - ], - "description": "A flat key/type map defining the event payload schema. Supported types are `string`, `number`, `boolean`, and `date`." + "const": "domain.updated", + "description": "The event type." }, "created_at": { "type": "string", - "description": "The date and time the event was created." + "format": "date-time", + "description": "Timestamp when the event was emitted." }, - "updated_at": { - "type": [ - "string", - "null" - ], - "description": "The date and time the event was last updated." + "data": { + "$ref": "#/components/schemas/DomainEventData" } } }, - "EventSummary": { + "DomainDeletedEvent": { "type": "object", + "required": [ + "type", + "created_at", + "data" + ], "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The event ID." - }, - "name": { + "type": { "type": "string", - "description": "The event name." - }, - "schema": { - "type": [ - "object", - "null" - ], - "description": "A flat key/type map defining the event payload schema. Supported types are `string`, `number`, `boolean`, and `date`." + "const": "domain.deleted", + "description": "The event type." }, "created_at": { "type": "string", - "description": "The date and time the event was created." + "format": "date-time", + "description": "Timestamp when the event was emitted." }, - "updated_at": { - "type": [ - "string", - "null" - ], - "description": "The date and time the event was last updated." + "data": { + "$ref": "#/components/schemas/DomainEventData" } } }, - "CreateEventRequest": { + "CreateSuppressionOptions": { "type": "object", "required": [ - "name" + "email" ], "properties": { - "name": { + "email": { "type": "string", - "description": "The name of the event. Cannot start with the reserved `resend:` prefix." - }, - "schema": { - "type": [ - "object", - "null" - ], - "description": "An optional flat key/type map defining the event payload schema. Supported types are `string`, `number`, `boolean`, and `date`." + "description": "Email address to suppress.", + "example": "steve.wozniak@gmail.com" } } }, - "CreateEventResponse": { + "CreateSuppressionResponseSuccess": { "type": "object", "properties": { "object": { "type": "string", "description": "Type of the response object.", - "example": "event" + "example": "suppression" }, "id": { "type": "string", - "format": "uuid", - "description": "The ID of the created event." + "description": "Unique identifier for the created suppression.", + "example": "e169aa45-1ecf-4183-9955-b1499d5701d3" } } }, - "ListEventsResponse": { + "BatchAddSuppressionsOptions": { + "type": "object", + "required": [ + "emails" + ], + "properties": { + "emails": { + "type": "array", + "minItems": 1, + "maxItems": 100, + "items": { + "type": "string" + }, + "description": "Email addresses to suppress.", + "example": [ + "steve.wozniak@gmail.com" + ] + } + } + }, + "BatchAddSuppressionsResponseSuccess": { "type": "object", "properties": { - "object": { - "type": "string", - "description": "Type of the response object.", - "example": "list" - }, - "has_more": { - "type": "boolean", - "description": "Indicates if there are more results available.", - "example": false - }, "data": { "type": "array", - "description": "Array containing event information.", + "description": "Array containing the created suppressions.", "items": { - "$ref": "#/components/schemas/EventSummary" + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "Type of the object.", + "example": "suppression" + }, + "id": { + "type": "string", + "description": "Unique identifier for the suppression.", + "example": "e169aa45-1ecf-4183-9955-b1499d5701d3" + } + } } } } }, - "UpdateEventRequest": { + "BatchRemoveSuppressionsOptions": { "type": "object", - "required": [ - "schema" - ], + "description": "Provide either `emails` or `ids`, but not both.", "properties": { - "schema": { - "type": [ - "object", - "null" - ], - "description": "A flat key/type map defining the event payload schema. Set to `null` to clear the schema. Supported types are `string`, `number`, `boolean`, and `date`." + "emails": { + "type": "array", + "minItems": 1, + "maxItems": 100, + "items": { + "type": "string" + }, + "description": "Email addresses to remove from the suppression list.", + "example": [ + "steve.wozniak@gmail.com" + ] + }, + "ids": { + "type": "array", + "minItems": 1, + "maxItems": 100, + "items": { + "type": "string" + }, + "description": "Suppression IDs to remove from the suppression list.", + "example": [ + "e169aa45-1ecf-4183-9955-b1499d5701d3" + ] } } }, - "UpdateEventResponse": { + "BatchRemoveSuppressionsResponseSuccess": { "type": "object", "properties": { - "object": { - "type": "string", - "description": "Type of the response object.", - "example": "event" - }, - "id": { - "type": "string", - "format": "uuid", - "description": "The ID of the updated event." + "data": { + "type": "array", + "description": "Array containing the removed suppressions.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "Type of the object.", + "example": "suppression" + }, + "id": { + "type": "string", + "description": "Unique identifier for the suppression.", + "example": "e169aa45-1ecf-4183-9955-b1499d5701d3" + }, + "deleted": { + "type": "boolean", + "description": "Indicates whether the suppression was successfully deleted.", + "example": true + } + } + } } } }, - "RemoveEventResponse": { + "RemoveSuppressionResponseSuccess": { "type": "object", "properties": { "object": { "type": "string", "description": "Type of the response object.", - "example": "event" + "example": "suppression" }, "id": { "type": "string", - "format": "uuid", - "description": "The ID of the deleted event." + "description": "Unique identifier for the removed suppression.", + "example": "e169aa45-1ecf-4183-9955-b1499d5701d3" }, "deleted": { "type": "boolean", - "description": "Indicates whether the event was deleted.", + "description": "Indicates whether the suppression was successfully deleted.", "example": true } } }, - "SendEventRequest": { + "GetSuppressionResponseSuccess": { "type": "object", - "required": [ - "event" - ], "properties": { - "event": { + "object": { "type": "string", - "description": "The name of the event to send." + "description": "Type of the response object.", + "example": "suppression" }, - "contact_id": { + "id": { "type": "string", - "format": "uuid", - "description": "The ID of the contact to associate with this event. Exactly one of `contact_id` or `email` must be provided." + "description": "Unique identifier for the suppression.", + "example": "e169aa45-1ecf-4183-9955-b1499d5701d3" }, "email": { "type": "string", - "format": "email", - "description": "The email address to associate with this event. Exactly one of `contact_id` or `email` must be provided." + "description": "Email address that is suppressed.", + "example": "steve.wozniak@gmail.com" }, - "payload": { - "type": "object", - "additionalProperties": true, - "description": "An optional payload of key/value pairs to include with the event." + "origin": { + "type": "string", + "enum": [ + "bounce", + "complaint", + "manual" + ], + "description": "Origin of the suppression.", + "example": "manual" + }, + "source_id": { + "type": "string", + "nullable": true, + "description": "Identifier of the event that caused the suppression, such as the email that bounced or complained.", + "example": "479e3145-dd38-476b-932c-529ceb705947" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the suppression was created.", + "example": "2023-10-06T23:47:56.678Z" } } }, - "SendEventResponse": { + "ListSuppressionsResponseSuccess": { "type": "object", "properties": { "object": { "type": "string", "description": "Type of the response object.", - "example": "event" + "example": "list" }, - "event": { - "type": "string", - "description": "The name of the event that was sent." + "has_more": { + "type": "boolean", + "description": "Indicates if there are more results available." + }, + "data": { + "type": "array", + "description": "Array containing suppression information.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the suppression.", + "example": "e169aa45-1ecf-4183-9955-b1499d5701d3" + }, + "email": { + "type": "string", + "description": "Email address that is suppressed.", + "example": "steve.wozniak@gmail.com" + }, + "origin": { + "type": "string", + "enum": [ + "bounce", + "complaint", + "manual" + ], + "description": "Origin of the suppression.", + "example": "manual" + }, + "source_id": { + "type": "string", + "nullable": true, + "description": "Identifier of the event that caused the suppression, such as the email that bounced or complained.", + "example": "479e3145-dd38-476b-932c-529ceb705947" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp indicating when the suppression was created.", + "example": "2023-10-06T23:47:56.678Z" + } + } + } } } }