{ "consumes": [ "application/json" ], "produces": [ "application/json" ], "schemes": [ "http" ], "swagger": "2.0", "info": { "description": "OpenAPI 2.0 documentation for [Mailpit](https://github.com/axllent/mailpit).", "title": "Mailpit API", "contact": { "name": "GitHub", "url": "https://github.com/axllent/mailpit" }, "license": { "name": "MIT license", "url": "https://github.com/axllent/mailpit/blob/develop/LICENSE" }, "version": "v1" }, "paths": { "/api/v1/chaos": { "get": { "description": "Returns the current Chaos triggers configuration.\nThis API route will return an error if Chaos is not enabled at runtime.", "produces": [ "application/json" ], "schemes": [ "http", "https" ], "tags": [ "testing" ], "summary": "Get Chaos triggers", "operationId": "getChaos", "responses": { "200": { "$ref": "#/responses/ChaosResponse" }, "400": { "$ref": "#/responses/ErrorResponse" } } }, "put": { "description": "Set the Chaos triggers configuration and return the updated values.\nThis API route will return an error if Chaos is not enabled at runtime.\n\nIf any triggers are omitted from the request, then those are reset to their\ndefault values with a 0% probability (ie: disabled).\nSetting a blank `{}` will reset all triggers to their default values.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "schemes": [ "http", "https" ], "tags": [ "testing" ], "summary": "Set Chaos triggers", "operationId": "setChaosParams", "parameters": [ { "name": "Body", "in": "body", "schema": { "$ref": "#/definitions/ChaosTriggers" } } ], "responses": { "200": { "$ref": "#/responses/ChaosResponse" }, "400": { "$ref": "#/responses/ErrorResponse" } } } }, "/api/v1/info": { "get": { "description": "Returns basic runtime information, message totals and latest release version.", "produces": [ "application/json" ], "schemes": [ "http", "https" ], "tags": [ "application" ], "summary": "Get application information", "operationId": "AppInformation", "responses": { "200": { "$ref": "#/responses/AppInfoResponse" }, "400": { "$ref": "#/responses/ErrorResponse" } } } }, "/api/v1/message/{ID}": { "get": { "description": "Returns the summary of a message, marking the message as read.\n\nThe ID can be set to `latest` to return the latest message.", "produces": [ "application/json" ], "schemes": [ "http", "https" ], "tags": [ "message" ], "summary": "Get message summary", "operationId": "GetMessageParams", "parameters": [ { "type": "string", "description": "Message database ID or \"latest\"", "name": "ID", "in": "path", "required": true } ], "responses": { "200": { "description": "Message", "schema": { "$ref": "#/definitions/Message" } }, "400": { "$ref": "#/responses/ErrorResponse" }, "404": { "$ref": "#/responses/NotFoundResponse" } } } }, "/api/v1/message/{ID}/headers": { "get": { "description": "Returns the message headers as an array. Note that header keys are returned alphabetically.\n\nThe ID can be set to `latest` to return the latest message headers.", "produces": [ "application/json" ], "schemes": [ "http", "https" ], "tags": [ "message" ], "summary": "Get message headers", "operationId": "GetHeadersParams", "parameters": [ { "type": "string", "description": "Message database ID or \"latest\"", "name": "ID", "in": "path", "required": true } ], "responses": { "200": { "description": "MessageHeadersResponse", "schema": { "$ref": "#/definitions/MessageHeadersResponse" } }, "400": { "$ref": "#/responses/ErrorResponse" }, "404": { "$ref": "#/responses/NotFoundResponse" } } } }, "/api/v1/message/{ID}/html-check": { "get": { "description": "Returns the summary of the message HTML checker.\n\nThe ID can be set to `latest` to return the latest message.", "produces": [ "application/json" ], "schemes": [ "http", "https" ], "tags": [ "other" ], "summary": "HTML check", "operationId": "HTMLCheckParams", "parameters": [ { "type": "string", "description": "Message database ID or \"latest\"", "name": "ID", "in": "path", "required": true } ], "responses": { "200": { "description": "HTMLCheckResponse", "schema": { "$ref": "#/definitions/HTMLCheckResponse" } }, "400": { "$ref": "#/responses/ErrorResponse" }, "404": { "$ref": "#/responses/NotFoundResponse" } } } }, "/api/v1/message/{ID}/link-check": { "get": { "description": "Returns the summary of the message Link checker.\n\nThe ID can be set to `latest` to return the latest message.", "produces": [ "application/json" ], "schemes": [ "http", "https" ], "tags": [ "other" ], "summary": "Link check", "operationId": "LinkCheckParams", "parameters": [ { "type": "string", "description": "Message database ID or \"latest\"", "name": "ID", "in": "path", "required": true }, { "type": "string", "default": "false", "x-go-name": "Follow", "description": "Follow redirects", "name": "follow", "in": "query" } ], "responses": { "200": { "description": "LinkCheckResponse", "schema": { "$ref": "#/definitions/LinkCheckResponse" } }, "400": { "$ref": "#/responses/ErrorResponse" }, "404": { "$ref": "#/responses/NotFoundResponse" } } } }, "/api/v1/message/{ID}/part/{PartID}": { "get": { "description": "This will return the attachment part using the appropriate Content-Type.\n\nThe ID can be set to `latest` to reference the latest message.", "produces": [ "application/*", "image/*", "text/*" ], "schemes": [ "http", "https" ], "tags": [ "message" ], "summary": "Get message attachment", "operationId": "AttachmentParams", "parameters": [ { "type": "string", "description": "Message database ID or \"latest\"", "name": "ID", "in": "path", "required": true }, { "type": "string", "description": "Attachment part ID", "name": "PartID", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/BinaryResponse" }, "400": { "$ref": "#/responses/ErrorResponse" }, "404": { "$ref": "#/responses/NotFoundResponse" } } } }, "/api/v1/message/{ID}/part/{PartID}/thumb": { "get": { "description": "This will return a cropped 180x120 JPEG thumbnail of an image attachment.\nIf the image is smaller than 180x120 then the image is padded. If the attachment is not an image then a blank image is returned.\n\nThe ID can be set to `latest` to return the latest message.", "produces": [ "image/jpeg" ], "schemes": [ "http", "https" ], "tags": [ "message" ], "summary": "Get an attachment image thumbnail", "operationId": "ThumbnailParams", "parameters": [ { "type": "string", "description": "Message database ID or \"latest\"", "name": "ID", "in": "path", "required": true }, { "type": "string", "description": "Attachment part ID", "name": "PartID", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/BinaryResponse" }, "400": { "$ref": "#/responses/ErrorResponse" } } } }, "/api/v1/message/{ID}/raw": { "get": { "description": "Returns the full email source as plain text.\n\nThe ID can be set to `latest` to return the latest message source.", "produces": [ "text/plain" ], "schemes": [ "http", "https" ], "tags": [ "message" ], "summary": "Get message source", "operationId": "DownloadRawParams", "parameters": [ { "type": "string", "description": "Message database ID or \"latest\"", "name": "ID", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/TextResponse" }, "400": { "$ref": "#/responses/ErrorResponse" }, "404": { "$ref": "#/responses/NotFoundResponse" } } } }, "/api/v1/message/{ID}/release": { "post": { "description": "Release a message via a pre-configured external SMTP server. This is only enabled if message relaying has been configured.\n\nThe ID can be set to `latest` to reference the latest message.", "consumes": [ "application/json" ], "produces": [ "text/plain" ], "schemes": [ "http", "https" ], "tags": [ "message" ], "summary": "Release message", "operationId": "ReleaseMessageParams", "parameters": [ { "type": "string", "description": "Message database ID", "name": "ID", "in": "path", "required": true }, { "name": "Body", "in": "body", "schema": { "type": "object", "required": [ "To" ], "properties": { "To": { "description": "Array of email addresses to relay the message to", "type": "array", "items": { "type": "string" }, "example": [ "user1@example.com", "user2@example.com" ] } } } } ], "responses": { "200": { "$ref": "#/responses/OKResponse" }, "400": { "$ref": "#/responses/ErrorResponse" }, "404": { "$ref": "#/responses/NotFoundResponse" } } } }, "/api/v1/message/{ID}/sa-check": { "get": { "description": "Returns the SpamAssassin summary (if enabled) of the message.\n\nThe ID can be set to `latest` to return the latest message.", "produces": [ "application/json" ], "schemes": [ "http", "https" ], "tags": [ "other" ], "summary": "SpamAssassin check", "operationId": "SpamAssassinCheckParams", "parameters": [ { "type": "string", "description": "Message database ID or \"latest\"", "name": "ID", "in": "path", "required": true } ], "responses": { "200": { "description": "SpamAssassinResponse", "schema": { "$ref": "#/definitions/SpamAssassinResponse" } }, "400": { "$ref": "#/responses/ErrorResponse" }, "404": { "$ref": "#/responses/NotFoundResponse" } } } }, "/api/v1/messages": { "get": { "description": "Returns messages from the mailbox ordered from newest to oldest.", "produces": [ "application/json" ], "schemes": [ "http", "https" ], "tags": [ "messages" ], "summary": "List messages", "operationId": "GetMessagesParams", "parameters": [ { "type": "integer", "format": "int64", "default": 0, "x-go-name": "Start", "description": "Pagination offset", "name": "start", "in": "query" }, { "type": "integer", "format": "int64", "default": 50, "x-go-name": "Limit", "description": "Limit number of results", "name": "limit", "in": "query" } ], "responses": { "200": { "$ref": "#/responses/MessagesSummaryResponse" }, "400": { "$ref": "#/responses/ErrorResponse" } } }, "put": { "description": "You can optionally provide an array of IDs or a search string.\nIf neither IDs nor search is provided then all mailbox messages are updated.", "consumes": [ "application/json" ], "produces": [ "text/plain" ], "schemes": [ "http", "https" ], "tags": [ "messages" ], "summary": "Set read status", "operationId": "SetReadStatusParams", "parameters": [ { "name": "Body", "in": "body", "schema": { "type": "object", "properties": { "IDs": { "description": "Optional array of message database IDs", "type": "array", "default": [], "items": { "type": "string" }, "example": [ "4oRBnPtCXgAqZniRhzLNmS", "hXayS6wnCgNnt6aFTvmOF6" ] }, "Read": { "description": "Read status", "type": "boolean", "default": false, "example": true }, "Search": { "description": "Optional messages matching a search", "type": "string", "example": "tag:backups" } } } }, { "type": "string", "x-go-name": "TZ", "description": "Optional [timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used only for `before:` \u0026 `after:` searches (eg: \"Pacific/Auckland\").", "name": "tz", "in": "query" } ], "responses": { "200": { "$ref": "#/responses/OKResponse" }, "400": { "$ref": "#/responses/ErrorResponse" } } }, "delete": { "description": "Delete individual or all messages. If no IDs are provided then all messages are deleted.", "consumes": [ "application/json" ], "produces": [ "text/plain" ], "schemes": [ "http", "https" ], "tags": [ "messages" ], "summary": "Delete messages", "operationId": "DeleteMessagesParams", "parameters": [ { "description": "Delete request", "name": "Body", "in": "body", "schema": { "type": "object", "properties": { "IDs": { "description": "Array of message database IDs", "type": "array", "items": { "type": "string" }, "example": [ "4oRBnPtCXgAqZniRhzLNmS", "hXayS6wnCgNnt6aFTvmOF6" ] } } } } ], "responses": { "200": { "$ref": "#/responses/OKResponse" }, "400": { "$ref": "#/responses/ErrorResponse" } } } }, "/api/v1/search": { "get": { "description": "Returns messages matching [a search](https://mailpit.axllent.org/docs/usage/search-filters/), sorted by received date (descending).", "produces": [ "application/json" ], "schemes": [ "http", "https" ], "tags": [ "messages" ], "summary": "Search messages", "operationId": "SearchParams", "parameters": [ { "type": "string", "x-go-name": "Query", "description": "Search query", "name": "query", "in": "query", "required": true }, { "type": "string", "default": "0", "x-go-name": "Start", "description": "Pagination offset", "name": "start", "in": "query" }, { "type": "string", "default": "50", "x-go-name": "Limit", "description": "Limit results", "name": "limit", "in": "query" }, { "type": "string", "x-go-name": "TZ", "description": "Optional [timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used only for `before:` \u0026 `after:` searches (eg: \"Pacific/Auckland\").", "name": "tz", "in": "query" } ], "responses": { "200": { "$ref": "#/responses/MessagesSummaryResponse" }, "400": { "$ref": "#/responses/ErrorResponse" } } }, "delete": { "description": "Delete all messages matching [a search](https://mailpit.axllent.org/docs/usage/search-filters/).", "produces": [ "application/json" ], "schemes": [ "http", "https" ], "tags": [ "messages" ], "summary": "Delete messages by search", "operationId": "DeleteSearchParams", "parameters": [ { "type": "string", "x-go-name": "Query", "description": "Search query", "name": "query", "in": "query", "required": true }, { "type": "string", "x-go-name": "TZ", "description": "[Timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used only for `before:` \u0026 `after:` searches (eg: \"Pacific/Auckland\").", "name": "tz", "in": "query" } ], "responses": { "200": { "$ref": "#/responses/OKResponse" }, "400": { "$ref": "#/responses/ErrorResponse" } } } }, "/api/v1/send": { "post": { "description": "Send a message via the HTTP API.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "schemes": [ "http", "https" ], "tags": [ "message" ], "summary": "Send a message", "operationId": "SendMessageParams", "parameters": [ { "name": "Body", "in": "body", "schema": { "type": "object", "required": [ "From" ], "properties": { "Attachments": { "description": "Attachments", "type": "array", "items": { "type": "object", "required": [ "Content", "Filename" ], "properties": { "Content": { "description": "Base64-encoded string of the file content", "type": "string", "example": "iVBORw0KGgoAAAANSUhEUgAAAEEAAAA8CAMAAAAOlSdoAAAACXBIWXMAAAHrAAAB6wGM2bZBAAAAS1BMVEVHcEwRfnUkZ2gAt4UsSF8At4UtSV4At4YsSV4At4YsSV8At4YsSV4At4YsSV4sSV4At4YsSV4At4YtSV4At4YsSV4At4YtSV8At4YsUWYNAAAAGHRSTlMAAwoXGiktRE5dbnd7kpOlr7zJ0d3h8PD8PCSRAAACWUlEQVR42pXT4ZaqIBSG4W9rhqQYocG+/ys9Y0Z0Br+x3j8zaxUPewFh65K+7yrIMeIY4MT3wPfEJCidKXEMnLaVkxDiELiMz4WEOAZSFghxBIypCOlKiAMgXfIqTnBgSm8CIQ6BImxEUxEckClVQiHGj4Ba4AQHikAIClwTE9KtIghAhUJwoLkmLnCiAHJLRKgIMsEtVUKbBUIwoAg2C4QgQBE6l4VCnApBgSKYLLApCnCa0+96AEMW2BQcmC+Pr3nfp7o5Exy49gIADcIqUELGfeA+bp93LmAJp8QJoEcN3C7NY3sbVANixMyI0nku20/n5/ZRf3KI2k6JEDWQtxcbdGuAqu3TAXG+/799Oyyas1B1MnMiA+XyxHp9q0PUKGPiRAau1fZbLRZV09wZcT8/gHk8QQAxXn8VgaDqcUmU6O/r28nbVwXAqca2mRNtPAF5+zoP2MeN9Fy4NgC6RfcbgE7XITBRYTtOE3U3C2DVff7pk+PkUxgAbvtnPXJaD6DxulMLwOhPS/M3MQkgg1ZFrIXnmfaZoOfpKiFgzeZD/WuKqQEGrfJYkyWf6vlG3xUgTuscnkNkQsb599q124kdpMUjCa/XARHs1gZymVtGt3wLkiFv8rUgTxitYCex5EVGec0Y9VmoDTFBSQte2TfXGXlf7hbdaUM9Sk7fisEN9qfBBTK+FZcvM9fQSdkl2vj4W2oX/bRogO3XasiNH7R0eW7fgRM834ImTg+Lg6BEnx4vz81rhr+MYPBBQg1v8GndEOrthxaCTxNAOut8WKLGZQl+MPz88Q9tAO/hVuSeqQAAAABJRU5ErkJggg==" }, "ContentID": { "description": "Optional Content-ID (`cid`) for attachment.\nIf this field is set then the file is attached inline.", "type": "string", "example": "mailpit-logo" }, "ContentType": { "description": "Optional Content Type for the the attachment.\nIf this field is not set (or empty) then the content type is automatically detected.", "type": "string", "example": "image/png" }, "Filename": { "description": "Filename", "type": "string", "example": "mailpit.png" } } } }, "Bcc": { "description": "Bcc recipients email addresses only", "type": "array", "items": { "type": "string" }, "example": [ "jack@example.com" ] }, "Cc": { "description": "Cc recipients", "type": "array", "items": { "type": "object", "required": [ "Email" ], "properties": { "Email": { "description": "Email address", "type": "string", "example": "manager@example.com" }, "Name": { "description": "Optional name", "type": "string", "example": "Manager" } } } }, "From": { "description": "\"From\" recipient", "type": "object", "required": [ "Email" ], "properties": { "Email": { "description": "Email address", "type": "string", "example": "john@example.com" }, "Name": { "description": "Optional name", "type": "string", "example": "John Doe" } } }, "HTML": { "description": "Message body (HTML)", "type": "string", "example": "\u003cdiv style=\"text-align:center\"\u003e\u003cp style=\"font-family: arial; font-size: 24px;\"\u003eMailpit is \u003cb\u003eawesome\u003c/b\u003e!\u003c/p\u003e\u003cp\u003e\u003cimg src=\"cid:mailpit-logo\" /\u003e\u003c/p\u003e\u003c/div\u003e" }, "Headers": { "description": "Optional headers in {\"key\":\"value\"} format", "type": "object", "additionalProperties": { "type": "string" }, "example": { "X-IP": "1.2.3.4" } }, "ReplyTo": { "description": "Optional Reply-To recipients", "type": "array", "items": { "type": "object", "required": [ "Email" ], "properties": { "Email": { "description": "Email address", "type": "string", "example": "secretary@example.com" }, "Name": { "description": "Optional name", "type": "string", "example": "Secretary" } } } }, "Subject": { "description": "Subject", "type": "string", "example": "Mailpit message via the HTTP API" }, "Tags": { "description": "Mailpit tags", "type": "array", "items": { "type": "string" }, "example": [ "Tag 1", "Tag 2" ] }, "Text": { "description": "Message body (text)", "type": "string", "example": "Mailpit is awesome!" }, "To": { "description": "\"To\" recipients", "type": "array", "items": { "type": "object", "required": [ "Email" ], "properties": { "Email": { "description": "Email address", "type": "string", "example": "jane@example.com" }, "Name": { "description": "Optional name", "type": "string", "example": "Jane Doe" } } } } } } } ], "responses": { "200": { "$ref": "#/responses/SendMessageResponse" }, "400": { "$ref": "#/responses/JSONErrorResponse" } } } }, "/api/v1/tags": { "get": { "description": "Returns a JSON array of all unique message tags.", "produces": [ "application/json" ], "schemes": [ "http", "https" ], "tags": [ "tags" ], "summary": "Get all current tags", "operationId": "GetAllTags", "responses": { "200": { "$ref": "#/responses/ArrayResponse" }, "400": { "$ref": "#/responses/ErrorResponse" } } }, "put": { "description": "This will overwrite any existing tags for selected message database IDs. To remove all tags from a message, pass an empty tags array.", "consumes": [ "application/json" ], "produces": [ "text/plain" ], "schemes": [ "http", "https" ], "tags": [ "tags" ], "summary": "Set message tags", "operationId": "SetTagsParams", "parameters": [ { "name": "Body", "in": "body", "schema": { "type": "object", "required": [ "Tags", "IDs" ], "properties": { "IDs": { "description": "Array of message database IDs", "type": "array", "items": { "type": "string" }, "example": [ "4oRBnPtCXgAqZniRhzLNmS", "hXayS6wnCgNnt6aFTvmOF6" ] }, "Tags": { "description": "Array of tag names to set", "type": "array", "items": { "type": "string" }, "example": [ "Tag 1", "Tag 2" ] } } } } ], "responses": { "200": { "$ref": "#/responses/OKResponse" }, "400": { "$ref": "#/responses/ErrorResponse" } } } }, "/api/v1/tags/{Tag}": { "put": { "description": "Renames an existing tag.", "produces": [ "text/plain" ], "schemes": [ "http", "https" ], "tags": [ "tags" ], "summary": "Rename a tag", "operationId": "RenameTagParams", "parameters": [ { "type": "string", "description": "The url-encoded tag name to rename", "name": "Tag", "in": "path", "required": true }, { "name": "Body", "in": "body", "schema": { "type": "object", "required": [ "Name" ], "properties": { "Name": { "description": "New name", "type": "string", "example": "New name" } } } } ], "responses": { "200": { "$ref": "#/responses/OKResponse" }, "400": { "$ref": "#/responses/ErrorResponse" } } }, "delete": { "description": "Deletes a tag. This will not delete any messages with the tag, but will remove the tag from any messages containing the tag.", "produces": [ "text/plain" ], "schemes": [ "http", "https" ], "tags": [ "tags" ], "summary": "Delete a tag", "operationId": "DeleteTagParams", "parameters": [ { "type": "string", "description": "The url-encoded tag name to delete", "name": "Tag", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/OKResponse" }, "400": { "$ref": "#/responses/ErrorResponse" } } } }, "/api/v1/webui": { "get": { "description": "Returns configuration settings for the web UI.\nIntended for web UI only!", "produces": [ "application/json" ], "schemes": [ "http", "https" ], "tags": [ "application" ], "summary": "Get web UI configuration", "operationId": "WebUIConfigurationResponse", "responses": { "200": { "$ref": "#/responses/WebUIConfigurationResponse" }, "400": { "$ref": "#/responses/ErrorResponse" } } } }, "/view/{ID}.html": { "get": { "description": "Renders just the message's HTML part which can be used for UI integration testing.\nAttached inline images are modified to link to the API provided they exist.\nNote that is the message does not contain a HTML part then an 404 error is returned.\n\nThe ID can be set to `latest` to return the latest message.", "produces": [ "text/html" ], "schemes": [ "http", "https" ], "tags": [ "testing" ], "summary": "Render message HTML part", "operationId": "GetMessageHTMLParams", "parameters": [ { "type": "string", "description": "Message database ID or \"latest\"", "name": "ID", "in": "path", "required": true }, { "type": "string", "x-go-name": "Embed", "description": "If this is route is to be embedded in an iframe, set embed to `1` in the URL to add `target=\"_blank\"` and `rel=\"noreferrer noopener\"` to all links.\n\nIn addition, a small script will be added to the end of the document to post (postMessage()) the height of the document back to the parent window for optional iframe height resizing.\n\nNote that this will also *transform* the message into a full HTML document (if it isn't already), so this option is useful for viewing but not programmatic testing.", "name": "embed", "in": "query" } ], "responses": { "200": { "$ref": "#/responses/HTMLResponse" }, "400": { "$ref": "#/responses/ErrorResponse" }, "404": { "$ref": "#/responses/NotFoundResponse" } } } }, "/view/{ID}.txt": { "get": { "description": "Renders just the message's text part which can be used for UI integration testing.\n\nThe ID can be set to `latest` to return the latest message.", "produces": [ "text/plain" ], "schemes": [ "http", "https" ], "tags": [ "testing" ], "summary": "Render message text part", "operationId": "GetMessageTextParams", "parameters": [ { "type": "string", "description": "Message database ID or \"latest\"", "name": "ID", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/TextResponse" }, "400": { "$ref": "#/responses/ErrorResponse" }, "404": { "$ref": "#/responses/NotFoundResponse" } } } } }, "definitions": { "Address": { "description": "An address such as \"Barry Gibbs \u003cbg@example.com\u003e\" is represented\nas Address{Name: \"Barry Gibbs\", Address: \"bg@example.com\"}.", "type": "object", "title": "Address represents a single mail address.", "properties": { "Address": { "type": "string" }, "Name": { "type": "string" } }, "x-go-package": "net/mail" }, "AppInformation": { "description": "AppInformation struct", "type": "object", "properties": { "Database": { "description": "Database path", "type": "string" }, "DatabaseSize": { "description": "Database size in bytes", "type": "integer", "format": "uint64" }, "LatestVersion": { "description": "Latest Mailpit version", "type": "string" }, "Messages": { "description": "Total number of messages in the database", "type": "integer", "format": "uint64" }, "RuntimeStats": { "description": "Runtime statistics", "type": "object", "properties": { "Memory": { "description": "Current memory usage in bytes", "type": "integer", "format": "uint64" }, "MessagesDeleted": { "description": "Database runtime messages deleted", "type": "integer", "format": "uint64" }, "SMTPAccepted": { "description": "Accepted runtime SMTP messages", "type": "integer", "format": "uint64" }, "SMTPAcceptedSize": { "description": "Total runtime accepted messages size in bytes", "type": "integer", "format": "uint64" }, "SMTPIgnored": { "description": "Ignored runtime SMTP messages (when using --ignore-duplicate-ids)", "type": "integer", "format": "uint64" }, "SMTPRejected": { "description": "Rejected runtime SMTP messages", "type": "integer", "format": "uint64" }, "Uptime": { "description": "Mailpit server uptime in seconds", "type": "integer", "format": "uint64" } } }, "Tags": { "description": "Tags and message totals per tag", "type": "object", "additionalProperties": { "type": "integer", "format": "int64" } }, "Unread": { "description": "Total number of messages in the database", "type": "integer", "format": "uint64" }, "Version": { "description": "Current Mailpit version", "type": "string" } }, "x-go-package": "github.com/axllent/mailpit/internal/stats" }, "Attachment": { "description": "Attachment struct for inline and attachments", "type": "object", "properties": { "ContentID": { "description": "Content ID", "type": "string" }, "ContentType": { "description": "Content type", "type": "string" }, "FileName": { "description": "File name", "type": "string" }, "PartID": { "description": "Attachment part ID", "type": "string" }, "Size": { "description": "Size in bytes", "type": "integer", "format": "uint64" } }, "x-go-package": "github.com/axllent/mailpit/internal/storage" }, "ChaosTrigger": { "description": "Trigger for Chaos", "type": "object", "required": [ "ErrorCode", "Probability" ], "properties": { "ErrorCode": { "description": "SMTP error code to return. The value must range from 400 to 599.", "type": "integer", "format": "int64", "example": 451 }, "Probability": { "description": "Probability (chance) of triggering the error. The value must range from 0 to 100.", "type": "integer", "format": "int64", "example": 5 } }, "x-go-name": "Trigger", "x-go-package": "github.com/axllent/mailpit/internal/smtpd/chaos" }, "ChaosTriggers": { "description": "Triggers for the Chaos configuration", "type": "object", "properties": { "Authentication": { "$ref": "#/definitions/ChaosTrigger" }, "Recipient": { "$ref": "#/definitions/ChaosTrigger" }, "Sender": { "$ref": "#/definitions/ChaosTrigger" } }, "x-go-name": "Triggers", "x-go-package": "github.com/axllent/mailpit/internal/smtpd/chaos" }, "HTMLCheckResponse": { "description": "Response represents the HTML check response struct", "type": "object", "properties": { "Platforms": { "description": "All platforms tested, mainly for the web UI", "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "Total": { "$ref": "#/definitions/HTMLCheckTotal" }, "Warnings": { "description": "List of warnings from tests", "type": "array", "items": { "$ref": "#/definitions/HTMLCheckWarning" } } }, "x-go-name": "Response", "x-go-package": "github.com/axllent/mailpit/internal/htmlcheck" }, "HTMLCheckResult": { "description": "Result struct", "type": "object", "properties": { "Family": { "description": "Family eg: Outlook, Mozilla Thunderbird", "type": "string" }, "Name": { "description": "Friendly name of result, combining family, platform \u0026 version", "type": "string" }, "NoteNumber": { "description": "Note number for partially supported if applicable", "type": "string" }, "Platform": { "description": "Platform eg: ios, android, windows", "type": "string" }, "Support": { "description": "Support [yes, no, partial]", "type": "string" }, "Version": { "description": "Family version eg: 4.7.1, 2019-10, 10.3", "type": "string" } }, "x-go-name": "Result", "x-go-package": "github.com/axllent/mailpit/internal/htmlcheck" }, "HTMLCheckScore": { "description": "Score struct", "type": "object", "properties": { "Found": { "description": "Number of matches in the document", "type": "integer", "format": "int64" }, "Partial": { "description": "Total percentage partially supported", "type": "number", "format": "float" }, "Supported": { "description": "Total percentage supported", "type": "number", "format": "float" }, "Unsupported": { "description": "Total percentage unsupported", "type": "number", "format": "float" } }, "x-go-name": "Score", "x-go-package": "github.com/axllent/mailpit/internal/htmlcheck" }, "HTMLCheckTotal": { "description": "Total weighted result for all scores", "type": "object", "properties": { "Nodes": { "description": "Total number of HTML nodes detected in message", "type": "integer", "format": "int64" }, "Partial": { "description": "Overall percentage partially supported", "type": "number", "format": "float" }, "Supported": { "description": "Overall percentage supported", "type": "number", "format": "float" }, "Tests": { "description": "Total number of tests done", "type": "integer", "format": "int64" }, "Unsupported": { "description": "Overall percentage unsupported", "type": "number", "format": "float" } }, "x-go-name": "Total", "x-go-package": "github.com/axllent/mailpit/internal/htmlcheck" }, "HTMLCheckWarning": { "description": "Warning represents a failed test", "type": "object", "properties": { "Category": { "description": "Category [css, html]", "type": "string" }, "Description": { "description": "Description", "type": "string" }, "Keywords": { "description": "Keywords", "type": "string" }, "NotesByNumber": { "description": "Notes based on results", "type": "object", "additionalProperties": { "type": "string" } }, "Results": { "description": "Test results", "type": "array", "items": { "$ref": "#/definitions/HTMLCheckResult" } }, "Score": { "$ref": "#/definitions/HTMLCheckScore" }, "Slug": { "description": "Slug identifier", "type": "string" }, "Tags": { "description": "Tags", "type": "array", "items": { "type": "string" } }, "Title": { "description": "Friendly title", "type": "string" }, "URL": { "description": "URL to caniemail.com", "type": "string" } }, "x-go-name": "Warning", "x-go-package": "github.com/axllent/mailpit/internal/htmlcheck" }, "Link": { "description": "Link struct", "type": "object", "properties": { "Status": { "description": "HTTP status definition", "type": "string" }, "StatusCode": { "description": "HTTP status code", "type": "integer", "format": "int64" }, "URL": { "description": "Link URL", "type": "string" } }, "x-go-package": "github.com/axllent/mailpit/internal/linkcheck" }, "LinkCheckResponse": { "description": "Response represents the Link check response", "type": "object", "properties": { "Errors": { "description": "Total number of errors", "type": "integer", "format": "int64" }, "Links": { "description": "Tested links", "type": "array", "items": { "$ref": "#/definitions/Link" } } }, "x-go-name": "Response", "x-go-package": "github.com/axllent/mailpit/internal/linkcheck" }, "ListUnsubscribe": { "description": "ListUnsubscribe contains a summary of List-Unsubscribe \u0026 List-Unsubscribe-Post headers\nincluding validation of the link structure", "type": "object", "properties": { "Errors": { "description": "Validation errors (if any)", "type": "string" }, "Header": { "description": "List-Unsubscribe header value", "type": "string" }, "HeaderPost": { "description": "List-Unsubscribe-Post value (if set)", "type": "string" }, "Links": { "description": "Detected links, maximum one email and one HTTP(S) link", "type": "array", "items": { "type": "string" } } }, "x-go-package": "github.com/axllent/mailpit/internal/storage" }, "Message": { "description": "Message data excluding physical attachments", "type": "object", "properties": { "Attachments": { "description": "Message attachments", "type": "array", "items": { "$ref": "#/definitions/Attachment" } }, "Bcc": { "description": "Bcc addresses", "type": "array", "items": { "$ref": "#/definitions/Address" } }, "Cc": { "description": "Cc addresses", "type": "array", "items": { "$ref": "#/definitions/Address" } }, "Date": { "description": "Message RFC3339Nano date \u0026 time (if set), else date \u0026 time received\n([extended RFC3339](https://tools.ietf.org/html/rfc3339#section-5.6) format with optional nano seconds)", "type": "string", "format": "date-time" }, "From": { "$ref": "#/definitions/Address" }, "HTML": { "description": "Message body HTML", "type": "string" }, "ID": { "description": "Database ID", "type": "string" }, "Inline": { "description": "Inline message attachments", "type": "array", "items": { "$ref": "#/definitions/Attachment" } }, "ListUnsubscribe": { "$ref": "#/definitions/ListUnsubscribe" }, "MessageID": { "description": "Message ID", "type": "string" }, "ReplyTo": { "description": "ReplyTo addresses", "type": "array", "items": { "$ref": "#/definitions/Address" } }, "ReturnPath": { "description": "Return-Path", "type": "string" }, "Size": { "description": "Message size in bytes", "type": "integer", "format": "uint64" }, "Subject": { "description": "Message subject", "type": "string" }, "Tags": { "description": "Message tags", "type": "array", "items": { "type": "string" } }, "Text": { "description": "Message body text", "type": "string" }, "To": { "description": "To addresses", "type": "array", "items": { "$ref": "#/definitions/Address" } }, "Username": { "description": "Username used for authentication (if provided) with the SMTP or Send API", "type": "string" } }, "x-go-package": "github.com/axllent/mailpit/internal/storage" }, "MessageHeadersResponse": { "description": "Message headers", "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } }, "x-go-name": "messageHeadersResponse", "x-go-package": "github.com/axllent/mailpit/server/apiv1" }, "MessageSummary": { "description": "MessageSummary struct for frontend messages", "type": "object", "properties": { "Attachments": { "description": "Whether the message has any attachments", "type": "integer", "format": "int64" }, "Bcc": { "description": "Bcc addresses", "type": "array", "items": { "$ref": "#/definitions/Address" } }, "Cc": { "description": "Cc addresses", "type": "array", "items": { "$ref": "#/definitions/Address" } }, "Created": { "description": "Received RFC3339Nano date \u0026 time ([extended RFC3339](https://tools.ietf.org/html/rfc3339#section-5.6) format with optional nano seconds)", "type": "string", "format": "date-time" }, "From": { "$ref": "#/definitions/Address" }, "ID": { "description": "Database ID", "type": "string" }, "MessageID": { "description": "Message ID", "type": "string" }, "Read": { "description": "Read status", "type": "boolean" }, "ReplyTo": { "description": "Reply-To address", "type": "array", "items": { "$ref": "#/definitions/Address" } }, "Size": { "description": "Message size in bytes (total)", "type": "integer", "format": "uint64" }, "Snippet": { "description": "Message snippet includes up to 250 characters", "type": "string" }, "Subject": { "description": "Email subject", "type": "string" }, "Tags": { "description": "Message tags", "type": "array", "items": { "type": "string" } }, "To": { "description": "To address", "type": "array", "items": { "$ref": "#/definitions/Address" } }, "Username": { "description": "Username used for authentication (if provided) with the SMTP or Send API", "type": "string" } }, "x-go-package": "github.com/axllent/mailpit/internal/storage" }, "MessagesSummary": { "description": "MessagesSummary is a summary of a list of messages", "type": "object", "properties": { "messages": { "description": "Messages summary\nin: body", "type": "array", "items": { "$ref": "#/definitions/MessageSummary" }, "x-go-name": "Messages" }, "messages_count": { "description": "Total number of messages matching current query", "type": "integer", "format": "uint64", "x-go-name": "MessagesCount" }, "messages_unread": { "description": "Total number of unread messages matching current query", "type": "integer", "format": "uint64", "x-go-name": "MessagesUnreadCount" }, "start": { "description": "Pagination offset", "type": "integer", "format": "int64", "x-go-name": "Start" }, "tags": { "description": "All current tags", "type": "array", "items": { "type": "string" }, "x-go-name": "Tags" }, "total": { "description": "Total number of messages in mailbox", "type": "integer", "format": "uint64", "x-go-name": "Total" }, "unread": { "description": "Total number of unread messages in mailbox", "type": "integer", "format": "uint64", "x-go-name": "Unread" } }, "x-go-package": "github.com/axllent/mailpit/server/apiv1" }, "Rule": { "description": "Rule struct", "type": "object", "properties": { "Description": { "description": "SpamAssassin rule description", "type": "string" }, "Name": { "description": "SpamAssassin rule name", "type": "string" }, "Score": { "description": "Spam rule score", "type": "number", "format": "double" } }, "x-go-package": "github.com/axllent/mailpit/internal/spamassassin" }, "SpamAssassinResponse": { "description": "Result is a SpamAssassin result", "type": "object", "properties": { "Error": { "description": "If populated will return an error string", "type": "string" }, "IsSpam": { "description": "Whether the message is spam or not", "type": "boolean" }, "Rules": { "description": "Spam rules triggered", "type": "array", "items": { "$ref": "#/definitions/Rule" } }, "Score": { "description": "Total spam score based on triggered rules", "type": "number", "format": "double" } }, "x-go-name": "Result", "x-go-package": "github.com/axllent/mailpit/internal/spamassassin" } }, "responses": { "AppInfoResponse": { "description": "Application information", "schema": { "$ref": "#/definitions/AppInformation" } }, "ArrayResponse": { "description": "Plain JSON array response", "schema": { "type": "array", "items": { "type": "string" } } }, "BinaryResponse": { "description": "Binary data response which inherits the attachment's content type.", "schema": { "type": "string" } }, "ChaosResponse": { "description": "Response for the Chaos triggers configuration", "schema": { "$ref": "#/definitions/ChaosTriggers" } }, "ErrorResponse": { "description": "Server error will return with a 400 status code\nwith the error message in the body", "schema": { "type": "string" } }, "HTMLResponse": { "description": "HTML response", "schema": { "type": "string" } }, "JSONErrorResponse": { "description": "JSON error response", "schema": { "type": "object", "properties": { "Error": { "description": "Error message", "type": "string", "example": "invalid format" } } } }, "MessagesSummaryResponse": { "description": "Summary of messages", "schema": { "$ref": "#/definitions/MessagesSummary" } }, "NotFoundResponse": { "description": "Not found error will return a 404 status code", "schema": { "type": "string" } }, "OKResponse": { "description": "Plain text \"ok\" response", "schema": { "type": "string" } }, "SendMessageResponse": { "description": "Confirmation message for HTTP send API", "schema": { "type": "object", "properties": { "ID": { "description": "Database ID", "type": "string", "example": "iAfZVVe2UQfNSG5BAjgYwa" } } } }, "TextResponse": { "description": "Plain text response", "schema": { "type": "string" } }, "WebUIConfigurationResponse": { "description": "Web UI configuration response", "schema": { "type": "object", "properties": { "ChaosEnabled": { "description": "Whether Chaos support is enabled at runtime", "type": "boolean" }, "DuplicatesIgnored": { "description": "Whether messages with duplicate IDs are ignored", "type": "boolean" }, "HideDeleteAllButton": { "description": "Whether the delete button should be hidden", "type": "boolean" }, "Label": { "description": "Optional label to identify this Mailpit instance", "type": "string" }, "MessageRelay": { "description": "Message Relay information", "type": "object", "properties": { "AllowedRecipients": { "description": "Only allow relaying to these recipients (regex)", "type": "string" }, "BlockedRecipients": { "description": "Block relaying to these recipients (regex)", "type": "string" }, "Enabled": { "description": "Whether message relaying (release) is enabled", "type": "boolean" }, "OverrideFrom": { "description": "Overrides the \"From\" address for all relayed messages", "type": "string" }, "PreserveMessageIDs": { "description": "Preserve the original Message-IDs when relaying messages", "type": "boolean" }, "ReturnPath": { "description": "Enforced Return-Path (if set) for relay bounces", "type": "string" }, "SMTPServer": { "description": "The configured SMTP server address", "type": "string" } } }, "SpamAssassin": { "description": "Whether SpamAssassin is enabled", "type": "boolean" } } } } } }