diff --git a/.github/workflows/create-release-transactional.yml b/.github/workflows/create-release-transactional.yml index a3b46a2..3d2f211 100644 --- a/.github/workflows/create-release-transactional.yml +++ b/.github/workflows/create-release-transactional.yml @@ -456,19 +456,11 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GIT_HUB_TOKEN }} SPEC_VERSION: ${{ needs.validate.outputs.version }} - continue-on-error: true # temp - name: Publish → npm → transactional-node if: env.PUBLISH_EXTERNAL == 'true' working-directory: transactional-node - run: NODE_AUTH_TOKEN="" npm publish --access public - continue-on-error: true # temp - - - name: Upload NPM logs - uses: actions/upload-artifact@v4 - with: - name: npm-logs - path: /home/runner/.npm/_logs/ + run: NODE_AUTH_TOKEN="" npm publish --access public # must set token to empty string to use OIDC. See https://github.com/actions/setup-node/issues/1440 publish-php: runs-on: ubuntu-latest diff --git a/spec/transactional.json b/spec/transactional.json index 1eea5f5..50a4333 100644 --- a/spec/transactional.json +++ b/spec/transactional.json @@ -191,7 +191,7 @@ }, "swagger": "2.0", "info": { - "version": "1.3.2", + "version": "1.3.3", "title": "Mailchimp Transactional API", "contact": { "name": "API Support", @@ -3310,8 +3310,13 @@ "description": "the full SMS content to be sent" }, "to": { - "type": "string", - "description": "the phone number to send the SMS message to" + "type": "array", + "description": "the phone numbers to send the SMS message to", + "items": { + "type": "string", + "description": "a single recipient's phone number", + "example": "+10000000000" + } }, "from": { "type": "string", @@ -3329,6 +3334,10 @@ } } } + }, + "async": { + "type": "boolean", + "description": "enable a background sending mode that is optimized for bulk sending. In async mode, messages/send-sms will immediately return a status of \"queued\" for every recipient. To handle rejections when sending in async mode, set up a webhook for the 'reject' event. Defaults to false for messages with no more than 10 recipients; messages with more than 10 recipients are always sent asynchronously, regardless of the value of async." } } } @@ -3362,8 +3371,29 @@ }, "reject_reason": { "type": "string", - "description": "The reason for the rejection if the recipient status is rejected", - "example": null + "description": "the reason for the rejection if the recipient status is \"rejected\"", + "enum": [ + "hard-bounce", + "soft-bounce", + "spam", + "unsub", + "custom", + "invalid-sender", + "invalid", + "test-mode-limit", + "unsigned", + "rule" + ], + "example": "hard-bounce" + }, + "queue_reason": { + "type": "string", + "description": "The reason for the queueing if the recipient status is queued", + "enum": [ + "multiple recipients", + "async requested by user" + ], + "example": "multiple recipients" }, "_id": { "type": "string", diff --git a/spec/transactional.openapi.json b/spec/transactional.openapi.json index 8345bdf..13563f2 100644 --- a/spec/transactional.openapi.json +++ b/spec/transactional.openapi.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "Mailchimp Transactional API", - "version": "1.3.0" + "version": "1.3.3" }, "servers": [ { @@ -4913,206 +4913,158 @@ } } }, - "/mctemplates/info": { + "/inbound/domains": { "post": { "tags": [ - "Mailchimp Transactional Templates" + "Inbound" ], - "summary": "Get Mailchimp Transactional template information", - "description": "Returns complete information about a Mailchimp Transactional template including draft and published versions", - "operationId": "mctemplates/info", + "summary": "List inbound domains", + "description": "List the domains that have been configured for inbound delivery.", + "operationId": "inbound/domains", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "required": [ - "key", - "mc_template_id" - ], - "properties": { - "key": { - "description": "Valid API key", - "type": "string", - "example": "12345" - }, - "mc_template_id": { - "description": "Mailchimp template ID", - "type": "integer", - "example": 12345 - } - }, - "type": "object" + "$ref": "#/components/schemas/ApiKey" } } } }, "responses": { "200": { - "description": "Template information retrieved successfully", + "description": "The inbound domains associated with the account", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/McTemplateResponse" + "type": "array", + "items": { + "$ref": "#/components/schemas/InboundDomain" + } } } } }, "401": { - "description": "Invalid API key" - }, - "404": { - "description": "Template not found" + "description": "Invalid API key", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } }, - "/mctemplates/list": { + "/inbound/add-domain": { "post": { "tags": [ - "Mailchimp Transactional Templates" + "Inbound" ], - "summary": "List Mailchimp Transactional templates", - "description": "Returns a list of all Mailchimp Transactional templates for the authenticated user", - "operationId": "mctemplates/list", + "summary": "Add inbound domain", + "description": "Add an inbound domain to your account.", + "operationId": "inbound/add-domain", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "required": [ - "key" - ], - "properties": { - "key": { - "description": "Valid API key", - "type": "string", - "example": "\"\"" + "allOf": [ + { + "$ref": "#/components/schemas/ApiKey" }, - "search_query": { - "description": "Optional search query to filter templates", - "type": [ - "string", - "null" + { + "required": [ + "domain" ], - "example": "\"\"" + "properties": { + "domain": { + "description": "A domain name for inbound email delivery", + "type": "string", + "example": "inbound.example.com" + } + }, + "type": "object" } - }, - "type": "object" + ] } } } }, "responses": { "200": { - "description": "List of templates retrieved successfully", + "description": "Information about the domain", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/McTemplateResponse" - } + "$ref": "#/components/schemas/InboundDomain" } } } }, "401": { - "description": "Invalid API key" + "description": "Invalid API key", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } }, - "/mctemplates/render": { + "/inbound/check-domain": { "post": { "tags": [ - "Mailchimp Transactional Templates" + "Inbound" ], - "summary": "Render a Mailchimp Transactional template", - "description": "Renders a Mailchimp Transactional template with optional merge variables", - "operationId": "mctemplates/render", + "summary": "Check domain settings", + "description": "Check the MX settings for an inbound domain. The domain must have already been added with the add-domain call.", + "operationId": "inbound/check-domain", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "required": [ - "key", - "mc_template_id" - ], - "properties": { - "key": { - "description": "Valid API key", - "type": "string", - "example": "12345" - }, - "mc_template_id": { - "description": "Mailchimp template ID", - "type": "integer", - "example": 12345 - }, - "mc_template_version": { - "description": "Template version - \"published\" or \"draft\". Note: requesting \"published\" when the template has not been published will return a 404 error.", - "type": "string", - "default": "published", - "enum": [ - "published", - "draft" - ], - "example": "12345" + "allOf": [ + { + "$ref": "#/components/schemas/ApiKey" }, - "merge_vars": { - "description": "Merge variables to inject into template", - "type": [ - "array", - "null" + { + "required": [ + "domain" ], - "items": { - "properties": { - "name": { - "description": "Variable name", - "type": "string", - "example": "FIRSTNAME" - }, - "content": { - "description": "Variable value", - "type": "string", - "example": "John" - } - }, - "type": "object" + "properties": { + "domain": { + "description": "An existing inbound domain", + "type": "string", + "example": "inbound.example.com" + } }, - "example": "12345" + "type": "object" } - }, - "type": "object" + ] } } } }, "responses": { "200": { - "description": "Template rendered successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/McTemplateRenderResponse" - } - } - } - }, - "400": { - "description": "MC_Exception_ValidationError: Invalid mc_template_version parameter", + "description": "Information about the inbound domain", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "$ref": "#/components/schemas/InboundDomain" } } } }, "401": { - "description": "Invalid_Key: Invalid API key", + "description": "Invalid API key", "content": { "application/json": { "schema": { @@ -5122,7 +5074,7 @@ } }, "404": { - "description": "Unknown_Template: Template not found", + "description": "Unknown inbound domain", "content": { "application/json": { "schema": { @@ -5134,107 +5086,128 @@ } } }, - "/mctemplates/time-series": { + "/inbound/delete-domain": { "post": { "tags": [ - "Mailchimp Transactional Templates" + "Inbound" ], - "summary": "Get Mailchimp Transactional template time series", - "description": "Returns hourly stats for the last 30 days for a Mailchimp Transactional template. Returns an empty array if the template exists but has never been used to send messages.", - "operationId": "mctemplates/time-series", + "summary": "Delete inbound domain", + "description": "Delete an inbound domain from the account. All mail will stop routing for this domain immediately.", + "operationId": "inbound/delete-domain", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "required": [ - "key", - "mc_template_id" - ], - "properties": { - "key": { - "description": "Valid API key", - "type": "string", - "example": "12345" + "allOf": [ + { + "$ref": "#/components/schemas/ApiKey" }, - "mc_template_id": { - "description": "Mailchimp template ID", - "type": "integer", - "example": 12345 + { + "required": [ + "domain" + ], + "properties": { + "domain": { + "description": "An existing inbound domain", + "type": "string", + "example": "inbound.example.com" + } + }, + "type": "object" } - }, - "type": "object" + ] } } } }, "responses": { "200": { - "description": "Time series data retrieved successfully (may be empty array if template never used)", + "description": "Information about the deleted domain", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TagTimeSeries" - } + "$ref": "#/components/schemas/InboundDomain" } } } }, "401": { - "description": "Invalid API key" + "description": "Invalid API key", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } }, "404": { - "description": "Template not found" - } - } - } - }, - "/messages/send": { - "post": { + "description": "Unknown inbound domain", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/inbound/routes": { + "post": { "tags": [ - "Messages" + "Inbound" ], - "summary": "Send a new transactional message through the Transactional API.", - "description": "Send a new transactional message through Mandrill\n\n\n \n \n \n \n \n \n
Note
\n If you signed up for a Mandrill account on or after December 1st, 2015, you must add SPF and DKIM records and verify ownership of your sending domains before you can send email through your account. Mandrill will not send any email from unverified domains or domains without valid SPF and DKIM records, including public domains like gmail.com, yahoo.com, and more.

Custom signing domains are only available to Mandrill accounts created before December 1st, 2015. If you signed up for a new Mandrill account on or after December 1st, 2015, the signing_domain parameter will be ignored.

Mail sent from unverified domains or domains without valid SPF and DKIM records will be rejected with the reject_reason, unsigned.

Learn more about SPF and DKIM, and domain verification\n
", - "operationId": "messages/send", + "summary": "List routes", + "description": "List the routes defined for an inbound domain or SMS program. Provide either domain or phone (not both).", + "operationId": "inbound/routes", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessagesSendRequest" + "allOf": [ + { + "$ref": "#/components/schemas/ApiKey" + }, + { + "properties": { + "domain": { + "description": "The domain to check (required if phone is not provided)", + "type": "string", + "example": "inbound.example.com" + }, + "phone": { + "description": "The SMS program phone number (required if domain is not provided)", + "type": "string", + "example": "+16505551234" + } + }, + "type": "object" + } + ] } } } }, "responses": { "200": { - "description": "an array of objects for each recipient containing the key \"email\" with the email address, and details of the message status for that recipient", + "description": "The routes associated with the domain or phone", "content": { "application/json": { "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/MessagesSendResponse" + "$ref": "#/components/schemas/InboundRoute" } } } } }, "401": { - "description": "Invalid_Key: Invalid API key", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "402": { - "description": "MC_Exception_PaymentRequired: Payment required", + "description": "Invalid API key", "content": { "application/json": { "schema": { @@ -5244,7 +5217,7 @@ } }, "404": { - "description": "Unknown_Subaccount: Subaccount not found", + "description": "Unknown inbound domain or SMS program", "content": { "application/json": { "schema": { @@ -5256,50 +5229,70 @@ } } }, - "/messages/send-template": { + "/inbound/add-route": { "post": { "tags": [ - "Messages" + "Inbound" ], - "summary": "Send a new transactional message using a template", - "description": "Send a new transactional message using a template. If you signed up for a Mandrill account on or after December 1st, 2015, you must add SPF and DKIM records and verify ownership of your sending domains before you can send email through your account. Mandrill will not send any email from unverified domains or domains without valid SPF and DKIM records, including public domains like gmail.com, yahoo.com, and more. Custom signing domains are only available to Mandrill accounts created before December 1st, 2015. If you signed up for a new Mandrill account on or after December 1st, 2015, the signing_domain parameter will be ignored. Mail sent from unverified domains or domains without valid SPF and DKIM records will be rejected with the reject_reason, unsigned.", - "operationId": "messages/send-template", + "summary": "Add route", + "description": "Add a new route to an inbound domain or SMS program. Provide either domain or phone (not both).", + "operationId": "inbound/add-route", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessagesSendTemplateRequest" + "allOf": [ + { + "$ref": "#/components/schemas/ApiKey" + }, + { + "required": [ + "url" + ], + "properties": { + "domain": { + "description": "An existing inbound domain (required if phone is not provided)", + "type": "string", + "example": "inbound.example.com" + }, + "phone": { + "description": "The SMS program phone number - the TO number that receives inbound SMS (required if domain is not provided)", + "type": "string", + "example": "+16505551234" + }, + "pattern": { + "description": "For email: the mailbox pattern (e.g., \"mailbox-*\"). For SMS: not used, the phone number is the pattern.", + "type": "string", + "example": "mailbox-*" + }, + "url": { + "description": "The webhook URL where the inbound messages will be published", + "type": "string", + "format": "uri", + "example": "https://example.com/webhook-url" + } + }, + "type": "object" + } + ] } } } }, "responses": { "200": { - "description": "Per-recipient send results", + "description": "The added route information", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MessagesSendResponse" - } + "$ref": "#/components/schemas/InboundRoute" } } } }, "401": { - "description": "Invalid_Key: Invalid API key", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "402": { - "description": "MC_Exception_PaymentRequired: Payment required", + "description": "Invalid API key", "content": { "application/json": { "schema": { @@ -5309,82 +5302,83 @@ } }, "404": { - "description": "Error 404", + "description": "Unknown inbound domain or SMS program", "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/ErrorResponse", - "description": "Unknown_Template: Template not found" - }, - { - "$ref": "#/components/schemas/ErrorResponse", - "description": "Unknown_Subaccount: Subaccount not found" - } - ] + "$ref": "#/components/schemas/ErrorResponse" } } } } - }, - "x-readonly": true + } } }, - "/messages/send-mc-template": { + "/inbound/update-route": { "post": { "tags": [ - "Messages" + "Inbound" ], - "summary": "Send a new transactional message using a Mailchimp Transactional template", - "description": "Send a new transactional message using a Mailchimp Transactional template. If you signed up for a Mandrill account on or after December 1st, 2015, you must add SPF and DKIM records and verify ownership of your sending domains before you can send email through your account.", - "operationId": "messages/send-mc-template", + "summary": "Update mailbox route", + "description": "Update the pattern or webhook of an existing inbound mailbox route. If null is provided for any fields, the values will remain unchanged.", + "operationId": "inbound/update-route", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessagesSendMcTemplateRequest" + "allOf": [ + { + "$ref": "#/components/schemas/ApiKey" + }, + { + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The unique identifier of an existing mailbox route", + "type": "string", + "example": "88.2144614" + }, + "pattern": { + "description": "For email: The search pattern that the mailbox name should match. For SMS: the sender's phone number (FROM number). Null to leave unchanged", + "type": [ + "string", + null + ], + "example": "*.*" + }, + "url": { + "description": "The webhook URL where the inbound messages will be published (null to leave unchanged)", + "type": [ + "string", + null + ], + "format": "uri", + "example": "https://example.com/webhook-url" + } + }, + "type": "object" + } + ] } } } }, "responses": { "200": { - "description": "Per-recipient send results", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MessagesSendResponse" - } - } - } - } - }, - "400": { - "description": "MC_Exception_ValidationError: Validation error", + "description": "The updated mailbox route information", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "$ref": "#/components/schemas/InboundRoute" } } } }, "401": { - "description": "Invalid_Key: Invalid API key", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "402": { - "description": "MC_Exception_PaymentRequired: Payment required", + "description": "Invalid API key", "content": { "application/json": { "schema": { @@ -5394,126 +5388,66 @@ } }, "404": { - "description": "Error 404", + "description": "Unknown inbound route", "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/ErrorResponse", - "description": "Unknown_Template: Template not found" - }, - { - "$ref": "#/components/schemas/ErrorResponse", - "description": "Unknown_Subaccount: Subaccount not found" - } - ] + "$ref": "#/components/schemas/ErrorResponse" } } } } - }, - "x-readonly": true + } } }, - "/messages/search": { + "/inbound/delete-route": { "post": { "tags": [ - "Messages" + "Inbound" ], - "summary": "Search recently sent messages", - "description": "Search recently sent messages and optionally narrow by date range, tags, senders, and API keys. Results can include both email and SMS messages. If no date range is specified, results within the last 7 days are returned.", - "operationId": "messages/search", + "summary": "Delete mailbox route", + "description": "Delete an existing inbound mailbox route.", + "operationId": "inbound/delete-route", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessagesSearchRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Messages matching the search query (can include both email and SMS messages)", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/MessageInfoResponse", - "description": "Email message search result" - }, - { - "$ref": "#/components/schemas/SmsInfoResponse", - "description": "SMS message search result" + "allOf": [ + { + "$ref": "#/components/schemas/ApiKey" + }, + { + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The unique identifier of an existing route", + "type": "string", + "example": "88.214614" } - ] + }, + "type": "object" } - } - } - } - }, - "401": { - "description": "Invalid_Key: Invalid API key", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "503": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - } - } - } - }, - "/messages/search-time-series": { - "post": { - "tags": [ - "Messages" - ], - "summary": "Get time series data for message search", - "description": "Search the content of recently sent messages and return the aggregated hourly stats for matching messages.", - "operationId": "messages/search-time-series", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MessagesSearchTimeSeriesRequest" + ] } } } }, "responses": { "200": { - "description": "Hourly stats for matching messages", + "description": "The deleted mailbox route information", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MessageSearchTimeSeriesResponse" - } + "$ref": "#/components/schemas/InboundRoute" } } } }, "401": { - "description": "Invalid_Key: Invalid API key", + "description": "Invalid API key", "content": { "application/json": { "schema": { @@ -5522,8 +5456,8 @@ } } }, - "503": { - "description": "Service unavailable", + "404": { + "description": "Unknown inbound route", "content": { "application/json": { "schema": { @@ -5532,50 +5466,96 @@ } } } - }, - "x-readonly": true + } } }, - "/messages/info": { + "/inbound/send-raw": { "post": { "tags": [ - "Messages" + "Inbound" ], - "summary": "Get information about a single sent message", - "description": "Returns detailed information about a single sent message. Can return either email or SMS message information depending on the message type.", - "operationId": "messages/info", + "summary": "Send mime document", + "description": "Take a raw MIME document destined for a domain with inbound domains set up, and send it to the inbound hook exactly as if it had been sent over SMTP.", + "operationId": "inbound/send-raw", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessagesInfoRequest" + "allOf": [ + { + "$ref": "#/components/schemas/ApiKey" + }, + { + "required": [ + "raw_message" + ], + "properties": { + "raw_message": { + "description": "The full MIME document of an email message", + "type": "string", + "example": "From: sender@example.com\\nTo: mailbox-123@inbound.example.com\\nSubject: Some Subject\\n\\nSome content." + }, + "to": { + "description": "Optionally define the recipients to receive the message - otherwise we'll use the To, Cc, and Bcc headers provided in the document", + "type": [ + "array", + null + ], + "items": { + "type": "string", + "format": "email" + }, + "example": [ + "mailbox-123@inbound.example.com" + ] + }, + "mail_from": { + "description": "The address specified in the MAIL FROM stage of the SMTP conversation", + "type": [ + "string", + null + ], + "format": "email", + "example": "sender@example.com" + }, + "helo": { + "description": "The hostname provided during HELO", + "type": [ + "string", + null + ], + "example": "sender.example.com" + }, + "client_address": { + "description": "The remote host's IP address", + "type": [ + "string", + null + ], + "example": "192.168.1.100" + } + }, + "type": "object" + } + ] } } } }, "responses": { "200": { - "description": "Information about the message (email or SMS)", + "description": "Processing results for each recipient or null if no recipients processed", "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/MessageInfoResponse", - "description": "Email message information" - }, - { - "$ref": "#/components/schemas/SmsInfoResponse", - "description": "SMS message information" - } - ] + "$ref": "#/components/schemas/SendRawResponse" } } } }, "401": { - "description": "Invalid_Key: Invalid API key", + "description": "Invalid API key", "content": { "application/json": { "schema": { @@ -5585,7 +5565,7 @@ } }, "404": { - "description": "Unknown_Message: Message not found", + "description": "Unknown inbound domain", "content": { "application/json": { "schema": { @@ -5594,159 +5574,199 @@ } } } - }, - "x-readonly": true + } } }, - "/messages/content": { + "/mctemplates/info": { "post": { "tags": [ - "Messages" + "Mailchimp Transactional Templates" ], - "summary": "Get the full content of a sent message", - "description": "Returns the full content of a recently sent message. For email messages, includes HTML, text, and attachments. For SMS messages, includes text content and SMS-specific fields.", - "operationId": "messages/content", + "summary": "Get Mailchimp Transactional template information", + "description": "Returns complete information about a Mailchimp Transactional template including draft and published versions", + "operationId": "mctemplates/info", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessagesContentRequest" + "required": [ + "key", + "mc_template_id" + ], + "properties": { + "key": { + "description": "Valid API key", + "type": "string", + "example": "12345" + }, + "mc_template_id": { + "description": "Mailchimp template ID", + "type": "integer", + "example": 12345 + } + }, + "type": "object" } } } }, "responses": { "200": { - "description": "The content of the message (email or SMS)", + "description": "Template information retrieved successfully", "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/MessageContentResponse", - "description": "Email message content" - }, - { - "$ref": "#/components/schemas/SmsContentResponse", - "description": "SMS message content" - } - ] + "$ref": "#/components/schemas/McTemplateResponse" } } } }, "401": { - "description": "Invalid_Key: Invalid API key", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "description": "Invalid API key" }, "404": { - "description": "Unknown_Message: Message not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "description": "Template not found" } - }, - "x-readonly": true + } } }, - "/messages/parse": { + "/mctemplates/list": { "post": { "tags": [ - "Messages" + "Mailchimp Transactional Templates" ], - "summary": "Parse a MIME message", - "description": "Parse the full MIME document for an email message, returning the content of the message broken into its constituent pieces.", - "operationId": "messages/parse", + "summary": "List Mailchimp Transactional templates", + "description": "Returns a list of all Mailchimp Transactional templates for the authenticated user", + "operationId": "mctemplates/list", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessagesParseRequest" + "required": [ + "key" + ], + "properties": { + "key": { + "description": "Valid API key", + "type": "string", + "example": "\"\"" + }, + "search_query": { + "description": "Optional search query to filter templates", + "type": [ + "string", + "null" + ], + "example": "\"\"" + } + }, + "type": "object" } } } }, "responses": { "200": { - "description": "The parsed message content", + "description": "List of templates retrieved successfully", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageParseResponse" + "type": "array", + "items": { + "$ref": "#/components/schemas/McTemplateResponse" + } } } } }, "401": { - "description": "Invalid_Key: Invalid API key", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "422": { - "description": "Validation error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "description": "Invalid API key" } - }, - "x-readonly": true + } } }, - "/messages/send-raw": { + "/mctemplates/render": { "post": { "tags": [ - "Messages" + "Mailchimp Transactional Templates" ], - "summary": "Send a raw MIME message through Mandrill", - "description": "Send a raw MIME document for a message, and send it exactly as if it were sent through Mandrill's SMTP servers.", - "operationId": "messages/send-raw", + "summary": "Render a Mailchimp Transactional template", + "description": "Renders a Mailchimp Transactional template with optional merge variables", + "operationId": "mctemplates/render", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessagesSendRawRequest" + "required": [ + "key", + "mc_template_id" + ], + "properties": { + "key": { + "description": "Valid API key", + "type": "string", + "example": "12345" + }, + "mc_template_id": { + "description": "Mailchimp template ID", + "type": "integer", + "example": 12345 + }, + "mc_template_version": { + "description": "Template version - \"published\" or \"draft\". Note: requesting \"published\" when the template has not been published will return a 404 error.", + "type": "string", + "default": "published", + "enum": [ + "published", + "draft" + ], + "example": "12345" + }, + "merge_vars": { + "description": "Merge variables to inject into template", + "type": [ + "array", + "null" + ], + "items": { + "properties": { + "name": { + "description": "Variable name", + "type": "string", + "example": "FIRSTNAME" + }, + "content": { + "description": "Variable value", + "type": "string", + "example": "John" + } + }, + "type": "object" + }, + "example": "12345" + } + }, + "type": "object" } } } }, "responses": { "200": { - "description": "Per-recipient send results", + "description": "Template rendered successfully", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MessagesSendResponse" - } + "$ref": "#/components/schemas/McTemplateRenderResponse" } } } }, - "401": { - "description": "Invalid_Key: Invalid API key", + "400": { + "description": "MC_Exception_ValidationError: Invalid mc_template_version parameter", "content": { "application/json": { "schema": { @@ -5755,8 +5775,8 @@ } } }, - "402": { - "description": "MC_Exception_PaymentRequired: Payment required", + "401": { + "description": "Invalid_Key: Invalid API key", "content": { "application/json": { "schema": { @@ -5766,7 +5786,7 @@ } }, "404": { - "description": "Unknown_Subaccount: Subaccount not found", + "description": "Unknown_Template: Template not found", "content": { "application/json": { "schema": { @@ -5775,81 +5795,94 @@ } } } - }, - "x-readonly": true + } } }, - "/messages/list-scheduled": { + "/mctemplates/time-series": { "post": { "tags": [ - "Messages" + "Mailchimp Transactional Templates" ], - "summary": "Get scheduled emails", - "description": "Queries your scheduled emails.", - "operationId": "messages/list-scheduled", + "summary": "Get Mailchimp Transactional template time series", + "description": "Returns hourly stats for the last 30 days for a Mailchimp Transactional template. Returns an empty array if the template exists but has never been used to send messages.", + "operationId": "mctemplates/time-series", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessagesListScheduledRequest" + "required": [ + "key", + "mc_template_id" + ], + "properties": { + "key": { + "description": "Valid API key", + "type": "string", + "example": "12345" + }, + "mc_template_id": { + "description": "Mailchimp template ID", + "type": "integer", + "example": 12345 + } + }, + "type": "object" } } } }, "responses": { "200": { - "description": "A list of up to 1000 scheduled emails", + "description": "Time series data retrieved successfully (may be empty array if template never used)", "content": { "application/json": { "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/MessageScheduledResponse" + "$ref": "#/components/schemas/TagTimeSeries" } } } } }, "401": { - "description": "Invalid_Key: Invalid API key", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "description": "Invalid API key" + }, + "404": { + "description": "Template not found" } - }, - "x-readonly": true + } } }, - "/messages/cancel-scheduled": { + "/messages/send": { "post": { "tags": [ "Messages" ], - "summary": "Cancel a scheduled email", - "description": "Cancels a scheduled email.", - "operationId": "messages/cancel-scheduled", + "summary": "Send a new transactional message through the Transactional API.", + "description": "Send a new transactional message through Mandrill\n\n\n \n \n \n \n \n \n
Note
\n If you signed up for a Mandrill account on or after December 1st, 2015, you must add SPF and DKIM records and verify ownership of your sending domains before you can send email through your account. Mandrill will not send any email from unverified domains or domains without valid SPF and DKIM records, including public domains like gmail.com, yahoo.com, and more.

Custom signing domains are only available to Mandrill accounts created before December 1st, 2015. If you signed up for a new Mandrill account on or after December 1st, 2015, the signing_domain parameter will be ignored.

Mail sent from unverified domains or domains without valid SPF and DKIM records will be rejected with the reject_reason, unsigned.

Learn more about SPF and DKIM, and domain verification\n
", + "operationId": "messages/send", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessagesCancelScheduledRequest" + "$ref": "#/components/schemas/MessagesSendRequest" } } } }, "responses": { "200": { - "description": "Information about the scheduled email that was cancelled", + "description": "an array of objects for each recipient containing the key \"email\" with the email address, and details of the message status for that recipient", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageScheduledResponse" + "type": "array", + "items": { + "$ref": "#/components/schemas/MessagesSendResponse" + } } } } @@ -5864,8 +5897,18 @@ } } }, + "402": { + "description": "MC_Exception_PaymentRequired: Payment required", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "404": { - "description": "Unknown_Message: Message not found", + "description": "Unknown_Subaccount: Subaccount not found", "content": { "application/json": { "schema": { @@ -5877,31 +5920,34 @@ } } }, - "/messages/reschedule": { + "/messages/send-template": { "post": { "tags": [ "Messages" ], - "summary": "Reschedule a scheduled email", - "description": "Reschedules a scheduled email.", - "operationId": "messages/reschedule", + "summary": "Send a new transactional message using a template", + "description": "Send a new transactional message using a template. If you signed up for a Mandrill account on or after December 1st, 2015, you must add SPF and DKIM records and verify ownership of your sending domains before you can send email through your account. Mandrill will not send any email from unverified domains or domains without valid SPF and DKIM records, including public domains like gmail.com, yahoo.com, and more. Custom signing domains are only available to Mandrill accounts created before December 1st, 2015. If you signed up for a new Mandrill account on or after December 1st, 2015, the signing_domain parameter will be ignored. Mail sent from unverified domains or domains without valid SPF and DKIM records will be rejected with the reject_reason, unsigned.", + "operationId": "messages/send-template", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessagesRescheduleRequest" + "$ref": "#/components/schemas/MessagesSendTemplateRequest" } } } }, "responses": { "200": { - "description": "Information about the scheduled email that was rescheduled", + "description": "Per-recipient send results", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageScheduledResponse" + "type": "array", + "items": { + "$ref": "#/components/schemas/MessagesSendResponse" + } } } } @@ -5916,8 +5962,8 @@ } } }, - "404": { - "description": "Unknown_Message: Message not found", + "402": { + "description": "MC_Exception_PaymentRequired: Payment required", "content": { "application/json": { "schema": { @@ -5925,42 +5971,72 @@ } } } + }, + "404": { + "description": "Error 404", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorResponse", + "description": "Unknown_Template: Template not found" + }, + { + "$ref": "#/components/schemas/ErrorResponse", + "description": "Unknown_Subaccount: Subaccount not found" + } + ] + } + } + } } - } + }, + "x-readonly": true } }, - "/messages/send-sms": { + "/messages/send-mc-template": { "post": { "tags": [ "Messages" ], - "summary": "Send SMS message", - "description": "Send a new SMS message through Mandrill", - "operationId": "messages/send-sms", + "summary": "Send a new transactional message using a Mailchimp Transactional template", + "description": "Send a new transactional message using a Mailchimp Transactional template. If you signed up for a Mandrill account on or after December 1st, 2015, you must add SPF and DKIM records and verify ownership of your sending domains before you can send email through your account.", + "operationId": "messages/send-mc-template", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SmsSendRequest" + "$ref": "#/components/schemas/MessagesSendMcTemplateRequest" } } } }, "responses": { "200": { - "description": "SMS sending results", + "description": "Per-recipient send results", "content": { "application/json": { "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/SmsSendResponse" + "$ref": "#/components/schemas/MessagesSendResponse" } } } } }, + "400": { + "description": "MC_Exception_ValidationError: Validation error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "401": { "description": "Invalid_Key: Invalid API key", "content": { @@ -5971,8 +6047,8 @@ } } }, - "400": { - "description": "Unknown_Subaccount: Unknown subaccount", + "402": { + "description": "MC_Exception_PaymentRequired: Payment required", "content": { "application/json": { "schema": { @@ -5980,44 +6056,83 @@ } } } + }, + "404": { + "description": "Error 404", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorResponse", + "description": "Unknown_Template: Template not found" + }, + { + "$ref": "#/components/schemas/ErrorResponse", + "description": "Unknown_Subaccount: Subaccount not found" + } + ] + } + } + } } - } + }, + "x-readonly": true } }, - "/inbound/domains": { + "/messages/search": { "post": { "tags": [ - "Inbound" + "Messages" ], - "summary": "List inbound domains", - "description": "List the domains that have been configured for inbound delivery.", - "operationId": "inbound/domains", + "summary": "Search recently sent messages", + "description": "Search recently sent messages and optionally narrow by date range, tags, senders, and API keys. Results can include both email and SMS messages. If no date range is specified, results within the last 7 days are returned.", + "operationId": "messages/search", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApiKey" + "$ref": "#/components/schemas/MessagesSearchRequest" } } } }, "responses": { "200": { - "description": "The inbound domains associated with the account", + "description": "Messages matching the search query (can include both email and SMS messages)", "content": { "application/json": { "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/InboundDomain" + "oneOf": [ + { + "$ref": "#/components/schemas/MessageInfoResponse", + "description": "Email message search result" + }, + { + "$ref": "#/components/schemas/SmsInfoResponse", + "description": "SMS message search result" + } + ] } } } } }, "401": { - "description": "Invalid API key", + "description": "Invalid_Key: Invalid API key", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "Service unavailable", "content": { "application/json": { "schema": { @@ -6029,54 +6144,50 @@ } } }, - "/inbound/add-domain": { + "/messages/search-time-series": { "post": { "tags": [ - "Inbound" - ], - "summary": "Add inbound domain", - "description": "Add an inbound domain to your account.", - "operationId": "inbound/add-domain", + "Messages" + ], + "summary": "Get time series data for message search", + "description": "Search the content of recently sent messages and return the aggregated hourly stats for matching messages.", + "operationId": "messages/search-time-series", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiKey" - }, - { - "required": [ - "domain" - ], - "properties": { - "domain": { - "description": "A domain name for inbound email delivery", - "type": "string", - "example": "inbound.example.com" - } - }, - "type": "object" - } - ] + "$ref": "#/components/schemas/MessagesSearchTimeSeriesRequest" } } } }, "responses": { "200": { - "description": "Information about the domain", + "description": "Hourly stats for matching messages", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InboundDomain" + "type": "array", + "items": { + "$ref": "#/components/schemas/MessageSearchTimeSeriesResponse" + } } } } }, "401": { - "description": "Invalid API key", + "description": "Invalid_Key: Invalid API key", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "Service unavailable", "content": { "application/json": { "schema": { @@ -6085,57 +6196,50 @@ } } } - } + }, + "x-readonly": true } }, - "/inbound/check-domain": { + "/messages/info": { "post": { "tags": [ - "Inbound" + "Messages" ], - "summary": "Check domain settings", - "description": "Check the MX settings for an inbound domain. The domain must have already been added with the add-domain call.", - "operationId": "inbound/check-domain", + "summary": "Get information about a single sent message", + "description": "Returns detailed information about a single sent message. Can return either email or SMS message information depending on the message type.", + "operationId": "messages/info", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiKey" - }, - { - "required": [ - "domain" - ], - "properties": { - "domain": { - "description": "An existing inbound domain", - "type": "string", - "example": "inbound.example.com" - } - }, - "type": "object" - } - ] + "$ref": "#/components/schemas/MessagesInfoRequest" } } } }, "responses": { "200": { - "description": "Information about the inbound domain", + "description": "Information about the message (email or SMS)", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InboundDomain" + "oneOf": [ + { + "$ref": "#/components/schemas/MessageInfoResponse", + "description": "Email message information" + }, + { + "$ref": "#/components/schemas/SmsInfoResponse", + "description": "SMS message information" + } + ] } } } }, "401": { - "description": "Invalid API key", + "description": "Invalid_Key: Invalid API key", "content": { "application/json": { "schema": { @@ -6145,7 +6249,7 @@ } }, "404": { - "description": "Unknown inbound domain", + "description": "Unknown_Message: Message not found", "content": { "application/json": { "schema": { @@ -6154,57 +6258,50 @@ } } } - } + }, + "x-readonly": true } }, - "/inbound/delete-domain": { + "/messages/content": { "post": { "tags": [ - "Inbound" + "Messages" ], - "summary": "Delete inbound domain", - "description": "Delete an inbound domain from the account. All mail will stop routing for this domain immediately.", - "operationId": "inbound/delete-domain", + "summary": "Get the full content of a sent message", + "description": "Returns the full content of a recently sent message. For email messages, includes HTML, text, and attachments. For SMS messages, includes text content and SMS-specific fields.", + "operationId": "messages/content", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiKey" - }, - { - "required": [ - "domain" - ], - "properties": { - "domain": { - "description": "An existing inbound domain", - "type": "string", - "example": "inbound.example.com" - } - }, - "type": "object" - } - ] + "$ref": "#/components/schemas/MessagesContentRequest" } } } }, "responses": { "200": { - "description": "Information about the deleted domain", + "description": "The content of the message (email or SMS)", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InboundDomain" + "oneOf": [ + { + "$ref": "#/components/schemas/MessageContentResponse", + "description": "Email message content" + }, + { + "$ref": "#/components/schemas/SmsContentResponse", + "description": "SMS message content" + } + ] } } } }, "401": { - "description": "Invalid API key", + "description": "Invalid_Key: Invalid API key", "content": { "application/json": { "schema": { @@ -6214,7 +6311,7 @@ } }, "404": { - "description": "Unknown inbound domain", + "description": "Unknown_Message: Message not found", "content": { "application/json": { "schema": { @@ -6223,62 +6320,41 @@ } } } - } + }, + "x-readonly": true } }, - "/inbound/routes": { + "/messages/parse": { "post": { "tags": [ - "Inbound" + "Messages" ], - "summary": "List routes", - "description": "List the routes defined for an inbound domain or SMS program. Provide either domain or phone (not both).", - "operationId": "inbound/routes", + "summary": "Parse a MIME message", + "description": "Parse the full MIME document for an email message, returning the content of the message broken into its constituent pieces.", + "operationId": "messages/parse", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiKey" - }, - { - "properties": { - "domain": { - "description": "The domain to check (required if phone is not provided)", - "type": "string", - "example": "inbound.example.com" - }, - "phone": { - "description": "The SMS program phone number (required if domain is not provided)", - "type": "string", - "example": "+16505551234" - } - }, - "type": "object" - } - ] + "$ref": "#/components/schemas/MessagesParseRequest" } } } }, "responses": { "200": { - "description": "The routes associated with the domain or phone", + "description": "The parsed message content", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/InboundRoute" - } + "$ref": "#/components/schemas/MessageParseResponse" } } } }, "401": { - "description": "Invalid API key", + "description": "Invalid_Key: Invalid API key", "content": { "application/json": { "schema": { @@ -6287,8 +6363,8 @@ } } }, - "404": { - "description": "Unknown inbound domain or SMS program", + "422": { + "description": "Validation error", "content": { "application/json": { "schema": { @@ -6297,73 +6373,64 @@ } } } - } + }, + "x-readonly": true } }, - "/inbound/add-route": { + "/messages/send-raw": { "post": { "tags": [ - "Inbound" + "Messages" ], - "summary": "Add route", - "description": "Add a new route to an inbound domain or SMS program. Provide either domain or phone (not both).", - "operationId": "inbound/add-route", + "summary": "Send a raw MIME message through Mandrill", + "description": "Send a raw MIME document for a message, and send it exactly as if it were sent through Mandrill's SMTP servers.", + "operationId": "messages/send-raw", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiKey" - }, - { - "required": [ - "url" - ], - "properties": { - "domain": { - "description": "An existing inbound domain (required if phone is not provided)", - "type": "string", - "example": "inbound.example.com" - }, - "phone": { - "description": "The SMS program phone number - the TO number that receives inbound SMS (required if domain is not provided)", - "type": "string", - "example": "+16505551234" - }, - "pattern": { - "description": "For email: the mailbox pattern (e.g., \"mailbox-*\"). For SMS: not used, the phone number is the pattern.", - "type": "string", - "example": "mailbox-*" - }, - "url": { - "description": "The webhook URL where the inbound messages will be published", - "type": "string", - "format": "uri", - "example": "https://example.com/webhook-url" - } - }, - "type": "object" - } - ] + "$ref": "#/components/schemas/MessagesSendRawRequest" } } } }, "responses": { "200": { - "description": "The added route information", + "description": "Per-recipient send results", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MessagesSendResponse" + } + } + } + } + }, + "401": { + "description": "Invalid_Key: Invalid API key", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "402": { + "description": "MC_Exception_PaymentRequired: Payment required", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InboundRoute" + "$ref": "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Invalid API key", + "404": { + "description": "Unknown_Subaccount: Subaccount not found", "content": { "application/json": { "schema": { @@ -6371,9 +6438,45 @@ } } } + } + }, + "x-readonly": true + } + }, + "/messages/list-scheduled": { + "post": { + "tags": [ + "Messages" + ], + "summary": "Get scheduled emails", + "description": "Queries your scheduled emails.", + "operationId": "messages/list-scheduled", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessagesListScheduledRequest" + } + } + } + }, + "responses": { + "200": { + "description": "A list of up to 1000 scheduled emails", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MessageScheduledResponse" + } + } + } + } }, - "404": { - "description": "Unknown inbound domain or SMS program", + "401": { + "description": "Invalid_Key: Invalid API key", "content": { "application/json": { "schema": { @@ -6382,74 +6485,41 @@ } } } - } + }, + "x-readonly": true } }, - "/inbound/update-route": { + "/messages/cancel-scheduled": { "post": { "tags": [ - "Inbound" + "Messages" ], - "summary": "Update mailbox route", - "description": "Update the pattern or webhook of an existing inbound mailbox route. If null is provided for any fields, the values will remain unchanged.", - "operationId": "inbound/update-route", + "summary": "Cancel a scheduled email", + "description": "Cancels a scheduled email.", + "operationId": "messages/cancel-scheduled", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiKey" - }, - { - "required": [ - "id" - ], - "properties": { - "id": { - "description": "The unique identifier of an existing mailbox route", - "type": "string", - "example": "88.2144614" - }, - "pattern": { - "description": "For email: The search pattern that the mailbox name should match. For SMS: the sender's phone number (FROM number). Null to leave unchanged", - "type": [ - "string", - null - ], - "example": "*.*" - }, - "url": { - "description": "The webhook URL where the inbound messages will be published (null to leave unchanged)", - "type": [ - "string", - null - ], - "format": "uri", - "example": "https://example.com/webhook-url" - } - }, - "type": "object" - } - ] + "$ref": "#/components/schemas/MessagesCancelScheduledRequest" } } } }, "responses": { "200": { - "description": "The updated mailbox route information", + "description": "Information about the scheduled email that was cancelled", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InboundRoute" + "$ref": "#/components/schemas/MessageScheduledResponse" } } } }, "401": { - "description": "Invalid API key", + "description": "Invalid_Key: Invalid API key", "content": { "application/json": { "schema": { @@ -6459,7 +6529,7 @@ } }, "404": { - "description": "Unknown inbound route", + "description": "Unknown_Message: Message not found", "content": { "application/json": { "schema": { @@ -6471,54 +6541,37 @@ } } }, - "/inbound/delete-route": { + "/messages/reschedule": { "post": { "tags": [ - "Inbound" + "Messages" ], - "summary": "Delete mailbox route", - "description": "Delete an existing inbound mailbox route.", - "operationId": "inbound/delete-route", + "summary": "Reschedule a scheduled email", + "description": "Reschedules a scheduled email.", + "operationId": "messages/reschedule", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiKey" - }, - { - "required": [ - "id" - ], - "properties": { - "id": { - "description": "The unique identifier of an existing route", - "type": "string", - "example": "88.214614" - } - }, - "type": "object" - } - ] + "$ref": "#/components/schemas/MessagesRescheduleRequest" } } } }, "responses": { "200": { - "description": "The deleted mailbox route information", + "description": "Information about the scheduled email that was rescheduled", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InboundRoute" + "$ref": "#/components/schemas/MessageScheduledResponse" } } } }, "401": { - "description": "Invalid API key", + "description": "Invalid_Key: Invalid API key", "content": { "application/json": { "schema": { @@ -6528,7 +6581,7 @@ } }, "404": { - "description": "Unknown inbound route", + "description": "Unknown_Message: Message not found", "content": { "application/json": { "schema": { @@ -6540,93 +6593,40 @@ } } }, - "/inbound/send-raw": { + "/messages/send-sms": { "post": { "tags": [ - "Inbound" + "Messages" ], - "summary": "Send mime document", - "description": "Take a raw MIME document destined for a domain with inbound domains set up, and send it to the inbound hook exactly as if it had been sent over SMTP.", - "operationId": "inbound/send-raw", + "summary": "Send SMS message", + "description": "Send a new SMS message through Mandrill", + "operationId": "messages/send-sms", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiKey" - }, - { - "required": [ - "raw_message" - ], - "properties": { - "raw_message": { - "description": "The full MIME document of an email message", - "type": "string", - "example": "From: sender@example.com\\nTo: mailbox-123@inbound.example.com\\nSubject: Some Subject\\n\\nSome content." - }, - "to": { - "description": "Optionally define the recipients to receive the message - otherwise we'll use the To, Cc, and Bcc headers provided in the document", - "type": [ - "array", - null - ], - "items": { - "type": "string", - "format": "email" - }, - "example": [ - "mailbox-123@inbound.example.com" - ] - }, - "mail_from": { - "description": "The address specified in the MAIL FROM stage of the SMTP conversation", - "type": [ - "string", - null - ], - "format": "email", - "example": "sender@example.com" - }, - "helo": { - "description": "The hostname provided during HELO", - "type": [ - "string", - null - ], - "example": "sender.example.com" - }, - "client_address": { - "description": "The remote host's IP address", - "type": [ - "string", - null - ], - "example": "192.168.1.100" - } - }, - "type": "object" - } - ] + "$ref": "#/components/schemas/SmsSendRequest" } } } }, "responses": { "200": { - "description": "Processing results for each recipient or null if no recipients processed", + "description": "SMS sending results", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SendRawResponse" + "type": "array", + "items": { + "$ref": "#/components/schemas/SmsSendResponse" + } } } } }, "401": { - "description": "Invalid API key", + "description": "Invalid_Key: Invalid API key", "content": { "application/json": { "schema": { @@ -6635,8 +6635,8 @@ } } }, - "404": { - "description": "Unknown inbound domain", + "400": { + "description": "Unknown_Subaccount: Unknown subaccount", "content": { "application/json": { "schema": { @@ -11335,15 +11335,21 @@ ], "properties": { "text": { - "description": "The SMS message content to be sent", + "description": "The SMS message content to be sent.", "type": "string", "example": "Hello from Mandrill SMS!" }, "to": { - "description": "The phone number to send the SMS to", - "type": "string", - "pattern": "^\\+[1-9]\\d{1,14}$", - "example": "+10000000000" + "description": "The phone numbers to send the SMS to.", + "type": "array", + "items": { + "type": "string", + "pattern": "^\\+[1-9]\\d{1,14}$" + }, + "example": [ + "+10000000000", + "+10000000001" + ] }, "from": { "description": "The phone number to send the SMS from.", @@ -11406,6 +11412,17 @@ } }, "type": "object" + }, + "async": { + "description": "enable a background sending mode that is optimized for bulk sending. In async mode, messages/send-sms will immediately return a status of \"queued\" for every recipient. To handle rejections when sending in async mode, set up a webhook for the 'reject' event. Defaults to false for messages with no more than 10 recipients; messages with more than 10 recipients are always sent asynchronously, regardless of the value of async.", + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] } }, "type": "object" @@ -11780,6 +11797,22 @@ } ] }, + "queue_reason": { + "description": "The reason for the queuing if the recipient status is queued", + "example": null, + "oneOf": [ + { + "type": "string", + "enum": [ + "async requested by user", + "multiple recipients" + ] + }, + { + "type": "null" + } + ] + }, "_id": { "description": "The message's unique id", "type": "string",