openapi: 3.0.0
info:
title: Marketing Email API
description: The marketing email API can be used to send marketing emails directly to recipients without the need to create a campaign. Email marketing status will be checked for known email addresses and email not sent if unsubscribed or suppressed.
version: 3.0.2
externalDocs:
description: Learn more about Dotdigital APIs
url: https://developer.dotdigital.com
servers:
- url: https://{region}-api.dotdigital.com
variables:
region:
description: The Dotdigital region id your account belongs to
enum:
- r1
- r2
- r3
default: r1
security:
- basicAuth: []
paths:
/marketing-email/v3/send:
post:
tags:
- Marketing Emails
summary: Send marketing email
description: "Send a marketing email.
\n**Note:** \n* _Email marketing status will be checked for known email addresses and email not sent if unsubscribed or suppressed._ \n* _Contacts will be created for unknown email addresses._"
operationId: sendmarketingEmail
requestBody:
description: Email details
content:
application/json:
schema:
$ref: '#/components/schemas/emailRequest'
examples:
Raw HTML:
summary: Sending email using your own raw HTML
value:
to: myCustomer1@emailsim.io
from: noreply@acme.com
content:
source: html
subject: An offer just for you
htmlContent: "\n\n
This is a paragraph in my email.
\n Click here\n\n\n" metadata: customerId: 12345 reportingSegement: 3Y25 Triggered campaign: summary: Sending email using a triggered campaign value: to: myCustomer1@emailsim.io from: noreply@acme.com content: source: template campaignId: 3456 personalizationValues: - name: OFFER_EXPIRES value: 1st June - name: OFFER_NAME value: May madness tags: - Offers - Marketing metadata: customerId: 12345 reportingSegement: 3Y25 required: true responses: '201': description: Email accepted '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/inline_response_400' examples: Bad request: summary: Badly formed request value: errorCode: marketingemail:badRequest description: Bad request No unsubscribe link: summary: No unsubscribe link value: errorCode: marketingemail:badRequest description: Marketing emails must contain an unsubscribe link. Include the '$UNSUB$' token in your HTML content. '401': description: Unauthorized '409': description: Opted out / uncontactable content: application/json: schema: $ref: '#/components/schemas/inline_response_409' example: errorCode: marketingEmail:unsubscribed description: Recipient 'bob@acme.com' is unsubscribed. /marketing-email/v3/batch: post: tags: - Marketing Emails summary: Send batch marketing emails description: "Send a batch of marketing emails.This is a paragraph in my email.
\n Click here\n\n\n" metadata: customerId: 12345 reportingSegement: 3Y25 - to: myCustomer2@emailsim.io from: noreply@acme.com content: source: template campaignId: 3456 personalizationValues: - name: OFFER_EXPIRES value: 1st June - name: OFFER_NAME value: May madness tags: - Offers - Marketing metadata: customerId: 23456 reportingSegement: 3Y25 items: $ref: '#/components/schemas/emailRequest' required: true responses: '201': description: Email batch accepted content: application/json: schema: $ref: '#/components/schemas/inline_response_201' '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/errorResponse' examples: '1': summary: Invalid request value: errorCode: marketingEmail:invalidRequest description: No email send requests found. '401': description: Unauthorized components: schemas: emailRequest: title: Email send request required: - content - to type: object properties: to: type: string description: The email address to send the email to. format: email example: recipient@example.com from: type: string description: 'The From address for your email. You can add an optional friendly name using the format: *{Friendly name}* **<***{From email address}***>**Blah blah blah...
' additionalProperties: false description: Raw HTML content. templateContent: title: Triggered campaign details required: - campaignId - source type: object properties: source: type: string description: The source the email content is created from. enum: - template campaignId: type: integer description: The ID of the triggered campaign to use to create the content. example: 12345 personalizationValues: maxItems: 100 minItems: 1 type: array description: Personalization values to be used with the campaign template. items: $ref: '#/components/schemas/templateContent_personalizationValues' tags: maxItems: 50 minItems: 1 type: array description: Any custom-defined tags to filter and report on data. example: - FOLLOW-UP - LAPSED items: type: string description: Tag additionalProperties: false description: Content created from a triggered campaign. errorResponse: required: - description - errorCode type: object properties: errorCode: type: string description: Unique error code description: type: string description: Description of the issue details: type: array items: $ref: '#/components/schemas/errorResponse_details' inline_response_409: allOf: - $ref: '#/components/schemas/errorResponse' - type: object properties: errorCode: $ref: '#/components/schemas/emailRefusedReason' inline_response_400: allOf: - $ref: '#/components/schemas/errorResponse' - type: object properties: errorCode: $ref: '#/components/schemas/SingleMarketingEmailErrorCode' inline_response_201: type: object properties: summary: $ref: '#/components/schemas/inline_response_201_summary' results: type: array description: Send results in index order as per request. items: $ref: '#/components/schemas/inline_response_201_results' example: summary: sent: 1 uncontactable: 1 failed: 1 results: - index: 0 status: sent - index: 1 status: uncontactable - index: 2 status: failed failures: - failureCode: marketingEmail:invalidEmailAddress description: Invalid email of 'invalid@email' - failureCode: marketingEmail:restrictedFromAddress description: The `from` address '