{ "openapi": "3.0.3", "info": { "title": "MailBaby Email Delivery and Management Service API", "version": "1.1.0", "description": "**Send emails fast and with confidence through our easy to use [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API interface.**\n# Overview\nThis is the API interface to the [Mail Baby](https//mail.baby/) Mail services provided by [InterServer](https://www.interserver.net). To use this service you must have an account with us at [my.interserver.net](https://my.interserver.net).\n# Authentication\nIn order to use most of the API calls you must pass credentials from the [my.interserver.net](https://my.interserver.net/) site.\nWe support several different authentication methods but the preferred method is to use the **API Key** which you can get from the [Account Security](https://my.interserver.net/account_security) page.\n", "termsOfService": "https://www.interserver.net/terms-of-service.html", "contact": { "name": "Mail Baby", "url": "https://www.mail.baby/contact/", "email": "support@interserver.net" }, "license": { "name": "GNU GPLv3", "url": "https://www.gnu.org/licenses/gpl.txt" } }, "servers": [ { "url": "https://api.mailbaby.net", "description": "Live API Endpoint" } ], "paths": { "/mail": { "get": { "tags": [ "Services" ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MailOrder" } }, "examples": { "MailOrders": { "value": [ { "id": 39, "status": "active", "username": "mb39" }, { "id": 33, "status": "canceled", "username": "mb33", "comment": "test order" } ] } } } }, "links": { "sendMailByIdLink": { "operationId": "sendMail", "parameters": { "id": "$response.body#/0/id" }, "description": "The `id` value returned in the response can be used as the `id` parameter in `GET /mail/advsend`." } }, "description": "OK" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/Unauthorized" } }, "operationId": "getMailOrders", "summary": "displays a list of mail service orders", "description": "This will return a list of the mail orders you have in our system including their id, status, username, and optional comment." } }, "/mail/blocks": { "get": { "tags": [ "Blocking" ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailBlocks" }, "examples": { "MailBlocksExample": { "value": { "local": [ { "date": "2023-08-07", "from": "user@domain.com", "messageId": "pFaRqFUEWkucjhTuIzYuoAgWU@domain.com", "subject": "Test Email", "to": "['client@site.com']" } ], "mbtrap": [ { "date": "2023-08-07", "from": "user@domain.com", "messageId": "pFaRqFUEWkucjhTuIzYuoAgWU@domain.com", "subject": "Test Email", "to": "['client@site.com']" } ], "subject": [ { "from": "user@domain.com", "subject": "Test Email" } ] } } } } }, "links": { "delistBlockLink": { "operationId": "delistBlock", "parameters": { "email": "$response.body#/local/0/from" }, "description": "The `from` value returned in the response can be used as the `email` parameter in `DELETE /mail/blocks`." } }, "description": "OK" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/Unauthorized" } }, "operationId": "getMailBlocks", "summary": "displays a list of blocked email addresses" } }, "/mail/stats": { "get": { "tags": [ "History" ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "required": [ "id", "status", "username" ], "type": "object", "properties": { "id": { "type": "integer", "example": 1234 }, "status": { "type": "string", "example": "active" }, "username": { "type": "string", "example": "mb1234" }, "password": { "type": "string", "example": "guest123" }, "comment": { "type": "string", "example": "main mail account" } } } } } }, "links": { "delistBlockLink": { "operationId": "delistBlock", "parameters": { "id": "$response.body#/0/id" }, "description": "The `id` value returned in the response can be used as the `id` parameter in `GET /mail/advsend`." } }, "description": "OK" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/Unauthorized" } }, "operationId": "getStats", "summary": "Account usage statistics.", "description": "Returns information about the usage on your mail accounts." } }, "/mail/send": { "post": { "requestBody": { "content": { "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/SendMail" } }, "application/json": { "schema": { "$ref": "#/components/schemas/SendMail" } } }, "required": true }, "tags": [ "Sending" ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenericResponse" } } }, "description": "search results matching criteria" }, "400": { "$ref": "#/components/responses/BadInput" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } }, "operationId": "sendMail", "summary": "Sends an Email", "description": "Sends an email through one of your mail orders.\n\n*Note*: If you want to send to multiple recipients or use file attachments use the advsend (Advanced Send) call instead.\n" } }, "/mail/advsend": { "summary": "Sends an Email with Advanced Options", "description": "Sends An email through one of your mail orders allowing additional options such as file attachments, cc, bcc, etc.", "post": { "requestBody": { "content": { "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/SendMailAdv" }, "examples": { "AdvSendExample": { "value": { "subject": "Welcome", "body": "Hello", "from": { "email": "user@domain.com" }, "to": [ { "email": "someone@client.com", "name": "Mr Client" } ], "attachments": [ { "filename": "message.txt", "data": "base64_encoded_contents" } ], "id": 66 } } } }, "application/json": { "schema": { "$ref": "#/components/schemas/SendMailAdv" }, "examples": { "AdvSendExample": { "value": { "subject": "Welcome", "body": "Hello", "from": { "email": "user@domain.com" }, "to": [ { "email": "someone@client.com", "name": "Mr Client" } ], "attachments": [ { "filename": "message.txt", "data": "base64_encoded_contents" } ], "id": 66 } } } } }, "required": true }, "tags": [ "Sending" ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenericResponse" } } }, "description": "search results matching criteria" }, "400": { "$ref": "#/components/responses/BadInput" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } }, "operationId": "sendAdvMail", "summary": "Sends an Email with Advanced Options", "description": "Sends An email through one of your mail orders allowing additional options such as file attachments, cc, bcc, etc.\n\nHere are 9 examples showing the various ways to call the advsend operation showing the different ways you can pass the to, cc, bcc, and replyto information. The first several examples are all for the application/x-www-form-urlencoded content-type while the later ones are for application/json content-types.\n\n```\ncurl -i --request POST --url https://api.mailbaby.net/mail/advsend \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/x-www-form-urlencoded' \\\n--header 'X-API-KEY: YOUR_API_KEY' \\\n--data 'subject=Welcome' \\\n--data 'body=Hello' \\\n--data from=user@domain.com \\\n--data to=support@interserver.net\n```\n\n```\ncurl -i --request POST --url https://api.mailbaby.net/mail/advsend \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/x-www-form-urlencoded' \\\n--header 'X-API-KEY: YOUR_API_KEY' \\\n--data 'subject=Welcome' \\\n--data 'body=Hello' \\\n--data from=user@domain.com \\\n--data \"to[0][name]=Joe\" \\\n--data \"to[0][email]=support@interserver.net\"\n```\n\n```\ncurl -i --request POST --url https://api.mailbaby.net/mail/advsend \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/x-www-form-urlencoded' \\\n--header 'X-API-KEY: YOUR_API_KEY' \\\n--data 'subject=Welcome' \\\n--data 'body=Hello' \\\n--data from=\"Joe \" \\\n--data to=\"Joe \"\n```\n\n```\ncurl -i --request POST --url https://api.mailbaby.net/mail/advsend \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/x-www-form-urlencoded' \\\n--header 'X-API-KEY: YOUR_API_KEY' \\\n--data 'subject=Welcome' \\\n--data 'body=Hello' \\\n--data from=user@domain.com \\\n--data \"to=support@interserver.net, support@interserver.net\"\n```\n\n```\ncurl -i --request POST --url https://api.mailbaby.net/mail/advsend \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/x-www-form-urlencoded' \\\n--header 'X-API-KEY: YOUR_API_KEY' \\\n--data 'subject=Welcome' \\\n--data 'body=Hello' \\\n--data from=user@domain.com \\\n--data \"to=Joe , Joe \"\n```\n\n```\ncurl -i --request POST --url https://api.mailbaby.net/mail/advsend \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/x-www-form-urlencoded' \\\n--header 'X-API-KEY: YOUR_API_KEY' \\\n--data 'subject=Welcome' \\\n--data 'body=Hello' \\\n--data from=user@domain.com \\\n--data \"to[0][name]=Joe\" \\\n--data \"to[0][email]=support@interserver.net\" \\\n--data \"to[1][name]=Joe\" \\\n--data \"to[1][email]=support@interserver.net\"\n```\n\n```\ncurl -i --request POST --url https://api.mailbaby.net/mail/advsend \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--header 'X-API-KEY: YOUR_API_KEY' \\\n--data '{\n\"subject\": \"Welcome\",\n\"body\": \"Hello\",\n\"from\": \"user@domain.com\",\n\"to\": \"support@interserver.net\"\n}'\n```\n\n```\ncurl -i --request POST --url https://api.mailbaby.net/mail/advsend \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--header 'X-API-KEY: YOUR_API_KEY' \\\n--data '{\n\"subject\": \"Welcome\",\n\"body\": \"Hello\",\n\"from\": {\"name\": \"Joe\", \"email\": \"user@domain.com\"},\n\"to\": [{\"name\": \"Joe\", \"email\": \"support@interserver.net\"}]\n}'\n```\n\n```\ncurl -i --request POST --url https://api.mailbaby.net/mail/advsend \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--header 'X-API-KEY: YOUR_API_KEY' \\\n--data '{\n\"subject\": \"Welcome\",\n\"body\": \"Hello\",\n\"from\": \"Joe \",\n\"to\": \"Joe \"\n}'\n```\n" } }, "/mail/log": { "get": { "tags": [ "History" ], "parameters": [ { "example": 2604, "name": "id", "description": "The ID of your mail order this will be sent through.", "schema": { "format": "int64", "type": "integer" }, "in": "query", "required": false }, { "example": "1.2.3.4", "name": "origin", "description": "originating ip address sending mail", "schema": { "type": "string" }, "in": "query", "required": false }, { "example": "mx.google.com", "name": "mx", "description": "mx record mail was sent to", "schema": { "type": "string" }, "in": "query", "required": false }, { "example": "me@sender.com", "name": "from", "description": "from email address", "schema": { "type": "string" }, "in": "query", "required": false }, { "example": "you@receiver.com", "name": "to", "description": "to/destination email address", "schema": { "type": "string" }, "in": "query", "required": false }, { "example": "Support", "name": "subject", "description": "subject containing this string", "schema": { "type": "string" }, "in": "query", "required": false }, { "example": "185997065c60008840", "name": "mailid", "description": "mail id", "schema": { "type": "string" }, "in": "query", "required": false }, { "example": 1000, "name": "skip", "description": "number of records to skip for pagination", "schema": { "format": "int32", "default": 0, "minimum": 0, "type": "integer" }, "in": "query", "required": false }, { "example": 1000, "name": "limit", "description": "maximum number of records to return", "schema": { "format": "int32", "default": 100, "maximum": 10000, "minimum": 1, "type": "integer" }, "in": "query", "required": false }, { "example": 1641781008, "name": "startDate", "description": "earliest date to get emails in unix timestamp format", "schema": { "format": "int64", "maximum": 9999999999, "minimum": 0, "type": "integer" }, "in": "query", "required": false }, { "example": 1673317008, "name": "endDate", "description": "earliest date to get emails in unix timestamp format", "schema": { "format": "int64", "maximum": 9999999999, "minimum": 0, "type": "integer" }, "in": "query", "required": false }, { "name": "replyto", "description": "Reply-To Email Address", "schema": { "type": "string" }, "in": "query" }, { "name": "headerfrom", "description": "Header From Email Address", "schema": { "type": "string" }, "in": "query" } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailLog" }, "examples": { "MailLogExample": { "value": { "total": 1, "skip": 0, "limit": 100, "emails": [ { "_id": 103172, "id": "17c7eda538e0005d03", "from": "person@mysite.com", "to": "client@isp.com", "subject": "sell 0.005 shares", "messageId": "", "created": "2021-10-14 08:50:10", "time": 1634215809, "user": "mb5658", "transtype": "ESMTPSA", "origin": "199.231.189.154", "interface": "feeder", "sendingZone": "interserver", "bodySize": 63, "seq": 1, "recipient": "client@isp.com", "domain": "interserver.net", "locked": 1, "lockTime": "1634215818533", "assigned": "relay1", "queued": "2021-10-14T12:50:15.487Z", "mxHostname": "mx.j.is.cc", "response": "250 2.0.0 Ok queued as C91D83E128C" } ] } } } } }, "description": "search results matching criteria" }, "400": { "description": "bad input parameter" } }, "operationId": "viewMailLog", "summary": "displays the mail log", "description": "Get a listing of the emails sent through this system\n" } }, "/ping": { "get": { "tags": [ "Status" ], "responses": { "200": { "description": "Server is up and running" }, "default": { "description": "Something is wrong" } }, "operationId": "pingServer", "summary": "Checks if the server is running" } }, "/mail/blocks/delete": { "post": { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmailAddress" }, "examples": { "BlocksDeleteExample": { "value": { "email": "client@domain.com" } } } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/EmailAddress" }, "examples": { "BlocksDeleteExampleForm": { "value": { "email": "client@domain.com" } } } } }, "required": true }, "tags": [ "Blocking" ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenericResponse" } } }, "description": "search results matching criteria" }, "400": { "$ref": "#/components/responses/BadInput" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } }, "operationId": "delistBlock", "summary": "Removes an email address from the blocked list", "description": "Removes an email address from the various block lists.\n" } }, "/mail/rules": { "summary": "Deny Rules", "description": "The deny rules allow you to setup assorted types of rules which will automatically deny the email from being sent through our system when the citeria match.", "get": { "tags": [ "Blocking" ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DenyRuleRecord" } }, "examples": { "ExampleMailRulesList": { "value": [ { "id": "14", "user": "mb20682", "type": "email", "data": "domeinwo@server.guesshost.net", "created": "2022-03-22 19:16:35" }, { "id": "15", "user": "mb20682", "type": "email", "data": "mamediieva@thedigital.gov.ua", "created": "2022-03-22 19:18:01" } ] } } } }, "links": { "delistBlockLink": { "operationId": "delistBlock", "parameters": { "id": "$response.body#/0/id" }, "description": "The `id` value returned in the response can be used as the `id` parameter in `GET /mail/advsend`." } }, "description": "OK" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/Unauthorized" } }, "operationId": "getRules", "summary": "Displays a listing of deny email rules.", "description": "Returns a listing of all the deny block rules you have configured." }, "post": { "requestBody": { "description": "These are the fields needed to create a new email deny rule.", "content": { "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/DenyRuleNew" }, "examples": { "DenyRuleNewFormExample": { "value": { "user": "mb20682", "type": "email", "data": "domeinwo@server.guesshost.net" } } } }, "application/json": { "schema": { "$ref": "#/components/schemas/DenyRuleNew" }, "examples": { "DenyRuleNewJsonExample": { "value": { "user": "mb20682", "type": "email", "data": "domeinwo@server.guesshost.net" } } } } }, "required": true }, "tags": [ "Blocking" ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenericResponse" } } }, "description": "search results matching criteria" }, "400": { "$ref": "#/components/responses/BadInput" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } }, "operationId": "addRule", "summary": "Creates a new email deny rule.", "description": "Adds a new email deny rule into the system to block new emails that match the given criteria" } }, "/mail/rules/{ruleId}": { "delete": { "tags": [ "Blocking" ], "parameters": [ { "examples": { "RuleIdExample": { "value": "34" } }, "name": "ruleId", "description": "The ID of the Rules entry.", "schema": { "type": "integer" }, "in": "path", "required": true } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenericResponse" } } }, "description": "search results matching criteria" }, "400": { "$ref": "#/components/responses/BadInput" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } }, "operationId": "deleteRule", "summary": "Removes an deny mail rule.", "description": "Removes one of the configured deny mail rules from the system." } } }, "components": { "schemas": { "GenericResponse": { "type": "object", "properties": { "status": { "type": "string", "example": "ok" }, "text": { "type": "string", "example": "The command completed successfully." } } }, "ErrorMessage": { "title": "ErrorMessage", "description": "The resposne when an error occurs.", "required": [ "code", "message" ], "type": "object", "properties": { "code": { "format": "int32", "description": "The response code associated with the error.", "type": "integer", "example": "400" }, "message": { "description": "The details or description of the error.", "type": "string", "example": "There was an error." } }, "example": { "code": 400, "message": "There was an error." } }, "EmailAddressName": { "title": "EmailAddressName", "description": "An email contact.", "required": [ "email" ], "type": "object", "properties": { "email": { "description": "The email address.", "type": "string", "example": "user@domain.com" }, "name": { "description": "Name to use for the sending contact.", "type": "string", "example": "John Smith" } }, "example": { "email": "user@domain.com", "name": "John Smith" } }, "DenyRuleRecord": { "title": "DenyRuleRecord", "description": "The data for a email deny rule record.", "type": "object", "allOf": [ { "required": [ "id", "created" ], "type": "object", "properties": { "id": { "description": "The deny rule Id number.", "type": "string", "example": "41124" }, "created": { "format": "date-time", "description": "the date the rule was created.", "type": "string", "example": "2022-03-22 19:16:35" } } }, { "$ref": "#/components/schemas/DenyRuleNew" } ], "example": { "id": 14, "user": "mb20682", "type": "email", "data": "domeinwo@server.guesshost.net", "created": "2022-03-22 19:16:35" } }, "DenyRuleNew": { "title": "DenyRuleNew", "description": "The data for a email deny rule record.", "required": [ "type", "data" ], "type": "object", "properties": { "user": { "description": "Mail account username that will be tied to this rule. If not specified the first active mail order will be used.", "type": "string", "example": "mb20682" }, "type": { "description": "The type of deny rule.", "enum": [ "domain", "email", "startswith", "destination" ], "type": "string", "example": "email" }, "data": { "description": "The content of the rule. If a domain type rule then an example would be google.com. For a begins with type an example would be msgid-. For the email typer an example would be user@server.com.", "type": "string", "example": "domeinwo@server.guesshost.net" } }, "example": { "user": "mb20682", "type": "email", "data": "domeinwo@server.guesshost.net" } }, "MailAttachment": { "title": "MailAttachment", "description": "(optional) File attachments to include in the email. The file contents must be base64", "required": [ "data", "filename" ], "type": "object", "properties": { "filename": { "description": "The filename of the attached file.", "type": "string", "example": "message.txt" }, "data": { "description": "The file contents base64 encoded", "type": "string", "example": "aGVsbG8gdGhlcmUK" } }, "example": { "filename": "file.txt", "data": "base64_encoded_file_contents" } }, "MailBlockClickHouse": { "title": "MailBlockClickHouse", "description": "A block entry from the clickhouse mailblocks server.", "required": [ "date", "to", "subject", "messageId", "from" ], "type": "object", "properties": { "date": { "format": "date", "type": "string" }, "from": { "type": "string" }, "messageId": { "type": "string" }, "subject": { "type": "string" }, "to": { "type": "string" } }, "example": { "date": "2023-08-07", "from": "user@domain.com", "messageId": "pFaRqFUEWkucjhTuIzYuoAgWU@domain.com", "subject": "Test Email", "to": "['client@site.com']" } }, "MailBlockRspamd": { "title": "MailBlockRspamd", "description": "This is a block entry from the rspamd block list.", "required": [ "subject", "from" ], "type": "object", "properties": { "from": { "type": "string" }, "subject": { "type": "string" } }, "example": { "from": "user@domain.com", "subject": "Test email" } }, "MailBlocks": { "title": "MailBlocks", "description": "The listing of blocked emails.", "required": [ "local", "mbtrap", "subject" ], "type": "object", "properties": { "local": { "type": "array", "items": { "$ref": "#/components/schemas/MailBlockClickHouse" } }, "mbtrap": { "type": "array", "items": { "$ref": "#/components/schemas/MailBlockClickHouse" } }, "subject": { "type": "array", "items": { "$ref": "#/components/schemas/MailBlockRspamd" } } }, "example": { "local": [ { "date": "2023-08-07", "from": "user@domain.com", "messageId": "pFaRqFUEWkucjhTuIzYuoAgWU@domain.com", "subject": "Test Email", "to": "['client@site.com']" } ], "mbtrap": [ { "date": "2023-08-07", "from": "user@domain.com", "messageId": "pFaRqFUEWkucjhTuIzYuoAgWU@domain.com", "subject": "Test Email", "to": "['client@site.com']" } ], "subject": [ { "from": "user@domain.com", "subject": "Test Email" } ] } }, "MailLog": { "title": "MailLog", "description": "Mail log records", "required": [ "total", "skip", "limit", "emails" ], "type": "object", "properties": { "total": { "description": "total number of mail log entries", "type": "integer", "example": "10234" }, "skip": { "description": "number of emails skipped in listing", "type": "integer", "example": "0" }, "limit": { "description": "number of emails to return", "type": "integer", "example": "100" }, "emails": { "type": "array", "items": { "$ref": "#/components/schemas/MailLogEntry" }, "example": "[{\n \"_id\": 103172,\n \"id\": \"17c7eda538e0005d03\",\n \"from\": \"person@mysite.com\",\n \"to\": \"client@isp.com\",\n \"subject\": \"sell 0.005 shares\",\n \"messageId\": \"\",\n \"created\": \"2021-10-14 08:50:10\",\n \"time\": 1634215809,\n \"user\": \"mb5658\",\n \"transtype\": \"ESMTPSA\",\n \"origin\": \"199.231.189.154\",\n \"interface\": \"feeder\",\n \"sendingZone\": \"interserver\",\n \"bodySize\": 63,\n \"seq\": 1,\n \"recipient\": \"client@isp.com\",\n \"domain\": \"interserver.net\",\n \"locked\": 1,\n \"lockTime\": \"1634215818533\",\n \"assigned\": \"relay1\",\n \"queued\": \"2021-10-14T12:50:15.487Z\",\n \"mxHostname\": \"mx.j.is.cc\",\n \"response\": \"250 2.0.0 Ok queued as C91D83E128C\"\n}]" } }, "example": { "total": 1, "skip": 0, "limit": 100, "emails": [ { "_id": 103172, "id": "17c7eda538e0005d03", "from": "person@mysite.com", "to": "client@isp.com", "subject": "sell 0.005 shares", "messageId": "", "created": "2021-10-14T08:50:10.000Z", "time": 1634215809, "user": "mb5658", "transtype": "ESMTPSA", "origin": "199.231.189.154", "interface": "feeder", "sendingZone": "interserver", "bodySize": 63, "seq": 1, "recipient": "client@isp.com", "domain": "interserver.net", "locked": 1, "lockTime": "1634215818533", "assigned": "relay1", "queued": "2021-10-14T12:50:15.487Z", "mxHostname": "mx.j.is.cc", "response": "250 2.0.0 Ok queued as C91D83E128C" } ] } }, "MailOrder": { "title": "MailOrder", "description": "A mail order record", "required": [ "status", "id", "username" ], "type": "object", "properties": { "id": { "format": "int32", "description": "The ID of the order.", "type": "integer", "example": "21472" }, "status": { "description": "The order status.", "type": "string", "example": "active" }, "username": { "description": "The username to use for this order.", "type": "string", "example": "mb21472" }, "comment": { "description": "Optional order comment.", "type": "string" } }, "example": { "id": 21472, "status": "active", "username": "mb21472" } }, "SendMail": { "title": "SendMail", "description": "Details for an Email", "required": [ "to", "from", "subject", "body" ], "type": "object", "properties": { "to": { "description": "The Contact whom is the primary recipient of this email.", "type": "string", "example": "johndoe@company.com" }, "from": { "description": "The contact whom is the this email is from.", "type": "string", "example": "janedoe@company.com" }, "subject": { "description": "The subject or title of the email", "type": "string", "example": "Attention Client" }, "body": { "description": "The main email contents.", "type": "string", "example": "This is an email to inform you that something noteworthy happened." } } }, "EmailAddressNames": { "title": "EmailAddressNames", "description": "Array of Email Addresses", "type": "array", "items": { "$ref": "#/components/schemas/EmailAddressName" }, "example": [ { "email": "user@domain.com", "name": "John Smith" } ] }, "SendMailAdv": { "title": "SendMailAdv", "description": "Details for an Email", "required": [ "from", "to", "subject", "body" ], "type": "object", "properties": { "subject": { "description": "The subject or title of the email", "type": "string", "example": "Your Package has been Delivered!" }, "body": { "description": "The main email contents.", "type": "string", "example": "The package you ordered on 2021-01-23 has been delivered. If the package is broken into many pieces, please blaim someone else." }, "from": { "$ref": "#/components/schemas/EmailAddressTypes", "description": "The from email address.", "example": "me@company.com" }, "to": { "$ref": "#/components/schemas/EmailAddressesTypes", "description": "A list of destionation email addresses to send this to. You can pass the `to` field either as a RFC 822 compliant comma seperated list of email addresses (like `user@domain.com, user2@domain.com, Guy `) or as an array of objects each one having at least an `email` field with the email address and an optional `name` field with the display name.", "example": "user@domain.com" }, "replyto": { "$ref": "#/components/schemas/EmailAddressesTypes", "description": "(optional) A list of email addresses that specify where replies to the email should be sent instead of the _from_ address.", "example": "user@domain.com" }, "cc": { "$ref": "#/components/schemas/EmailAddressesTypes", "description": "(optional) A list of email addresses to carbon copy this message to. They are listed on the email and anyone getting the email can see this full list of Contacts who received the email as well.", "example": "user2@domain.com" }, "bcc": { "$ref": "#/components/schemas/EmailAddressesTypes", "description": "(optional) list of email addresses that should receive copies of the email. They are hidden on the email and anyone gettitng the email would not see the other people getting the email in this list.", "example": "[{\"email\": \"user@domain.com\", \"name\": \"John Smith\"}]" }, "attachments": { "description": "(optional) File attachments to include in the email. The file contents must be base64 encoded!", "type": "array", "items": { "$ref": "#/components/schemas/MailAttachment" }, "example": "[\n {\n \"filename\": \"text.txt\",\n \"data\": \"base64_encoded_contents\"\n }\n]" }, "id": { "format": "int64", "description": "(optional) ID of the Mail order within our system to use as the Mail Account.", "type": "integer", "example": "5000" } }, "example": { "subject": "Welcome", "body": "Hello", "from": "user@domain.com", "to": "someone@client.com", "cc": [ { "email": "someone2@client.com", "name": "Mr Client" }, { "email": "someone3@client.com", "name": "Mr Client" } ], "attachments": [ { "filename": "file.txt", "data": "base64_encoded_contents" } ], "id": 66 } }, "MailLogEntry": { "title": "MailLogEntry", "description": "An email record", "required": [ "_id", "id", "from", "to", "subject", "created", "time", "user", "transtype", "origin", "interface", "sendingZone", "bodySize", "seq", "recipient", "domain", "locked", "lockTime", "assigned", "queued", "mxHostname", "response" ], "type": "object", "properties": { "_id": { "description": "internal db id", "type": "integer", "example": "103172" }, "id": { "description": "mail id", "type": "string", "example": "17c7eda538e0005d03" }, "from": { "description": "from address", "type": "string", "example": "person@mysite.com" }, "to": { "description": "to address", "type": "string", "example": "client@isp.com" }, "subject": { "description": "email subject", "type": "string", "example": "sell 0.005 shares" }, "messageId": { "description": "message id", "type": "string", "example": "" }, "created": { "description": "creation date", "type": "string", "example": "2021-10-14 08:50:10" }, "time": { "description": "creation timestamp", "type": "integer", "example": "1634215809" }, "user": { "description": "user account", "type": "string", "example": "mb5658" }, "transtype": { "description": "transaction type", "type": "string", "example": "ESMTPSA" }, "origin": { "description": "origin ip", "type": "string", "example": "199.231.189.154" }, "interface": { "description": "interface name", "type": "string", "example": "feeder" }, "sendingZone": { "description": "sending zone", "type": "string", "example": "interserver" }, "bodySize": { "description": "email body size in bytes", "type": "integer", "example": "63" }, "seq": { "description": "index of email in the to adderess list", "type": "integer", "example": "1" }, "recipient": { "description": "to address this email is being sent to", "type": "string", "example": "client@isp.com" }, "domain": { "description": "to address domain", "type": "string", "example": "interserver.net" }, "locked": { "description": "locked status", "type": "integer", "example": "1" }, "lockTime": { "description": "lock timestamp", "type": "string", "example": "1634215818533" }, "assigned": { "description": "assigned server", "type": "string", "example": "relay1" }, "queued": { "description": "queued timestamp", "type": "string", "example": "2021-10-14T12:50:15.487Z" }, "mxHostname": { "description": "mx hostname", "type": "string", "example": "mx.j.is.cc" }, "response": { "description": "mail delivery response", "type": "string", "example": "250 2.0.0 Ok queued as C91D83E128C" } }, "example": { "_id": 103172, "id": "17c7eda538e0005d03", "from": "person@mysite.com", "to": "client@isp.com", "subject": "sell 0.005 shares", "messageId": "", "created": "2021-10-14 08:50:10", "time": 1634215809, "user": "mb5658", "transtype": "ESMTPSA", "origin": "199.231.189.154", "interface": "feeder", "sendingZone": "interserver", "bodySize": 63, "seq": 1, "recipient": "client@isp.com", "domain": "interserver.net", "locked": 1, "lockTime": "1634215818533", "assigned": "relay1", "queued": "2021-10-14T12:50:15.487Z", "mxHostname": "mx.j.is.cc", "response": "250 2.0.0 Ok queued as C91D83E128C" } }, "EmailAddress": { "description": "an email address", "type": "string", "example": "user@domain.com" }, "EmailAddressesTypes": { "oneOf": [ { "$ref": "#/components/schemas/EmailAddress" }, { "$ref": "#/components/schemas/EmailAddressNames" } ], "title": "EmailAddressTypes", "description": "" }, "EmailAddressTypes": { "oneOf": [ { "$ref": "#/components/schemas/EmailAddress" }, { "$ref": "#/components/schemas/EmailAddressName" } ], "title": "EmailAddressTypes", "description": "" } }, "responses": { "BadInput": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorMessage" }, "examples": { "BadInputError": { "value": { "code": 400, "message": "There was a problem with the input parameters." } } } } }, "description": "Error message when there was a problem with the input parameters." }, "NotFound": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorMessage" }, "examples": { "NotFoundError": { "value": { "code": 404, "message": "The specified resource was not found." } } } } }, "description": "The specified resource was not found" }, "Unauthorized": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorMessage" }, "examples": { "UnauthorizedError": { "value": { "code": 401, "message": "Unauthorized" } } } } }, "description": "Unauthorized" } }, "securitySchemes": { "apiKeyAuth": { "type": "apiKey", "description": "This authentication method uses a X-API-KEY HTTP header with the API Key from your account for validation.", "name": "X-API-KEY", "in": "header" } } }, "security": [ { "apiKeyAuth": [] } ], "tags": [ { "name": "Services", "description": "Mail service orders." }, { "name": "Sending", "description": "Email delivery commands" }, { "name": "Blocking", "description": "Management of email blocking rules and block lists." }, { "name": "History", "description": "Information about already delivered emails." }, { "name": "Status", "description": "Service Status" } ], "externalDocs": { "description": "FAQ", "url": "https://www.mail.baby/tips/" } }