Mailchimp Content API

The Content API from Mailchimp — 3 operation(s) for content.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

mailchimp-content-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  version: 3.0.55
  title: Mailchimp Marketing Abuse Content API
  contact:
    name: Mailchimp API Support
    email: apihelp@mailchimp.com
  x-permalink: https://github.com/mailchimp/mailchimp-client-lib-codegen/blob/main/spec/marketing.json
  description: '

    The Mailchimp Marketing API provides programmatic access to Mailchimp data

    and functionality, allowing developers to build custom features to do

    things like sync email activity and campaign analytics with their

    database, manage audiences and campaigns, and more.'
host: server.api.mailchimp.com
basePath: /3.0
schemes:
- https
consumes:
- application/json
produces:
- application/json
- application/problem+json
security:
- basicAuth: []
tags:
- name: Content
paths:
  /campaigns/{campaign_id}/content:
    get:
      summary: Mailchimp Get Campaign Content
      description: Get the the HTML and plain-text content for a campaign.
      operationId: getCampaignsIdContent
      parameters:
      - name: fields
        x-title: Fields
        in: query
        description: A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.
        required: false
        type: array
        collectionFormat: csv
        items:
          type: string
        example: example_value
      - name: exclude_fields
        x-title: Exclude Fields
        in: query
        description: A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.
        required: false
        type: array
        collectionFormat: csv
        items:
          type: string
        example: example_value
      - in: path
        name: campaign_id
        x-title: Campaign ID
        type: string
        required: true
        description: The unique id for the campaign.
        example: '500123'
      responses:
        '200':
          description: ''
          schema:
            type: object
            title: Campaign Content
            description: The HTML and plain-text content for a campaign.
            properties:
              variate_contents:
                type: array
                title: Variate Contents
                description: Content options for multivariate campaigns.
                items:
                  type: object
                  properties:
                    content_label:
                      type: string
                      title: Content Label
                      description: Label used to identify the content option.
                      example: Green header
                    plain_text:
                      type: string
                      title: Plain Text
                      description: The plain-text portion of the campaign. If left unspecified, we'll generate this automatically.
                    html:
                      type: string
                      title: Campaign HTML
                      description: The raw HTML for the campaign.
                      example: <!DOCTYPE html><html xmlns=http://www.w3.org/1999/xhtml><head><meta http-equiv=Content-Type content="text/html; charset=UTF-8"><title>*|MC:SUBJECT|*</title><style type=text/css>body{background-color:#d0e4fe}</style><body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0 offset=0>
              plain_text:
                type: string
                title: Plain Text
                description: The plain-text portion of the campaign. If left unspecified, we'll generate this automatically.
              html:
                type: string
                title: Campaign HTML
                description: The raw HTML for the campaign.
              archive_html:
                type: string
                title: Campaign Archive HTML
                description: The Archive HTML for the campaign.
                example: <!DOCTYPE html><html xmlns=http://www.w3.org/1999/xhtml><head><meta http-equiv=Content-Type content="text/html; charset=UTF-8"><title>My Subject</title><style type=text/css>body{background-color:#d0e4fe}</style><body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0 offset=0>
              _links:
                title: Links
                description: A list of link types and descriptions for the API schema documents.
                type: array
                items:
                  type: object
                  title: Resource Link
                  description: This object represents a link from the resource where it is found to another resource or action that may be performed.
                  properties:
                    rel:
                      type: string
                      title: Rel
                      description: As with an HTML 'rel' attribute, this describes the type of link.
                      readOnly: true
                    href:
                      type: string
                      title: Href
                      description: This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
                      readOnly: true
                    method:
                      type: string
                      title: Method
                      description: The HTTP method that should be used when accessing the URL defined in 'href'.
                      enum:
                      - GET
                      - POST
                      - PUT
                      - PATCH
                      - DELETE
                      - OPTIONS
                      - HEAD
                      readOnly: true
                    targetSchema:
                      type: string
                      title: Target Schema
                      description: For GETs, this is a URL representing the schema that the response should conform to.
                      readOnly: true
                    schema:
                      type: string
                      title: Schema
                      description: For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.
                      readOnly: true
                readOnly: true
        default:
          description: An error generated by the Mailchimp API.
          schema:
            type: object
            title: Problem Detail Document
            description: An error generated by the Mailchimp API. Conforms to IETF draft 'draft-nottingham-http-problem-06'.
            required:
            - type
            - title
            - status
            - detail
            - instance
            properties:
              type:
                type: string
                title: Problem Type
                description: An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type.
                example: https://mailchimp.com/developer/marketing/docs/errors/
              title:
                type: string
                title: Error Title
                description: A short, human-readable summary of the problem type. It shouldn't change based on the occurrence of the problem, except for purposes of localization.
                example: Resource Not Found
              status:
                type: integer
                title: HTTP Status Code
                description: The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem.
                example: 404
              detail:
                type: string
                title: Error Message
                description: A human-readable explanation specific to this occurrence of the problem. [Learn more about errors](/developer/guides/get-started-with-mailchimp-api-3/#Errors).
                example: The requested resource could not be found.
              instance:
                type: string
                title: Instance ID
                description: A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support.
                example: 995c5cb0-3280-4a6e-808b-3b096d0bb219
      deprecated: false
      tags:
      - Content
      x-custom-config:
        methodNameSnake: get_content
        methodNameCamel: getContent
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      summary: Mailchimp Set Campaign Content
      description: Set the content for a campaign.
      operationId: putCampaignsIdContent
      parameters:
      - in: path
        name: campaign_id
        x-title: Campaign ID
        type: string
        required: true
        description: The unique id for the campaign.
        example: '500123'
      - in: body
        name: body
        description: ''
        required: true
        schema:
          type: object
          title: Campaign Content
          description: The HTML and plain-text content for a campaign
          properties:
            plain_text:
              type: string
              title: Plain Text
              description: The plain-text portion of the campaign. If left unspecified, we'll generate this automatically.
            html:
              type: string
              title: Campaign HTML
              description: The raw HTML for the campaign.
            url:
              type: string
              title: Campaign URL
              description: When importing a campaign, the URL where the HTML lives.
            template:
              type: object
              title: Template Content
              description: Use this template to generate the HTML content of the campaign
              required:
              - id
              properties:
                id:
                  type: integer
                  title: Template ID
                  description: The id of the template to use.
                sections:
                  type: object
                  title: Template Sections
                  description: Content for the sections of the template. Each key should be the unique [mc:edit area](https://mailchimp.com/help/create-editable-content-areas-with-mailchimps-template-language/) name from the template.
            archive:
              type: object
              title: Upload Archive
              description: Available when uploading an archive to create campaign content. The archive should include all campaign content and images. [Learn more](https://mailchimp.com/help/import-a-custom-html-template/).
              required:
              - archive_content
              properties:
                archive_content:
                  type: string
                  title: Archive Content
                  description: The base64-encoded representation of the archive file.
                archive_type:
                  type: string
                  enum:
                  - zip
                  - tar.gz
                  - tar.bz2
                  - tar
                  - tgz
                  - tbz
                  title: Archive Type
                  description: The type of encoded file. Defaults to zip.
            variate_contents:
              type: array
              title: Variate Contents
              description: Content options for [Multivariate Campaigns](https://mailchimp.com/help/about-multivariate-campaigns/). Each content option must provide HTML content and may optionally provide plain text. For campaigns not testing content, only one object should be provided.
              items:
                type: object
                required:
                - content_label
                properties:
                  content_label:
                    type: string
                    title: Content Label
                    description: The label used to identify the content option.
                  plain_text:
                    type: string
                    title: Plain Text
                    description: The plain-text portion of the campaign. If left unspecified, we'll generate this automatically.
                  html:
                    type: string
                    title: Campaign HTML
                    description: The raw HTML for the campaign.
                  url:
                    type: string
                    title: Campaign URL
                    description: When importing a campaign, the URL for the HTML.
                  template:
                    type: object
                    title: Template Content
                    description: Use this template to generate the HTML content for the campaign.
                    required:
                    - id
                    properties:
                      id:
                        type: integer
                        title: Template ID
                        description: The id of the template to use.
                      sections:
                        type: object
                        title: Template Sections
                        description: Content for the sections of the template. Each key should be the unique [mc:edit area](https://mailchimp.com/help/create-editable-content-areas-with-mailchimps-template-language/) name from the template.
                  archive:
                    type: object
                    title: Upload Archive
                    description: Available when uploading an archive to create campaign content. The archive should include all campaign content and images. [Learn more](https://mailchimp.com/help/import-a-custom-html-template/).
                    required:
                    - archive_content
                    properties:
                      archive_content:
                        type: string
                        title: Archive Content
                        description: The base64-encoded representation of the archive file.
                      archive_type:
                        type: string
                        enum:
                        - zip
                        - tar.gz
                        - tar.bz2
                        - tar
                        - tgz
                        - tbz
                        title: Archive Type
                        description: The type of encoded file. Defaults to zip.
        example: example_value
      responses:
        '200':
          description: ''
          schema:
            type: object
            title: Campaign Content
            description: The HTML and plain-text content for a campaign.
            properties:
              variate_contents:
                type: array
                title: Variate Contents
                description: Content options for multivariate campaigns.
                items:
                  type: object
                  properties:
                    content_label:
                      type: string
                      title: Content Label
                      description: Label used to identify the content option.
                      example: Green header
                    plain_text:
                      type: string
                      title: Plain Text
                      description: The plain-text portion of the campaign. If left unspecified, we'll generate this automatically.
                    html:
                      type: string
                      title: Campaign HTML
                      description: The raw HTML for the campaign.
                      example: <!DOCTYPE html><html xmlns=http://www.w3.org/1999/xhtml><head><meta http-equiv=Content-Type content="text/html; charset=UTF-8"><title>*|MC:SUBJECT|*</title><style type=text/css>body{background-color:#d0e4fe}</style><body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0 offset=0>
              plain_text:
                type: string
                title: Plain Text
                description: The plain-text portion of the campaign. If left unspecified, we'll generate this automatically.
              html:
                type: string
                title: Campaign HTML
                description: The raw HTML for the campaign.
              archive_html:
                type: string
                title: Campaign Archive HTML
                description: The Archive HTML for the campaign.
                example: <!DOCTYPE html><html xmlns=http://www.w3.org/1999/xhtml><head><meta http-equiv=Content-Type content="text/html; charset=UTF-8"><title>My Subject</title><style type=text/css>body{background-color:#d0e4fe}</style><body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0 offset=0>
              _links:
                title: Links
                description: A list of link types and descriptions for the API schema documents.
                type: array
                items:
                  type: object
                  title: Resource Link
                  description: This object represents a link from the resource where it is found to another resource or action that may be performed.
                  properties:
                    rel:
                      type: string
                      title: Rel
                      description: As with an HTML 'rel' attribute, this describes the type of link.
                      readOnly: true
                    href:
                      type: string
                      title: Href
                      description: This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
                      readOnly: true
                    method:
                      type: string
                      title: Method
                      description: The HTTP method that should be used when accessing the URL defined in 'href'.
                      enum:
                      - GET
                      - POST
                      - PUT
                      - PATCH
                      - DELETE
                      - OPTIONS
                      - HEAD
                      readOnly: true
                    targetSchema:
                      type: string
                      title: Target Schema
                      description: For GETs, this is a URL representing the schema that the response should conform to.
                      readOnly: true
                    schema:
                      type: string
                      title: Schema
                      description: For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.
                      readOnly: true
                readOnly: true
        default:
          description: An error generated by the Mailchimp API.
          schema:
            type: object
            title: Problem Detail Document
            description: An error generated by the Mailchimp API. Conforms to IETF draft 'draft-nottingham-http-problem-06'.
            required:
            - type
            - title
            - status
            - detail
            - instance
            properties:
              type:
                type: string
                title: Problem Type
                description: An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type.
                example: https://mailchimp.com/developer/marketing/docs/errors/
              title:
                type: string
                title: Error Title
                description: A short, human-readable summary of the problem type. It shouldn't change based on the occurrence of the problem, except for purposes of localization.
                example: Resource Not Found
              status:
                type: integer
                title: HTTP Status Code
                description: The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem.
                example: 404
              detail:
                type: string
                title: Error Message
                description: A human-readable explanation specific to this occurrence of the problem. [Learn more about errors](/developer/guides/get-started-with-mailchimp-api-3/#Errors).
                example: The requested resource could not be found.
              instance:
                type: string
                title: Instance ID
                description: A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support.
                example: 995c5cb0-3280-4a6e-808b-3b096d0bb219
      deprecated: false
      tags:
      - Content
      x-custom-config:
        methodNameSnake: set_content
        methodNameCamel: setContent
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /landing-pages/{page_id}/content:
    get:
      summary: Mailchimp Get Landing Page Content
      description: Get the the HTML for your landing page.
      parameters:
      - name: fields
        x-title: Fields
        in: query
        description: A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.
        required: false
        type: array
        collectionFormat: csv
        items:
          type: string
        example: example_value
      - name: exclude_fields
        x-title: Exclude Fields
        in: query
        description: A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.
        required: false
        type: array
        collectionFormat: csv
        items:
          type: string
        example: example_value
      - in: path
        name: page_id
        x-title: Landing Page unique ID
        type: string
        required: true
        description: The unique id for the page.
        example: '500123'
      responses:
        '200':
          description: ''
          schema:
            type: object
            title: Landing Page Content
            description: The HTML content for a landing page.
            properties:
              html:
                type: string
                title: Landing Page HTML
                description: The raw HTML for the landing page.
              json:
                type: string
                title: Landing Page JSON
                description: The JSON Structure for the landing page
              _links:
                title: Links
                description: A list of link types and descriptions for the API schema documents.
                type: array
                items:
                  type: object
                  title: Resource Link
                  description: This object represents a link from the resource where it is found to another resource or action that may be performed.
                  properties:
                    rel:
                      type: string
                      title: Rel
                      description: As with an HTML 'rel' attribute, this describes the type of link.
                      readOnly: true
                    href:
                      type: string
                      title: Href
                      description: This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
                      readOnly: true
                    method:
                      type: string
                      title: Method
                      description: The HTTP method that should be used when accessing the URL defined in 'href'.
                      enum:
                      - GET
                      - POST
                      - PUT
                      - PATCH
                      - DELETE
                      - OPTIONS
                      - HEAD
                      readOnly: true
                    targetSchema:
                      type: string
                      title: Target Schema
                      description: For GETs, this is a URL representing the schema that the response should conform to.
                      readOnly: true
                    schema:
                      type: string
                      title: Schema
                      description: For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.
                      readOnly: true
                readOnly: true
        default:
          description: An error generated by the Mailchimp API.
          schema:
            type: object
            title: Problem Detail Document
            description: An error generated by the Mailchimp API. Conforms to IETF draft 'draft-nottingham-http-problem-06'.
            required:
            - type
            - title
            - status
            - detail
            - instance
            properties:
              type:
                type: string
                title: Problem Type
                description: An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type.
                example: https://mailchimp.com/developer/marketing/docs/errors/
              title:
                type: string
                title: Error Title
                description: A short, human-readable summary of the problem type. It shouldn't change based on the occurrence of the problem, except for purposes of localization.
                example: Resource Not Found
              status:
                type: integer
                title: HTTP Status Code
                description: The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem.
                example: 404
              detail:
                type: string
                title: Error Message
                description: A human-readable explanation specific to this occurrence of the problem. [Learn more about errors](/developer/guides/get-started-with-mailchimp-api-3/#Errors).
                example: The requested resource could not be found.
              instance:
                type: string
                title: Instance ID
                description: A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support.
                example: 995c5cb0-3280-4a6e-808b-3b096d0bb219
      deprecated: false
      tags:
      - Content
      x-custom-config:
        methodNameSnake: get_page_content
        methodNameCamel: getPageContent
      operationId: getLandingPageIdContent
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /templates/{template_id}/default-content:
    get:
      summary: Mailchimp View Default Content
      description: Get the sections that you can edit in a template, including each section's default content.
      operationId: getTemplatesIdDefaultContent
      parameters:
      - name: fields
        x-title: Fields
        in: query
        description: A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.
        required: false
        type: array
        collectionFormat: csv
        items:
          type: string
        example: example_value
      - name: exclude_fields
        x-title: Exclude Fields
        in: query
        description: A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.
        required: false
        type: array
        collectionFormat: csv
        items:
          type: string
        example: example_value
      - name: template_id
        x-title: Template ID
        in: path
        description: The unique id for the template.
        required: true
        type: string
        example: '500123'
      responses:
        '200':
          description: ''
          schema:
            type: object
            title: Template Default Content
            description: Default content for a template.
            properties:
              sections:
                type: object
                title: Sections
                description: The sections that you can edit in the template, including each section's default content.
                additionalProperties:
                  description: The default content for the sections that you can edit in the template.
              _links:
                title: Links
                description: A list of link types and descriptions for the API schema documents.
                type: array
                items:
                  type: object
                  title: Resource Link
                  description: This object represents a link from the resource where it is found to another resource or action that may be performed.
                  properties:
                    rel:
                      type: string
                      title: Rel
                      description: As with an HTML 'rel' attribute, this describes the type of link.
                      readOnly: true
                    href:
                      type: string
                      title: Href
                      description: This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
                      readOnly: true
                    method:
                      type: string
                      title: Method
                      description: The HTTP method that should be used when accessing the URL defined in 'href'.
                      enum:
                      - GET
                      - POST
                      - PUT
                      - PATCH
                      - DELETE
                      - OPTIONS
                      - HEAD
                      readOnly: true
                    targetSchema:
                      type: string
                      title: Target Schema
                      description: For GETs, this is a URL representing the schema that the response should conform to.
                      readOnly: true
                    schema:
                      type: string
                      title: Schema
                      description: For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.
                      readOnly: true
                readOnly: true
        default:
          description: An error generated by the Mailchimp API.
          schema:
            type: object
            title: Problem Detail Document
            description: An error generated by the Mailchimp API. Conforms to IETF draft 'draft-nottingham-http-problem-06'.
            required:
            - type
            - title
            - status
            - detail
            - instance
            properties:
              type:
                type: string
                title: Problem Type
                description: An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type.
                example: https://mailchimp.com/developer/marketing/docs/errors/
              title:
                type: string
                title: Error Title
                description: A short, human-readable summary of the problem type. It shouldn't change based on the occurrence of the problem, except for purposes of localization.
                example: Resource Not Found
              status:
                type: integer
                title: HTTP Status Code
                description: The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem.
                example: 404
              detail:
                type: string
                title: Error Message
                description: A human-readable explanation specific to this occurrence of the problem. [Learn more about errors](/developer/guides/get-started-with-mailchimp-api-3/#Errors).
                example: The requested resource could not be found.
              instance:
                type: string
                title: Instance ID
                description: A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support.
                example: 995c5cb0-3280-4a6e-808b-3b096d0bb219
      deprecated: false
      tags:
      - Content
      x-custom-config:
        methodNameSnake: get_default_content_for_template
        methodNameCamel: getDefaultContentForTemplate
      x-microcks-operation:
        delay: 0
 

# --- truncated at 32 KB (58 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/mailchimp/refs/heads/main/openapi/mailchimp-content-api-openapi.yml