Mailjet Send API

Send transactional and marketing emails

OpenAPI Specification

mailjet-send-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Mailjet Email Campaigns Send API
  description: The Mailjet Email API enables sending transactional and marketing emails programmatically via JSON requests. The API also exposes resources for managing contacts, contact lists, segments, campaigns, templates, sender addresses, statistics, and event tracking. All requests use HTTP Basic authentication with an API key and secret pair issued from the Mailjet account dashboard.
  version: '3.1'
  contact:
    name: Mailjet API Support
    url: https://documentation.mailjet.com/hc/en-us
  termsOfService: https://www.mailjet.com/legal/terms/
servers:
- url: https://api.mailjet.com/v3.1
  description: Send API v3.1
- url: https://api.mailjet.com/v3
  description: REST API v3
security:
- BasicAuth: []
tags:
- name: Send
  description: Send transactional and marketing emails
paths:
  /send:
    post:
      operationId: sendEmail
      summary: Send transactional emails (v3.1)
      description: Send one or more transactional emails using the Send API v3.1. Each message in the Messages array specifies its own sender, recipients, subject, content, and optional template.
      tags:
      - Send
      servers:
      - url: https://api.mailjet.com/v3.1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendV31Request'
      responses:
        '200':
          description: Send acknowledged
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendV31Response'
        '400':
          description: Validation error
        '401':
          description: Authentication failed
components:
  schemas:
    SendV31Message:
      type: object
      required:
      - From
      - To
      properties:
        From:
          $ref: '#/components/schemas/EmailAddress'
        To:
          type: array
          items:
            $ref: '#/components/schemas/EmailAddress'
        Cc:
          type: array
          items:
            $ref: '#/components/schemas/EmailAddress'
        Bcc:
          type: array
          items:
            $ref: '#/components/schemas/EmailAddress'
        Subject:
          type: string
        TextPart:
          type: string
        HTMLPart:
          type: string
        TemplateID:
          type: integer
        TemplateLanguage:
          type: boolean
        Variables:
          type: object
          additionalProperties: true
        CustomID:
          type: string
        EventPayload:
          type: string
        Headers:
          type: object
          additionalProperties:
            type: string
        Attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
        InlinedAttachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
    Attachment:
      type: object
      required:
      - ContentType
      - Filename
      - Base64Content
      properties:
        ContentType:
          type: string
        Filename:
          type: string
        Base64Content:
          type: string
        ContentID:
          type: string
    SendV31Response:
      type: object
      properties:
        Messages:
          type: array
          items:
            type: object
            properties:
              Status:
                type: string
              To:
                type: array
                items:
                  type: object
                  properties:
                    Email:
                      type: string
                    MessageUUID:
                      type: string
                    MessageID:
                      type: integer
                    MessageHref:
                      type: string
    EmailAddress:
      type: object
      required:
      - Email
      properties:
        Email:
          type: string
          format: email
        Name:
          type: string
    SendV31Request:
      type: object
      required:
      - Messages
      properties:
        Messages:
          type: array
          items:
            $ref: '#/components/schemas/SendV31Message'
        SandboxMode:
          type: boolean
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: API key and secret used as HTTP Basic credentials
externalDocs:
  description: Mailjet API Reference
  url: https://dev.mailjet.com/email/reference/