openapi: 3.1.0 info: title: Campaign Templates description: 'Create, retrieve, and update reusable email campaign templates. Use this API to create templates with HTML and plain-text content, list all templates with pagination, fetch a specific template by ID, and update an existing template''s name, subject, from name, and content.' version: 2.0.1 x-readme: headers: [] explorer-enabled: true proxy-enabled: true x-readme-fauxas: true x-samples-languages: - curl - csharp - java - javascript - node - python - php - ruby externalDocs: description: Learn more about Dotdigital APIs url: https://developer.dotdigital.com servers: - url: https://{region}-api.dotdigital.com variables: region: default: r1 enum: - r1 - r2 - r3 description: The Dotdigital region id your account belongs to security: - basicAuth: [] components: securitySchemes: basicAuth: type: http scheme: basic paths: /v2/templates: parameters: - in: header name: x-ddg-integration-token required: false description: If you are a partner of Dotdigital and have a [verified integration](https://developer.dotdigital.com/docs/partner-integration-verification) then include your [integration tracking token](https://developer.dotdigital.co/docs/verified-integration-tracking) here. schema: type: string pattern: /^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/ example: 5a96bc79-19a7-4544-973b-e2da0c9136f9 post: summary: Create template deprecated: false description: Creates an email campaign template operationId: create-template tags: - Campaign Templates parameters: [] requestBody: content: application/json: schema: type: object required: - name - subject - fromName - htmlContent - plainTextContent properties: name: type: string description: The name of the template being created subject: type: string description: The email subject line of the template fromName: type: string description: The from name of the template htmlContent: type: string description: The HTML content of the template plainTextContent: type: string description: The plain text content of the template examples: Request Example: value: name: New product promotion 2 subject: New product! fromName: Company name htmlContent: "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
" plainTextContent: "\r\n\n---\r\nWant to unsubscribe? $UNSUB$" summary: Request Example responses: '201': description: '201' content: application/json: schema: type: object properties: id: type: integer default: 0 examples: - 4 name: type: string examples: - New product promotion 2 subject: type: string examples: - New product! fromName: type: string examples: - Company name htmlContent: type: string examples: - "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
" plainTextContent: type: string examples: - "\r\n\n---\r\nWant to unsubscribe? $UNSUB$" replyAction: type: string examples: - Unset replyToAddress: type: string examples: - '' examples: Result: summary: Result value: id: 4 name: New product promotion 2 subject: New product! fromName: Company name htmlContent: "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
" plainTextContent: "\r\n\n---\r\nWant to unsubscribe? $UNSUB$" replyAction: Unset replyToAddress: '' get: summary: Get templates deprecated: false description: Gets a list of all email campaign templates operationId: get-templates tags: - Campaign Templates parameters: - name: select in: query description: The number of records to select between 1 and 1000 required: false schema: type: integer format: int32 - name: skip in: query description: The numbers of records to skip in the result set required: false schema: type: integer format: int32 responses: '200': description: '200' content: application/json: schema: type: array items: type: object properties: id: type: integer default: 0 examples: - 1 name: type: string examples: - Monthly newsletter Dec 2015 subject: type: string examples: - Monthly newsletter fromName: type: string examples: - Company name htmlContent: {} plainTextContent: {} replyAction: type: string examples: - Unset replyToAddress: {} examples: Result: summary: Result value: - id: 1 name: Monthly newsletter Dec 2015 subject: Monthly newsletter fromName: Company name htmlContent: null plainTextContent: null replyAction: Unset replyToAddress: null - id: 2 name: Financial update subject: Financial update fromName: Company name htmlContent: null plainTextContent: null replyAction: Unset replyToAddress: null - id: 3 name: New product promotion subject: New product! fromName: Company name htmlContent: null plainTextContent: null replyAction: WebMailForward replyToAddress: shop@company-name123.com /v2/templates/{id}: parameters: - in: header name: x-ddg-integration-token required: false description: If you are a partner of Dotdigital and have a [verified integration](https://developer.dotdigital.com/docs/partner-integration-verification) then include your [integration tracking token](https://developer.dotdigital.co/docs/verified-integration-tracking) here. schema: type: string pattern: /^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/ example: 5a96bc79-19a7-4544-973b-e2da0c9136f9 get: summary: Get template by id deprecated: false description: Gets an email campaign template by id operationId: get-template-by-id tags: - Campaign Templates parameters: - name: id in: path description: The id of the email campaign template required: true example: 0 schema: type: integer format: int32 responses: '200': description: '200' content: application/json: schema: type: object properties: id: type: integer default: 0 examples: - 1 name: type: string examples: - New product promotion subject: type: string examples: - New product! fromName: type: string examples: - Company name htmlContent: type: string examples: - "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
" plainTextContent: type: string examples: - "\r\n\n---\r\nWant to unsubscribe? $UNSUB$" replyAction: type: string examples: - WebMailForward replyToAddress: type: string examples: - shop@company-name123.com examples: Result: summary: Result value: id: 1 name: New product promotion subject: New product! fromName: Company name htmlContent: "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
" plainTextContent: "\r\n\n---\r\nWant to unsubscribe? $UNSUB$" replyAction: WebMailForward replyToAddress: shop@company-name123.com put: summary: Update template deprecated: false description: Creates an email campaign template operationId: update-template tags: - Campaign Templates parameters: - name: id in: path description: The id of the template being updated required: true example: 0 schema: type: integer format: int32 requestBody: content: application/json: schema: type: object required: - name - subject - fromName - htmlContent - plainTextContent properties: name: type: string description: The name of the template being created subject: type: string description: The email subject line of the template fromName: type: string description: The from name of the template htmlContent: type: string description: The HTML content of the template plainTextContent: type: string description: The plain text content of the template examples: Request Example: value: name: New product promotion subject: New product! fromName: Company name htmlContent: "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
" plainTextContent: "\r\n\n---\r\nWant to unsubscribe? $UNSUB$" summary: Request Example responses: '200': description: '200' content: application/json: schema: type: object properties: id: type: integer default: 0 examples: - 4 name: type: string examples: - New product promotion 2 subject: type: string examples: - Brand new product released! fromName: type: string examples: - Company name htmlContent: type: string examples: - "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
" plainTextContent: type: string examples: - "\r\n\n---\r\nWant to unsubscribe? $UNSUB$" replyAction: type: string examples: - Unset replyToAddress: type: string examples: - '' examples: Result: summary: Result value: id: 4 name: New product promotion 2 subject: Brand new product released! fromName: Company name htmlContent: "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
" plainTextContent: "\r\n\n---\r\nWant to unsubscribe? $UNSUB$" replyAction: Unset replyToAddress: ''