{
  "openapi": "3.0.3",
  "info": {
    "title": "SecuMailer MailJet-compatible Mail API",
    "version": "0.2"
  },
  "servers": [
    {
      "url": "https://test-api.secumailer.com",
      "description": "Acceptance environment"
    },
    {
      "url": "https://api.secumailer.com",
      "description": "Production environment"
    }
  ],
  "paths": {
    "/mailjet/v1/send": {
      "post": {
        "tags": [
          "Mail Send"
        ],
        "summary": "Send Email with SecuMailer.",
        "description": "*The Mail Send operation allows you to send email over SecuMailers REST API*",
        "operationId": "PostMailSend",
        "parameters": [
          {
            "name": "Content-Encoding",
            "in": "header",
            "description": "[IGNORED] This option is accepted but will not yield any result.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "gzip"
              ]
            }
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/PostMailSend"
        },
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Sent"
                }
              }
            }
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "text/plain": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponseOne"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponseTwo"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponseThree"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponseFour"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponseFive"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponseSix"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponseSeven"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "RecipientArray": {
        "type": "object",
        "properties": {
          "Recipients": {
            "type": "array",
            "description": "An array of recipients to whom the e-mail will be sent. Each object in this array must contain a recipient's email address via the Email property and, optionally, the recipient's name via the Name property.",
            "items": {
              "type": "object",
              "properties": {
                "Email": {
                  "type": "string",
                  "format": "email",
                  "example": "recipient@somedomain.com"
                },
                "Name": {
                  "type": "string",
                  "example": "Firstname Lastname"
                }
              }
            }
          }
        }
      },
      "RecipientHeaders": {
        "type": "object",
        "properties": {
          "To": {
            "type": "string",
            "description": "A comma-separated list of recipients to whom the e-mail will be sent. Note that Recipients and To have a different behaviors. The recipients listed in To will receive a common message showing every other recipients and carbon-copied recipients. The recipients listed in Recipients will each receive an separate message without showing all the other recipients.",
            "example": "First Recipient <first.recipient@somedomain.com>, <second.recipient@somedomain.com>"
          },
          "Cc": {
            "type": "string",
            "description": "A comma-separated list of recipients to whom a carbon copy of the e-mail will be sent.",
            "example": "Third Recipient <third.recipient@somedomain.com>, <fourth.recipient@somedomain.com>"
          },
          "Bcc": {
            "type": "string",
            "description": "A comma-separated list of recipients who will each receive a blind carbon copy of the e-mail.",
            "example": "Fifth Recipient <fifth.recipient@somedomain.com>, <sixth.recipient@somedomain.com>"
          }
        }
      },
      "Attachment": {
        "required": [
          "Content-type",
          "Filename",
          "content"
        ],
        "type": "object",
        "properties": {
          "Content-type": {
            "type": "string",
            "description": "The attachment's MIME type.",
            "example": "image/png"
          },
          "Filename": {
            "type": "string",
            "description": "The attachment's filename.",
            "example": "secumailer.png"
          },
          "content": {
            "type": "string",
            "description": "The attachment, in Base64 encoding.",
            "example": "iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAALVBMVEUkAFwkAFxHcEwkAFwkAFwkAFwkAFwkAFwkAFwkAFwkAFwkAFwkAFwkAFwkAFzfhNRlAAAAD3RSTlPl8QDrR8M1ECOWX4Oq2VLQ3t6AAAAA6UlEQVQokX2RW5bEIAhEQXyhJvtf7kBUgqenu74iF0gBELxKOZ6ww40ToQgSt3LAlhAJliQnNYNZ8p/YlGYh5QWjMARuuYhyY9B3fOEVvZF4HTAdLkP6CclDGPf3SvU64n+VpV/qn5A4f8IQqvh/ODy8+7ZDIplp8qtXiVWDNN3GgZuXd33vKPfme30VAd0ccgVZ324baH6bpBXZyQZR97ATDYP3ytySTrfBIA66L4QVnh7EUnZ/xOag7MuoulmTLVik00xveoVyQJ0VMMVoM3oYKmixloHNbDAEnnvjN+Kg3g3Yr8rDD/0BPDIILI4kSewAAAAASUVORK5CYII="
          }
        },
        "description": "An attachment."
      },
      "Sent": {
        "type": "array",
        "description": "An array of recipient addresses and message identifiers.",
        "items": {
          "$ref": "#/components/schemas/SentObject"
        }
      },
      "SentObject": {
        "required": [
          "Email"
        ],
        "type": "object",
        "properties": {
          "Email": {
            "type": "string",
            "format": "e-mail"
          },
          "MessageID": {
            "type": "string",
            "description": "Unique ID of the message (legacy format).",
            "example": "010001904de4ce1c-c5734920-5ad5-4db5-a943-14f5c2a73d95-000000@sendingdomain.com"
          },
          "MessageUUID": {
            "type": "string",
            "example": "c894fda1-61ee-4096-a7c4-cd4b2c364787@test-api.secumailer.com"
          }
        }
      },
      "ErrorResponseOne": {
        "type": "string",
        "description": "Invalid characters detected",
        "example": "Invalid characters detected"
      },
      "ErrorResponseTwo": {
        "type": "string",
        "description": "\\\"Headers\\\" is not JSON object type",
        "example": "\\\"Headers\\\" is not JSON object type"
      },
      "ErrorResponseThree": {
        "type": "string",
        "description": "Header [Property name] is not string type",
        "example": "Header [Property name] is not string type"
      },
      "ErrorResponseFour": {
        "type": "string",
        "description": "Missing \\\"To\\\" or \\\"Recipients\\\" property",
        "example": "Missing \\\"To\\\" or \\\"Recipients\\\" property"
      },
      "ErrorResponseFive": {
        "type": "string",
        "description": "Too many recipients in To",
        "example": "Too many recipients in To"
      },
      "ErrorResponseSix": {
        "type": "string",
        "description": "Too many recipients in Cc",
        "example": "Too many recipients in Cc"
      },
      "ErrorResponseSeven": {
        "type": "string",
        "description": "Too many recipients in Bcc",
        "example": "Too many recipients in Bcc"
      }
    },
    "parameters": {
      "MailBodyCompression": {
        "name": "Content-Encoding",
        "in": "header",
        "description": "[IGNORED] This option is accepted but will not yield any result.",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "gzip"
          ]
        }
      }
    },
    "requestBodies": {
      "PostMailSend": {
        "content": {
          "application/json": {
            "schema": {
              "required": [
                "FromEmail"
              ],
              "type": "object",
              "properties": {
                "FromEmail": {
                  "type": "string",
                  "description": "The sender's e-mail address.",
                  "format": "email",
                  "example": "john.doe@somedomain.com"
                },
                "FromName": {
                  "type": "string",
                  "description": "The sending address' display name.",
                  "example": "John Doe"
                },
                "Subject": {
                  "type": "string",
                  "description": "The e-mail's subject.",
                  "example": "Daily stand-up at 9:30AM"
                },
                "Headers": {
                  "type": "array",
                  "description": "A collection of JSON property name and property value pairs allowing you to specify handling instructions for your email. You may not override the following headers: `x-sg-id`, `x-sg-eid`, `received`, `dkim-signature`, `Content-Type`, `Content-Transfer-Encoding`, `To`, `From`, `Subject`, `Reply-To`, `CC`, `BCC`.",
                  "example": {
                    "Reply-To": "sender@domain.com",
                    "X-Custom-Header": "Some value"
                  },
                  "items": {
                    "type": "object"
                  }
                },
                "Html-part": {
                  "type": "string",
                  "description": "The HTML content of the e-mail.",
                  "example": "<h3>Hello there!</h3><img src=\"cid:secumailer.png\"><p>Welcome to SecuMailer!</p>"
                },
                "Text-part": {
                  "type": "string",
                  "description": "The text content of the e-mail. Note that, when not provided, the Text-part will not be automatically generated from the HTML-part.",
                  "example": "Hello there!\\n\\nWelcome to SecuMailer!"
                },
                "Attachments": {
                  "type": "array",
                  "description": "An array of one or more attachments.",
                  "items": {
                    "$ref": "#/components/schemas/Attachment"
                  }
                },
                "Inline_attachments": {
                  "type": "array",
                  "description": "An array of one or more inline attachments. When using an inline attachment, it is possible to insert the file inside the HTML code of the email by using cid:FILENAME.EXT where FILENAME.EXT is the Filename specified in the declaration of the Attachment (e.g. <img src=\\\"cid:secumailer.png\\\">).",
                  "items": {
                    "$ref": "#/components/schemas/Attachment"
                  }
                }
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/RecipientArray"
                },
                {
                  "$ref": "#/components/schemas/RecipientHeaders"
                }
              ]
            }
          }
        }
      }
    }
  },
  "tags": []
}