{
    "openapi": "3.0.0",
    "info": {
        "title": "DuoCircle Mail API",
        "description": "REST API for sending outbound email using your DuoCircle Outbound SMTP account.",
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "/",
            "description": ""
        }
    ],
    "paths": {
        "/v1/message": {
            "get": {
                "operationId": "getMessageCollection",
                "tags": [
                    "Email"
                ],
                "responses": {
                    "200": {
                        "description": "message collection",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/message-v1MessageGet.output"
                                    }
                                }
                            },
                            "text/html": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/message-v1MessageGet.output"
                                    }
                                }
                            }
                        }
                    }
                },
                "summary": "Retrieves the collection of message resources.",
                "description": "Retrieves the collection of message resources.",
                "parameters": [
                    {
                        "name": "messageId",
                        "in": "query",
                        "description": "ID of the transaction which generated the messages",
                        "required": false,
                        "deprecated": false,
                        "allowEmptyValue": false,
                        "schema": {
                            "type": "string"
                        },
                        "style": "form",
                        "explode": false,
                        "allowReserved": false
                    },
                    {
                        "name": "query",
                        "in": "query",
                        "description": "Search for messages quering by subject, sender (from), and the recipient (to)",
                        "required": false,
                        "deprecated": false,
                        "allowEmptyValue": false,
                        "schema": {
                            "type": "string"
                        },
                        "style": "form",
                        "explode": false,
                        "allowReserved": false
                    },
                    {
                        "name": "subject",
                        "in": "query",
                        "description": "Subject of the Email",
                        "required": false,
                        "deprecated": false,
                        "allowEmptyValue": false,
                        "schema": {
                            "type": "string"
                        },
                        "style": "form",
                        "explode": false,
                        "allowReserved": false
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Sender address",
                        "required": false,
                        "deprecated": false,
                        "allowEmptyValue": false,
                        "schema": {
                            "type": "string"
                        },
                        "style": "form",
                        "explode": false,
                        "allowReserved": false
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Recipient address",
                        "required": false,
                        "deprecated": false,
                        "allowEmptyValue": false,
                        "schema": {
                            "type": "string"
                        },
                        "style": "form",
                        "explode": false,
                        "allowReserved": false
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Delivery status code",
                        "required": false,
                        "deprecated": false,
                        "allowEmptyValue": false,
                        "schema": {
                            "type": "string"
                        },
                        "style": "form",
                        "explode": false,
                        "allowReserved": false
                    },
                    {
                        "name": "statusDescription",
                        "in": "query",
                        "description": "Delivery status message",
                        "required": false,
                        "deprecated": false,
                        "allowEmptyValue": false,
                        "schema": {
                            "type": "string"
                        },
                        "style": "form",
                        "explode": false,
                        "allowReserved": false
                    },
                    {
                        "name": "timeField",
                        "in": "query",
                        "description": "Which timestamp field timeStart/timeEnd filters apply to.",
                        "required": false,
                        "deprecated": false,
                        "allowEmptyValue": false,
                        "schema": {
                            "type": "string",
                            "default": "created",
                            "enum": [
                                "created",
                                "finished"
                            ]
                        },
                        "style": "form",
                        "explode": false,
                        "allowReserved": false
                    },
                    {
                        "name": "timeStart",
                        "in": "query",
                        "description": "Date/Timestamp. Acceptable formats Unix and RFC3339",
                        "required": false,
                        "deprecated": false,
                        "allowEmptyValue": false,
                        "schema": {
                            "type": "string"
                        },
                        "style": "form",
                        "explode": false,
                        "allowReserved": false
                    },
                    {
                        "name": "timeEnd",
                        "in": "query",
                        "description": "Date/Timestamp. Acceptable formats Unix and RFC3339",
                        "required": false,
                        "deprecated": false,
                        "allowEmptyValue": false,
                        "schema": {
                            "type": "string"
                        },
                        "style": "form",
                        "explode": false,
                        "allowReserved": false
                    },
                    {
                        "name": "countOnly",
                        "in": "query",
                        "description": "If you would like a report on the total number of items returned by the request for your API key, change the query parameter to 1.<br>Note:<br>- Items are only counted, a list of results is NOT returned.<br>- If used with `limit` query parameter, the `limit` is ignored",
                        "required": false,
                        "deprecated": false,
                        "allowEmptyValue": false,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        },
                        "style": "form",
                        "explode": false,
                        "allowReserved": false
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Selection of returned objects limited to specified value.",
                        "required": false,
                        "deprecated": false,
                        "allowEmptyValue": false,
                        "schema": {
                            "type": "integer",
                            "default": 10,
                            "maximum": 1000
                        },
                        "style": "form",
                        "explode": false,
                        "allowReserved": false
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "By combining with the `limit` query parameter, used to return a specific segment of the objects list. Offset refers to the starting point for the beginning of the retrieval.",
                        "required": false,
                        "deprecated": false,
                        "allowEmptyValue": false,
                        "schema": {
                            "type": "integer",
                            "default": 0
                        },
                        "style": "form",
                        "explode": false,
                        "allowReserved": false
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Syntax: `property_name` (for example 'id') `-` (hyphen) `ASC or DESC`.<br><br>  Refer to the example below.<br>",
                        "required": false,
                        "deprecated": false,
                        "allowEmptyValue": false,
                        "schema": {
                            "type": "string",
                            "example": "created-DESC"
                        },
                        "style": "form",
                        "explode": false,
                        "allowReserved": false
                    }
                ],
                "deprecated": false
            },
            "parameters": []
        },
        "/v1/message/{id}": {
            "get": {
                "operationId": "getMessageItem",
                "tags": [
                    "Email"
                ],
                "responses": {
                    "200": {
                        "description": "message resource",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/message-v1MessageGet.output"
                                }
                            },
                            "text/html": {
                                "schema": {
                                    "$ref": "#/components/schemas/message-v1MessageGet.output"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found"
                    }
                },
                "summary": "Retrieves a message resource.",
                "description": "Retrieves a message resource.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Resource identifier",
                        "required": true,
                        "deprecated": false,
                        "allowEmptyValue": false,
                        "schema": {
                            "type": "string"
                        },
                        "style": "simple",
                        "explode": false,
                        "allowReserved": false
                    }
                ],
                "deprecated": false
            },
            "parameters": []
        },
        "/v1/send": {
            "post": {
                "operationId": "postSendCollection",
                "tags": [
                    "Email"
                ],
                "responses": {
                    "201": {
                        "description": "send resource created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/send.SendMessagesResponse-v1Send.output"
                                }
                            },
                            "text/html": {
                                "schema": {
                                    "$ref": "#/components/schemas/send.SendMessagesResponse-v1Send.output"
                                }
                            }
                        },
                        "links": {}
                    },
                    "400": {
                        "description": "Invalid input"
                    },
                    "422": {
                        "description": "Unprocessable entity"
                    }
                },
                "summary": "Creates a send resource.",
                "description": "Creates a send resource.",
                "parameters": [],
                "requestBody": {
                    "description": "The new send resource",
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/send-v1Send.input"
                            }
                        },
                        "text/html": {
                            "schema": {
                                "$ref": "#/components/schemas/send-v1Send.input"
                            }
                        }
                    },
                    "required": true
                },
                "deprecated": false
            },
            "parameters": []
        }
    },
    "components": {
        "schemas": {
            "MessageAttachment-v1Send.input": {
                "type": "object",
                "description": "",
                "properties": {
                    "filename": {
                        "type": "string",
                        "nullable": true
                    },
                    "contentId": {
                        "type": "string",
                        "nullable": true
                    },
                    "contentType": {
                        "type": "string"
                    },
                    "base64Content": {
                        "type": "string"
                    }
                }
            },
            "MessageRecipient-v1MessageGet.output": {
                "type": "object",
                "description": "",
                "properties": {
                    "email": {
                        "example": "jane.doe@example.com",
                        "type": "string"
                    }
                }
            },
            "MessageRecipient-v1Send.input": {
                "type": "object",
                "description": "",
                "properties": {
                    "name": {
                        "example": "Jane Doe",
                        "type": "string"
                    },
                    "email": {
                        "example": "jane.doe@example.com",
                        "type": "string"
                    }
                }
            },
            "MessageRecipient-v1Send.output": {
                "type": "object",
                "description": ""
            },
            "SendMessagesItem-v1Send.input": {
                "type": "object",
                "description": "",
                "properties": {
                    "from": {
                        "$ref": "#/components/schemas/MessageRecipient-v1Send.input"
                    },
                    "sender": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/MessageRecipient-v1Send.input"
                            }
                        ],
                        "nullable": true
                    },
                    "replyTo": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/MessageRecipient-v1Send.input"
                            }
                        ],
                        "nullable": true
                    },
                    "to": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/MessageRecipient-v1Send.input"
                        }
                    },
                    "cc": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/MessageRecipient-v1Send.input"
                        }
                    },
                    "bcc": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/MessageRecipient-v1Send.input"
                        }
                    },
                    "subject": {
                        "type": "string"
                    },
                    "html": {
                        "type": "string",
                        "nullable": true
                    },
                    "text": {
                        "type": "string",
                        "nullable": true
                    },
                    "attachments": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/MessageAttachment-v1Send.input"
                        }
                    },
                    "inlinedAttachments": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/MessageAttachment-v1Send.input"
                        }
                    },
                    "templateLanguage": {
                        "type": "boolean"
                    },
                    "variables": {
                        "description": "Map of variables which are available to just this message.",
                        "example": {
                            "ExampleVar": "local value",
                            "GlobalVar2": "overrides global var of same name"
                        },
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "headers": {
                        "description": "Map of headers to add to just this message.",
                        "example": {
                            "X-Example-Header": "Header Value"
                        },
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "SendMessagesResponseItem-v1Send.output": {
                "type": "object",
                "description": "",
                "properties": {
                    "successful": {
                        "description": "Flag to indicate if this message was accepted.",
                        "type": "boolean"
                    },
                    "sourceIndex": {
                        "description": "Indicates which 'message' element from the original request this result applies to.",
                        "type": "integer",
                        "nullable": true
                    },
                    "to": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/MessageRecipient-v1Send.output"
                        }
                    },
                    "cc": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/MessageRecipient-v1Send.output"
                        }
                    },
                    "bcc": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/MessageRecipient-v1Send.output"
                        }
                    },
                    "messageId": {
                        "description": "ID assigned to this message.",
                        "type": "string",
                        "nullable": true
                    },
                    "status": {
                        "description": "Response status code.",
                        "type": "string"
                    },
                    "statusMessage": {
                        "description": "Response reason message.",
                        "type": "string"
                    }
                }
            },
            "message-v1MessageGet.output": {
                "type": "object",
                "description": "Transaction log for an accepted message.",
                "properties": {
                    "id": {
                        "description": "Recipient Identifier",
                        "type": "string"
                    },
                    "messageId": {
                        "description": "Message Identifier",
                        "type": "string"
                    },
                    "from": {
                        "description": "Sender",
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/MessageRecipient-v1MessageGet.output"
                            }
                        ],
                        "nullable": true
                    },
                    "to": {
                        "description": "Recipient",
                        "$ref": "#/components/schemas/MessageRecipient-v1MessageGet.output"
                    },
                    "subject": {
                        "description": "Subject line",
                        "type": "string"
                    },
                    "created": {
                        "description": "Timestamp",
                        "type": "string"
                    },
                    "finished": {
                        "description": "Finished Timestamp",
                        "type": "string",
                        "nullable": true
                    },
                    "status": {
                        "description": "Delivery status code",
                        "type": "string"
                    },
                    "statusDescription": {
                        "description": "Delivery status message",
                        "type": "string"
                    },
                    "tlsIn": {
                        "description": "TLS version (incoming)",
                        "type": "string",
                        "nullable": true
                    },
                    "tlsOut": {
                        "description": "TLS version (incoming)",
                        "type": "string",
                        "nullable": true
                    },
                    "deliveryIp": {
                        "description": "Outbound IP used for delivery",
                        "type": "string",
                        "nullable": true
                    },
                    "destinationMx": {
                        "description": "Destination MX hostname",
                        "type": "string",
                        "nullable": true
                    },
                    "destinationIp": {
                        "description": "Destination IP address",
                        "type": "string",
                        "nullable": true
                    },
                    "destinationPort": {
                        "description": "Destination port",
                        "type": "integer",
                        "nullable": true
                    }
                }
            },
            "send-v1Send.input": {
                "type": "object",
                "description": "Send one or more messages.",
                "properties": {
                    "sandboxMode": {
                        "description": "Sandbox mode will validate the input provided but not send any email to the recipients.",
                        "type": "boolean"
                    },
                    "globals": {
                        "description": "Map of variables which are available to every message in this transaction.",
                        "example": {
                            "GlobalVar1": "value",
                            "GlobalVar2": "another value"
                        },
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "messages": {
                        "description": "Collection of individual email messages to send in this transaction.",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SendMessagesItem-v1Send.input"
                        }
                    }
                }
            },
            "send.SendMessagesResponse-v1Send.output": {
                "type": "object",
                "description": "Send one or more messages.",
                "properties": {
                    "successful": {
                        "description": "Flag to indicate if all messages in the transaction were accepted.",
                        "type": "boolean"
                    },
                    "messages": {
                        "description": "Status of all messages processed during this transaction.",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SendMessagesResponseItem-v1Send.output"
                        }
                    }
                }
            }
        },
        "responses": {},
        "parameters": {},
        "examples": {},
        "requestBodies": {},
        "headers": {},
        "securitySchemes": {
            "Credentials": {
                "type": "http",
                "scheme": "basic"
            }
        }
    },
    "security": [
        {
            "Credentials": []
        }
    ],
    "tags": []
}