1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-01-10 00:43:53 +02:00
mailpit/server/ui/api/v1/swagger.json
2024-05-05 15:50:56 +12:00

1818 lines
48 KiB
JSON

{
"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/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/InfoResponse"
},
"default": {
"$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": "Message",
"parameters": [
{
"type": "string",
"description": "Message database ID or \"latest\"",
"name": "ID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Message",
"schema": {
"$ref": "#/definitions/Message"
}
},
"default": {
"$ref": "#/responses/ErrorResponse"
}
}
}
},
"/api/v1/message/{ID}/headers": {
"get": {
"description": "Returns the message headers as an array.\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": "Headers",
"parameters": [
{
"type": "string",
"description": "Message database ID or \"latest\"",
"name": "ID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "MessageHeaders",
"schema": {
"$ref": "#/definitions/MessageHeaders"
}
},
"default": {
"$ref": "#/responses/ErrorResponse"
}
}
}
},
"/api/v1/message/{ID}/html-check": {
"get": {
"description": "Returns the summary of the message HTML checker.",
"produces": [
"application/json"
],
"schemes": [
"http",
"https"
],
"tags": [
"Other"
],
"summary": "HTML check",
"operationId": "HTMLCheck",
"parameters": [
{
"type": "string",
"description": "Message database ID or \"latest\"",
"name": "ID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "HTMLCheckResponse",
"schema": {
"$ref": "#/definitions/HTMLCheckResponse"
}
},
"default": {
"$ref": "#/responses/ErrorResponse"
}
}
}
},
"/api/v1/message/{ID}/link-check": {
"get": {
"description": "Returns the summary of the message Link checker.",
"produces": [
"application/json"
],
"schemes": [
"http",
"https"
],
"tags": [
"Other"
],
"summary": "Link check",
"operationId": "LinkCheck",
"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"
}
},
"default": {
"$ref": "#/responses/ErrorResponse"
}
}
}
},
"/api/v1/message/{ID}/part/{PartID}": {
"get": {
"description": "This will return the attachment part using the appropriate Content-Type.",
"produces": [
"application/*",
"image/*",
"text/*"
],
"schemes": [
"http",
"https"
],
"tags": [
"message"
],
"summary": "Get message attachment",
"operationId": "Attachment",
"parameters": [
{
"type": "string",
"description": "Message database ID",
"name": "ID",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Attachment part ID",
"name": "PartID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/BinaryResponse"
},
"default": {
"$ref": "#/responses/ErrorResponse"
}
}
}
},
"/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.",
"produces": [
"image/jpeg"
],
"schemes": [
"http",
"https"
],
"tags": [
"message"
],
"summary": "Get an attachment image thumbnail",
"operationId": "Thumbnail",
"parameters": [
{
"type": "string",
"description": "Database ID",
"name": "ID",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Attachment part ID",
"name": "PartID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/BinaryResponse"
},
"default": {
"$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": "Raw",
"parameters": [
{
"type": "string",
"description": "Message database ID or \"latest\"",
"name": "ID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/TextResponse"
},
"default": {
"$ref": "#/responses/ErrorResponse"
}
}
}
},
"/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.",
"consumes": [
"application/json"
],
"produces": [
"text/plain"
],
"schemes": [
"http",
"https"
],
"tags": [
"message"
],
"summary": "Release message",
"operationId": "ReleaseMessage",
"parameters": [
{
"type": "string",
"description": "Message database ID",
"name": "ID",
"in": "path",
"required": true
},
{
"name": "Body",
"in": "body",
"schema": {
"$ref": "#/definitions/releaseMessageRequestBody"
}
}
],
"responses": {
"200": {
"$ref": "#/responses/OKResponse"
},
"default": {
"$ref": "#/responses/ErrorResponse"
}
}
}
},
"/api/v1/message/{ID}/sa-check": {
"get": {
"description": "Returns the SpamAssassin summary (if enabled) of the message.",
"produces": [
"application/json"
],
"schemes": [
"http",
"https"
],
"tags": [
"Other"
],
"summary": "SpamAssassin check",
"operationId": "SpamAssassinCheck",
"parameters": [
{
"type": "string",
"description": "Message database ID or \"latest\"",
"name": "ID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "SpamAssassinResponse",
"schema": {
"$ref": "#/definitions/SpamAssassinResponse"
}
},
"default": {
"$ref": "#/responses/ErrorResponse"
}
}
}
},
"/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": "GetMessages",
"parameters": [
{
"type": "integer",
"default": 0,
"description": "Pagination offset",
"name": "start",
"in": "query"
},
{
"type": "integer",
"default": 50,
"description": "Limit results",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"$ref": "#/responses/MessagesSummaryResponse"
},
"default": {
"$ref": "#/responses/ErrorResponse"
}
}
},
"put": {
"description": "If no IDs are provided then all messages are updated.",
"consumes": [
"application/json"
],
"produces": [
"text/plain"
],
"schemes": [
"http",
"https"
],
"tags": [
"messages"
],
"summary": "Set read status",
"operationId": "SetReadStatus",
"parameters": [
{
"name": "Body",
"in": "body",
"schema": {
"$ref": "#/definitions/setReadStatusRequestBody"
}
}
],
"responses": {
"200": {
"$ref": "#/responses/OKResponse"
},
"default": {
"$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": "DeleteMessages",
"parameters": [
{
"name": "Body",
"in": "body",
"schema": {
"$ref": "#/definitions/DeleteRequest"
}
}
],
"responses": {
"200": {
"$ref": "#/responses/OKResponse"
},
"default": {
"$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": "MessagesSummary",
"parameters": [
{
"type": "string",
"description": "Search query",
"name": "query",
"in": "query",
"required": true
},
{
"type": "integer",
"default": 0,
"description": "Pagination offset",
"name": "start",
"in": "query"
},
{
"type": "integer",
"default": 50,
"description": "Limit results",
"name": "limit",
"in": "query"
},
{
"type": "string",
"description": "[Timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used specifically for `before:` \u0026 `after:` searches (eg: \"Pacific/Auckland\").",
"name": "tz",
"in": "query"
}
],
"responses": {
"200": {
"$ref": "#/responses/MessagesSummaryResponse"
},
"default": {
"$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": "DeleteSearch",
"parameters": [
{
"type": "string",
"description": "Search query",
"name": "query",
"in": "query",
"required": true
},
{
"type": "string",
"description": "[Timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used specifically for `before:` \u0026 `after:` searches (eg: \"Pacific/Auckland\").",
"name": "tz",
"in": "query"
}
],
"responses": {
"200": {
"$ref": "#/responses/OKResponse"
},
"default": {
"$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": "SendMessage",
"parameters": [
{
"name": "Body",
"in": "body",
"schema": {
"$ref": "#/definitions/SendRequest"
}
}
],
"responses": {
"200": {
"$ref": "#/responses/sendMessageResponse"
},
"default": {
"$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"
},
"default": {
"$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": "SetTags",
"parameters": [
{
"name": "Body",
"in": "body",
"schema": {
"$ref": "#/definitions/setTagsRequestBody"
}
}
],
"responses": {
"200": {
"$ref": "#/responses/OKResponse"
},
"default": {
"$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": "WebUIConfiguration",
"responses": {
"200": {
"$ref": "#/responses/WebUIConfigurationResponse"
},
"default": {
"$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": "GetMessageHTML",
"parameters": [
{
"type": "string",
"description": "Database ID or latest",
"name": "ID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/HTMLResponse"
},
"default": {
"$ref": "#/responses/ErrorResponse"
}
}
}
},
"/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": "GetMessageText",
"parameters": [
{
"type": "string",
"description": "Database ID or latest",
"name": "ID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/TextResponse"
},
"default": {
"$ref": "#/responses/ErrorResponse"
}
}
}
}
},
"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": "number",
"format": "double"
},
"LatestVersion": {
"description": "Latest Mailpit version",
"type": "string"
},
"Messages": {
"description": "Total number of messages in the database",
"type": "number",
"format": "double"
},
"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": "number",
"format": "double"
},
"SMTPAccepted": {
"description": "Accepted runtime SMTP messages",
"type": "number",
"format": "double"
},
"SMTPAcceptedSize": {
"description": "Total runtime accepted messages size in bytes",
"type": "number",
"format": "double"
},
"SMTPIgnored": {
"description": "Ignored runtime SMTP messages (when using --ignore-duplicate-ids)",
"type": "number",
"format": "double"
},
"SMTPRejected": {
"description": "Rejected runtime SMTP messages",
"type": "number",
"format": "double"
},
"Uptime": {
"description": "Mailpit server uptime in seconds",
"type": "number",
"format": "double"
}
}
},
"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": "number",
"format": "double"
},
"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": "number",
"format": "double"
}
},
"x-go-package": "github.com/axllent/mailpit/internal/storage"
},
"DeleteRequest": {
"description": "Delete request",
"type": "object",
"properties": {
"IDs": {
"description": "Array of message database IDs",
"type": "array",
"items": {
"type": "string"
},
"example": [
"5dec4247-812e-4b77-9101-e25ad406e9ea",
"8ac66bbc-2d9a-4c41-ad99-00aa75fa674e"
]
}
},
"x-go-name": "deleteMessagesRequestBody",
"x-go-package": "github.com/axllent/mailpit/server/apiv1"
},
"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"
},
"JSONErrorMessage": {
"description": "JSONErrorMessage struct",
"type": "object",
"properties": {
"Error": {
"description": "Error message",
"type": "string",
"example": "invalid format"
}
},
"x-go-package": "github.com/axllent/mailpit/server/apiv1"
},
"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"
},
"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 date if set, else date received",
"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"
}
},
"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": "number",
"format": "double"
},
"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"
}
}
},
"x-go-package": "github.com/axllent/mailpit/internal/storage"
},
"MessageHeaders": {
"description": "Message headers",
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
},
"x-go-name": "messageHeaders",
"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": "Created time",
"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": "number",
"format": "double"
},
"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"
}
}
},
"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": "number",
"format": "double",
"x-go-name": "MessagesCount"
},
"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": "number",
"format": "double",
"x-go-name": "Total"
},
"unread": {
"description": "Total number of unread messages in mailbox",
"type": "number",
"format": "double",
"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"
},
"SendMessageConfirmation": {
"description": "SendMessageConfirmation struct",
"type": "object",
"properties": {
"ID": {
"description": "Database ID",
"type": "string",
"example": "iAfZVVe2UQFNSG5BAjgYwa"
}
},
"x-go-package": "github.com/axllent/mailpit/server/apiv1"
},
"SendRequest": {
"description": "SendRequest to send a message via HTTP",
"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": "VGhpcyBpcyBhIHBsYWluIHRleHQgYXR0YWNobWVudA=="
},
"Filename": {
"description": "Filename",
"type": "string",
"example": "AttachedFile.txt"
}
}
}
},
"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": "\u003cp style=\"font-family: arial\"\u003eMailpit is \u003cb\u003eawesome\u003c/b\u003e!\u003c/p\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": "This is the text body"
},
"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"
}
}
}
}
},
"x-go-package": "github.com/axllent/mailpit/server/apiv1"
},
"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"
},
"WebUIConfiguration": {
"description": "Response includes global web UI settings",
"type": "object",
"properties": {
"DuplicatesIgnored": {
"description": "Whether messages with duplicate IDs are ignored",
"type": "boolean"
},
"MessageRelay": {
"description": "Message Relay information",
"type": "object",
"properties": {
"AllowedRecipients": {
"description": "Only allow relaying to these recipients (regex)",
"type": "string"
},
"Enabled": {
"description": "Whether message relaying (release) is enabled",
"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"
}
},
"x-go-name": "webUIConfiguration",
"x-go-package": "github.com/axllent/mailpit/server/apiv1"
},
"releaseMessageRequestBody": {
"description": "Release request",
"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"
]
}
},
"x-go-package": "github.com/axllent/mailpit/server/apiv1"
},
"setReadStatusRequestBody": {
"description": "Set read status request",
"type": "object",
"properties": {
"IDs": {
"description": "Array of message database IDs",
"type": "array",
"items": {
"type": "string"
},
"example": [
"5dec4247-812e-4b77-9101-e25ad406e9ea",
"8ac66bbc-2d9a-4c41-ad99-00aa75fa674e"
]
},
"Read": {
"description": "Read status",
"type": "boolean",
"default": false,
"example": true
}
},
"x-go-package": "github.com/axllent/mailpit/server/apiv1"
},
"setTagsRequestBody": {
"description": "Set tags request",
"type": "object",
"required": [
"Tags",
"IDs"
],
"properties": {
"IDs": {
"description": "Array of message database IDs",
"type": "array",
"items": {
"type": "string"
},
"example": [
"5dec4247-812e-4b77-9101-e25ad406e9ea",
"8ac66bbc-2d9a-4c41-ad99-00aa75fa674e"
]
},
"Tags": {
"description": "Array of tag names to set",
"type": "array",
"items": {
"type": "string"
},
"example": [
"Tag 1",
"Tag 2"
]
}
},
"x-go-package": "github.com/axllent/mailpit/server/apiv1"
}
},
"responses": {
"ArrayResponse": {
"description": "Plain JSON array response",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"BinaryResponse": {
"description": "Binary data response inherits the attachment's content type.",
"schema": {
"type": "string"
}
},
"ErrorResponse": {
"description": "HTTP error response will return with a \u003e= 400 response code",
"schema": {
"type": "string"
}
},
"HTMLResponse": {
"description": "HTML response",
"schema": {
"type": "string"
}
},
"InfoResponse": {
"description": "Application information",
"schema": {
"$ref": "#/definitions/AppInformation"
}
},
"MessagesSummaryResponse": {
"description": "Message summary",
"schema": {
"$ref": "#/definitions/MessagesSummary"
}
},
"OKResponse": {
"description": "Plain text \"ok\" response",
"schema": {
"type": "string"
}
},
"TextResponse": {
"description": "Plain text response",
"schema": {
"type": "string"
}
},
"WebUIConfigurationResponse": {
"description": "Web UI configuration",
"schema": {
"$ref": "#/definitions/WebUIConfiguration"
}
},
"jsonErrorResponse": {
"description": "JSON error response",
"schema": {
"$ref": "#/definitions/JSONErrorMessage"
}
},
"sendMessageResponse": {
"description": "Confirmation message for HTTP send API",
"schema": {
"$ref": "#/definitions/SendMessageConfirmation"
}
}
}
}