diff --git a/config/imap.toml b/config/imap.toml index 69b769ee..f2b3cd49 100644 --- a/config/imap.toml +++ b/config/imap.toml @@ -13,13 +13,13 @@ maxMB=25 # delete messages from \Trash and \Junk after retention days retention=30 -# TODO: Max donwload bandwith per day -maxDownloadMB=3000 +# Default max donwload bandwith per day in megabytes +maxDownloadMB=10000 -# TODO: Max upload bandwith per day -maxUploadMB=1000 +# Default max upload bandwith per day in megabytes +maxUploadMB=10000 -# TODO: Max concurrent connections per service per client +# Default max concurrent connections per service per client maxConnections=15 # if `true` then do not autodelete expired messages diff --git a/config/pop3.toml b/config/pop3.toml index de353dfc..c9378fa8 100644 --- a/config/pop3.toml +++ b/config/pop3.toml @@ -15,8 +15,8 @@ disableVersionString=false # POP3 server never lists all messages but only a limited length list maxMessages=250 -# TODO: Max donwload bandwith per day -maxDownloadMB=3000 +# Max donwload bandwith per day in megabytes +maxDownloadMB=10000 # If true, then expect HAProxy PROXY header as the first line of data useProxy=false diff --git a/docs/api_data.js b/docs/api_data.js index 4c2d0bfb..9827a502 100644 --- a/docs/api_data.js +++ b/docs/api_data.js @@ -1 +1 @@ -define({ "api": [ { "type": "delete", "url": "/users/:user/addresses/:address", "title": "Delete an Address", "name": "DeleteUserAddress", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "address", "description": "

ID of the Address

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Trying to delete main address. Set a new main address first\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59ef21aef255ed1d9d790e7a/addresses/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "get", "url": "/addresses", "title": "List registered Addresses", "name": "GetAddresses", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Partial match of an address

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Address listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Address

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.address", "description": "

E-mail address string

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.user", "description": "

User ID this address belongs to

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"user\": \"59ef21aef255ed1d9d790e7a\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/addresses", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "get", "url": "/users/:user/addresses/:address", "title": "Request Addresses information", "name": "GetUserAddress", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "address", "description": "

ID of the Address

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Address

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "address", "description": "

E-mail address string

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "main", "description": "

Indicates if this is the default address for the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "created", "description": "

Datestring of the time the address was created

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"main\": true,\n \"created\": \"2017-10-24T11:19:10.911Z\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59ef21aef255ed1d9d790e7a/addresses/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "get", "url": "/users/:user/addresses", "title": "List registered Addresses for an User", "name": "GetUserAddresses", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Address listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Address

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.address", "description": "

E-mail address string

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.main", "description": "

Indicates if this is the default address for the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring of the time the address was created

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"main\": true,\n \"created\": \"2017-10-24T11:19:10.911Z\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59ef21aef255ed1d9d790e7a/addresses", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "post", "url": "/users/:user/addresses", "title": "Create new Address", "name": "PostUserAddress", "group": "Addresses", "description": "

Add a new email address for an User. Addresses can contain unicode characters. Dots in usernames are normalized so no need to create both "firstlast@example.com" and "first.last@example.com"

Special addresses @example.com and username@ catches all emails to these domains or users without a registered destination (requires allowWildcard argument)

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "address", "description": "

E-mail Address

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "main", "defaultValue": "false", "description": "

Indicates if this is the default address for the User

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "allowWildcard", "defaultValue": "false", "description": "

If true then address value can be in the form of *@example.com, otherwise using * is not allowed

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Address

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/addresses \\\n-H 'Content-type: application/json' \\\n-d '{\n \"address\": \"my.new.address@example.com\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "put", "url": "/users/:user/addresses/:address", "title": "Update Address information", "name": "PutUserAddress", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "main", "description": "

Indicates if this is the default address for the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/addresses/5a1d4541153888cdcd62a71b \\\n-H 'Content-type: application/json' \\\n-d '{\n \"main\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "delete", "url": "/users/:user/asps/:asp", "title": "Delete an Application Password", "name": "DeleteASP", "group": "ApplicationPasswords", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "asp", "description": "

ID of the Application Password

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE \"http://localhost:8080/users/59fc66a03e54454869460e45/asps/5a1d6dd776e56b6d97e5dd48\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/asps.js", "groupTitle": "ApplicationPasswords" }, { "type": "get", "url": "/users/:user/asps", "title": "List Application Passwords", "name": "GetASPs", "group": "ApplicationPasswords", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Event listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Application Password

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.description", "description": "

Description

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "results.scopes", "description": "

Allowed scopes for the Application Password

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.expires", "description": "

Datestring if this is a temporary Application Password or false if not

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"results\": [\n {\n \"id\": \"5a1d6dd776e56b6d97e5dd48\",\n \"description\": \"Thunderbird\",\n \"scopes\": [\n \"imap\",\n \"smtp\"\n ],\n \"created\": \"2017-11-28T14:08:23.520Z\",\n \"expires\": false\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/asps\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/asps.js", "groupTitle": "ApplicationPasswords" }, { "type": "post", "url": "/users/:user/asps", "title": "Create new Application Password", "name": "PostASP", "group": "ApplicationPasswords", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "description", "description": "

Description

" }, { "group": "Parameter", "type": "String[]", "optional": false, "field": "scopes", "description": "

List of scopes this Password applies to. Special scope "*" indicates that this password can be used for any scope except "master"

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "expires", "description": "

Datestring if this is a temporary Application Password

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "generateMobileconfig", "description": "

If true then result contains a mobileconfig formatted file with account config

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Application Password

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "password", "description": "

Application Specific Password. Generated password is whitespace agnostic, so it could be displayed to the client as "abcd efgh ijkl mnop" instead of "abcdefghijklmnop"

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mobileconfig", "description": "

Base64 encoded mobileconfig file. Generated profile file should be sent to the client with Content-Type value of application/x-apple-aspen-config.

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1d6dd776e56b6d97e5dd48\",\n \"password\": \"rflhmllyegblyybd\",\n \"mobileconfig\": \"MIIQBgYJKoZIhvcNAQcCoIIP9...\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/asps \\\n-H 'Content-type: application/json' \\\n-d '{\n \"description\": \"Thunderbird\",\n \"scopes\": [\"imap\", \"smtp\"],\n \"generateMobileconfig\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/asps.js", "groupTitle": "ApplicationPasswords" }, { "type": "get", "url": "/users/:user/archived/:message/attachments/:attachment", "title": "Download Archived Attachment", "name": "GetArchivedAttachment", "group": "Archive", "description": "

This method returns attachment file contents in binary form

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Archived Message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "attachment", "description": "

ID of the Attachment

" } ] } }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This attachment does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/59fc66a13e54454869460e58/attachments/ATT00003\"", "type": "curl" } ], "success": { "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: image/png\n\n<89>PNG...", "type": "text" } ] }, "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "get", "url": "/users/:user/archived/:message", "title": "Request Archived Message", "name": "GetArchivedMessage", "group": "Archive", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox the messages was deleted from

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from", "description": "

From: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "to", "description": "

To: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "cc", "description": "

Cc: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "messageId", "description": "

Message-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "date", "description": "

Datestring of message header

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "list", "description": "

If set then this message is from a mailing list

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.id", "description": "

Value from List-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.unsubscribe", "description": "

Value from List-Unsubscribe header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "expires", "description": "

Datestring, if set then indicates the time after this message is automatically deleted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "seen", "description": "

Does this message have a \\Seen flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "deleted", "description": "

Does this message have a \\Deleted flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "draft", "description": "

Does this message have a \\Draft flag

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "html", "description": "

An array of HTML string. Every array element is from a separate mime node, usually you would just join these to a single string

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "text", "description": "

Plaintext content of the message

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "attachments", "description": "

List of attachments for this message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.id", "description": "

Attachment ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.filename", "description": "

Filename of the attachment

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.contentType", "description": "

MIME type

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.disposition", "description": "

Attachment disposition

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.transferEncoding", "description": "

Which transfer encoding was used (actual content when fetching attachments is not encoded)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "attachments.related", "description": "

Was this attachment found from a multipart/related node. This usually means that this is an embedded image

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "attachments.sizeKb", "description": "

Approximate size of the attachment in kilobytes

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a13e54454869460e58\",\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"user\": \"59fc66a03e54454869460e45\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"to\": [\n {\n \"address\": \"bob@domain.dom\",\n \"name\": \"\"\n }\n ],\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"messageId\": \"<1066976914.4721.5.camel@localhost>\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"html\": [\n \"

Welcome to Ryan Finnie's MIME torture test.

\",\n \"

While a message/rfc822 part inside another message/rfc822 part in a
message isn't too strange, 200 iterations of that would be.

\"\n ],\n \"text\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed\\nto introduce a couple of the newer features of MIME-aware MUA\",\n \"attachments\": [\n {\n \"id\": \"ATT00004\",\n \"filename\": \"foo.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n },\n {\n \"id\": \"ATT00007\",\n \"filename\": \"blah1.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n }\n ],\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/59fc66a13e54454869460e58\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "get", "url": "/users/:user/archived", "title": "List archived messages", "name": "GetArchivedMessages", "group": "Archive", "description": "

Archive contains all recently deleted messages besides Drafts etc.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "order", "defaultValue": "desc", "description": "

Ordering of the records by insert date

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Message listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Message (24 byte hex)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.thread", "description": "

ID of the Thread

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.from", "description": "

Sender info

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.date", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.intro", "description": "

First 128 bytes of the message

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.attachments", "description": "

Does the message have attachments

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.seen", "description": "

Is this message alread seen or not

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.deleted", "description": "

Does this message have a \\Deleted flag (should not have as messages are automatically deleted once this flag is set)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59fc66a13e54454869460e58\",\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"intro\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed to introduce a couple of the newer features of MIME-aware…\",\n \"attachments\": true,\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"url\": \"/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\",\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/archived\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "post", "url": "/users/:user/archived/:message/restore", "title": "Restore archived Message", "name": "RestoreMessage", "group": "Archive", "description": "

Restores an archived message by moving it back to the mailbox it was deleted from or to provided target mailbox. If target mailbox does not exist, then the message is moved to INBOX.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

Message ID

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailbox", "description": "

ID of the target Mailbox. If not set then original mailbox is used.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mailbox", "description": "

Maibox ID the message was moved to

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "id", "description": "

New ID for the Message

" } ] }, "examples": [ { "title": "Restore Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"mailbox\": \"59fc66a13e54454869460e57\",\n \"id\": 4\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Restore a Message:", "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/59fc66a13e54454869460e58/restore\" \\\n-H 'Content-type: application/json' \\\n-d '{}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "get", "url": "/users/:user/authlog", "title": "List authentication Events", "name": "GetAuthlog", "group": "Authentication", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action", "description": "

Limit listing only to values with specific action value

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Limit listing only to values with specific session identifier

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

Limit listing only to values with specific IP address

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Event listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Event

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.action", "description": "

Action identifier

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.result", "description": "

Did the action succeed

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.sess", "description": "

Session identifier

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.ip", "description": "

IP address of the Event

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring of the Event time

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"action\": \"account created\",\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59fc66a03e54454869460e4d\",\n \"action\": \"account created\",\n \"result\": \"success\",\n \"sess\": null,\n \"ip\": null,\n \"created\": \"2017-11-03T12:52:48.792Z\",\n \"expires\": \"2017-12-03T12:52:48.792Z\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/authlog?action=account+created\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/auth.js", "groupTitle": "Authentication" }, { "type": "post", "url": "/authenticate", "title": "Authenticate an User", "name": "PostAuth", "group": "Authentication", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "username", "description": "

Username or E-mail address

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

Password

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "protocol", "description": "

Application identifier for security logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "scope", "defaultValue": "master", "description": "

Required scope. One of master, imap, smtp, pop3

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of authenticated User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "username", "description": "

Username of authenticated User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "scope", "description": "

The scope this authentication is valid for

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "require2fa", "description": "

List of enabled 2FA mechanisms

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "requirePasswordChange", "description": "

Indicates if account hassword has been reset and should be replaced

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a12914c350c183bd0d331f0\",\n \"username\": \"myuser\",\n \"scope\": \"master\",\n \"require2fa\": [\n \"totp\"\n ],\n \"requirePasswordChange\": false\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Authentication failed. Invalid scope\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/authenticate \\\n-H 'Content-type: application/json' \\\n-d '{\n \"username\": \"myuser\",\n \"password\": \"secretpass\",\n \"scope\": \"master\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/auth.js", "groupTitle": "Authentication" }, { "type": "delete", "url": "/users/:user/autoreply", "title": "Delete Autoreply information", "name": "DeleteAutoreply", "group": "Autoreplies", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/autoreply", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/autoreply.js", "groupTitle": "Autoreplies" }, { "type": "get", "url": "/users/:user/autoreply", "title": "Request Autoreply information", "name": "GetAutoreply", "group": "Autoreplies", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "status", "description": "

Is the autoreply enabled (true) or not (false)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "subject", "description": "

Subject line for the autoreply. If empty then uses subject of the original message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "html", "description": "

HTML formatted content of the autoreply message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "text", "description": "

Plaintext formatted content of the autoreply message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "start", "description": "

Datestring of the start of the autoreply

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "end", "description": "

Datestring of the end of the autoreply

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"status\": true,\n \"subject\": \"\",\n \"text\": \"Away from office until Dec.19\",\n \"html\": \"\",\n \"start\": \"2017-11-15T00:00:00.000Z\",\n \"end\": \"2017-12-19T00:00:00.000Z\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/autoreply", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/autoreply.js", "groupTitle": "Autoreplies" }, { "type": "put", "url": "/users/:user/autoreply", "title": "Update Autoreply information", "name": "PutAutoreply", "group": "Autoreplies", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "status", "description": "

Is the autoreply enabled (true) or not (false)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "subject", "description": "

Subject line for the autoreply. If empty then uses subject of the original message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "html", "description": "

HTML formatted content of the autoreply message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "text", "description": "

Plaintext formatted content of the autoreply message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "start", "description": "

Datestring of the start of the autoreply

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "end", "description": "

Datestring of the end of the autoreply

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/autoreply \\\n-H 'Content-type: application/json' \\\n-d '{\n \"status\": true,\n \"text\": \"Away from office until Dec.19\",\n \"start\": \"2017-11-15T00:00:00.000Z\",\n \"end\": \"2017-12-19T00:00:00.000Z\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/autoreply.js", "groupTitle": "Autoreplies" }, { "type": "delete", "url": "/domainaliases/:alias", "title": "Delete an Alias", "name": "DeleteDomainAlias", "group": "DomainAliases", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "alias", "description": "

ID of the Alias

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/domainaliases/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "get", "url": "/addresses", "title": "List registered Domain Aliases", "name": "GetAliases", "group": "DomainAliases", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Partial match of a Domain Alias or Domain name

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Aliases listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Domain Alias

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.alias", "description": "

Domain Alias

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.domain", "description": "

The domain this alias applies to

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"alias\": \"example.net\",\n \"domain\": \"example.com\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/domainaliases", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "get", "url": "/domainaliases/:alias", "title": "Request Alias information", "name": "GetDomainAlias", "group": "DomainAliases", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "alias", "description": "

ID of the Alias

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Alias

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "alias", "description": "

Alias domain

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "domain", "description": "

Alias target

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "created", "description": "

Datestring of the time the alias was created

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e7a\",\n \"alias\": \"example.net\",\n \"domain\": \"example.com\",\n \"created\": \"2017-10-24T11:19:10.911Z\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This Alias does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/domainaliases/59ef21aef255ed1d9d790e7a", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "post", "url": "/domainaliases/addresses", "title": "Create new Domain Alias", "name": "PostDomainAlias", "group": "DomainAliases", "description": "

Add a new Alias for a Domain. This allows to accept mail on username@domain and username@alias

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "alias", "description": "

Domain Alias

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "domain", "description": "

Domain name this Alias applies to

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Domain Alias

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/domainaliases \\\n-H 'Content-type: application/json' \\\n-d '{\n \"domain\": \"example.com\",\n \"alias\": \"example.org\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "delete", "url": "/users/:user/filters/:filter", "title": "Delete a Filter", "name": "DeleteFilter", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "filter", "description": "

Filters unique ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This filter does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/filters/5a1c0ee490a34c67e266931c", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "get", "url": "/users/:user/filters/:filter", "title": "Request Filter information", "name": "GetFilter", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "filter", "description": "

Filters unique ID.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the Filter

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "name", "description": "

Name of the Filter

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_from", "description": "

Partial match for the From: header (case insensitive)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_to", "description": "

Partial match for the To:/Cc: headers (case insensitive)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_subject", "description": "

Partial match for the Subject: header (case insensitive)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_text", "description": "

Fulltext search against message text

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "query_ha", "description": "

Does a message have to have an attachment or not

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "query_size", "description": "

Message size in bytes. If the value is a positive number then message needs to be larger, if negative then message needs to be smaller than abs(size) value

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_delete", "description": "

If true then do not store matching messages

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_spam", "description": "

If true then store matching messags to Junk Mail folder

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action_mailbox", "description": "

Mailbox ID to store matching messages to

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action_forward", "description": "

An email address where matching messages should be forwarded to

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action_targetUrl", "description": "

An URL where matching messages should be POSTed to

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1c0ee490a34c67e266931c\",\n \"created\": \"2017-11-27T13:11:00.835Z\",\n \"query_from\": \"Mäger\",\n \"action_seen\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This filter does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/filters/5a1c0ee490a34c67e266931c", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "get", "url": "/users/:user/filters", "title": "List Filters for an User", "name": "GetFilters", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Filter description

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

Filter ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.name", "description": "

Name for the filter

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring of the time the filter was created

" }, { "group": "Success 200", "type": "Array[]", "optional": false, "field": "results.query", "description": "

A list of query descriptions

" }, { "group": "Success 200", "type": "Array[]", "optional": false, "field": "results.action", "description": "

A list of action descriptions

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"results\": [\n {\n \"id\": \"5a1c0ee490a34c67e266931c\",\n \"query\": [\n [\n \"from\",\n \"(Mäger)\"\n ]\n ],\n \"action\": [\n [\n \"mark as read\"\n ]\n ],\n \"created\": \"2017-11-27T13:11:00.835Z\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/5a1bda70bfbd1442cd96c6f0/filters", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "post", "url": "/users/:user/filters", "title": "Create new Filter", "name": "PostFilter", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Name of the Filter

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_from", "description": "

Partial match for the From: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_to", "description": "

Partial match for the To:/Cc: headers (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_subject", "description": "

Partial match for the Subject: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_text", "description": "

Fulltext search against message text

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "query_ha", "description": "

Does a message have to have an attachment or not

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "query_size", "description": "

Message size in bytes. If the value is a positive number then message needs to be larger, if negative then message needs to be smaller than abs(size) value

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_delete", "description": "

If true then do not store matching messages

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_spam", "description": "

If true then store matching messags to Junk Mail folder

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_mailbox", "description": "

Mailbox ID to store matching messages to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_forward", "description": "

An email address where matching messages should be forwarded to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_targetUrl", "description": "

An URL where matching messages should be POSTed to

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the created Filter

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1c0ee490a34c67e266931c\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Empty filter query\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/5a1bda70bfbd1442cd96c6f0/filters \\\n-H 'Content-type: application/json' \\\n-d '{\n \"query_from\": \"Mäger\",\n \"action_seen\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "put", "url": "/users/:user/filters/:filter", "title": "Update Filter information", "name": "PutFilter", "group": "Filters", "description": "

This method updates Filter data. To unset a value, use empty strings

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "filter", "description": "

Filters unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Name of the Filter

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_from", "description": "

Partial match for the From: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_to", "description": "

Partial match for the To:/Cc: headers (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_subject", "description": "

Partial match for the Subject: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_text", "description": "

Fulltext search against message text

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "query_ha", "description": "

Does a message have to have an attachment or not

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "query_size", "description": "

Message size in bytes. If the value is a positive number then message needs to be larger, if negative then message needs to be smaller than abs(size) value

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_delete", "description": "

If true then do not store matching messages

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_spam", "description": "

If true then store matching messags to Junk Mail folder

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_mailbox", "description": "

Mailbox ID to store matching messages to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_forward", "description": "

An email address where matching messages should be forwarded to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_targetUrl", "description": "

An URL where matching messages should be POSTed to

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the created Filter

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Empty filter query\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/filters/5a1c0ee490a34c67e266931c \\\n-H 'Content-type: application/json' \\\n-d '{\n \"action_seen\": \"\",\n \"action_flag\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "delete", "url": "/users/:user/mailboxes/:mailbox", "title": "Delete a Mailbox", "name": "DeleteMailbox", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

Mailbox unique ID. Special use folders and INBOX can not be deleted

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Mailbox deletion failed with code CANNOT\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/5a1d2816153888cdcd62a715", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox", "title": "Request Mailbox information", "name": "GetMailbox", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

Mailbox unique ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

Mailbox ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "name", "description": "

Name for the mailbox (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "path", "description": "

Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "specialUse", "description": "

Either special use identifier or null. One of \\Drafts, \\Junk, \\Sent or \\Trash

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "modifyIndex", "description": "

Modification sequence number. Incremented on every change in the mailbox.

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "subscribed", "description": "

Mailbox subscription status. IMAP clients may unsubscribe from a folder.

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many messages are stored in this mailbox

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "unseen", "description": "

How many unseen messages are stored in this mailbox

" } ] }, "examples": [ { "title": "Success-Response:", "content": " HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e46\",\n \"name\": \"INBOX\",\n \"path\": \"INBOX\",\n \"specialUse\": null,\n \"modifyIndex\": 1808,\n \"subscribed\": true,\n \"total\": 20,\n \"unseen\": 2\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This mailbox does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "get", "url": "/users/:user/mailboxes", "title": "List Mailboxes for an User", "name": "GetMailboxes", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "counters", "defaultValue": "false", "description": "

Should the response include counters (total + unseen). Counters come with some overhead.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

List of user mailboxes

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

Mailbox ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.name", "description": "

Name for the mailbox (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.path", "description": "

Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.specialUse", "description": "

Either special use identifier or null. One of \\Drafts, \\Junk, \\Sent or \\Trash

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.modifyIndex", "description": "

Modification sequence number. Incremented on every change in the mailbox.

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.subscribed", "description": "

Mailbox subscription status. IMAP clients may unsubscribe from a folder.

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.total", "description": "

How many messages are stored in this mailbox

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.unseen", "description": "

How many unseen messages are stored in this mailbox

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"results\": [\n {\n \"id\": \"59fc66a03e54454869460e46\",\n \"name\": \"INBOX\",\n \"path\": \"INBOX\",\n \"specialUse\": null,\n \"modifyIndex\": 1808,\n \"subscribed\": true,\n \"total\": 20,\n \"unseen\": 2\n },\n {\n \"id\": \"59fc66a03e54454869460e47\",\n \"name\": \"Sent Mail\",\n \"path\": \"Sent Mail\",\n \"specialUse\": \"\\\\Sent\",\n \"modifyIndex\": 145,\n \"subscribed\": true,\n \"total\": 15,\n \"unseen\": 0\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This mailbox does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes?counters=true", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "post", "url": "/users/:user/mailboxes", "title": "Create new Mailbox", "name": "PostMailboxes", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "path", "description": "

Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "defaultValue": "0", "description": "

Retention policy for the created Mailbox. Milliseconds after a message added to mailbox expires. Set to 0 to disable.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

Mailbox ID

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1d2816153888cdcd62a715\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Mailbox creation failed with code ALREADYEXISTS\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes \\\n-H 'Content-type: application/json' \\\n-d '{\n \"path\": \"First Level/Second 😎 Level/Folder Name\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "put", "url": "/users/:user/mailboxes/:mailbox", "title": "Update Mailbox information", "name": "PutMailbox", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

Mailbox unique ID

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "path", "description": "

Full path of the mailbox, use this to rename an existing Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "description": "

Retention policy for the created Mailbox. Chaning retention value only affects messages added to this folder after the change

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "subscribed", "description": "

Change Mailbox subscription state

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Mailbox update failed with code ALREADYEXISTS\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/5a1d2816153888cdcd62a715 \\\n-H 'Content-type: application/json' \\\n-d '{\n \"path\": \"Updated Folder Name\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "delete", "url": "/users/:user/mailboxes/:mailbox/messages/:message", "title": "Delete a Message", "name": "DeleteMessage", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

Message ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Delete Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Delete a Message:", "content": "curl -i -XDELETE \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/2\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "post", "url": "/users/:user/mailboxes/:mailbox/messages/:message/forward", "title": "Forward stored Message", "name": "DeleteMessage", "group": "Messages", "description": "

This method allows either to re-forward a message to an original forward target or forward it to some other address. This is useful if an user had forwarding turned on but the message was not delivered so you can try again. Forwarding does not modify the original message.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

Message ID

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "target", "description": "

Number of original forwarding target

" }, { "group": "Parameter", "type": "String[]", "optional": true, "field": "addresses", "description": "

An array of additional forward targets

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "queueId", "description": "

Message ID in outbound queue

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "forwarded", "description": "

Information about forwarding targets

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "forwarded.seq", "description": "

Sequence ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "forwarded.type", "description": "

Target type

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "forwarded.value", "description": "

Target address

" } ] }, "examples": [ { "title": "Forward Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"1600d2f36470008b72\",\n \"forwarded\": [\n {\n \"seq\": \"001\",\n \"type\": \"mail\",\n \"value\": \"andris@ethereal.email\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Delete a Message:", "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/1/forward\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"addresses\": [\n \"andris@ethereal.email\"\n ]\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message", "title": "Request Message information", "name": "GetMessage", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "markAsSeen", "defaultValue": "false", "description": "

If true then marks message as seen

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from", "description": "

From: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "to", "description": "

To: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "cc", "description": "

Cc: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "messageId", "description": "

Message-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "date", "description": "

Datestring of message header

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "list", "description": "

If set then this message is from a mailing list

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.id", "description": "

Value from List-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.unsubscribe", "description": "

Value from List-Unsubscribe header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "expires", "description": "

Datestring, if set then indicates the time after this message is automatically deleted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "seen", "description": "

Does this message have a \\Seen flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "deleted", "description": "

Does this message have a \\Deleted flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "draft", "description": "

Does this message have a \\Draft flag

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "html", "description": "

An array of HTML string. Every array element is from a separate mime node, usually you would just join these to a single string

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "text", "description": "

Plaintext content of the message

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "attachments", "description": "

List of attachments for this message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.id", "description": "

Attachment ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.filename", "description": "

Filename of the attachment

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.contentType", "description": "

MIME type

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.disposition", "description": "

Attachment disposition

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.transferEncoding", "description": "

Which transfer encoding was used (actual content when fetching attachments is not encoded)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "attachments.related", "description": "

Was this attachment found from a multipart/related node. This usually means that this is an embedded image

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "attachments.sizeKb", "description": "

Approximate size of the attachment in kilobytes

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"user\": \"59fc66a03e54454869460e45\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"to\": [\n {\n \"address\": \"bob@domain.dom\",\n \"name\": \"\"\n }\n ],\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"messageId\": \"<1066976914.4721.5.camel@localhost>\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"html\": [\n \"

Welcome to Ryan Finnie's MIME torture test.

\",\n \"

While a message/rfc822 part inside another message/rfc822 part in a
message isn't too strange, 200 iterations of that would be.

\"\n ],\n \"text\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed\\nto introduce a couple of the newer features of MIME-aware MUA\",\n \"attachments\": [\n {\n \"id\": \"ATT00004\",\n \"filename\": \"foo.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n },\n {\n \"id\": \"ATT00007\",\n \"filename\": \"blah1.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n }\n ],\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message/attachments/:attachment", "title": "Download Attachment", "name": "GetMessageAttachment", "group": "Messages", "description": "

This method returns attachment file contents in binary form

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "attachment", "description": "

ID of the Attachment

" } ] } }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This attachment does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/1/attachments/ATT00002\"", "type": "curl" } ], "success": { "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: image/png\n\n<89>PNG...", "type": "text" } ] }, "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message/events", "title": "Message events", "name": "GetMessageEvents", "group": "Messages", "description": "

This method returns a listing of events related to this messages. This includes how the message was received and also information about forwarding

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "events", "description": "

List of events

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action", "description": "

Event type

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e4e\",\n \"events\": [\n {\n \"id\": \"59fc66a03e54454869460e4e\",\n \"stored\": \"59fc66a03e54454869460e4e\",\n \"action\": \"STORE\",\n \"origin\": \"Import\",\n \"messageId\": \"<1066976914.4721.5.camel@localhost>\",\n \"from\": null,\n \"to\": [\n \"user1@example.com\"\n ],\n \"transtype\": null,\n \"time\": 1509713568834\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1/events\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message/message.eml", "title": "Get Message source", "name": "GetMessageSource", "group": "Messages", "description": "

This method returns the full RFC822 formatted source of the stored message

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" } ] } }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1/message.eml\"", "type": "curl" } ], "success": { "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: message/rfc822\n\nSubject: Ryan Finnie's MIME Torture Test v1.0\nFrom: Ryan Finnie \nTo: bob@domain.dom\nContent-Type: multipart/mixed; boundary=\"=-qYxqvD9rbH0PNeExagh1\"\n...", "type": "text" } ] }, "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages", "title": "List messages in a Mailbox", "name": "GetMessages", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "order", "defaultValue": "desc", "description": "

Ordering of the records by insert date

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Message listing

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.thread", "description": "

ID of the Thread

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.from", "description": "

Sender info

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.date", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.intro", "description": "

First 128 bytes of the message

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.attachments", "description": "

Does the message have attachments

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.seen", "description": "

Is this message alread seen or not

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.deleted", "description": "

Does this message have a \\Deleted flag (should not have as messages are automatically deleted once this flag is set)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"specialUse\": null,\n \"results\": [\n {\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"intro\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed to introduce a couple of the newer features of MIME-aware…\",\n \"attachments\": true,\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"url\": \"/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\",\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/search", "title": "Search for messages", "name": "GetMessagesSearch", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Search string, uses MongoDB fulltext index. Covers data from mesage body and also common headers like from, to, subject etc.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "datestart", "description": "

Datestring for the earliest message storing time

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "dateend", "description": "

Datestring for the latest message storing time

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "from", "description": "

Partial match for the From: header line

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "to", "description": "

Partial match for the To: and Cc: header lines

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "subject", "description": "

Partial match for the Subject: header line

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "attachments", "description": "

If true, then matches only messages with attachments

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "flagged", "description": "

If true, then matches only messages with \\Flagged flags

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Message listing

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.thread", "description": "

ID of the Thread

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.from", "description": "

Sender info

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.date", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.intro", "description": "

First 128 bytes of the message

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.attachments", "description": "

Does the message have attachments

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.seen", "description": "

Is this message alread seen or not

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.deleted", "description": "

Does this message have a \\Deleted flag (should not have as messages are automatically deleted once this flag is set)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.url", "description": "

Relative API url for fetching message contents

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"query\": \"Ryan\",\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"specialUse\": null,\n \"results\": [\n {\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"intro\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed to introduce a couple of the newer features of MIME-aware…\",\n \"attachments\": true,\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"url\": \"/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\",\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/search?query=Ryan\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "put", "url": "/users/:user/mailboxes/:mailbox/messages/:message", "title": "Update Message information", "name": "PutMessage", "group": "Messages", "description": "

This method updates message flags and also allows to move messages to a different mailbox

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "message", "description": "

Message ID values. Either comma separated numbers (1,2,3) or colon separated range (3:15)

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "moveTo", "description": "

ID of the target Mailbox if you want to move messages

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "seen", "description": "

State of the \\Seen flag

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "flagged", "description": "

State of the \\Flagged flag

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "draft", "description": "

State of the \\Draft flag

" }, { "group": "Parameter", "type": "Datestring", "optional": false, "field": "expires", "description": "

Either expiration date or false to turn of autoexpiration

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "id", "description": "

If messages were moved then lists new ID values. Array entry is an array with first element pointing to old ID and second to new ID

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "updated", "description": "

If messages were not moved, then indicates the number of updated messages

" } ] }, "examples": [ { "title": "Update Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"updated\": 2\n}", "type": "json" }, { "title": "Move Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"mailbox\": \"59fc66a13e54454869460e57\",\n \"id\": [\n [1,24],\n [2,25]\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Mark messages as unseen:", "content": "curl -i -XPUT \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1,2,3\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"seen\": false\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "post", "url": "/users/:user/submit", "title": "Submit a Message for Delivery", "name": "PostSubmit", "group": "Submission", "description": "

Use this method to send emails from an user account

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "reference", "description": "

Optional referenced email. If submitted message is a reply and relevant fields are not provided then these are resolved from the message to be replied to

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "reference.mailbox", "description": "

Mailbox ID

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "reference.id", "description": "

Message ID in Mailbox

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "reference.action", "description": "

Either reply, replyAll or forward

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sendTime", "description": "

Datestring for delivery if message should be sent some later time

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "envelope", "description": "

SMTP envelope. If not provided then resolved either from message headers or from referenced message

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "envelope.from", "description": "

Sender information. If not set then it is resolved to User's default address

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "envelope.from.address", "description": "

Sender address. If this is not listed as allowed address for the sending User then it is replaced with the User's default address

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "envelope.to", "description": "

Recipients information

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "envelope.to.address", "description": "

Recipient address

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "from", "description": "

Address for the From: header

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "from.name", "description": "

Name of the sender

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "from.address", "description": "

Address of the sender

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "to", "description": "

Addresses for the To: header

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "to.name", "description": "

Name of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "to.address", "description": "

Address of the recipient

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "cc", "description": "

Addresses for the Cc: header

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "cc.name", "description": "

Name of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "cc.address", "description": "

Address of the recipient

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "bcc", "description": "

Addresses for the Bcc: header

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "bcc.name", "description": "

Name of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "bcc.address", "description": "

Address of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "subject", "description": "

Message subject. If not then resolved from Reference message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "text", "description": "

Plaintext message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "html", "description": "

HTML formatted message

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "headers", "description": "

Custom headers for the message. If reference message is set then In-Reply-To and References headers are set automatically

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "headers.key", "description": "

Header key ('X-Mailer')

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "headers.value", "description": "

Header value ('My Awesome Mailing Service')

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "attachments", "description": "

Attachments for the message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "attachments.content", "description": "

Base64 encoded attachment content

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "attachments.filename", "description": "

Attachment filename

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "attachments.contentType", "description": "

MIME type for the attachment file

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "attachments.cid", "description": "

Content-ID value if you want to reference to this attachment from HTML formatted message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "message", "description": "

Information about submitted Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "message.mailbox", "description": "

Mailbox ID the message was stored to

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "message.id", "description": "

Message ID in Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "message.queueId", "description": "

Queue ID in MTA

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"message\": {\n \"id\": 16,\n \"mailbox\": \"59fc66a03e54454869460e47\",\n \"queueId\": \"1600798505b000a25f\"\n }\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "error", "description": "

Description of the error

" }, { "group": "Error 4xx", "type": "String", "optional": false, "field": "code", "description": "

Reason for the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"User account is disabled\",\n \"code\": \"ERRDISABLEDUSER\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "# Sender info is derived from account settings\ncurl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"to\": [{\n \"address\": \"andris@ethereal.email\"\n }],\n \"subject\": \"Hello world!\",\n \"text\": \"Test message\"\n}'", "type": "curl" }, { "title": "Reply to All", "content": "# Recipients and subject line are derived from referenced message\ncurl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"reference\": {\n \"mailbox\": \"59fc66a03e54454869460e47\",\n \"id\": 15,\n \"action\": \"replyAll\"\n },\n \"text\": \"Yeah, sure\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/submit.js", "groupTitle": "Submission" }, { "type": "delete", "url": "/users/:id", "title": "Delete an User", "name": "DeleteUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/5a1bda70bfbd1442cd96c6f0?ip=127.0.0.1", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "get", "url": "/users/:id/updates", "title": "Open change stream", "name": "GetUpdates", "group": "Users", "description": "

This api call returns an EventSource response. Listen on this stream to get notifications about changes in messages and mailboxes. Returned events are JSON encoded strings

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "command", "description": "

Indicates data event type

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: text/event-stream\n\ndata: {\ndata: \"command\": \"CREATE\",\ndata: \"mailbox\": \"5a1d3061153888cdcd62a719\",\ndata: \"path\": \"First Level/Second 😎 Level/Folder Name\"\ndata: }", "type": "text" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "var stream = new EventSource('/users/59fc66a03e54454869460e45/updates');\nstream.onmessage = function(e) {\n console.log(JSON.parse(e.data));\n};", "type": "javascript" } ], "version": "0.0.0", "filename": "lib/api/updates.js", "groupTitle": "Users" }, { "type": "get", "url": "/users/:id", "title": "Request User information", "name": "GetUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID (24 byte hex)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "username", "description": "

Username of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "name", "description": "

Name of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "address", "description": "

Main email address of the User

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "retention", "description": "

Default retention time in ms. false if not enabled

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "enabled2fa", "description": "

List of enabled 2FA methods

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "pubKey", "description": "

Public PGP key for the User that is used for encryption

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "keyInfo", "description": "

Information about public key or false if key is not available

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "keyInfo.name", "description": "

Name listed in public key

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "keyInfo.address", "description": "

E-mail address listed in public key

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "keyInfo.fingerprint", "description": "

Fingerprint of the public key

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "targetUrl", "description": "

An URL to post all incoming emails

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits", "description": "

Account limits and usage

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits.quota", "description": "

Quota usage limits

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.quota.allowed", "description": "

Allowed quota of the user in bytes

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.quota.used", "description": "

Space used in bytes

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits.recipients", "description": "

Sending quota

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.recipients.allowed", "description": "

How many messages per 24 hour can be sent

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.recipients.used", "description": "

How many messages are sent during current 24 hour period

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.recipients.ttl", "description": "

Time until the end of current 24 hour period

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits.forwards", "description": "

Forwarding quota

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.forwards.allowed", "description": "

How many messages per 24 hour can be forwarded

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.forwards.used", "description": "

How many messages are forwarded during current 24 hour period

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.forwards.ttl", "description": "

Time until the end of current 24 hour period

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "tags", "description": "

List of tags associated with the User

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "hasPasswordSet", "description": "

If true then the User has a password set and can authenticate

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "activated", "description": "

Is the account activated

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "disabled", "description": "

If true then the user can not authenticate or receive any new mail

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\",\n \"username\": \"testuser01\",\n \"name\": null,\n \"address\": \"testuser01@example.com\",\n \"retention\": false,\n \"enabled2fa\": [],\n \"encryptMessages\": false,\n \"encryptForwarded\": false,\n \"pubKey\": \"\",\n \"keyInfo\": false,\n \"forward\": [],\n \"targetUrl\": \"\",\n \"limits\": {\n \"quota\": {\n \"allowed\": 107374182400,\n \"used\": 289838\n },\n \"recipients\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n },\n \"forwards\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n }\n },\n \"tags\": [\"green\", \"blue\"],\n \"hasPasswordSet\": true,\n \"activated\": true,\n \"disabled\": false\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "get", "url": "/users", "title": "List registered Users", "name": "GetUsers", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Partial match of username or default email address

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "tags", "description": "

Comma separated list of tags. The User must have at least one to be set

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "requiredTags", "description": "

Comma separated list of tags. The User must have all listed tags to be set

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

User listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

Users unique ID (24 byte hex)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.username", "description": "

Username of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.name", "description": "

Name of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.address", "description": "

Main email address of the User

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "results.tags", "description": "

List of tags associated with the User'

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "results.forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.quota", "description": "

Quota usage limits

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.quota.allowed", "description": "

Allowed quota of the user in bytes

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.quota.used", "description": "

Space used in bytes

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.hasPasswordSet", "description": "

If true then the User has a password set and can authenticate

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.activated", "description": "

Is the account activated

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.disabled", "description": "

If true then the user can not authenticate or receive any new mail

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59cb948ad80a820b68f05230\",\n \"username\": \"myuser\",\n \"name\": \"John Doe\",\n \"address\": \"john@example.com\",\n \"tags\": [],\n \"forward\": [],\n \"encryptMessages\": false,\n \"encryptForwarded\": false,\n \"quota\": {\n \"allowed\": 1073741824,\n \"used\": 17799833\n },\n \"hasPasswordSet\": true,\n \"activated\": true,\n \"disabled\": false\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "post", "url": "/users", "title": "Create new user", "name": "PostUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "

Username of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

New password for the account

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "address", "description": "

Default email address for the User (autogenerated if not set)

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "emptyAddress", "description": "

If true then do not autogenerate missing email address for the User. Only needed if you want to create an user account that does not have any email address associated

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "description": "

Default retention time in ms. Set to 0 to disable

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "pubKey", "description": "

Public PGP key for the User that is used for encryption. Use empty string to remove the key

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "language", "description": "

Language code for the User

" }, { "group": "Parameter", "type": "String[]", "optional": true, "field": "forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "targetUrl", "description": "

An URL to post all incoming emails

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "quota", "description": "

Allowed quota of the user in bytes

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "recipients", "description": "

How many messages per 24 hour can be sent

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "forwards", "description": "

How many messages per 24 hour can be forwarded

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "disabled", "description": "

If true then disables user account (can not login, can not receive messages)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the created User

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1bda70bfbd1442cd96c6f0\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This username already exists\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users \\\n-H 'Content-type: application/json' \\\n-d '{\n \"username\": \"myuser\",\n \"password\": \"verysecret\",\n \"name\": \"John Doe\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "post", "url": "/users/:id/quota/reset", "title": "Recalculate User quota", "name": "PostUserQuota", "group": "Users", "description": "

This method recalculates quota usage for an User. Normally not needed, only use it if quota numbers are way off. This method is not transactional, so if the user is currently receiving new messages then the resulting value is not exact.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "reason", "description": "

Message to be shown to connected IMAP client

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "storageUsed", "description": "

Calculated quota usage for the user

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"storageUsed\": 1234567\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/quota/reset \\\n-H 'Content-type: application/json' \\\n-d '{}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "put", "url": "/users/:id", "title": "Update User information", "name": "PutUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Name of the User

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "existingPassword", "description": "

If provided then validates against account password before applying any changes

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "password", "description": "

New password for the account

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "description": "

Default retention time in ms. Set to 0 to disable

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "pubKey", "description": "

Public PGP key for the User that is used for encryption. Use empty string to remove the key

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "language", "description": "

Language code for the User

" }, { "group": "Parameter", "type": "String[]", "optional": true, "field": "forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "targetUrl", "description": "

An URL to post all incoming emails

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "quota", "description": "

Allowed quota of the user in bytes

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "recipients", "description": "

How many messages per 24 hour can be sent

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "forwards", "description": "

How many messages per 24 hour can be forwarded

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "disabled", "description": "

If true then disables user account (can not login, can not receive messages)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45 \\\n-H 'Content-type: application/json' \\\n-d '{\n \"name\": \"Updated user name\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "put", "url": "/users/:id/logout", "title": "Log out User", "name": "PutUserLogout", "group": "Users", "description": "

This method logs out all user sessions in IMAP

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "reason", "description": "

Message to be shown to connected IMAP client

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/logout \\\n-H 'Content-type: application/json' \\\n-d '{\n \"reason\": \"Logout requested from API\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "post", "url": "/users/:id/password/reset", "title": "Reset password for an User", "name": "ResetUserPassword", "group": "Users", "description": "

This method generates a new temporary password for an User. Additionally it removes all two-factor authentication settings

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "password", "description": "

Temporary password

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"password\": \"temporarypass\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/5a1bda70bfbd1442cd96/password/reset \\\n-H 'Content-type: application/json' \\\n-d '{\n \"ip\": \"127.0.0.1\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" } ] }); +define({ "api": [ { "type": "delete", "url": "/users/:user/addresses/:address", "title": "Delete an Address", "name": "DeleteUserAddress", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "address", "description": "

ID of the Address

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Trying to delete main address. Set a new main address first\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59ef21aef255ed1d9d790e7a/addresses/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "get", "url": "/addresses", "title": "List registered Addresses", "name": "GetAddresses", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Partial match of an address

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Address listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Address

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.address", "description": "

E-mail address string

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.user", "description": "

User ID this address belongs to

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"user\": \"59ef21aef255ed1d9d790e7a\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/addresses", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "get", "url": "/users/:user/addresses/:address", "title": "Request Addresses information", "name": "GetUserAddress", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "address", "description": "

ID of the Address

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Address

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "address", "description": "

E-mail address string

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "main", "description": "

Indicates if this is the default address for the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "created", "description": "

Datestring of the time the address was created

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"main\": true,\n \"created\": \"2017-10-24T11:19:10.911Z\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59ef21aef255ed1d9d790e7a/addresses/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "get", "url": "/users/:user/addresses", "title": "List registered Addresses for an User", "name": "GetUserAddresses", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Address listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Address

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.address", "description": "

E-mail address string

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.main", "description": "

Indicates if this is the default address for the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring of the time the address was created

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"main\": true,\n \"created\": \"2017-10-24T11:19:10.911Z\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59ef21aef255ed1d9d790e7a/addresses", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "post", "url": "/users/:user/addresses", "title": "Create new Address", "name": "PostUserAddress", "group": "Addresses", "description": "

Add a new email address for an User. Addresses can contain unicode characters. Dots in usernames are normalized so no need to create both "firstlast@example.com" and "first.last@example.com"

Special addresses @example.com and username@ catches all emails to these domains or users without a registered destination (requires allowWildcard argument)

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "address", "description": "

E-mail Address

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "main", "defaultValue": "false", "description": "

Indicates if this is the default address for the User

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "allowWildcard", "defaultValue": "false", "description": "

If true then address value can be in the form of *@example.com, otherwise using * is not allowed

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Address

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/addresses \\\n-H 'Content-type: application/json' \\\n-d '{\n \"address\": \"my.new.address@example.com\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "put", "url": "/users/:user/addresses/:address", "title": "Update Address information", "name": "PutUserAddress", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "main", "description": "

Indicates if this is the default address for the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/addresses/5a1d4541153888cdcd62a71b \\\n-H 'Content-type: application/json' \\\n-d '{\n \"main\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "delete", "url": "/users/:user/asps/:asp", "title": "Delete an Application Password", "name": "DeleteASP", "group": "ApplicationPasswords", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "asp", "description": "

ID of the Application Password

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE \"http://localhost:8080/users/59fc66a03e54454869460e45/asps/5a1d6dd776e56b6d97e5dd48\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/asps.js", "groupTitle": "ApplicationPasswords" }, { "type": "get", "url": "/users/:user/asps", "title": "List Application Passwords", "name": "GetASPs", "group": "ApplicationPasswords", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Event listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Application Password

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.description", "description": "

Description

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "results.scopes", "description": "

Allowed scopes for the Application Password

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.expires", "description": "

Datestring if this is a temporary Application Password or false if not

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"results\": [\n {\n \"id\": \"5a1d6dd776e56b6d97e5dd48\",\n \"description\": \"Thunderbird\",\n \"scopes\": [\n \"imap\",\n \"smtp\"\n ],\n \"created\": \"2017-11-28T14:08:23.520Z\",\n \"expires\": false\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/asps\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/asps.js", "groupTitle": "ApplicationPasswords" }, { "type": "post", "url": "/users/:user/asps", "title": "Create new Application Password", "name": "PostASP", "group": "ApplicationPasswords", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "description", "description": "

Description

" }, { "group": "Parameter", "type": "String[]", "optional": false, "field": "scopes", "description": "

List of scopes this Password applies to. Special scope "*" indicates that this password can be used for any scope except "master"

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "expires", "description": "

Datestring if this is a temporary Application Password

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "generateMobileconfig", "description": "

If true then result contains a mobileconfig formatted file with account config

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Application Password

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "password", "description": "

Application Specific Password. Generated password is whitespace agnostic, so it could be displayed to the client as "abcd efgh ijkl mnop" instead of "abcdefghijklmnop"

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mobileconfig", "description": "

Base64 encoded mobileconfig file. Generated profile file should be sent to the client with Content-Type value of application/x-apple-aspen-config.

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1d6dd776e56b6d97e5dd48\",\n \"password\": \"rflhmllyegblyybd\",\n \"mobileconfig\": \"MIIQBgYJKoZIhvcNAQcCoIIP9...\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/asps \\\n-H 'Content-type: application/json' \\\n-d '{\n \"description\": \"Thunderbird\",\n \"scopes\": [\"imap\", \"smtp\"],\n \"generateMobileconfig\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/asps.js", "groupTitle": "ApplicationPasswords" }, { "type": "get", "url": "/users/:user/archived/:message/attachments/:attachment", "title": "Download Archived Attachment", "name": "GetArchivedAttachment", "group": "Archive", "description": "

This method returns attachment file contents in binary form

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Archived Message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "attachment", "description": "

ID of the Attachment

" } ] } }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This attachment does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/59fc66a13e54454869460e58/attachments/ATT00003\"", "type": "curl" } ], "success": { "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: image/png\n\n<89>PNG...", "type": "text" } ] }, "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "get", "url": "/users/:user/archived/:message", "title": "Request Archived Message", "name": "GetArchivedMessage", "group": "Archive", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox the messages was deleted from

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from", "description": "

From: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "to", "description": "

To: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "cc", "description": "

Cc: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "messageId", "description": "

Message-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "date", "description": "

Datestring of message header

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "list", "description": "

If set then this message is from a mailing list

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.id", "description": "

Value from List-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.unsubscribe", "description": "

Value from List-Unsubscribe header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "expires", "description": "

Datestring, if set then indicates the time after this message is automatically deleted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "seen", "description": "

Does this message have a \\Seen flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "deleted", "description": "

Does this message have a \\Deleted flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "draft", "description": "

Does this message have a \\Draft flag

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "html", "description": "

An array of HTML string. Every array element is from a separate mime node, usually you would just join these to a single string

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "text", "description": "

Plaintext content of the message

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "attachments", "description": "

List of attachments for this message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.id", "description": "

Attachment ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.filename", "description": "

Filename of the attachment

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.contentType", "description": "

MIME type

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.disposition", "description": "

Attachment disposition

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.transferEncoding", "description": "

Which transfer encoding was used (actual content when fetching attachments is not encoded)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "attachments.related", "description": "

Was this attachment found from a multipart/related node. This usually means that this is an embedded image

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "attachments.sizeKb", "description": "

Approximate size of the attachment in kilobytes

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a13e54454869460e58\",\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"user\": \"59fc66a03e54454869460e45\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"to\": [\n {\n \"address\": \"bob@domain.dom\",\n \"name\": \"\"\n }\n ],\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"messageId\": \"<1066976914.4721.5.camel@localhost>\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"html\": [\n \"

Welcome to Ryan Finnie's MIME torture test.

\",\n \"

While a message/rfc822 part inside another message/rfc822 part in a
message isn't too strange, 200 iterations of that would be.

\"\n ],\n \"text\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed\\nto introduce a couple of the newer features of MIME-aware MUA\",\n \"attachments\": [\n {\n \"id\": \"ATT00004\",\n \"filename\": \"foo.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n },\n {\n \"id\": \"ATT00007\",\n \"filename\": \"blah1.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n }\n ],\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/59fc66a13e54454869460e58\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "get", "url": "/users/:user/archived", "title": "List archived messages", "name": "GetArchivedMessages", "group": "Archive", "description": "

Archive contains all recently deleted messages besides Drafts etc.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "order", "defaultValue": "desc", "description": "

Ordering of the records by insert date

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Message listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Message (24 byte hex)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.thread", "description": "

ID of the Thread

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.from", "description": "

Sender info

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.date", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.intro", "description": "

First 128 bytes of the message

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.attachments", "description": "

Does the message have attachments

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.seen", "description": "

Is this message alread seen or not

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.deleted", "description": "

Does this message have a \\Deleted flag (should not have as messages are automatically deleted once this flag is set)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59fc66a13e54454869460e58\",\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"intro\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed to introduce a couple of the newer features of MIME-aware…\",\n \"attachments\": true,\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"url\": \"/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\",\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/archived\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "post", "url": "/users/:user/archived/:message/restore", "title": "Restore archived Message", "name": "RestoreMessage", "group": "Archive", "description": "

Restores an archived message by moving it back to the mailbox it was deleted from or to provided target mailbox. If target mailbox does not exist, then the message is moved to INBOX.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

Message ID

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailbox", "description": "

ID of the target Mailbox. If not set then original mailbox is used.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mailbox", "description": "

Maibox ID the message was moved to

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "id", "description": "

New ID for the Message

" } ] }, "examples": [ { "title": "Restore Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"mailbox\": \"59fc66a13e54454869460e57\",\n \"id\": 4\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Restore a Message:", "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/59fc66a13e54454869460e58/restore\" \\\n-H 'Content-type: application/json' \\\n-d '{}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "get", "url": "/users/:user/authlog", "title": "List authentication Events", "name": "GetAuthlog", "group": "Authentication", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action", "description": "

Limit listing only to values with specific action value

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Limit listing only to values with specific session identifier

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

Limit listing only to values with specific IP address

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Event listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Event

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.action", "description": "

Action identifier

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.result", "description": "

Did the action succeed

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.sess", "description": "

Session identifier

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.ip", "description": "

IP address of the Event

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring of the Event time

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"action\": \"account created\",\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59fc66a03e54454869460e4d\",\n \"action\": \"account created\",\n \"result\": \"success\",\n \"sess\": null,\n \"ip\": null,\n \"created\": \"2017-11-03T12:52:48.792Z\",\n \"expires\": \"2017-12-03T12:52:48.792Z\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/authlog?action=account+created\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/auth.js", "groupTitle": "Authentication" }, { "type": "post", "url": "/authenticate", "title": "Authenticate an User", "name": "PostAuth", "group": "Authentication", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "username", "description": "

Username or E-mail address

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

Password

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "protocol", "description": "

Application identifier for security logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "scope", "defaultValue": "master", "description": "

Required scope. One of master, imap, smtp, pop3

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of authenticated User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "username", "description": "

Username of authenticated User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "scope", "description": "

The scope this authentication is valid for

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "require2fa", "description": "

List of enabled 2FA mechanisms

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "requirePasswordChange", "description": "

Indicates if account hassword has been reset and should be replaced

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a12914c350c183bd0d331f0\",\n \"username\": \"myuser\",\n \"scope\": \"master\",\n \"require2fa\": [\n \"totp\"\n ],\n \"requirePasswordChange\": false\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Authentication failed. Invalid scope\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/authenticate \\\n-H 'Content-type: application/json' \\\n-d '{\n \"username\": \"myuser\",\n \"password\": \"secretpass\",\n \"scope\": \"master\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/auth.js", "groupTitle": "Authentication" }, { "type": "delete", "url": "/users/:user/autoreply", "title": "Delete Autoreply information", "name": "DeleteAutoreply", "group": "Autoreplies", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/autoreply", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/autoreply.js", "groupTitle": "Autoreplies" }, { "type": "get", "url": "/users/:user/autoreply", "title": "Request Autoreply information", "name": "GetAutoreply", "group": "Autoreplies", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "status", "description": "

Is the autoreply enabled (true) or not (false)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "subject", "description": "

Subject line for the autoreply. If empty then uses subject of the original message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "html", "description": "

HTML formatted content of the autoreply message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "text", "description": "

Plaintext formatted content of the autoreply message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "start", "description": "

Datestring of the start of the autoreply

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "end", "description": "

Datestring of the end of the autoreply

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"status\": true,\n \"subject\": \"\",\n \"text\": \"Away from office until Dec.19\",\n \"html\": \"\",\n \"start\": \"2017-11-15T00:00:00.000Z\",\n \"end\": \"2017-12-19T00:00:00.000Z\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/autoreply", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/autoreply.js", "groupTitle": "Autoreplies" }, { "type": "put", "url": "/users/:user/autoreply", "title": "Update Autoreply information", "name": "PutAutoreply", "group": "Autoreplies", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "status", "description": "

Is the autoreply enabled (true) or not (false)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "subject", "description": "

Subject line for the autoreply. If empty then uses subject of the original message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "html", "description": "

HTML formatted content of the autoreply message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "text", "description": "

Plaintext formatted content of the autoreply message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "start", "description": "

Datestring of the start of the autoreply

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "end", "description": "

Datestring of the end of the autoreply

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/autoreply \\\n-H 'Content-type: application/json' \\\n-d '{\n \"status\": true,\n \"text\": \"Away from office until Dec.19\",\n \"start\": \"2017-11-15T00:00:00.000Z\",\n \"end\": \"2017-12-19T00:00:00.000Z\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/autoreply.js", "groupTitle": "Autoreplies" }, { "type": "delete", "url": "/domainaliases/:alias", "title": "Delete an Alias", "name": "DeleteDomainAlias", "group": "DomainAliases", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "alias", "description": "

ID of the Alias

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/domainaliases/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "get", "url": "/addresses", "title": "List registered Domain Aliases", "name": "GetAliases", "group": "DomainAliases", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Partial match of a Domain Alias or Domain name

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Aliases listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Domain Alias

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.alias", "description": "

Domain Alias

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.domain", "description": "

The domain this alias applies to

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"alias\": \"example.net\",\n \"domain\": \"example.com\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/domainaliases", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "get", "url": "/domainaliases/:alias", "title": "Request Alias information", "name": "GetDomainAlias", "group": "DomainAliases", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "alias", "description": "

ID of the Alias

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Alias

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "alias", "description": "

Alias domain

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "domain", "description": "

Alias target

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "created", "description": "

Datestring of the time the alias was created

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e7a\",\n \"alias\": \"example.net\",\n \"domain\": \"example.com\",\n \"created\": \"2017-10-24T11:19:10.911Z\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This Alias does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/domainaliases/59ef21aef255ed1d9d790e7a", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "post", "url": "/domainaliases/addresses", "title": "Create new Domain Alias", "name": "PostDomainAlias", "group": "DomainAliases", "description": "

Add a new Alias for a Domain. This allows to accept mail on username@domain and username@alias

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "alias", "description": "

Domain Alias

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "domain", "description": "

Domain name this Alias applies to

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Domain Alias

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/domainaliases \\\n-H 'Content-type: application/json' \\\n-d '{\n \"domain\": \"example.com\",\n \"alias\": \"example.org\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "delete", "url": "/users/:user/filters/:filter", "title": "Delete a Filter", "name": "DeleteFilter", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "filter", "description": "

Filters unique ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This filter does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/filters/5a1c0ee490a34c67e266931c", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "get", "url": "/users/:user/filters/:filter", "title": "Request Filter information", "name": "GetFilter", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "filter", "description": "

Filters unique ID.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the Filter

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "name", "description": "

Name of the Filter

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_from", "description": "

Partial match for the From: header (case insensitive)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_to", "description": "

Partial match for the To:/Cc: headers (case insensitive)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_subject", "description": "

Partial match for the Subject: header (case insensitive)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_text", "description": "

Fulltext search against message text

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "query_ha", "description": "

Does a message have to have an attachment or not

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "query_size", "description": "

Message size in bytes. If the value is a positive number then message needs to be larger, if negative then message needs to be smaller than abs(size) value

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_delete", "description": "

If true then do not store matching messages

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_spam", "description": "

If true then store matching messags to Junk Mail folder

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action_mailbox", "description": "

Mailbox ID to store matching messages to

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action_forward", "description": "

An email address where matching messages should be forwarded to

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action_targetUrl", "description": "

An URL where matching messages should be POSTed to

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1c0ee490a34c67e266931c\",\n \"created\": \"2017-11-27T13:11:00.835Z\",\n \"query_from\": \"Mäger\",\n \"action_seen\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This filter does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/filters/5a1c0ee490a34c67e266931c", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "get", "url": "/users/:user/filters", "title": "List Filters for an User", "name": "GetFilters", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Filter description

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

Filter ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.name", "description": "

Name for the filter

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring of the time the filter was created

" }, { "group": "Success 200", "type": "Array[]", "optional": false, "field": "results.query", "description": "

A list of query descriptions

" }, { "group": "Success 200", "type": "Array[]", "optional": false, "field": "results.action", "description": "

A list of action descriptions

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"results\": [\n {\n \"id\": \"5a1c0ee490a34c67e266931c\",\n \"query\": [\n [\n \"from\",\n \"(Mäger)\"\n ]\n ],\n \"action\": [\n [\n \"mark as read\"\n ]\n ],\n \"created\": \"2017-11-27T13:11:00.835Z\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/5a1bda70bfbd1442cd96c6f0/filters", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "post", "url": "/users/:user/filters", "title": "Create new Filter", "name": "PostFilter", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Name of the Filter

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_from", "description": "

Partial match for the From: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_to", "description": "

Partial match for the To:/Cc: headers (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_subject", "description": "

Partial match for the Subject: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_text", "description": "

Fulltext search against message text

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "query_ha", "description": "

Does a message have to have an attachment or not

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "query_size", "description": "

Message size in bytes. If the value is a positive number then message needs to be larger, if negative then message needs to be smaller than abs(size) value

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_delete", "description": "

If true then do not store matching messages

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_spam", "description": "

If true then store matching messags to Junk Mail folder

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_mailbox", "description": "

Mailbox ID to store matching messages to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_forward", "description": "

An email address where matching messages should be forwarded to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_targetUrl", "description": "

An URL where matching messages should be POSTed to

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the created Filter

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1c0ee490a34c67e266931c\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Empty filter query\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/5a1bda70bfbd1442cd96c6f0/filters \\\n-H 'Content-type: application/json' \\\n-d '{\n \"query_from\": \"Mäger\",\n \"action_seen\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "put", "url": "/users/:user/filters/:filter", "title": "Update Filter information", "name": "PutFilter", "group": "Filters", "description": "

This method updates Filter data. To unset a value, use empty strings

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "filter", "description": "

Filters unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Name of the Filter

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_from", "description": "

Partial match for the From: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_to", "description": "

Partial match for the To:/Cc: headers (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_subject", "description": "

Partial match for the Subject: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_text", "description": "

Fulltext search against message text

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "query_ha", "description": "

Does a message have to have an attachment or not

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "query_size", "description": "

Message size in bytes. If the value is a positive number then message needs to be larger, if negative then message needs to be smaller than abs(size) value

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_delete", "description": "

If true then do not store matching messages

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_spam", "description": "

If true then store matching messags to Junk Mail folder

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_mailbox", "description": "

Mailbox ID to store matching messages to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_forward", "description": "

An email address where matching messages should be forwarded to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_targetUrl", "description": "

An URL where matching messages should be POSTed to

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the created Filter

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Empty filter query\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/filters/5a1c0ee490a34c67e266931c \\\n-H 'Content-type: application/json' \\\n-d '{\n \"action_seen\": \"\",\n \"action_flag\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "delete", "url": "/users/:user/mailboxes/:mailbox", "title": "Delete a Mailbox", "name": "DeleteMailbox", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

Mailbox unique ID. Special use folders and INBOX can not be deleted

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Mailbox deletion failed with code CANNOT\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/5a1d2816153888cdcd62a715", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox", "title": "Request Mailbox information", "name": "GetMailbox", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

Mailbox unique ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

Mailbox ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "name", "description": "

Name for the mailbox (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "path", "description": "

Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "specialUse", "description": "

Either special use identifier or null. One of \\Drafts, \\Junk, \\Sent or \\Trash

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "modifyIndex", "description": "

Modification sequence number. Incremented on every change in the mailbox.

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "subscribed", "description": "

Mailbox subscription status. IMAP clients may unsubscribe from a folder.

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many messages are stored in this mailbox

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "unseen", "description": "

How many unseen messages are stored in this mailbox

" } ] }, "examples": [ { "title": "Success-Response:", "content": " HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e46\",\n \"name\": \"INBOX\",\n \"path\": \"INBOX\",\n \"specialUse\": null,\n \"modifyIndex\": 1808,\n \"subscribed\": true,\n \"total\": 20,\n \"unseen\": 2\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This mailbox does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "get", "url": "/users/:user/mailboxes", "title": "List Mailboxes for an User", "name": "GetMailboxes", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "counters", "defaultValue": "false", "description": "

Should the response include counters (total + unseen). Counters come with some overhead.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

List of user mailboxes

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

Mailbox ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.name", "description": "

Name for the mailbox (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.path", "description": "

Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.specialUse", "description": "

Either special use identifier or null. One of \\Drafts, \\Junk, \\Sent or \\Trash

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.modifyIndex", "description": "

Modification sequence number. Incremented on every change in the mailbox.

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.subscribed", "description": "

Mailbox subscription status. IMAP clients may unsubscribe from a folder.

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.total", "description": "

How many messages are stored in this mailbox

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.unseen", "description": "

How many unseen messages are stored in this mailbox

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"results\": [\n {\n \"id\": \"59fc66a03e54454869460e46\",\n \"name\": \"INBOX\",\n \"path\": \"INBOX\",\n \"specialUse\": null,\n \"modifyIndex\": 1808,\n \"subscribed\": true,\n \"total\": 20,\n \"unseen\": 2\n },\n {\n \"id\": \"59fc66a03e54454869460e47\",\n \"name\": \"Sent Mail\",\n \"path\": \"Sent Mail\",\n \"specialUse\": \"\\\\Sent\",\n \"modifyIndex\": 145,\n \"subscribed\": true,\n \"total\": 15,\n \"unseen\": 0\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This mailbox does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes?counters=true", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "post", "url": "/users/:user/mailboxes", "title": "Create new Mailbox", "name": "PostMailboxes", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "path", "description": "

Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "defaultValue": "0", "description": "

Retention policy for the created Mailbox. Milliseconds after a message added to mailbox expires. Set to 0 to disable.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

Mailbox ID

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1d2816153888cdcd62a715\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Mailbox creation failed with code ALREADYEXISTS\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes \\\n-H 'Content-type: application/json' \\\n-d '{\n \"path\": \"First Level/Second 😎 Level/Folder Name\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "put", "url": "/users/:user/mailboxes/:mailbox", "title": "Update Mailbox information", "name": "PutMailbox", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

Mailbox unique ID

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "path", "description": "

Full path of the mailbox, use this to rename an existing Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "description": "

Retention policy for the created Mailbox. Chaning retention value only affects messages added to this folder after the change

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "subscribed", "description": "

Change Mailbox subscription state

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Mailbox update failed with code ALREADYEXISTS\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/5a1d2816153888cdcd62a715 \\\n-H 'Content-type: application/json' \\\n-d '{\n \"path\": \"Updated Folder Name\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "delete", "url": "/users/:user/mailboxes/:mailbox/messages/:message", "title": "Delete a Message", "name": "DeleteMessage", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

Message ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Delete Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Delete a Message:", "content": "curl -i -XDELETE \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/2\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "post", "url": "/users/:user/mailboxes/:mailbox/messages/:message/forward", "title": "Forward stored Message", "name": "DeleteMessage", "group": "Messages", "description": "

This method allows either to re-forward a message to an original forward target or forward it to some other address. This is useful if an user had forwarding turned on but the message was not delivered so you can try again. Forwarding does not modify the original message.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

Message ID

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "target", "description": "

Number of original forwarding target

" }, { "group": "Parameter", "type": "String[]", "optional": true, "field": "addresses", "description": "

An array of additional forward targets

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "queueId", "description": "

Message ID in outbound queue

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "forwarded", "description": "

Information about forwarding targets

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "forwarded.seq", "description": "

Sequence ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "forwarded.type", "description": "

Target type

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "forwarded.value", "description": "

Target address

" } ] }, "examples": [ { "title": "Forward Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"1600d2f36470008b72\",\n \"forwarded\": [\n {\n \"seq\": \"001\",\n \"type\": \"mail\",\n \"value\": \"andris@ethereal.email\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Delete a Message:", "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/1/forward\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"addresses\": [\n \"andris@ethereal.email\"\n ]\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message", "title": "Request Message information", "name": "GetMessage", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "markAsSeen", "defaultValue": "false", "description": "

If true then marks message as seen

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from", "description": "

From: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "to", "description": "

To: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "cc", "description": "

Cc: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "messageId", "description": "

Message-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "date", "description": "

Datestring of message header

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "list", "description": "

If set then this message is from a mailing list

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.id", "description": "

Value from List-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.unsubscribe", "description": "

Value from List-Unsubscribe header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "expires", "description": "

Datestring, if set then indicates the time after this message is automatically deleted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "seen", "description": "

Does this message have a \\Seen flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "deleted", "description": "

Does this message have a \\Deleted flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "draft", "description": "

Does this message have a \\Draft flag

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "html", "description": "

An array of HTML string. Every array element is from a separate mime node, usually you would just join these to a single string

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "text", "description": "

Plaintext content of the message

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "attachments", "description": "

List of attachments for this message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.id", "description": "

Attachment ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.filename", "description": "

Filename of the attachment

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.contentType", "description": "

MIME type

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.disposition", "description": "

Attachment disposition

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.transferEncoding", "description": "

Which transfer encoding was used (actual content when fetching attachments is not encoded)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "attachments.related", "description": "

Was this attachment found from a multipart/related node. This usually means that this is an embedded image

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "attachments.sizeKb", "description": "

Approximate size of the attachment in kilobytes

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"user\": \"59fc66a03e54454869460e45\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"to\": [\n {\n \"address\": \"bob@domain.dom\",\n \"name\": \"\"\n }\n ],\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"messageId\": \"<1066976914.4721.5.camel@localhost>\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"html\": [\n \"

Welcome to Ryan Finnie's MIME torture test.

\",\n \"

While a message/rfc822 part inside another message/rfc822 part in a
message isn't too strange, 200 iterations of that would be.

\"\n ],\n \"text\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed\\nto introduce a couple of the newer features of MIME-aware MUA\",\n \"attachments\": [\n {\n \"id\": \"ATT00004\",\n \"filename\": \"foo.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n },\n {\n \"id\": \"ATT00007\",\n \"filename\": \"blah1.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n }\n ],\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message/attachments/:attachment", "title": "Download Attachment", "name": "GetMessageAttachment", "group": "Messages", "description": "

This method returns attachment file contents in binary form

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "attachment", "description": "

ID of the Attachment

" } ] } }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This attachment does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/1/attachments/ATT00002\"", "type": "curl" } ], "success": { "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: image/png\n\n<89>PNG...", "type": "text" } ] }, "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message/events", "title": "Message events", "name": "GetMessageEvents", "group": "Messages", "description": "

This method returns a listing of events related to this messages. This includes how the message was received and also information about forwarding

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "events", "description": "

List of events

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action", "description": "

Event type

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e4e\",\n \"events\": [\n {\n \"id\": \"59fc66a03e54454869460e4e\",\n \"stored\": \"59fc66a03e54454869460e4e\",\n \"action\": \"STORE\",\n \"origin\": \"Import\",\n \"messageId\": \"<1066976914.4721.5.camel@localhost>\",\n \"from\": null,\n \"to\": [\n \"user1@example.com\"\n ],\n \"transtype\": null,\n \"time\": 1509713568834\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1/events\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message/message.eml", "title": "Get Message source", "name": "GetMessageSource", "group": "Messages", "description": "

This method returns the full RFC822 formatted source of the stored message

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" } ] } }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1/message.eml\"", "type": "curl" } ], "success": { "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: message/rfc822\n\nSubject: Ryan Finnie's MIME Torture Test v1.0\nFrom: Ryan Finnie \nTo: bob@domain.dom\nContent-Type: multipart/mixed; boundary=\"=-qYxqvD9rbH0PNeExagh1\"\n...", "type": "text" } ] }, "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages", "title": "List messages in a Mailbox", "name": "GetMessages", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "order", "defaultValue": "desc", "description": "

Ordering of the records by insert date

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Message listing

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.thread", "description": "

ID of the Thread

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.from", "description": "

Sender info

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.date", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.intro", "description": "

First 128 bytes of the message

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.attachments", "description": "

Does the message have attachments

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.seen", "description": "

Is this message alread seen or not

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.deleted", "description": "

Does this message have a \\Deleted flag (should not have as messages are automatically deleted once this flag is set)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"specialUse\": null,\n \"results\": [\n {\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"intro\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed to introduce a couple of the newer features of MIME-aware…\",\n \"attachments\": true,\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"url\": \"/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\",\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/search", "title": "Search for messages", "name": "GetMessagesSearch", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Search string, uses MongoDB fulltext index. Covers data from mesage body and also common headers like from, to, subject etc.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "datestart", "description": "

Datestring for the earliest message storing time

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "dateend", "description": "

Datestring for the latest message storing time

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "from", "description": "

Partial match for the From: header line

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "to", "description": "

Partial match for the To: and Cc: header lines

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "subject", "description": "

Partial match for the Subject: header line

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "attachments", "description": "

If true, then matches only messages with attachments

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "flagged", "description": "

If true, then matches only messages with \\Flagged flags

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Message listing

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.thread", "description": "

ID of the Thread

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.from", "description": "

Sender info

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.date", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.intro", "description": "

First 128 bytes of the message

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.attachments", "description": "

Does the message have attachments

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.seen", "description": "

Is this message alread seen or not

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.deleted", "description": "

Does this message have a \\Deleted flag (should not have as messages are automatically deleted once this flag is set)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.url", "description": "

Relative API url for fetching message contents

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"query\": \"Ryan\",\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"specialUse\": null,\n \"results\": [\n {\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"intro\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed to introduce a couple of the newer features of MIME-aware…\",\n \"attachments\": true,\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"url\": \"/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\",\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/search?query=Ryan\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "put", "url": "/users/:user/mailboxes/:mailbox/messages/:message", "title": "Update Message information", "name": "PutMessage", "group": "Messages", "description": "

This method updates message flags and also allows to move messages to a different mailbox

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "message", "description": "

Message ID values. Either comma separated numbers (1,2,3) or colon separated range (3:15)

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "moveTo", "description": "

ID of the target Mailbox if you want to move messages

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "seen", "description": "

State of the \\Seen flag

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "flagged", "description": "

State of the \\Flagged flag

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "draft", "description": "

State of the \\Draft flag

" }, { "group": "Parameter", "type": "Datestring", "optional": false, "field": "expires", "description": "

Either expiration date or false to turn of autoexpiration

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "id", "description": "

If messages were moved then lists new ID values. Array entry is an array with first element pointing to old ID and second to new ID

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "updated", "description": "

If messages were not moved, then indicates the number of updated messages

" } ] }, "examples": [ { "title": "Update Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"updated\": 2\n}", "type": "json" }, { "title": "Move Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"mailbox\": \"59fc66a13e54454869460e57\",\n \"id\": [\n [1,24],\n [2,25]\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Mark messages as unseen:", "content": "curl -i -XPUT \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1,2,3\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"seen\": false\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "post", "url": "/users/:user/submit", "title": "Submit a Message for Delivery", "name": "PostSubmit", "group": "Submission", "description": "

Use this method to send emails from an user account

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "reference", "description": "

Optional referenced email. If submitted message is a reply and relevant fields are not provided then these are resolved from the message to be replied to

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "reference.mailbox", "description": "

Mailbox ID

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "reference.id", "description": "

Message ID in Mailbox

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "reference.action", "description": "

Either reply, replyAll or forward

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sendTime", "description": "

Datestring for delivery if message should be sent some later time

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "envelope", "description": "

SMTP envelope. If not provided then resolved either from message headers or from referenced message

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "envelope.from", "description": "

Sender information. If not set then it is resolved to User's default address

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "envelope.from.address", "description": "

Sender address. If this is not listed as allowed address for the sending User then it is replaced with the User's default address

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "envelope.to", "description": "

Recipients information

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "envelope.to.address", "description": "

Recipient address

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "from", "description": "

Address for the From: header

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "from.name", "description": "

Name of the sender

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "from.address", "description": "

Address of the sender

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "to", "description": "

Addresses for the To: header

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "to.name", "description": "

Name of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "to.address", "description": "

Address of the recipient

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "cc", "description": "

Addresses for the Cc: header

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "cc.name", "description": "

Name of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "cc.address", "description": "

Address of the recipient

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "bcc", "description": "

Addresses for the Bcc: header

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "bcc.name", "description": "

Name of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "bcc.address", "description": "

Address of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "subject", "description": "

Message subject. If not then resolved from Reference message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "text", "description": "

Plaintext message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "html", "description": "

HTML formatted message

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "headers", "description": "

Custom headers for the message. If reference message is set then In-Reply-To and References headers are set automatically

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "headers.key", "description": "

Header key ('X-Mailer')

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "headers.value", "description": "

Header value ('My Awesome Mailing Service')

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "attachments", "description": "

Attachments for the message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "attachments.content", "description": "

Base64 encoded attachment content

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "attachments.filename", "description": "

Attachment filename

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "attachments.contentType", "description": "

MIME type for the attachment file

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "attachments.cid", "description": "

Content-ID value if you want to reference to this attachment from HTML formatted message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "message", "description": "

Information about submitted Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "message.mailbox", "description": "

Mailbox ID the message was stored to

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "message.id", "description": "

Message ID in Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "message.queueId", "description": "

Queue ID in MTA

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"message\": {\n \"id\": 16,\n \"mailbox\": \"59fc66a03e54454869460e47\",\n \"queueId\": \"1600798505b000a25f\"\n }\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "error", "description": "

Description of the error

" }, { "group": "Error 4xx", "type": "String", "optional": false, "field": "code", "description": "

Reason for the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"User account is disabled\",\n \"code\": \"ERRDISABLEDUSER\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "# Sender info is derived from account settings\ncurl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"to\": [{\n \"address\": \"andris@ethereal.email\"\n }],\n \"subject\": \"Hello world!\",\n \"text\": \"Test message\"\n}'", "type": "curl" }, { "title": "Reply to All", "content": "# Recipients and subject line are derived from referenced message\ncurl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"reference\": {\n \"mailbox\": \"59fc66a03e54454869460e47\",\n \"id\": 15,\n \"action\": \"replyAll\"\n },\n \"text\": \"Yeah, sure\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/submit.js", "groupTitle": "Submission" }, { "type": "delete", "url": "/users/:id", "title": "Delete an User", "name": "DeleteUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/5a1bda70bfbd1442cd96c6f0?ip=127.0.0.1", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "get", "url": "/users/:id/updates", "title": "Open change stream", "name": "GetUpdates", "group": "Users", "description": "

This api call returns an EventSource response. Listen on this stream to get notifications about changes in messages and mailboxes. Returned events are JSON encoded strings

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "command", "description": "

Indicates data event type

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: text/event-stream\n\ndata: {\ndata: \"command\": \"CREATE\",\ndata: \"mailbox\": \"5a1d3061153888cdcd62a719\",\ndata: \"path\": \"First Level/Second 😎 Level/Folder Name\"\ndata: }", "type": "text" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "var stream = new EventSource('/users/59fc66a03e54454869460e45/updates');\nstream.onmessage = function(e) {\n console.log(JSON.parse(e.data));\n};", "type": "javascript" } ], "version": "0.0.0", "filename": "lib/api/updates.js", "groupTitle": "Users" }, { "type": "get", "url": "/users/:id", "title": "Request User information", "name": "GetUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID (24 byte hex)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "username", "description": "

Username of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "name", "description": "

Name of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "address", "description": "

Main email address of the User

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "retention", "description": "

Default retention time in ms. false if not enabled

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "enabled2fa", "description": "

List of enabled 2FA methods

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "pubKey", "description": "

Public PGP key for the User that is used for encryption

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "keyInfo", "description": "

Information about public key or false if key is not available

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "keyInfo.name", "description": "

Name listed in public key

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "keyInfo.address", "description": "

E-mail address listed in public key

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "keyInfo.fingerprint", "description": "

Fingerprint of the public key

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "targetUrl", "description": "

An URL to post all incoming emails

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits", "description": "

Account limits and usage

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits.quota", "description": "

Quota usage limits

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.quota.allowed", "description": "

Allowed quota of the user in bytes

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.quota.used", "description": "

Space used in bytes

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits.recipients", "description": "

Sending quota

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.recipients.allowed", "description": "

How many messages per 24 hour can be sent

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.recipients.used", "description": "

How many messages are sent during current 24 hour period

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.recipients.ttl", "description": "

Time until the end of current 24 hour period

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits.forwards", "description": "

Forwarding quota

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.forwards.allowed", "description": "

How many messages per 24 hour can be forwarded

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.forwards.used", "description": "

How many messages are forwarded during current 24 hour period

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.forwards.ttl", "description": "

Time until the end of current 24 hour period

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "tags", "description": "

List of tags associated with the User

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "hasPasswordSet", "description": "

If true then the User has a password set and can authenticate

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "activated", "description": "

Is the account activated

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "disabled", "description": "

If true then the user can not authenticate or receive any new mail

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\",\n \"username\": \"testuser01\",\n \"name\": null,\n \"address\": \"testuser01@example.com\",\n \"retention\": false,\n \"enabled2fa\": [],\n \"encryptMessages\": false,\n \"encryptForwarded\": false,\n \"pubKey\": \"\",\n \"keyInfo\": false,\n \"forward\": [],\n \"targetUrl\": \"\",\n \"limits\": {\n \"quota\": {\n \"allowed\": 107374182400,\n \"used\": 289838\n },\n \"recipients\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n },\n \"forwards\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n }\n },\n \"tags\": [\"green\", \"blue\"],\n \"hasPasswordSet\": true,\n \"activated\": true,\n \"disabled\": false\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "get", "url": "/users", "title": "List registered Users", "name": "GetUsers", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Partial match of username or default email address

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "tags", "description": "

Comma separated list of tags. The User must have at least one to be set

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "requiredTags", "description": "

Comma separated list of tags. The User must have all listed tags to be set

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

User listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

Users unique ID (24 byte hex)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.username", "description": "

Username of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.name", "description": "

Name of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.address", "description": "

Main email address of the User

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "results.tags", "description": "

List of tags associated with the User'

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "results.forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.quota", "description": "

Quota usage limits

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.quota.allowed", "description": "

Allowed quota of the user in bytes

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.quota.used", "description": "

Space used in bytes

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.hasPasswordSet", "description": "

If true then the User has a password set and can authenticate

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.activated", "description": "

Is the account activated

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.disabled", "description": "

If true then the user can not authenticate or receive any new mail

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59cb948ad80a820b68f05230\",\n \"username\": \"myuser\",\n \"name\": \"John Doe\",\n \"address\": \"john@example.com\",\n \"tags\": [],\n \"forward\": [],\n \"encryptMessages\": false,\n \"encryptForwarded\": false,\n \"quota\": {\n \"allowed\": 1073741824,\n \"used\": 17799833\n },\n \"hasPasswordSet\": true,\n \"activated\": true,\n \"disabled\": false\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "post", "url": "/users", "title": "Create new user", "name": "PostUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "

Username of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

New password for the account

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "address", "description": "

Default email address for the User (autogenerated if not set)

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "emptyAddress", "description": "

If true then do not autogenerate missing email address for the User. Only needed if you want to create an user account that does not have any email address associated

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "description": "

Default retention time in ms. Set to 0 to disable

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "pubKey", "description": "

Public PGP key for the User that is used for encryption. Use empty string to remove the key

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "language", "description": "

Language code for the User

" }, { "group": "Parameter", "type": "String[]", "optional": true, "field": "forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "targetUrl", "description": "

An URL to post all incoming emails

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "quota", "description": "

Allowed quota of the user in bytes

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "recipients", "description": "

How many messages per 24 hour can be sent

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "forwards", "description": "

How many messages per 24 hour can be forwarded

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "limits", "description": "

Service specific limits

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the created User

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1bda70bfbd1442cd96c6f0\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This username already exists\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users \\\n-H 'Content-type: application/json' \\\n-d '{\n \"username\": \"myuser\",\n \"password\": \"verysecret\",\n \"name\": \"John Doe\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "post", "url": "/users/:id/quota/reset", "title": "Recalculate User quota", "name": "PostUserQuota", "group": "Users", "description": "

This method recalculates quota usage for an User. Normally not needed, only use it if quota numbers are way off. This method is not transactional, so if the user is currently receiving new messages then the resulting value is not exact.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "reason", "description": "

Message to be shown to connected IMAP client

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "storageUsed", "description": "

Calculated quota usage for the user

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"storageUsed\": 1234567\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/quota/reset \\\n-H 'Content-type: application/json' \\\n-d '{}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "put", "url": "/users/:id", "title": "Update User information", "name": "PutUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Name of the User

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "existingPassword", "description": "

If provided then validates against account password before applying any changes

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "password", "description": "

New password for the account

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "description": "

Default retention time in ms. Set to 0 to disable

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "pubKey", "description": "

Public PGP key for the User that is used for encryption. Use empty string to remove the key

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "language", "description": "

Language code for the User

" }, { "group": "Parameter", "type": "String[]", "optional": true, "field": "forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "targetUrl", "description": "

An URL to post all incoming emails

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "quota", "description": "

Allowed quota of the user in bytes

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "recipients", "description": "

How many messages per 24 hour can be sent

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "forwards", "description": "

How many messages per 24 hour can be forwarded

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "disabled", "description": "

If true then disables user account (can not login, can not receive messages)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45 \\\n-H 'Content-type: application/json' \\\n-d '{\n \"name\": \"Updated user name\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "put", "url": "/users/:id/logout", "title": "Log out User", "name": "PutUserLogout", "group": "Users", "description": "

This method logs out all user sessions in IMAP

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "reason", "description": "

Message to be shown to connected IMAP client

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/logout \\\n-H 'Content-type: application/json' \\\n-d '{\n \"reason\": \"Logout requested from API\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "post", "url": "/users/:id/password/reset", "title": "Reset password for an User", "name": "ResetUserPassword", "group": "Users", "description": "

This method generates a new temporary password for an User. Additionally it removes all two-factor authentication settings

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "password", "description": "

Temporary password

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"password\": \"temporarypass\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/5a1bda70bfbd1442cd96/password/reset \\\n-H 'Content-type: application/json' \\\n-d '{\n \"ip\": \"127.0.0.1\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" } ] }); diff --git a/docs/api_data.json b/docs/api_data.json index d672b74d..af3bc0dc 100644 --- a/docs/api_data.json +++ b/docs/api_data.json @@ -1 +1 @@ -[ { "type": "delete", "url": "/users/:user/addresses/:address", "title": "Delete an Address", "name": "DeleteUserAddress", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "address", "description": "

ID of the Address

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Trying to delete main address. Set a new main address first\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59ef21aef255ed1d9d790e7a/addresses/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "get", "url": "/addresses", "title": "List registered Addresses", "name": "GetAddresses", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Partial match of an address

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Address listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Address

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.address", "description": "

E-mail address string

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.user", "description": "

User ID this address belongs to

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"user\": \"59ef21aef255ed1d9d790e7a\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/addresses", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "get", "url": "/users/:user/addresses/:address", "title": "Request Addresses information", "name": "GetUserAddress", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "address", "description": "

ID of the Address

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Address

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "address", "description": "

E-mail address string

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "main", "description": "

Indicates if this is the default address for the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "created", "description": "

Datestring of the time the address was created

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"main\": true,\n \"created\": \"2017-10-24T11:19:10.911Z\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59ef21aef255ed1d9d790e7a/addresses/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "get", "url": "/users/:user/addresses", "title": "List registered Addresses for an User", "name": "GetUserAddresses", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Address listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Address

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.address", "description": "

E-mail address string

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.main", "description": "

Indicates if this is the default address for the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring of the time the address was created

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"main\": true,\n \"created\": \"2017-10-24T11:19:10.911Z\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59ef21aef255ed1d9d790e7a/addresses", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "post", "url": "/users/:user/addresses", "title": "Create new Address", "name": "PostUserAddress", "group": "Addresses", "description": "

Add a new email address for an User. Addresses can contain unicode characters. Dots in usernames are normalized so no need to create both "firstlast@example.com" and "first.last@example.com"

Special addresses @example.com and username@ catches all emails to these domains or users without a registered destination (requires allowWildcard argument)

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "address", "description": "

E-mail Address

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "main", "defaultValue": "false", "description": "

Indicates if this is the default address for the User

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "allowWildcard", "defaultValue": "false", "description": "

If true then address value can be in the form of *@example.com, otherwise using * is not allowed

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Address

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/addresses \\\n-H 'Content-type: application/json' \\\n-d '{\n \"address\": \"my.new.address@example.com\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "put", "url": "/users/:user/addresses/:address", "title": "Update Address information", "name": "PutUserAddress", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "main", "description": "

Indicates if this is the default address for the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/addresses/5a1d4541153888cdcd62a71b \\\n-H 'Content-type: application/json' \\\n-d '{\n \"main\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "delete", "url": "/users/:user/asps/:asp", "title": "Delete an Application Password", "name": "DeleteASP", "group": "ApplicationPasswords", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "asp", "description": "

ID of the Application Password

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE \"http://localhost:8080/users/59fc66a03e54454869460e45/asps/5a1d6dd776e56b6d97e5dd48\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/asps.js", "groupTitle": "ApplicationPasswords" }, { "type": "get", "url": "/users/:user/asps", "title": "List Application Passwords", "name": "GetASPs", "group": "ApplicationPasswords", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Event listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Application Password

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.description", "description": "

Description

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "results.scopes", "description": "

Allowed scopes for the Application Password

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.expires", "description": "

Datestring if this is a temporary Application Password or false if not

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"results\": [\n {\n \"id\": \"5a1d6dd776e56b6d97e5dd48\",\n \"description\": \"Thunderbird\",\n \"scopes\": [\n \"imap\",\n \"smtp\"\n ],\n \"created\": \"2017-11-28T14:08:23.520Z\",\n \"expires\": false\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/asps\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/asps.js", "groupTitle": "ApplicationPasswords" }, { "type": "post", "url": "/users/:user/asps", "title": "Create new Application Password", "name": "PostASP", "group": "ApplicationPasswords", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "description", "description": "

Description

" }, { "group": "Parameter", "type": "String[]", "optional": false, "field": "scopes", "description": "

List of scopes this Password applies to. Special scope "*" indicates that this password can be used for any scope except "master"

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "expires", "description": "

Datestring if this is a temporary Application Password

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "generateMobileconfig", "description": "

If true then result contains a mobileconfig formatted file with account config

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Application Password

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "password", "description": "

Application Specific Password. Generated password is whitespace agnostic, so it could be displayed to the client as "abcd efgh ijkl mnop" instead of "abcdefghijklmnop"

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mobileconfig", "description": "

Base64 encoded mobileconfig file. Generated profile file should be sent to the client with Content-Type value of application/x-apple-aspen-config.

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1d6dd776e56b6d97e5dd48\",\n \"password\": \"rflhmllyegblyybd\",\n \"mobileconfig\": \"MIIQBgYJKoZIhvcNAQcCoIIP9...\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/asps \\\n-H 'Content-type: application/json' \\\n-d '{\n \"description\": \"Thunderbird\",\n \"scopes\": [\"imap\", \"smtp\"],\n \"generateMobileconfig\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/asps.js", "groupTitle": "ApplicationPasswords" }, { "type": "get", "url": "/users/:user/archived/:message/attachments/:attachment", "title": "Download Archived Attachment", "name": "GetArchivedAttachment", "group": "Archive", "description": "

This method returns attachment file contents in binary form

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Archived Message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "attachment", "description": "

ID of the Attachment

" } ] } }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This attachment does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/59fc66a13e54454869460e58/attachments/ATT00003\"", "type": "curl" } ], "success": { "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: image/png\n\n<89>PNG...", "type": "text" } ] }, "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "get", "url": "/users/:user/archived/:message", "title": "Request Archived Message", "name": "GetArchivedMessage", "group": "Archive", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox the messages was deleted from

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from", "description": "

From: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "to", "description": "

To: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "cc", "description": "

Cc: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "messageId", "description": "

Message-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "date", "description": "

Datestring of message header

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "list", "description": "

If set then this message is from a mailing list

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.id", "description": "

Value from List-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.unsubscribe", "description": "

Value from List-Unsubscribe header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "expires", "description": "

Datestring, if set then indicates the time after this message is automatically deleted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "seen", "description": "

Does this message have a \\Seen flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "deleted", "description": "

Does this message have a \\Deleted flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "draft", "description": "

Does this message have a \\Draft flag

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "html", "description": "

An array of HTML string. Every array element is from a separate mime node, usually you would just join these to a single string

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "text", "description": "

Plaintext content of the message

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "attachments", "description": "

List of attachments for this message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.id", "description": "

Attachment ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.filename", "description": "

Filename of the attachment

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.contentType", "description": "

MIME type

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.disposition", "description": "

Attachment disposition

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.transferEncoding", "description": "

Which transfer encoding was used (actual content when fetching attachments is not encoded)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "attachments.related", "description": "

Was this attachment found from a multipart/related node. This usually means that this is an embedded image

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "attachments.sizeKb", "description": "

Approximate size of the attachment in kilobytes

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a13e54454869460e58\",\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"user\": \"59fc66a03e54454869460e45\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"to\": [\n {\n \"address\": \"bob@domain.dom\",\n \"name\": \"\"\n }\n ],\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"messageId\": \"<1066976914.4721.5.camel@localhost>\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"html\": [\n \"

Welcome to Ryan Finnie's MIME torture test.

\",\n \"

While a message/rfc822 part inside another message/rfc822 part in a
message isn't too strange, 200 iterations of that would be.

\"\n ],\n \"text\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed\\nto introduce a couple of the newer features of MIME-aware MUA\",\n \"attachments\": [\n {\n \"id\": \"ATT00004\",\n \"filename\": \"foo.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n },\n {\n \"id\": \"ATT00007\",\n \"filename\": \"blah1.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n }\n ],\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/59fc66a13e54454869460e58\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "get", "url": "/users/:user/archived", "title": "List archived messages", "name": "GetArchivedMessages", "group": "Archive", "description": "

Archive contains all recently deleted messages besides Drafts etc.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "order", "defaultValue": "desc", "description": "

Ordering of the records by insert date

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Message listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Message (24 byte hex)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.thread", "description": "

ID of the Thread

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.from", "description": "

Sender info

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.date", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.intro", "description": "

First 128 bytes of the message

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.attachments", "description": "

Does the message have attachments

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.seen", "description": "

Is this message alread seen or not

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.deleted", "description": "

Does this message have a \\Deleted flag (should not have as messages are automatically deleted once this flag is set)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59fc66a13e54454869460e58\",\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"intro\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed to introduce a couple of the newer features of MIME-aware…\",\n \"attachments\": true,\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"url\": \"/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\",\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/archived\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "post", "url": "/users/:user/archived/:message/restore", "title": "Restore archived Message", "name": "RestoreMessage", "group": "Archive", "description": "

Restores an archived message by moving it back to the mailbox it was deleted from or to provided target mailbox. If target mailbox does not exist, then the message is moved to INBOX.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

Message ID

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailbox", "description": "

ID of the target Mailbox. If not set then original mailbox is used.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mailbox", "description": "

Maibox ID the message was moved to

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "id", "description": "

New ID for the Message

" } ] }, "examples": [ { "title": "Restore Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"mailbox\": \"59fc66a13e54454869460e57\",\n \"id\": 4\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Restore a Message:", "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/59fc66a13e54454869460e58/restore\" \\\n-H 'Content-type: application/json' \\\n-d '{}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "get", "url": "/users/:user/authlog", "title": "List authentication Events", "name": "GetAuthlog", "group": "Authentication", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action", "description": "

Limit listing only to values with specific action value

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Limit listing only to values with specific session identifier

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

Limit listing only to values with specific IP address

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Event listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Event

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.action", "description": "

Action identifier

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.result", "description": "

Did the action succeed

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.sess", "description": "

Session identifier

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.ip", "description": "

IP address of the Event

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring of the Event time

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"action\": \"account created\",\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59fc66a03e54454869460e4d\",\n \"action\": \"account created\",\n \"result\": \"success\",\n \"sess\": null,\n \"ip\": null,\n \"created\": \"2017-11-03T12:52:48.792Z\",\n \"expires\": \"2017-12-03T12:52:48.792Z\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/authlog?action=account+created\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/auth.js", "groupTitle": "Authentication" }, { "type": "post", "url": "/authenticate", "title": "Authenticate an User", "name": "PostAuth", "group": "Authentication", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "username", "description": "

Username or E-mail address

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

Password

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "protocol", "description": "

Application identifier for security logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "scope", "defaultValue": "master", "description": "

Required scope. One of master, imap, smtp, pop3

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of authenticated User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "username", "description": "

Username of authenticated User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "scope", "description": "

The scope this authentication is valid for

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "require2fa", "description": "

List of enabled 2FA mechanisms

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "requirePasswordChange", "description": "

Indicates if account hassword has been reset and should be replaced

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a12914c350c183bd0d331f0\",\n \"username\": \"myuser\",\n \"scope\": \"master\",\n \"require2fa\": [\n \"totp\"\n ],\n \"requirePasswordChange\": false\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Authentication failed. Invalid scope\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/authenticate \\\n-H 'Content-type: application/json' \\\n-d '{\n \"username\": \"myuser\",\n \"password\": \"secretpass\",\n \"scope\": \"master\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/auth.js", "groupTitle": "Authentication" }, { "type": "delete", "url": "/users/:user/autoreply", "title": "Delete Autoreply information", "name": "DeleteAutoreply", "group": "Autoreplies", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/autoreply", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/autoreply.js", "groupTitle": "Autoreplies" }, { "type": "get", "url": "/users/:user/autoreply", "title": "Request Autoreply information", "name": "GetAutoreply", "group": "Autoreplies", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "status", "description": "

Is the autoreply enabled (true) or not (false)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "subject", "description": "

Subject line for the autoreply. If empty then uses subject of the original message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "html", "description": "

HTML formatted content of the autoreply message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "text", "description": "

Plaintext formatted content of the autoreply message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "start", "description": "

Datestring of the start of the autoreply

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "end", "description": "

Datestring of the end of the autoreply

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"status\": true,\n \"subject\": \"\",\n \"text\": \"Away from office until Dec.19\",\n \"html\": \"\",\n \"start\": \"2017-11-15T00:00:00.000Z\",\n \"end\": \"2017-12-19T00:00:00.000Z\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/autoreply", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/autoreply.js", "groupTitle": "Autoreplies" }, { "type": "put", "url": "/users/:user/autoreply", "title": "Update Autoreply information", "name": "PutAutoreply", "group": "Autoreplies", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "status", "description": "

Is the autoreply enabled (true) or not (false)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "subject", "description": "

Subject line for the autoreply. If empty then uses subject of the original message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "html", "description": "

HTML formatted content of the autoreply message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "text", "description": "

Plaintext formatted content of the autoreply message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "start", "description": "

Datestring of the start of the autoreply

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "end", "description": "

Datestring of the end of the autoreply

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/autoreply \\\n-H 'Content-type: application/json' \\\n-d '{\n \"status\": true,\n \"text\": \"Away from office until Dec.19\",\n \"start\": \"2017-11-15T00:00:00.000Z\",\n \"end\": \"2017-12-19T00:00:00.000Z\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/autoreply.js", "groupTitle": "Autoreplies" }, { "type": "delete", "url": "/domainaliases/:alias", "title": "Delete an Alias", "name": "DeleteDomainAlias", "group": "DomainAliases", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "alias", "description": "

ID of the Alias

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/domainaliases/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "get", "url": "/addresses", "title": "List registered Domain Aliases", "name": "GetAliases", "group": "DomainAliases", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Partial match of a Domain Alias or Domain name

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Aliases listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Domain Alias

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.alias", "description": "

Domain Alias

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.domain", "description": "

The domain this alias applies to

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"alias\": \"example.net\",\n \"domain\": \"example.com\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/domainaliases", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "get", "url": "/domainaliases/:alias", "title": "Request Alias information", "name": "GetDomainAlias", "group": "DomainAliases", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "alias", "description": "

ID of the Alias

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Alias

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "alias", "description": "

Alias domain

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "domain", "description": "

Alias target

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "created", "description": "

Datestring of the time the alias was created

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e7a\",\n \"alias\": \"example.net\",\n \"domain\": \"example.com\",\n \"created\": \"2017-10-24T11:19:10.911Z\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This Alias does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/domainaliases/59ef21aef255ed1d9d790e7a", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "post", "url": "/domainaliases/addresses", "title": "Create new Domain Alias", "name": "PostDomainAlias", "group": "DomainAliases", "description": "

Add a new Alias for a Domain. This allows to accept mail on username@domain and username@alias

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "alias", "description": "

Domain Alias

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "domain", "description": "

Domain name this Alias applies to

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Domain Alias

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/domainaliases \\\n-H 'Content-type: application/json' \\\n-d '{\n \"domain\": \"example.com\",\n \"alias\": \"example.org\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "delete", "url": "/users/:user/filters/:filter", "title": "Delete a Filter", "name": "DeleteFilter", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "filter", "description": "

Filters unique ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This filter does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/filters/5a1c0ee490a34c67e266931c", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "get", "url": "/users/:user/filters/:filter", "title": "Request Filter information", "name": "GetFilter", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "filter", "description": "

Filters unique ID.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the Filter

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "name", "description": "

Name of the Filter

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_from", "description": "

Partial match for the From: header (case insensitive)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_to", "description": "

Partial match for the To:/Cc: headers (case insensitive)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_subject", "description": "

Partial match for the Subject: header (case insensitive)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_text", "description": "

Fulltext search against message text

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "query_ha", "description": "

Does a message have to have an attachment or not

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "query_size", "description": "

Message size in bytes. If the value is a positive number then message needs to be larger, if negative then message needs to be smaller than abs(size) value

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_delete", "description": "

If true then do not store matching messages

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_spam", "description": "

If true then store matching messags to Junk Mail folder

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action_mailbox", "description": "

Mailbox ID to store matching messages to

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action_forward", "description": "

An email address where matching messages should be forwarded to

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action_targetUrl", "description": "

An URL where matching messages should be POSTed to

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1c0ee490a34c67e266931c\",\n \"created\": \"2017-11-27T13:11:00.835Z\",\n \"query_from\": \"Mäger\",\n \"action_seen\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This filter does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/filters/5a1c0ee490a34c67e266931c", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "get", "url": "/users/:user/filters", "title": "List Filters for an User", "name": "GetFilters", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Filter description

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

Filter ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.name", "description": "

Name for the filter

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring of the time the filter was created

" }, { "group": "Success 200", "type": "Array[]", "optional": false, "field": "results.query", "description": "

A list of query descriptions

" }, { "group": "Success 200", "type": "Array[]", "optional": false, "field": "results.action", "description": "

A list of action descriptions

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"results\": [\n {\n \"id\": \"5a1c0ee490a34c67e266931c\",\n \"query\": [\n [\n \"from\",\n \"(Mäger)\"\n ]\n ],\n \"action\": [\n [\n \"mark as read\"\n ]\n ],\n \"created\": \"2017-11-27T13:11:00.835Z\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/5a1bda70bfbd1442cd96c6f0/filters", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "post", "url": "/users/:user/filters", "title": "Create new Filter", "name": "PostFilter", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Name of the Filter

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_from", "description": "

Partial match for the From: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_to", "description": "

Partial match for the To:/Cc: headers (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_subject", "description": "

Partial match for the Subject: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_text", "description": "

Fulltext search against message text

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "query_ha", "description": "

Does a message have to have an attachment or not

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "query_size", "description": "

Message size in bytes. If the value is a positive number then message needs to be larger, if negative then message needs to be smaller than abs(size) value

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_delete", "description": "

If true then do not store matching messages

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_spam", "description": "

If true then store matching messags to Junk Mail folder

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_mailbox", "description": "

Mailbox ID to store matching messages to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_forward", "description": "

An email address where matching messages should be forwarded to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_targetUrl", "description": "

An URL where matching messages should be POSTed to

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the created Filter

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1c0ee490a34c67e266931c\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Empty filter query\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/5a1bda70bfbd1442cd96c6f0/filters \\\n-H 'Content-type: application/json' \\\n-d '{\n \"query_from\": \"Mäger\",\n \"action_seen\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "put", "url": "/users/:user/filters/:filter", "title": "Update Filter information", "name": "PutFilter", "group": "Filters", "description": "

This method updates Filter data. To unset a value, use empty strings

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "filter", "description": "

Filters unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Name of the Filter

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_from", "description": "

Partial match for the From: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_to", "description": "

Partial match for the To:/Cc: headers (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_subject", "description": "

Partial match for the Subject: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_text", "description": "

Fulltext search against message text

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "query_ha", "description": "

Does a message have to have an attachment or not

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "query_size", "description": "

Message size in bytes. If the value is a positive number then message needs to be larger, if negative then message needs to be smaller than abs(size) value

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_delete", "description": "

If true then do not store matching messages

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_spam", "description": "

If true then store matching messags to Junk Mail folder

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_mailbox", "description": "

Mailbox ID to store matching messages to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_forward", "description": "

An email address where matching messages should be forwarded to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_targetUrl", "description": "

An URL where matching messages should be POSTed to

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the created Filter

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Empty filter query\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/filters/5a1c0ee490a34c67e266931c \\\n-H 'Content-type: application/json' \\\n-d '{\n \"action_seen\": \"\",\n \"action_flag\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "delete", "url": "/users/:user/mailboxes/:mailbox", "title": "Delete a Mailbox", "name": "DeleteMailbox", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

Mailbox unique ID. Special use folders and INBOX can not be deleted

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Mailbox deletion failed with code CANNOT\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/5a1d2816153888cdcd62a715", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox", "title": "Request Mailbox information", "name": "GetMailbox", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

Mailbox unique ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

Mailbox ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "name", "description": "

Name for the mailbox (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "path", "description": "

Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "specialUse", "description": "

Either special use identifier or null. One of \\Drafts, \\Junk, \\Sent or \\Trash

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "modifyIndex", "description": "

Modification sequence number. Incremented on every change in the mailbox.

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "subscribed", "description": "

Mailbox subscription status. IMAP clients may unsubscribe from a folder.

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many messages are stored in this mailbox

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "unseen", "description": "

How many unseen messages are stored in this mailbox

" } ] }, "examples": [ { "title": "Success-Response:", "content": " HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e46\",\n \"name\": \"INBOX\",\n \"path\": \"INBOX\",\n \"specialUse\": null,\n \"modifyIndex\": 1808,\n \"subscribed\": true,\n \"total\": 20,\n \"unseen\": 2\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This mailbox does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "get", "url": "/users/:user/mailboxes", "title": "List Mailboxes for an User", "name": "GetMailboxes", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "counters", "defaultValue": "false", "description": "

Should the response include counters (total + unseen). Counters come with some overhead.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

List of user mailboxes

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

Mailbox ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.name", "description": "

Name for the mailbox (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.path", "description": "

Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.specialUse", "description": "

Either special use identifier or null. One of \\Drafts, \\Junk, \\Sent or \\Trash

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.modifyIndex", "description": "

Modification sequence number. Incremented on every change in the mailbox.

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.subscribed", "description": "

Mailbox subscription status. IMAP clients may unsubscribe from a folder.

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.total", "description": "

How many messages are stored in this mailbox

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.unseen", "description": "

How many unseen messages are stored in this mailbox

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"results\": [\n {\n \"id\": \"59fc66a03e54454869460e46\",\n \"name\": \"INBOX\",\n \"path\": \"INBOX\",\n \"specialUse\": null,\n \"modifyIndex\": 1808,\n \"subscribed\": true,\n \"total\": 20,\n \"unseen\": 2\n },\n {\n \"id\": \"59fc66a03e54454869460e47\",\n \"name\": \"Sent Mail\",\n \"path\": \"Sent Mail\",\n \"specialUse\": \"\\\\Sent\",\n \"modifyIndex\": 145,\n \"subscribed\": true,\n \"total\": 15,\n \"unseen\": 0\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This mailbox does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes?counters=true", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "post", "url": "/users/:user/mailboxes", "title": "Create new Mailbox", "name": "PostMailboxes", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "path", "description": "

Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "defaultValue": "0", "description": "

Retention policy for the created Mailbox. Milliseconds after a message added to mailbox expires. Set to 0 to disable.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

Mailbox ID

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1d2816153888cdcd62a715\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Mailbox creation failed with code ALREADYEXISTS\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes \\\n-H 'Content-type: application/json' \\\n-d '{\n \"path\": \"First Level/Second 😎 Level/Folder Name\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "put", "url": "/users/:user/mailboxes/:mailbox", "title": "Update Mailbox information", "name": "PutMailbox", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

Mailbox unique ID

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "path", "description": "

Full path of the mailbox, use this to rename an existing Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "description": "

Retention policy for the created Mailbox. Chaning retention value only affects messages added to this folder after the change

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "subscribed", "description": "

Change Mailbox subscription state

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Mailbox update failed with code ALREADYEXISTS\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/5a1d2816153888cdcd62a715 \\\n-H 'Content-type: application/json' \\\n-d '{\n \"path\": \"Updated Folder Name\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "delete", "url": "/users/:user/mailboxes/:mailbox/messages/:message", "title": "Delete a Message", "name": "DeleteMessage", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

Message ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Delete Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Delete a Message:", "content": "curl -i -XDELETE \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/2\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "post", "url": "/users/:user/mailboxes/:mailbox/messages/:message/forward", "title": "Forward stored Message", "name": "DeleteMessage", "group": "Messages", "description": "

This method allows either to re-forward a message to an original forward target or forward it to some other address. This is useful if an user had forwarding turned on but the message was not delivered so you can try again. Forwarding does not modify the original message.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

Message ID

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "target", "description": "

Number of original forwarding target

" }, { "group": "Parameter", "type": "String[]", "optional": true, "field": "addresses", "description": "

An array of additional forward targets

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "queueId", "description": "

Message ID in outbound queue

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "forwarded", "description": "

Information about forwarding targets

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "forwarded.seq", "description": "

Sequence ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "forwarded.type", "description": "

Target type

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "forwarded.value", "description": "

Target address

" } ] }, "examples": [ { "title": "Forward Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"1600d2f36470008b72\",\n \"forwarded\": [\n {\n \"seq\": \"001\",\n \"type\": \"mail\",\n \"value\": \"andris@ethereal.email\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Delete a Message:", "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/1/forward\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"addresses\": [\n \"andris@ethereal.email\"\n ]\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message", "title": "Request Message information", "name": "GetMessage", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "markAsSeen", "defaultValue": "false", "description": "

If true then marks message as seen

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from", "description": "

From: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "to", "description": "

To: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "cc", "description": "

Cc: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "messageId", "description": "

Message-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "date", "description": "

Datestring of message header

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "list", "description": "

If set then this message is from a mailing list

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.id", "description": "

Value from List-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.unsubscribe", "description": "

Value from List-Unsubscribe header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "expires", "description": "

Datestring, if set then indicates the time after this message is automatically deleted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "seen", "description": "

Does this message have a \\Seen flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "deleted", "description": "

Does this message have a \\Deleted flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "draft", "description": "

Does this message have a \\Draft flag

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "html", "description": "

An array of HTML string. Every array element is from a separate mime node, usually you would just join these to a single string

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "text", "description": "

Plaintext content of the message

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "attachments", "description": "

List of attachments for this message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.id", "description": "

Attachment ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.filename", "description": "

Filename of the attachment

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.contentType", "description": "

MIME type

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.disposition", "description": "

Attachment disposition

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.transferEncoding", "description": "

Which transfer encoding was used (actual content when fetching attachments is not encoded)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "attachments.related", "description": "

Was this attachment found from a multipart/related node. This usually means that this is an embedded image

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "attachments.sizeKb", "description": "

Approximate size of the attachment in kilobytes

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"user\": \"59fc66a03e54454869460e45\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"to\": [\n {\n \"address\": \"bob@domain.dom\",\n \"name\": \"\"\n }\n ],\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"messageId\": \"<1066976914.4721.5.camel@localhost>\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"html\": [\n \"

Welcome to Ryan Finnie's MIME torture test.

\",\n \"

While a message/rfc822 part inside another message/rfc822 part in a
message isn't too strange, 200 iterations of that would be.

\"\n ],\n \"text\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed\\nto introduce a couple of the newer features of MIME-aware MUA\",\n \"attachments\": [\n {\n \"id\": \"ATT00004\",\n \"filename\": \"foo.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n },\n {\n \"id\": \"ATT00007\",\n \"filename\": \"blah1.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n }\n ],\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message/attachments/:attachment", "title": "Download Attachment", "name": "GetMessageAttachment", "group": "Messages", "description": "

This method returns attachment file contents in binary form

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "attachment", "description": "

ID of the Attachment

" } ] } }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This attachment does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/1/attachments/ATT00002\"", "type": "curl" } ], "success": { "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: image/png\n\n<89>PNG...", "type": "text" } ] }, "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message/events", "title": "Message events", "name": "GetMessageEvents", "group": "Messages", "description": "

This method returns a listing of events related to this messages. This includes how the message was received and also information about forwarding

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "events", "description": "

List of events

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action", "description": "

Event type

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e4e\",\n \"events\": [\n {\n \"id\": \"59fc66a03e54454869460e4e\",\n \"stored\": \"59fc66a03e54454869460e4e\",\n \"action\": \"STORE\",\n \"origin\": \"Import\",\n \"messageId\": \"<1066976914.4721.5.camel@localhost>\",\n \"from\": null,\n \"to\": [\n \"user1@example.com\"\n ],\n \"transtype\": null,\n \"time\": 1509713568834\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1/events\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message/message.eml", "title": "Get Message source", "name": "GetMessageSource", "group": "Messages", "description": "

This method returns the full RFC822 formatted source of the stored message

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" } ] } }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1/message.eml\"", "type": "curl" } ], "success": { "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: message/rfc822\n\nSubject: Ryan Finnie's MIME Torture Test v1.0\nFrom: Ryan Finnie \nTo: bob@domain.dom\nContent-Type: multipart/mixed; boundary=\"=-qYxqvD9rbH0PNeExagh1\"\n...", "type": "text" } ] }, "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages", "title": "List messages in a Mailbox", "name": "GetMessages", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "order", "defaultValue": "desc", "description": "

Ordering of the records by insert date

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Message listing

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.thread", "description": "

ID of the Thread

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.from", "description": "

Sender info

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.date", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.intro", "description": "

First 128 bytes of the message

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.attachments", "description": "

Does the message have attachments

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.seen", "description": "

Is this message alread seen or not

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.deleted", "description": "

Does this message have a \\Deleted flag (should not have as messages are automatically deleted once this flag is set)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"specialUse\": null,\n \"results\": [\n {\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"intro\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed to introduce a couple of the newer features of MIME-aware…\",\n \"attachments\": true,\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"url\": \"/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\",\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/search", "title": "Search for messages", "name": "GetMessagesSearch", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Search string, uses MongoDB fulltext index. Covers data from mesage body and also common headers like from, to, subject etc.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "datestart", "description": "

Datestring for the earliest message storing time

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "dateend", "description": "

Datestring for the latest message storing time

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "from", "description": "

Partial match for the From: header line

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "to", "description": "

Partial match for the To: and Cc: header lines

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "subject", "description": "

Partial match for the Subject: header line

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "attachments", "description": "

If true, then matches only messages with attachments

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "flagged", "description": "

If true, then matches only messages with \\Flagged flags

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Message listing

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.thread", "description": "

ID of the Thread

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.from", "description": "

Sender info

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.date", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.intro", "description": "

First 128 bytes of the message

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.attachments", "description": "

Does the message have attachments

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.seen", "description": "

Is this message alread seen or not

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.deleted", "description": "

Does this message have a \\Deleted flag (should not have as messages are automatically deleted once this flag is set)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.url", "description": "

Relative API url for fetching message contents

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"query\": \"Ryan\",\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"specialUse\": null,\n \"results\": [\n {\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"intro\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed to introduce a couple of the newer features of MIME-aware…\",\n \"attachments\": true,\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"url\": \"/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\",\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/search?query=Ryan\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "put", "url": "/users/:user/mailboxes/:mailbox/messages/:message", "title": "Update Message information", "name": "PutMessage", "group": "Messages", "description": "

This method updates message flags and also allows to move messages to a different mailbox

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "message", "description": "

Message ID values. Either comma separated numbers (1,2,3) or colon separated range (3:15)

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "moveTo", "description": "

ID of the target Mailbox if you want to move messages

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "seen", "description": "

State of the \\Seen flag

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "flagged", "description": "

State of the \\Flagged flag

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "draft", "description": "

State of the \\Draft flag

" }, { "group": "Parameter", "type": "Datestring", "optional": false, "field": "expires", "description": "

Either expiration date or false to turn of autoexpiration

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "id", "description": "

If messages were moved then lists new ID values. Array entry is an array with first element pointing to old ID and second to new ID

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "updated", "description": "

If messages were not moved, then indicates the number of updated messages

" } ] }, "examples": [ { "title": "Update Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"updated\": 2\n}", "type": "json" }, { "title": "Move Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"mailbox\": \"59fc66a13e54454869460e57\",\n \"id\": [\n [1,24],\n [2,25]\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Mark messages as unseen:", "content": "curl -i -XPUT \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1,2,3\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"seen\": false\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "post", "url": "/users/:user/submit", "title": "Submit a Message for Delivery", "name": "PostSubmit", "group": "Submission", "description": "

Use this method to send emails from an user account

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "reference", "description": "

Optional referenced email. If submitted message is a reply and relevant fields are not provided then these are resolved from the message to be replied to

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "reference.mailbox", "description": "

Mailbox ID

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "reference.id", "description": "

Message ID in Mailbox

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "reference.action", "description": "

Either reply, replyAll or forward

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sendTime", "description": "

Datestring for delivery if message should be sent some later time

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "envelope", "description": "

SMTP envelope. If not provided then resolved either from message headers or from referenced message

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "envelope.from", "description": "

Sender information. If not set then it is resolved to User's default address

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "envelope.from.address", "description": "

Sender address. If this is not listed as allowed address for the sending User then it is replaced with the User's default address

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "envelope.to", "description": "

Recipients information

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "envelope.to.address", "description": "

Recipient address

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "from", "description": "

Address for the From: header

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "from.name", "description": "

Name of the sender

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "from.address", "description": "

Address of the sender

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "to", "description": "

Addresses for the To: header

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "to.name", "description": "

Name of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "to.address", "description": "

Address of the recipient

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "cc", "description": "

Addresses for the Cc: header

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "cc.name", "description": "

Name of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "cc.address", "description": "

Address of the recipient

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "bcc", "description": "

Addresses for the Bcc: header

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "bcc.name", "description": "

Name of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "bcc.address", "description": "

Address of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "subject", "description": "

Message subject. If not then resolved from Reference message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "text", "description": "

Plaintext message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "html", "description": "

HTML formatted message

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "headers", "description": "

Custom headers for the message. If reference message is set then In-Reply-To and References headers are set automatically

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "headers.key", "description": "

Header key ('X-Mailer')

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "headers.value", "description": "

Header value ('My Awesome Mailing Service')

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "attachments", "description": "

Attachments for the message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "attachments.content", "description": "

Base64 encoded attachment content

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "attachments.filename", "description": "

Attachment filename

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "attachments.contentType", "description": "

MIME type for the attachment file

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "attachments.cid", "description": "

Content-ID value if you want to reference to this attachment from HTML formatted message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "message", "description": "

Information about submitted Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "message.mailbox", "description": "

Mailbox ID the message was stored to

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "message.id", "description": "

Message ID in Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "message.queueId", "description": "

Queue ID in MTA

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"message\": {\n \"id\": 16,\n \"mailbox\": \"59fc66a03e54454869460e47\",\n \"queueId\": \"1600798505b000a25f\"\n }\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "error", "description": "

Description of the error

" }, { "group": "Error 4xx", "type": "String", "optional": false, "field": "code", "description": "

Reason for the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"User account is disabled\",\n \"code\": \"ERRDISABLEDUSER\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "# Sender info is derived from account settings\ncurl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"to\": [{\n \"address\": \"andris@ethereal.email\"\n }],\n \"subject\": \"Hello world!\",\n \"text\": \"Test message\"\n}'", "type": "curl" }, { "title": "Reply to All", "content": "# Recipients and subject line are derived from referenced message\ncurl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"reference\": {\n \"mailbox\": \"59fc66a03e54454869460e47\",\n \"id\": 15,\n \"action\": \"replyAll\"\n },\n \"text\": \"Yeah, sure\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/submit.js", "groupTitle": "Submission" }, { "type": "delete", "url": "/users/:id", "title": "Delete an User", "name": "DeleteUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/5a1bda70bfbd1442cd96c6f0?ip=127.0.0.1", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "get", "url": "/users/:id/updates", "title": "Open change stream", "name": "GetUpdates", "group": "Users", "description": "

This api call returns an EventSource response. Listen on this stream to get notifications about changes in messages and mailboxes. Returned events are JSON encoded strings

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "command", "description": "

Indicates data event type

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: text/event-stream\n\ndata: {\ndata: \"command\": \"CREATE\",\ndata: \"mailbox\": \"5a1d3061153888cdcd62a719\",\ndata: \"path\": \"First Level/Second 😎 Level/Folder Name\"\ndata: }", "type": "text" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "var stream = new EventSource('/users/59fc66a03e54454869460e45/updates');\nstream.onmessage = function(e) {\n console.log(JSON.parse(e.data));\n};", "type": "javascript" } ], "version": "0.0.0", "filename": "lib/api/updates.js", "groupTitle": "Users" }, { "type": "get", "url": "/users/:id", "title": "Request User information", "name": "GetUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID (24 byte hex)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "username", "description": "

Username of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "name", "description": "

Name of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "address", "description": "

Main email address of the User

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "retention", "description": "

Default retention time in ms. false if not enabled

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "enabled2fa", "description": "

List of enabled 2FA methods

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "pubKey", "description": "

Public PGP key for the User that is used for encryption

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "keyInfo", "description": "

Information about public key or false if key is not available

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "keyInfo.name", "description": "

Name listed in public key

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "keyInfo.address", "description": "

E-mail address listed in public key

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "keyInfo.fingerprint", "description": "

Fingerprint of the public key

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "targetUrl", "description": "

An URL to post all incoming emails

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits", "description": "

Account limits and usage

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits.quota", "description": "

Quota usage limits

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.quota.allowed", "description": "

Allowed quota of the user in bytes

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.quota.used", "description": "

Space used in bytes

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits.recipients", "description": "

Sending quota

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.recipients.allowed", "description": "

How many messages per 24 hour can be sent

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.recipients.used", "description": "

How many messages are sent during current 24 hour period

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.recipients.ttl", "description": "

Time until the end of current 24 hour period

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits.forwards", "description": "

Forwarding quota

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.forwards.allowed", "description": "

How many messages per 24 hour can be forwarded

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.forwards.used", "description": "

How many messages are forwarded during current 24 hour period

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.forwards.ttl", "description": "

Time until the end of current 24 hour period

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "tags", "description": "

List of tags associated with the User

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "hasPasswordSet", "description": "

If true then the User has a password set and can authenticate

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "activated", "description": "

Is the account activated

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "disabled", "description": "

If true then the user can not authenticate or receive any new mail

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\",\n \"username\": \"testuser01\",\n \"name\": null,\n \"address\": \"testuser01@example.com\",\n \"retention\": false,\n \"enabled2fa\": [],\n \"encryptMessages\": false,\n \"encryptForwarded\": false,\n \"pubKey\": \"\",\n \"keyInfo\": false,\n \"forward\": [],\n \"targetUrl\": \"\",\n \"limits\": {\n \"quota\": {\n \"allowed\": 107374182400,\n \"used\": 289838\n },\n \"recipients\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n },\n \"forwards\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n }\n },\n \"tags\": [\"green\", \"blue\"],\n \"hasPasswordSet\": true,\n \"activated\": true,\n \"disabled\": false\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "get", "url": "/users", "title": "List registered Users", "name": "GetUsers", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Partial match of username or default email address

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "tags", "description": "

Comma separated list of tags. The User must have at least one to be set

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "requiredTags", "description": "

Comma separated list of tags. The User must have all listed tags to be set

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

User listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

Users unique ID (24 byte hex)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.username", "description": "

Username of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.name", "description": "

Name of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.address", "description": "

Main email address of the User

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "results.tags", "description": "

List of tags associated with the User'

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "results.forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.quota", "description": "

Quota usage limits

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.quota.allowed", "description": "

Allowed quota of the user in bytes

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.quota.used", "description": "

Space used in bytes

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.hasPasswordSet", "description": "

If true then the User has a password set and can authenticate

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.activated", "description": "

Is the account activated

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.disabled", "description": "

If true then the user can not authenticate or receive any new mail

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59cb948ad80a820b68f05230\",\n \"username\": \"myuser\",\n \"name\": \"John Doe\",\n \"address\": \"john@example.com\",\n \"tags\": [],\n \"forward\": [],\n \"encryptMessages\": false,\n \"encryptForwarded\": false,\n \"quota\": {\n \"allowed\": 1073741824,\n \"used\": 17799833\n },\n \"hasPasswordSet\": true,\n \"activated\": true,\n \"disabled\": false\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "post", "url": "/users", "title": "Create new user", "name": "PostUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "

Username of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

New password for the account

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "address", "description": "

Default email address for the User (autogenerated if not set)

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "emptyAddress", "description": "

If true then do not autogenerate missing email address for the User. Only needed if you want to create an user account that does not have any email address associated

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "description": "

Default retention time in ms. Set to 0 to disable

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "pubKey", "description": "

Public PGP key for the User that is used for encryption. Use empty string to remove the key

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "language", "description": "

Language code for the User

" }, { "group": "Parameter", "type": "String[]", "optional": true, "field": "forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "targetUrl", "description": "

An URL to post all incoming emails

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "quota", "description": "

Allowed quota of the user in bytes

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "recipients", "description": "

How many messages per 24 hour can be sent

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "forwards", "description": "

How many messages per 24 hour can be forwarded

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "disabled", "description": "

If true then disables user account (can not login, can not receive messages)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the created User

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1bda70bfbd1442cd96c6f0\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This username already exists\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users \\\n-H 'Content-type: application/json' \\\n-d '{\n \"username\": \"myuser\",\n \"password\": \"verysecret\",\n \"name\": \"John Doe\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "post", "url": "/users/:id/quota/reset", "title": "Recalculate User quota", "name": "PostUserQuota", "group": "Users", "description": "

This method recalculates quota usage for an User. Normally not needed, only use it if quota numbers are way off. This method is not transactional, so if the user is currently receiving new messages then the resulting value is not exact.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "reason", "description": "

Message to be shown to connected IMAP client

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "storageUsed", "description": "

Calculated quota usage for the user

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"storageUsed\": 1234567\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/quota/reset \\\n-H 'Content-type: application/json' \\\n-d '{}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "put", "url": "/users/:id", "title": "Update User information", "name": "PutUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Name of the User

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "existingPassword", "description": "

If provided then validates against account password before applying any changes

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "password", "description": "

New password for the account

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "description": "

Default retention time in ms. Set to 0 to disable

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "pubKey", "description": "

Public PGP key for the User that is used for encryption. Use empty string to remove the key

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "language", "description": "

Language code for the User

" }, { "group": "Parameter", "type": "String[]", "optional": true, "field": "forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "targetUrl", "description": "

An URL to post all incoming emails

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "quota", "description": "

Allowed quota of the user in bytes

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "recipients", "description": "

How many messages per 24 hour can be sent

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "forwards", "description": "

How many messages per 24 hour can be forwarded

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "disabled", "description": "

If true then disables user account (can not login, can not receive messages)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45 \\\n-H 'Content-type: application/json' \\\n-d '{\n \"name\": \"Updated user name\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "put", "url": "/users/:id/logout", "title": "Log out User", "name": "PutUserLogout", "group": "Users", "description": "

This method logs out all user sessions in IMAP

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "reason", "description": "

Message to be shown to connected IMAP client

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/logout \\\n-H 'Content-type: application/json' \\\n-d '{\n \"reason\": \"Logout requested from API\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "post", "url": "/users/:id/password/reset", "title": "Reset password for an User", "name": "ResetUserPassword", "group": "Users", "description": "

This method generates a new temporary password for an User. Additionally it removes all two-factor authentication settings

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "password", "description": "

Temporary password

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"password\": \"temporarypass\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/5a1bda70bfbd1442cd96/password/reset \\\n-H 'Content-type: application/json' \\\n-d '{\n \"ip\": \"127.0.0.1\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" } ] +[ { "type": "delete", "url": "/users/:user/addresses/:address", "title": "Delete an Address", "name": "DeleteUserAddress", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "address", "description": "

ID of the Address

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Trying to delete main address. Set a new main address first\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59ef21aef255ed1d9d790e7a/addresses/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "get", "url": "/addresses", "title": "List registered Addresses", "name": "GetAddresses", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Partial match of an address

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Address listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Address

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.address", "description": "

E-mail address string

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.user", "description": "

User ID this address belongs to

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"user\": \"59ef21aef255ed1d9d790e7a\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/addresses", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "get", "url": "/users/:user/addresses/:address", "title": "Request Addresses information", "name": "GetUserAddress", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "address", "description": "

ID of the Address

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Address

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "address", "description": "

E-mail address string

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "main", "description": "

Indicates if this is the default address for the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "created", "description": "

Datestring of the time the address was created

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"main\": true,\n \"created\": \"2017-10-24T11:19:10.911Z\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59ef21aef255ed1d9d790e7a/addresses/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "get", "url": "/users/:user/addresses", "title": "List registered Addresses for an User", "name": "GetUserAddresses", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Address listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Address

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.address", "description": "

E-mail address string

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.main", "description": "

Indicates if this is the default address for the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring of the time the address was created

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"main\": true,\n \"created\": \"2017-10-24T11:19:10.911Z\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59ef21aef255ed1d9d790e7a/addresses", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "post", "url": "/users/:user/addresses", "title": "Create new Address", "name": "PostUserAddress", "group": "Addresses", "description": "

Add a new email address for an User. Addresses can contain unicode characters. Dots in usernames are normalized so no need to create both "firstlast@example.com" and "first.last@example.com"

Special addresses @example.com and username@ catches all emails to these domains or users without a registered destination (requires allowWildcard argument)

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "address", "description": "

E-mail Address

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "main", "defaultValue": "false", "description": "

Indicates if this is the default address for the User

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "allowWildcard", "defaultValue": "false", "description": "

If true then address value can be in the form of *@example.com, otherwise using * is not allowed

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Address

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/addresses \\\n-H 'Content-type: application/json' \\\n-d '{\n \"address\": \"my.new.address@example.com\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "put", "url": "/users/:user/addresses/:address", "title": "Update Address information", "name": "PutUserAddress", "group": "Addresses", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "main", "description": "

Indicates if this is the default address for the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/addresses/5a1d4541153888cdcd62a71b \\\n-H 'Content-type: application/json' \\\n-d '{\n \"main\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "delete", "url": "/users/:user/asps/:asp", "title": "Delete an Application Password", "name": "DeleteASP", "group": "ApplicationPasswords", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "asp", "description": "

ID of the Application Password

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE \"http://localhost:8080/users/59fc66a03e54454869460e45/asps/5a1d6dd776e56b6d97e5dd48\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/asps.js", "groupTitle": "ApplicationPasswords" }, { "type": "get", "url": "/users/:user/asps", "title": "List Application Passwords", "name": "GetASPs", "group": "ApplicationPasswords", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Event listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Application Password

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.description", "description": "

Description

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "results.scopes", "description": "

Allowed scopes for the Application Password

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.expires", "description": "

Datestring if this is a temporary Application Password or false if not

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"results\": [\n {\n \"id\": \"5a1d6dd776e56b6d97e5dd48\",\n \"description\": \"Thunderbird\",\n \"scopes\": [\n \"imap\",\n \"smtp\"\n ],\n \"created\": \"2017-11-28T14:08:23.520Z\",\n \"expires\": false\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/asps\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/asps.js", "groupTitle": "ApplicationPasswords" }, { "type": "post", "url": "/users/:user/asps", "title": "Create new Application Password", "name": "PostASP", "group": "ApplicationPasswords", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "description", "description": "

Description

" }, { "group": "Parameter", "type": "String[]", "optional": false, "field": "scopes", "description": "

List of scopes this Password applies to. Special scope "*" indicates that this password can be used for any scope except "master"

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "expires", "description": "

Datestring if this is a temporary Application Password

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "generateMobileconfig", "description": "

If true then result contains a mobileconfig formatted file with account config

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Application Password

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "password", "description": "

Application Specific Password. Generated password is whitespace agnostic, so it could be displayed to the client as "abcd efgh ijkl mnop" instead of "abcdefghijklmnop"

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mobileconfig", "description": "

Base64 encoded mobileconfig file. Generated profile file should be sent to the client with Content-Type value of application/x-apple-aspen-config.

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1d6dd776e56b6d97e5dd48\",\n \"password\": \"rflhmllyegblyybd\",\n \"mobileconfig\": \"MIIQBgYJKoZIhvcNAQcCoIIP9...\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/asps \\\n-H 'Content-type: application/json' \\\n-d '{\n \"description\": \"Thunderbird\",\n \"scopes\": [\"imap\", \"smtp\"],\n \"generateMobileconfig\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/asps.js", "groupTitle": "ApplicationPasswords" }, { "type": "get", "url": "/users/:user/archived/:message/attachments/:attachment", "title": "Download Archived Attachment", "name": "GetArchivedAttachment", "group": "Archive", "description": "

This method returns attachment file contents in binary form

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Archived Message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "attachment", "description": "

ID of the Attachment

" } ] } }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This attachment does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/59fc66a13e54454869460e58/attachments/ATT00003\"", "type": "curl" } ], "success": { "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: image/png\n\n<89>PNG...", "type": "text" } ] }, "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "get", "url": "/users/:user/archived/:message", "title": "Request Archived Message", "name": "GetArchivedMessage", "group": "Archive", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox the messages was deleted from

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from", "description": "

From: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "to", "description": "

To: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "cc", "description": "

Cc: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "messageId", "description": "

Message-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "date", "description": "

Datestring of message header

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "list", "description": "

If set then this message is from a mailing list

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.id", "description": "

Value from List-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.unsubscribe", "description": "

Value from List-Unsubscribe header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "expires", "description": "

Datestring, if set then indicates the time after this message is automatically deleted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "seen", "description": "

Does this message have a \\Seen flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "deleted", "description": "

Does this message have a \\Deleted flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "draft", "description": "

Does this message have a \\Draft flag

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "html", "description": "

An array of HTML string. Every array element is from a separate mime node, usually you would just join these to a single string

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "text", "description": "

Plaintext content of the message

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "attachments", "description": "

List of attachments for this message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.id", "description": "

Attachment ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.filename", "description": "

Filename of the attachment

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.contentType", "description": "

MIME type

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.disposition", "description": "

Attachment disposition

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.transferEncoding", "description": "

Which transfer encoding was used (actual content when fetching attachments is not encoded)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "attachments.related", "description": "

Was this attachment found from a multipart/related node. This usually means that this is an embedded image

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "attachments.sizeKb", "description": "

Approximate size of the attachment in kilobytes

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a13e54454869460e58\",\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"user\": \"59fc66a03e54454869460e45\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"to\": [\n {\n \"address\": \"bob@domain.dom\",\n \"name\": \"\"\n }\n ],\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"messageId\": \"<1066976914.4721.5.camel@localhost>\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"html\": [\n \"

Welcome to Ryan Finnie's MIME torture test.

\",\n \"

While a message/rfc822 part inside another message/rfc822 part in a
message isn't too strange, 200 iterations of that would be.

\"\n ],\n \"text\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed\\nto introduce a couple of the newer features of MIME-aware MUA\",\n \"attachments\": [\n {\n \"id\": \"ATT00004\",\n \"filename\": \"foo.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n },\n {\n \"id\": \"ATT00007\",\n \"filename\": \"blah1.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n }\n ],\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/59fc66a13e54454869460e58\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "get", "url": "/users/:user/archived", "title": "List archived messages", "name": "GetArchivedMessages", "group": "Archive", "description": "

Archive contains all recently deleted messages besides Drafts etc.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "order", "defaultValue": "desc", "description": "

Ordering of the records by insert date

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Message listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Message (24 byte hex)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.thread", "description": "

ID of the Thread

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.from", "description": "

Sender info

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.date", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.intro", "description": "

First 128 bytes of the message

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.attachments", "description": "

Does the message have attachments

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.seen", "description": "

Is this message alread seen or not

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.deleted", "description": "

Does this message have a \\Deleted flag (should not have as messages are automatically deleted once this flag is set)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59fc66a13e54454869460e58\",\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"intro\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed to introduce a couple of the newer features of MIME-aware…\",\n \"attachments\": true,\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"url\": \"/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\",\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/archived\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "post", "url": "/users/:user/archived/:message/restore", "title": "Restore archived Message", "name": "RestoreMessage", "group": "Archive", "description": "

Restores an archived message by moving it back to the mailbox it was deleted from or to provided target mailbox. If target mailbox does not exist, then the message is moved to INBOX.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

Message ID

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailbox", "description": "

ID of the target Mailbox. If not set then original mailbox is used.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mailbox", "description": "

Maibox ID the message was moved to

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "id", "description": "

New ID for the Message

" } ] }, "examples": [ { "title": "Restore Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"mailbox\": \"59fc66a13e54454869460e57\",\n \"id\": 4\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Restore a Message:", "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/59fc66a13e54454869460e58/restore\" \\\n-H 'Content-type: application/json' \\\n-d '{}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "get", "url": "/users/:user/authlog", "title": "List authentication Events", "name": "GetAuthlog", "group": "Authentication", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action", "description": "

Limit listing only to values with specific action value

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Limit listing only to values with specific session identifier

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

Limit listing only to values with specific IP address

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Event listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Event

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.action", "description": "

Action identifier

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.result", "description": "

Did the action succeed

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.sess", "description": "

Session identifier

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.ip", "description": "

IP address of the Event

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring of the Event time

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"action\": \"account created\",\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59fc66a03e54454869460e4d\",\n \"action\": \"account created\",\n \"result\": \"success\",\n \"sess\": null,\n \"ip\": null,\n \"created\": \"2017-11-03T12:52:48.792Z\",\n \"expires\": \"2017-12-03T12:52:48.792Z\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/authlog?action=account+created\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/auth.js", "groupTitle": "Authentication" }, { "type": "post", "url": "/authenticate", "title": "Authenticate an User", "name": "PostAuth", "group": "Authentication", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "username", "description": "

Username or E-mail address

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

Password

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "protocol", "description": "

Application identifier for security logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "scope", "defaultValue": "master", "description": "

Required scope. One of master, imap, smtp, pop3

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of authenticated User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "username", "description": "

Username of authenticated User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "scope", "description": "

The scope this authentication is valid for

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "require2fa", "description": "

List of enabled 2FA mechanisms

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "requirePasswordChange", "description": "

Indicates if account hassword has been reset and should be replaced

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a12914c350c183bd0d331f0\",\n \"username\": \"myuser\",\n \"scope\": \"master\",\n \"require2fa\": [\n \"totp\"\n ],\n \"requirePasswordChange\": false\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Authentication failed. Invalid scope\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/authenticate \\\n-H 'Content-type: application/json' \\\n-d '{\n \"username\": \"myuser\",\n \"password\": \"secretpass\",\n \"scope\": \"master\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/auth.js", "groupTitle": "Authentication" }, { "type": "delete", "url": "/users/:user/autoreply", "title": "Delete Autoreply information", "name": "DeleteAutoreply", "group": "Autoreplies", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/autoreply", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/autoreply.js", "groupTitle": "Autoreplies" }, { "type": "get", "url": "/users/:user/autoreply", "title": "Request Autoreply information", "name": "GetAutoreply", "group": "Autoreplies", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "status", "description": "

Is the autoreply enabled (true) or not (false)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "subject", "description": "

Subject line for the autoreply. If empty then uses subject of the original message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "html", "description": "

HTML formatted content of the autoreply message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "text", "description": "

Plaintext formatted content of the autoreply message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "start", "description": "

Datestring of the start of the autoreply

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "end", "description": "

Datestring of the end of the autoreply

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"status\": true,\n \"subject\": \"\",\n \"text\": \"Away from office until Dec.19\",\n \"html\": \"\",\n \"start\": \"2017-11-15T00:00:00.000Z\",\n \"end\": \"2017-12-19T00:00:00.000Z\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/autoreply", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/autoreply.js", "groupTitle": "Autoreplies" }, { "type": "put", "url": "/users/:user/autoreply", "title": "Update Autoreply information", "name": "PutAutoreply", "group": "Autoreplies", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "status", "description": "

Is the autoreply enabled (true) or not (false)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "subject", "description": "

Subject line for the autoreply. If empty then uses subject of the original message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "html", "description": "

HTML formatted content of the autoreply message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "text", "description": "

Plaintext formatted content of the autoreply message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "start", "description": "

Datestring of the start of the autoreply

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "end", "description": "

Datestring of the end of the autoreply

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/autoreply \\\n-H 'Content-type: application/json' \\\n-d '{\n \"status\": true,\n \"text\": \"Away from office until Dec.19\",\n \"start\": \"2017-11-15T00:00:00.000Z\",\n \"end\": \"2017-12-19T00:00:00.000Z\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/autoreply.js", "groupTitle": "Autoreplies" }, { "type": "delete", "url": "/domainaliases/:alias", "title": "Delete an Alias", "name": "DeleteDomainAlias", "group": "DomainAliases", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "alias", "description": "

ID of the Alias

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/domainaliases/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "get", "url": "/addresses", "title": "List registered Domain Aliases", "name": "GetAliases", "group": "DomainAliases", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Partial match of a Domain Alias or Domain name

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Aliases listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

ID of the Domain Alias

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.alias", "description": "

Domain Alias

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.domain", "description": "

The domain this alias applies to

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"alias\": \"example.net\",\n \"domain\": \"example.com\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/domainaliases", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "get", "url": "/domainaliases/:alias", "title": "Request Alias information", "name": "GetDomainAlias", "group": "DomainAliases", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "alias", "description": "

ID of the Alias

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Alias

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "alias", "description": "

Alias domain

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "domain", "description": "

Alias target

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "created", "description": "

Datestring of the time the alias was created

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e7a\",\n \"alias\": \"example.net\",\n \"domain\": \"example.com\",\n \"created\": \"2017-10-24T11:19:10.911Z\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This Alias does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/domainaliases/59ef21aef255ed1d9d790e7a", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "post", "url": "/domainaliases/addresses", "title": "Create new Domain Alias", "name": "PostDomainAlias", "group": "DomainAliases", "description": "

Add a new Alias for a Domain. This allows to accept mail on username@domain and username@alias

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "alias", "description": "

Domain Alias

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "domain", "description": "

Domain name this Alias applies to

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID of the Domain Alias

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/domainaliases \\\n-H 'Content-type: application/json' \\\n-d '{\n \"domain\": \"example.com\",\n \"alias\": \"example.org\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/domainaliases.js", "groupTitle": "DomainAliases" }, { "type": "delete", "url": "/users/:user/filters/:filter", "title": "Delete a Filter", "name": "DeleteFilter", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "filter", "description": "

Filters unique ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This filter does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/filters/5a1c0ee490a34c67e266931c", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "get", "url": "/users/:user/filters/:filter", "title": "Request Filter information", "name": "GetFilter", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "filter", "description": "

Filters unique ID.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the Filter

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "name", "description": "

Name of the Filter

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_from", "description": "

Partial match for the From: header (case insensitive)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_to", "description": "

Partial match for the To:/Cc: headers (case insensitive)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_subject", "description": "

Partial match for the Subject: header (case insensitive)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "query_text", "description": "

Fulltext search against message text

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "query_ha", "description": "

Does a message have to have an attachment or not

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "query_size", "description": "

Message size in bytes. If the value is a positive number then message needs to be larger, if negative then message needs to be smaller than abs(size) value

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_delete", "description": "

If true then do not store matching messages

" }, { "group": "Success 200", "type": "Bolean", "optional": false, "field": "action_spam", "description": "

If true then store matching messags to Junk Mail folder

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action_mailbox", "description": "

Mailbox ID to store matching messages to

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action_forward", "description": "

An email address where matching messages should be forwarded to

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action_targetUrl", "description": "

An URL where matching messages should be POSTed to

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1c0ee490a34c67e266931c\",\n \"created\": \"2017-11-27T13:11:00.835Z\",\n \"query_from\": \"Mäger\",\n \"action_seen\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This filter does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/filters/5a1c0ee490a34c67e266931c", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "get", "url": "/users/:user/filters", "title": "List Filters for an User", "name": "GetFilters", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Filter description

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

Filter ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.name", "description": "

Name for the filter

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.created", "description": "

Datestring of the time the filter was created

" }, { "group": "Success 200", "type": "Array[]", "optional": false, "field": "results.query", "description": "

A list of query descriptions

" }, { "group": "Success 200", "type": "Array[]", "optional": false, "field": "results.action", "description": "

A list of action descriptions

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"results\": [\n {\n \"id\": \"5a1c0ee490a34c67e266931c\",\n \"query\": [\n [\n \"from\",\n \"(Mäger)\"\n ]\n ],\n \"action\": [\n [\n \"mark as read\"\n ]\n ],\n \"created\": \"2017-11-27T13:11:00.835Z\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/5a1bda70bfbd1442cd96c6f0/filters", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "post", "url": "/users/:user/filters", "title": "Create new Filter", "name": "PostFilter", "group": "Filters", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Name of the Filter

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_from", "description": "

Partial match for the From: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_to", "description": "

Partial match for the To:/Cc: headers (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_subject", "description": "

Partial match for the Subject: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_text", "description": "

Fulltext search against message text

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "query_ha", "description": "

Does a message have to have an attachment or not

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "query_size", "description": "

Message size in bytes. If the value is a positive number then message needs to be larger, if negative then message needs to be smaller than abs(size) value

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_delete", "description": "

If true then do not store matching messages

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_spam", "description": "

If true then store matching messags to Junk Mail folder

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_mailbox", "description": "

Mailbox ID to store matching messages to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_forward", "description": "

An email address where matching messages should be forwarded to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_targetUrl", "description": "

An URL where matching messages should be POSTed to

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the created Filter

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1c0ee490a34c67e266931c\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Empty filter query\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/5a1bda70bfbd1442cd96c6f0/filters \\\n-H 'Content-type: application/json' \\\n-d '{\n \"query_from\": \"Mäger\",\n \"action_seen\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "put", "url": "/users/:user/filters/:filter", "title": "Update Filter information", "name": "PutFilter", "group": "Filters", "description": "

This method updates Filter data. To unset a value, use empty strings

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "filter", "description": "

Filters unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Name of the Filter

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_from", "description": "

Partial match for the From: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_to", "description": "

Partial match for the To:/Cc: headers (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_subject", "description": "

Partial match for the Subject: header (case insensitive)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query_text", "description": "

Fulltext search against message text

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "query_ha", "description": "

Does a message have to have an attachment or not

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "query_size", "description": "

Message size in bytes. If the value is a positive number then message needs to be larger, if negative then message needs to be smaller than abs(size) value

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_delete", "description": "

If true then do not store matching messages

" }, { "group": "Parameter", "type": "Bolean", "optional": true, "field": "action_spam", "description": "

If true then store matching messags to Junk Mail folder

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_mailbox", "description": "

Mailbox ID to store matching messages to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_forward", "description": "

An email address where matching messages should be forwarded to

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "action_targetUrl", "description": "

An URL where matching messages should be POSTed to

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the created Filter

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Empty filter query\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/filters/5a1c0ee490a34c67e266931c \\\n-H 'Content-type: application/json' \\\n-d '{\n \"action_seen\": \"\",\n \"action_flag\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/filters.js", "groupTitle": "Filters" }, { "type": "delete", "url": "/users/:user/mailboxes/:mailbox", "title": "Delete a Mailbox", "name": "DeleteMailbox", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

Mailbox unique ID. Special use folders and INBOX can not be deleted

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Mailbox deletion failed with code CANNOT\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/5a1d2816153888cdcd62a715", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox", "title": "Request Mailbox information", "name": "GetMailbox", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

Mailbox unique ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

Mailbox ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "name", "description": "

Name for the mailbox (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "path", "description": "

Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "specialUse", "description": "

Either special use identifier or null. One of \\Drafts, \\Junk, \\Sent or \\Trash

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "modifyIndex", "description": "

Modification sequence number. Incremented on every change in the mailbox.

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "subscribed", "description": "

Mailbox subscription status. IMAP clients may unsubscribe from a folder.

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many messages are stored in this mailbox

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "unseen", "description": "

How many unseen messages are stored in this mailbox

" } ] }, "examples": [ { "title": "Success-Response:", "content": " HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e46\",\n \"name\": \"INBOX\",\n \"path\": \"INBOX\",\n \"specialUse\": null,\n \"modifyIndex\": 1808,\n \"subscribed\": true,\n \"total\": 20,\n \"unseen\": 2\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This mailbox does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "get", "url": "/users/:user/mailboxes", "title": "List Mailboxes for an User", "name": "GetMailboxes", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "counters", "defaultValue": "false", "description": "

Should the response include counters (total + unseen). Counters come with some overhead.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

List of user mailboxes

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

Mailbox ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.name", "description": "

Name for the mailbox (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.path", "description": "

Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.specialUse", "description": "

Either special use identifier or null. One of \\Drafts, \\Junk, \\Sent or \\Trash

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.modifyIndex", "description": "

Modification sequence number. Incremented on every change in the mailbox.

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.subscribed", "description": "

Mailbox subscription status. IMAP clients may unsubscribe from a folder.

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.total", "description": "

How many messages are stored in this mailbox

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.unseen", "description": "

How many unseen messages are stored in this mailbox

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"results\": [\n {\n \"id\": \"59fc66a03e54454869460e46\",\n \"name\": \"INBOX\",\n \"path\": \"INBOX\",\n \"specialUse\": null,\n \"modifyIndex\": 1808,\n \"subscribed\": true,\n \"total\": 20,\n \"unseen\": 2\n },\n {\n \"id\": \"59fc66a03e54454869460e47\",\n \"name\": \"Sent Mail\",\n \"path\": \"Sent Mail\",\n \"specialUse\": \"\\\\Sent\",\n \"modifyIndex\": 145,\n \"subscribed\": true,\n \"total\": 15,\n \"unseen\": 0\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This mailbox does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes?counters=true", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "post", "url": "/users/:user/mailboxes", "title": "Create new Mailbox", "name": "PostMailboxes", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "path", "description": "

Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "defaultValue": "0", "description": "

Retention policy for the created Mailbox. Milliseconds after a message added to mailbox expires. Set to 0 to disable.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

Mailbox ID

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1d2816153888cdcd62a715\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Mailbox creation failed with code ALREADYEXISTS\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes \\\n-H 'Content-type: application/json' \\\n-d '{\n \"path\": \"First Level/Second 😎 Level/Folder Name\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "put", "url": "/users/:user/mailboxes/:mailbox", "title": "Update Mailbox information", "name": "PutMailbox", "group": "Mailboxes", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

Mailbox unique ID

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "path", "description": "

Full path of the mailbox, use this to rename an existing Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "description": "

Retention policy for the created Mailbox. Chaning retention value only affects messages added to this folder after the change

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "subscribed", "description": "

Change Mailbox subscription state

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Mailbox update failed with code ALREADYEXISTS\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/5a1d2816153888cdcd62a715 \\\n-H 'Content-type: application/json' \\\n-d '{\n \"path\": \"Updated Folder Name\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/mailboxes.js", "groupTitle": "Mailboxes" }, { "type": "delete", "url": "/users/:user/mailboxes/:mailbox/messages/:message", "title": "Delete a Message", "name": "DeleteMessage", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

Message ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Delete Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Delete a Message:", "content": "curl -i -XDELETE \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/2\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "post", "url": "/users/:user/mailboxes/:mailbox/messages/:message/forward", "title": "Forward stored Message", "name": "DeleteMessage", "group": "Messages", "description": "

This method allows either to re-forward a message to an original forward target or forward it to some other address. This is useful if an user had forwarding turned on but the message was not delivered so you can try again. Forwarding does not modify the original message.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

Message ID

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "target", "description": "

Number of original forwarding target

" }, { "group": "Parameter", "type": "String[]", "optional": true, "field": "addresses", "description": "

An array of additional forward targets

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "queueId", "description": "

Message ID in outbound queue

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "forwarded", "description": "

Information about forwarding targets

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "forwarded.seq", "description": "

Sequence ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "forwarded.type", "description": "

Target type

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "forwarded.value", "description": "

Target address

" } ] }, "examples": [ { "title": "Forward Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"1600d2f36470008b72\",\n \"forwarded\": [\n {\n \"seq\": \"001\",\n \"type\": \"mail\",\n \"value\": \"andris@ethereal.email\"\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Delete a Message:", "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/1/forward\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"addresses\": [\n \"andris@ethereal.email\"\n ]\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message", "title": "Request Message information", "name": "GetMessage", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "markAsSeen", "defaultValue": "false", "description": "

If true then marks message as seen

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from", "description": "

From: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "to", "description": "

To: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "to.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "cc", "description": "

Cc: header info

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "cc.address", "description": "

Address of the recipient

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "messageId", "description": "

Message-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "date", "description": "

Datestring of message header

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "list", "description": "

If set then this message is from a mailing list

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.id", "description": "

Value from List-ID header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "list.unsubscribe", "description": "

Value from List-Unsubscribe header

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "expires", "description": "

Datestring, if set then indicates the time after this message is automatically deleted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "seen", "description": "

Does this message have a \\Seen flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "deleted", "description": "

Does this message have a \\Deleted flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "draft", "description": "

Does this message have a \\Draft flag

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "html", "description": "

An array of HTML string. Every array element is from a separate mime node, usually you would just join these to a single string

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "text", "description": "

Plaintext content of the message

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "attachments", "description": "

List of attachments for this message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.id", "description": "

Attachment ID

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.filename", "description": "

Filename of the attachment

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.contentType", "description": "

MIME type

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.disposition", "description": "

Attachment disposition

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "attachments.transferEncoding", "description": "

Which transfer encoding was used (actual content when fetching attachments is not encoded)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "attachments.related", "description": "

Was this attachment found from a multipart/related node. This usually means that this is an embedded image

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "attachments.sizeKb", "description": "

Approximate size of the attachment in kilobytes

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"user\": \"59fc66a03e54454869460e45\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"to\": [\n {\n \"address\": \"bob@domain.dom\",\n \"name\": \"\"\n }\n ],\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"messageId\": \"<1066976914.4721.5.camel@localhost>\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"html\": [\n \"

Welcome to Ryan Finnie's MIME torture test.

\",\n \"

While a message/rfc822 part inside another message/rfc822 part in a
message isn't too strange, 200 iterations of that would be.

\"\n ],\n \"text\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed\\nto introduce a couple of the newer features of MIME-aware MUA\",\n \"attachments\": [\n {\n \"id\": \"ATT00004\",\n \"filename\": \"foo.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n },\n {\n \"id\": \"ATT00007\",\n \"filename\": \"blah1.gz\",\n \"contentType\": \"application/x-gzip\",\n \"disposition\": \"attachment\",\n \"transferEncoding\": \"base64\",\n \"related\": false,\n \"sizeKb\": 1\n }\n ],\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message/attachments/:attachment", "title": "Download Attachment", "name": "GetMessageAttachment", "group": "Messages", "description": "

This method returns attachment file contents in binary form

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "attachment", "description": "

ID of the Attachment

" } ] } }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This attachment does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/1/attachments/ATT00002\"", "type": "curl" } ], "success": { "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: image/png\n\n<89>PNG...", "type": "text" } ] }, "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message/events", "title": "Message events", "name": "GetMessageEvents", "group": "Messages", "description": "

This method returns a listing of events related to this messages. This includes how the message was received and also information about forwarding

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "events", "description": "

List of events

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "action", "description": "

Event type

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e4e\",\n \"events\": [\n {\n \"id\": \"59fc66a03e54454869460e4e\",\n \"stored\": \"59fc66a03e54454869460e4e\",\n \"action\": \"STORE\",\n \"origin\": \"Import\",\n \"messageId\": \"<1066976914.4721.5.camel@localhost>\",\n \"from\": null,\n \"to\": [\n \"user1@example.com\"\n ],\n \"transtype\": null,\n \"time\": 1509713568834\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1/events\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages/:message/message.eml", "title": "Get Message source", "name": "GetMessageSource", "group": "Messages", "description": "

This method returns the full RFC822 formatted source of the stored message

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "message", "description": "

ID of the Message

" } ] } }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1/message.eml\"", "type": "curl" } ], "success": { "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: message/rfc822\n\nSubject: Ryan Finnie's MIME Torture Test v1.0\nFrom: Ryan Finnie \nTo: bob@domain.dom\nContent-Type: multipart/mixed; boundary=\"=-qYxqvD9rbH0PNeExagh1\"\n...", "type": "text" } ] }, "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/mailboxes/:mailbox/messages", "title": "List messages in a Mailbox", "name": "GetMessages", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "order", "defaultValue": "desc", "description": "

Ordering of the records by insert date

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Message listing

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.thread", "description": "

ID of the Thread

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.from", "description": "

Sender info

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.date", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.intro", "description": "

First 128 bytes of the message

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.attachments", "description": "

Does the message have attachments

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.seen", "description": "

Is this message alread seen or not

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.deleted", "description": "

Does this message have a \\Deleted flag (should not have as messages are automatically deleted once this flag is set)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"specialUse\": null,\n \"results\": [\n {\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"intro\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed to introduce a couple of the newer features of MIME-aware…\",\n \"attachments\": true,\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"url\": \"/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\",\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "get", "url": "/users/:user/search", "title": "Search for messages", "name": "GetMessagesSearch", "group": "Messages", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Search string, uses MongoDB fulltext index. Covers data from mesage body and also common headers like from, to, subject etc.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "datestart", "description": "

Datestring for the earliest message storing time

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "dateend", "description": "

Datestring for the latest message storing time

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "from", "description": "

Partial match for the From: header line

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "to", "description": "

Partial match for the To: and Cc: header lines

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "subject", "description": "

Partial match for the Subject: header line

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "attachments", "description": "

If true, then matches only messages with attachments

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "flagged", "description": "

If true, then matches only messages with \\Flagged flags

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

Message listing

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.id", "description": "

ID of the Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.mailbox", "description": "

ID of the Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.thread", "description": "

ID of the Thread

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.from", "description": "

Sender info

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.name", "description": "

Name of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.from.address", "description": "

Address of the sender

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.subject", "description": "

Message subject

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.date", "description": "

Datestring

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.intro", "description": "

First 128 bytes of the message

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.attachments", "description": "

Does the message have attachments

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.seen", "description": "

Is this message alread seen or not

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.deleted", "description": "

Does this message have a \\Deleted flag (should not have as messages are automatically deleted once this flag is set)

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.flagged", "description": "

Does this message have a \\Flagged flag

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.url", "description": "

Relative API url for fetching message contents

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType", "description": "

Parsed Content-Type header. Usually needed to identify encrypted messages and such

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.contentType.value", "description": "

MIME type of the message, eg. "multipart/mixed"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.contentType.params", "description": "

An object with Content-Type params as key-value pairs

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"query\": \"Ryan\",\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"specialUse\": null,\n \"results\": [\n {\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\n \"from\": {\n \"address\": \"rfinnie@domain.dom\",\n \"name\": \"Ryan Finnie\"\n },\n \"subject\": \"Ryan Finnie's MIME Torture Test v1.0\",\n \"date\": \"2003-10-24T06:28:34.000Z\",\n \"intro\": \"Welcome to Ryan Finnie's MIME torture test. This message was designed to introduce a couple of the newer features of MIME-aware…\",\n \"attachments\": true,\n \"seen\": true,\n \"deleted\": false,\n \"flagged\": true,\n \"draft\": false,\n \"url\": \"/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1\",\n \"contentType\": {\n \"value\": \"multipart/mixed\",\n \"params\": {\n \"boundary\": \"=-qYxqvD9rbH0PNeExagh1\"\n }\n }\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/search?query=Ryan\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "put", "url": "/users/:user/mailboxes/:mailbox/messages/:message", "title": "Update Message information", "name": "PutMessage", "group": "Messages", "description": "

This method updates message flags and also allows to move messages to a different mailbox

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

ID of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "mailbox", "description": "

ID of the Mailbox

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "message", "description": "

Message ID values. Either comma separated numbers (1,2,3) or colon separated range (3:15)

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "moveTo", "description": "

ID of the target Mailbox if you want to move messages

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "seen", "description": "

State of the \\Seen flag

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "flagged", "description": "

State of the \\Flagged flag

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "draft", "description": "

State of the \\Draft flag

" }, { "group": "Parameter", "type": "Datestring", "optional": false, "field": "expires", "description": "

Either expiration date or false to turn of autoexpiration

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "id", "description": "

If messages were moved then lists new ID values. Array entry is an array with first element pointing to old ID and second to new ID

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "updated", "description": "

If messages were not moved, then indicates the number of updated messages

" } ] }, "examples": [ { "title": "Update Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"updated\": 2\n}", "type": "json" }, { "title": "Move Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"mailbox\": \"59fc66a13e54454869460e57\",\n \"id\": [\n [1,24],\n [2,25]\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Mark messages as unseen:", "content": "curl -i -XPUT \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a03e54454869460e46/messages/1,2,3\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"seen\": false\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "post", "url": "/users/:user/submit", "title": "Submit a Message for Delivery", "name": "PostSubmit", "group": "Submission", "description": "

Use this method to send emails from an user account

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "user", "description": "

Users unique ID

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "reference", "description": "

Optional referenced email. If submitted message is a reply and relevant fields are not provided then these are resolved from the message to be replied to

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "reference.mailbox", "description": "

Mailbox ID

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "reference.id", "description": "

Message ID in Mailbox

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "reference.action", "description": "

Either reply, replyAll or forward

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sendTime", "description": "

Datestring for delivery if message should be sent some later time

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "envelope", "description": "

SMTP envelope. If not provided then resolved either from message headers or from referenced message

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "envelope.from", "description": "

Sender information. If not set then it is resolved to User's default address

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "envelope.from.address", "description": "

Sender address. If this is not listed as allowed address for the sending User then it is replaced with the User's default address

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "envelope.to", "description": "

Recipients information

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "envelope.to.address", "description": "

Recipient address

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "from", "description": "

Address for the From: header

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "from.name", "description": "

Name of the sender

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "from.address", "description": "

Address of the sender

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "to", "description": "

Addresses for the To: header

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "to.name", "description": "

Name of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "to.address", "description": "

Address of the recipient

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "cc", "description": "

Addresses for the Cc: header

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "cc.name", "description": "

Name of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "cc.address", "description": "

Address of the recipient

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "bcc", "description": "

Addresses for the Bcc: header

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "bcc.name", "description": "

Name of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "bcc.address", "description": "

Address of the recipient

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "subject", "description": "

Message subject. If not then resolved from Reference message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "text", "description": "

Plaintext message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "html", "description": "

HTML formatted message

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "headers", "description": "

Custom headers for the message. If reference message is set then In-Reply-To and References headers are set automatically

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "headers.key", "description": "

Header key ('X-Mailer')

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "headers.value", "description": "

Header value ('My Awesome Mailing Service')

" }, { "group": "Parameter", "type": "Object[]", "optional": true, "field": "attachments", "description": "

Attachments for the message

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "attachments.content", "description": "

Base64 encoded attachment content

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "attachments.filename", "description": "

Attachment filename

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "attachments.contentType", "description": "

MIME type for the attachment file

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "attachments.cid", "description": "

Content-ID value if you want to reference to this attachment from HTML formatted message

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "message", "description": "

Information about submitted Message

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "message.mailbox", "description": "

Mailbox ID the message was stored to

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "message.id", "description": "

Message ID in Mailbox

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "message.queueId", "description": "

Queue ID in MTA

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"message\": {\n \"id\": 16,\n \"mailbox\": \"59fc66a03e54454869460e47\",\n \"queueId\": \"1600798505b000a25f\"\n }\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "error", "description": "

Description of the error

" }, { "group": "Error 4xx", "type": "String", "optional": false, "field": "code", "description": "

Reason for the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"User account is disabled\",\n \"code\": \"ERRDISABLEDUSER\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "# Sender info is derived from account settings\ncurl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"to\": [{\n \"address\": \"andris@ethereal.email\"\n }],\n \"subject\": \"Hello world!\",\n \"text\": \"Test message\"\n}'", "type": "curl" }, { "title": "Reply to All", "content": "# Recipients and subject line are derived from referenced message\ncurl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"reference\": {\n \"mailbox\": \"59fc66a03e54454869460e47\",\n \"id\": 15,\n \"action\": \"replyAll\"\n },\n \"text\": \"Yeah, sure\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/submit.js", "groupTitle": "Submission" }, { "type": "delete", "url": "/users/:id", "title": "Delete an User", "name": "DeleteUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/5a1bda70bfbd1442cd96c6f0?ip=127.0.0.1", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "get", "url": "/users/:id/updates", "title": "Open change stream", "name": "GetUpdates", "group": "Users", "description": "

This api call returns an EventSource response. Listen on this stream to get notifications about changes in messages and mailboxes. Returned events are JSON encoded strings

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "command", "description": "

Indicates data event type

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\nContent-Type: text/event-stream\n\ndata: {\ndata: \"command\": \"CREATE\",\ndata: \"mailbox\": \"5a1d3061153888cdcd62a719\",\ndata: \"path\": \"First Level/Second 😎 Level/Folder Name\"\ndata: }", "type": "text" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "var stream = new EventSource('/users/59fc66a03e54454869460e45/updates');\nstream.onmessage = function(e) {\n console.log(JSON.parse(e.data));\n};", "type": "javascript" } ], "version": "0.0.0", "filename": "lib/api/updates.js", "groupTitle": "Users" }, { "type": "get", "url": "/users/:id", "title": "Request User information", "name": "GetUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID (24 byte hex)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "username", "description": "

Username of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "name", "description": "

Name of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "address", "description": "

Main email address of the User

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "retention", "description": "

Default retention time in ms. false if not enabled

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "enabled2fa", "description": "

List of enabled 2FA methods

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "pubKey", "description": "

Public PGP key for the User that is used for encryption

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "keyInfo", "description": "

Information about public key or false if key is not available

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "keyInfo.name", "description": "

Name listed in public key

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "keyInfo.address", "description": "

E-mail address listed in public key

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "keyInfo.fingerprint", "description": "

Fingerprint of the public key

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "targetUrl", "description": "

An URL to post all incoming emails

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits", "description": "

Account limits and usage

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits.quota", "description": "

Quota usage limits

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.quota.allowed", "description": "

Allowed quota of the user in bytes

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.quota.used", "description": "

Space used in bytes

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits.recipients", "description": "

Sending quota

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.recipients.allowed", "description": "

How many messages per 24 hour can be sent

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.recipients.used", "description": "

How many messages are sent during current 24 hour period

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.recipients.ttl", "description": "

Time until the end of current 24 hour period

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "limits.forwards", "description": "

Forwarding quota

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.forwards.allowed", "description": "

How many messages per 24 hour can be forwarded

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.forwards.used", "description": "

How many messages are forwarded during current 24 hour period

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "limits.forwards.ttl", "description": "

Time until the end of current 24 hour period

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "tags", "description": "

List of tags associated with the User

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "hasPasswordSet", "description": "

If true then the User has a password set and can authenticate

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "activated", "description": "

Is the account activated

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "disabled", "description": "

If true then the user can not authenticate or receive any new mail

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\",\n \"username\": \"testuser01\",\n \"name\": null,\n \"address\": \"testuser01@example.com\",\n \"retention\": false,\n \"enabled2fa\": [],\n \"encryptMessages\": false,\n \"encryptForwarded\": false,\n \"pubKey\": \"\",\n \"keyInfo\": false,\n \"forward\": [],\n \"targetUrl\": \"\",\n \"limits\": {\n \"quota\": {\n \"allowed\": 107374182400,\n \"used\": 289838\n },\n \"recipients\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n },\n \"forwards\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n }\n },\n \"tags\": [\"green\", \"blue\"],\n \"hasPasswordSet\": true,\n \"activated\": true,\n \"disabled\": false\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "get", "url": "/users", "title": "List registered Users", "name": "GetUsers", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "query", "description": "

Partial match of username or default email address

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "tags", "description": "

Comma separated list of tags. The User must have at least one to be set

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "requiredTags", "description": "

Comma separated list of tags. The User must have all listed tags to be set

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "limit", "defaultValue": "20", "description": "

How many records to return

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "page", "defaultValue": "1", "description": "

Current page number. Informational only, page numbers start from 1

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "next", "description": "

Cursor value for next page, retrieved from nextCursor response value

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "previous", "description": "

Cursor value for previous page, retrieved from previousCursor response value

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "total", "description": "

How many results were found

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "page", "description": "

Current page number. Derived from page query argument

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "previousCursor", "description": "

Either a cursor string or false if there are not any previous results

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "nextCursor", "description": "

Either a cursor string or false if there are not any next results

" }, { "group": "Success 200", "type": "Object[]", "optional": false, "field": "results", "description": "

User listing

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.id", "description": "

Users unique ID (24 byte hex)

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.username", "description": "

Username of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.name", "description": "

Name of the User

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "results.address", "description": "

Main email address of the User

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "results.tags", "description": "

List of tags associated with the User'

" }, { "group": "Success 200", "type": "String[]", "optional": false, "field": "results.forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "results.quota", "description": "

Quota usage limits

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.quota.allowed", "description": "

Allowed quota of the user in bytes

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "results.quota.used", "description": "

Space used in bytes

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.hasPasswordSet", "description": "

If true then the User has a password set and can authenticate

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.activated", "description": "

Is the account activated

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "results.disabled", "description": "

If true then the user can not authenticate or receive any new mail

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"total\": 1,\n \"page\": 1,\n \"previousCursor\": false,\n \"nextCursor\": false,\n \"results\": [\n {\n \"id\": \"59cb948ad80a820b68f05230\",\n \"username\": \"myuser\",\n \"name\": \"John Doe\",\n \"address\": \"john@example.com\",\n \"tags\": [],\n \"forward\": [],\n \"encryptMessages\": false,\n \"encryptForwarded\": false,\n \"quota\": {\n \"allowed\": 1073741824,\n \"used\": 17799833\n },\n \"hasPasswordSet\": true,\n \"activated\": true,\n \"disabled\": false\n }\n ]\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "post", "url": "/users", "title": "Create new user", "name": "PostUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "

Username of the User

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

New password for the account

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "address", "description": "

Default email address for the User (autogenerated if not set)

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "emptyAddress", "description": "

If true then do not autogenerate missing email address for the User. Only needed if you want to create an user account that does not have any email address associated

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "description": "

Default retention time in ms. Set to 0 to disable

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "pubKey", "description": "

Public PGP key for the User that is used for encryption. Use empty string to remove the key

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "language", "description": "

Language code for the User

" }, { "group": "Parameter", "type": "String[]", "optional": true, "field": "forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "targetUrl", "description": "

An URL to post all incoming emails

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "quota", "description": "

Allowed quota of the user in bytes

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "recipients", "description": "

How many messages per 24 hour can be sent

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "forwards", "description": "

How many messages per 24 hour can be forwarded

" }, { "group": "Parameter", "type": "Object", "optional": true, "field": "limits", "description": "

Service specific limits

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "id", "description": "

ID for the created User

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1bda70bfbd1442cd96c6f0\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This username already exists\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users \\\n-H 'Content-type: application/json' \\\n-d '{\n \"username\": \"myuser\",\n \"password\": \"verysecret\",\n \"name\": \"John Doe\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "post", "url": "/users/:id/quota/reset", "title": "Recalculate User quota", "name": "PostUserQuota", "group": "Users", "description": "

This method recalculates quota usage for an User. Normally not needed, only use it if quota numbers are way off. This method is not transactional, so if the user is currently receiving new messages then the resulting value is not exact.

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "reason", "description": "

Message to be shown to connected IMAP client

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "storageUsed", "description": "

Calculated quota usage for the user

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"storageUsed\": 1234567\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/quota/reset \\\n-H 'Content-type: application/json' \\\n-d '{}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "put", "url": "/users/:id", "title": "Update User information", "name": "PutUser", "group": "Users", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "

Name of the User

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "existingPassword", "description": "

If provided then validates against account password before applying any changes

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "password", "description": "

New password for the account

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "retention", "description": "

Default retention time in ms. Set to 0 to disable

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptMessages", "description": "

If true then received messages are encrypted

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "encryptForwarded", "description": "

If true then forwarded messages are encrypted

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "pubKey", "description": "

Public PGP key for the User that is used for encryption. Use empty string to remove the key

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "language", "description": "

Language code for the User

" }, { "group": "Parameter", "type": "String[]", "optional": true, "field": "forward", "description": "

A list of email addresses to forward all incoming emails

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "targetUrl", "description": "

An URL to post all incoming emails

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "quota", "description": "

Allowed quota of the user in bytes

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "recipients", "description": "

How many messages per 24 hour can be sent

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "forwards", "description": "

How many messages per 24 hour can be forwarded

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "disabled", "description": "

If true then disables user account (can not login, can not receive messages)

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45 \\\n-H 'Content-type: application/json' \\\n-d '{\n \"name\": \"Updated user name\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "put", "url": "/users/:id/logout", "title": "Log out User", "name": "PutUserLogout", "group": "Users", "description": "

This method logs out all user sessions in IMAP

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "reason", "description": "

Message to be shown to connected IMAP client

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/logout \\\n-H 'Content-type: application/json' \\\n-d '{\n \"reason\": \"Logout requested from API\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" }, { "type": "post", "url": "/users/:id/password/reset", "title": "Reset password for an User", "name": "ResetUserPassword", "group": "Users", "description": "

This method generates a new temporary password for an User. Additionally it removes all two-factor authentication settings

", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Access-Token", "description": "

Optional access token if authentication is enabled

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Access-Token\": \"59fc66a03e54454869460e45\"\n}", "type": "json" } ] }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "id", "description": "

Users unique ID.

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "sess", "description": "

Session identifier for the logs

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "ip", "description": "

IP address for the logs

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Boolean", "optional": false, "field": "success", "description": "

Indicates successful response

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "password", "description": "

Temporary password

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"password\": \"temporarypass\"\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "optional": false, "field": "error", "description": "

Description of the error

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"This user does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/5a1bda70bfbd1442cd96/password/reset \\\n-H 'Content-type: application/json' \\\n-d '{\n \"ip\": \"127.0.0.1\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/users.js", "groupTitle": "Users" } ] diff --git a/docs/api_project.js b/docs/api_project.js index 1e69cd31..1aa8affb 100644 --- a/docs/api_project.js +++ b/docs/api_project.js @@ -1 +1 @@ -define({ "name": "wildduck", "version": "1.0.0", "description": "WildDuck API docs. Under construction, see old docs here: https://github.com/nodemailer/wildduck/blob/master/docs/api.md", "title": "WildDuck API", "url": "http://localhost:8080", "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2017-12-01T13:21:34.058Z", "url": "http://apidocjs.com", "version": "0.17.6" } }); +define({ "name": "wildduck", "version": "1.0.0", "description": "WildDuck API docs. Under construction, see old docs here: https://github.com/nodemailer/wildduck/blob/master/docs/api.md", "title": "WildDuck API", "url": "http://localhost:8080", "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2017-12-04T08:40:27.968Z", "url": "http://apidocjs.com", "version": "0.17.6" } }); diff --git a/docs/api_project.json b/docs/api_project.json index ef20bd35..60a98f07 100644 --- a/docs/api_project.json +++ b/docs/api_project.json @@ -1 +1 @@ -{ "name": "wildduck", "version": "1.0.0", "description": "WildDuck API docs. Under construction, see old docs here: https://github.com/nodemailer/wildduck/blob/master/docs/api.md", "title": "WildDuck API", "url": "http://localhost:8080", "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2017-12-01T13:21:34.058Z", "url": "http://apidocjs.com", "version": "0.17.6" } } +{ "name": "wildduck", "version": "1.0.0", "description": "WildDuck API docs. Under construction, see old docs here: https://github.com/nodemailer/wildduck/blob/master/docs/api.md", "title": "WildDuck API", "url": "http://localhost:8080", "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2017-12-04T08:40:27.968Z", "url": "http://apidocjs.com", "version": "0.17.6" } } diff --git a/imap-core/lib/indexer/body-structure.js b/imap-core/lib/indexer/body-structure.js index d8657a25..a5634b76 100644 --- a/imap-core/lib/indexer/body-structure.js +++ b/imap-core/lib/indexer/body-structure.js @@ -60,6 +60,17 @@ class BodyStructure { let bodySubtype = (node.parsedHeader['content-type'] && node.parsedHeader['content-type'].subtype) || null; let contentTransfer = node.parsedHeader['content-transfer-encoding'] || '7bit'; + if (!bodyType || !bodySubtype) { + // prevent strange content types like (NIL "/ms-word") that may break some clients + if (bodyType === 'text' || bodySubtype === 'plain') { + bodyType = 'text'; + bodySubtype = 'plain'; + } else { + bodyType = 'application'; + bodySubtype = 'octet-stream'; + } + } + return [ // body type options.upperCaseKeys ? (bodyType && bodyType.toUpperCase()) || null : bodyType, diff --git a/lib/api/users.js b/lib/api/users.js index 05a2097f..c1759068 100644 --- a/lib/api/users.js +++ b/lib/api/users.js @@ -301,7 +301,7 @@ module.exports = (db, server, userHandler) => { * @apiParam {Number} [quota] Allowed quota of the user in bytes * @apiParam {Number} [recipients] How many messages per 24 hour can be sent * @apiParam {Number} [forwards] How many messages per 24 hour can be forwarded - * @apiParam {Boolean} [disabled] If true then disables user account (can not login, can not receive messages) + * @apiParam {Object} [limits] Service specific limits * @apiParam {String} [sess] Session identifier for the logs * @apiParam {String} [ip] IP address for the logs * diff --git a/lib/handlers/on-append.js b/lib/handlers/on-append.js index 1e69c533..51169f0b 100644 --- a/lib/handlers/on-append.js +++ b/lib/handlers/on-append.js @@ -15,64 +15,74 @@ module.exports = (server, messageHandler) => (path, flags, date, raw, session, c path ); - db.users.collection('users').findOne({ - _id: session.user.id - }, (err, userData) => { - if (err) { - return callback(err); - } - if (!userData) { - return callback(new Error('User not found')); - } - - if (userData.quota && userData.storageUsed > userData.quota) { - return callback(false, 'OVERQUOTA'); - } - - messageHandler.counters.ttlcounter('iup:' + session.user.id, 0, config.imap.maxUploadMB * 1024 * 1024, false, (err, res) => { + db.users.collection('users').findOne( + { + _id: session.user.id + }, + (err, userData) => { if (err) { return callback(err); } - if (!res.success) { - let err = new Error('Upload was rate limited. Try again in ' + res.ttl + ' seconds'); - err.response = 'NO'; - return callback(err); + if (!userData) { + return callback(new Error('User not found')); } - messageHandler.counters.ttlcounter('iup:' + session.user.id, raw.length, config.imap.maxUploadMB * 1024 * 1024, false, () => { - messageHandler.encryptMessage(userData.encryptMessages ? userData.pubKey : false, raw, (err, encrypted) => { - if (!err && encrypted) { - raw = encrypted; + if (userData.quota && userData.storageUsed > userData.quota) { + return callback(false, 'OVERQUOTA'); + } + + db.redis.hget('limits:' + session.user.id, 'imap:upload', (err, value) => { + let limit = (config.imap.maxUploadMB || 10) * 1024 * 1024; + if (!err && value && !isNaN(value)) { + limit = Number(value) || limit; + } + + messageHandler.counters.ttlcounter('iup:' + session.user.id, 0, limit, false, (err, res) => { + if (err) { + return callback(err); } - messageHandler.add( - { - user: session.user.id, - path, - meta: { - source: 'IMAP', - from: '', - to: [session.user.address || session.user.username], - origin: session.remoteAddress, - transtype: 'APPEND', - time: new Date() - }, - session, - date, - flags, - raw - }, - (err, status, data) => { - if (err) { - if (err.imapResponse) { - return callback(null, err.imapResponse); - } - return callback(err); + if (!res.success) { + let err = new Error('Upload was rate limited. Try again in ' + res.ttl + ' seconds'); + err.response = 'NO'; + return callback(err); + } + + messageHandler.counters.ttlcounter('iup:' + session.user.id, raw.length, limit, false, () => { + messageHandler.encryptMessage(userData.encryptMessages ? userData.pubKey : false, raw, (err, encrypted) => { + if (!err && encrypted) { + raw = encrypted; } - callback(null, status, data); - } - ); + messageHandler.add( + { + user: session.user.id, + path, + meta: { + source: 'IMAP', + from: '', + to: [session.user.address || session.user.username], + origin: session.remoteAddress, + transtype: 'APPEND', + time: new Date() + }, + session, + date, + flags, + raw + }, + (err, status, data) => { + if (err) { + if (err.imapResponse) { + return callback(null, err.imapResponse); + } + return callback(err); + } + callback(null, status, data); + } + ); + }); + }); }); }); - }); - }); + } + ); }; diff --git a/lib/handlers/on-auth.js b/lib/handlers/on-auth.js index dcd1f6e7..5a9415a0 100644 --- a/lib/handlers/on-auth.js +++ b/lib/handlers/on-auth.js @@ -29,15 +29,21 @@ module.exports = (server, userHandler) => (login, session, callback) => { let checkConnectionLimits = next => { if (typeof server.notifier.allocateConnection === 'function') { - return server.notifier.allocateConnection( - { - service: 'imap', - session, - user: result.user, - limit: config.imap.maxConnections || 15 - }, - next - ); + return userHandler.redis.hget('limits:' + result.user, 'imap:connections', (err, value) => { + let limit = config.imap.maxConnections || 15; + if (!err && value && !isNaN(value)) { + limit = Number(value) || limit; + } + server.notifier.allocateConnection( + { + service: 'imap', + session, + user: result.user, + limit + }, + next + ); + }); } return next(null, true); diff --git a/lib/handlers/on-fetch.js b/lib/handlers/on-fetch.js index 9ebeed7d..fa004ebc 100644 --- a/lib/handlers/on-fetch.js +++ b/lib/handlers/on-fetch.js @@ -19,230 +19,249 @@ module.exports = (server, messageHandler) => (path, options, session, callback) session.id, path ); - db.database.collection('mailboxes').findOne({ - user: session.user.id, - path - }, (err, mailboxData) => { - if (err) { - return callback(err); - } - if (!mailboxData) { - return callback(null, 'NONEXISTENT'); - } - messageHandler.counters.ttlcounter('idw:' + session.user.id, 0, config.imap.maxDownloadMB * 1024 * 1024, false, (err, res) => { + db.database.collection('mailboxes').findOne( + { + user: session.user.id, + path + }, + (err, mailboxData) => { if (err) { return callback(err); } - if (!res.success) { - let err = new Error('Download was rate limited. Check again in ' + res.ttl + ' seconds'); - err.response = 'NO'; - return callback(err); + if (!mailboxData) { + return callback(null, 'NONEXISTENT'); } - let projection = { - uid: true, - modseq: true, - idate: true, - flags: true, - envelope: true, - bodystructure: true, - size: true - }; - - if (!options.metadataOnly) { - projection.mimeTree = true; - } - - let query = { - mailbox: mailboxData._id - }; - - if (options.changedSince) { - query = { - mailbox: mailboxData._id, - modseq: { - $gt: options.changedSince - } - }; - } - - let queryAll = false; - if (options.messages.length !== session.selected.uidList.length) { - // do not use uid selector for 1:* - query.uid = tools.checkRangeQuery(options.messages); - } else { - // 1:* - queryAll = true; - // uid is part of the sharding key so we need it somehow represented in the query - query.uid = { - $gt: 0, - $lt: mailboxData.uidNext - }; - } - - let isUpdated = false; - let updateEntries = []; - let notifyEntries = []; - - let done = (...args) => { - if (updateEntries.length) { - return db.database.collection('messages').bulkWrite(updateEntries, { - ordered: false, - w: 1 - }, () => { - updateEntries = []; - server.notifier.addEntries(session.user.id, path, notifyEntries, () => { - notifyEntries = []; - server.notifier.fire(session.user.id, path); - return callback(...args); - }); - }); + db.redis.hget('limits:' + session.user.id, 'imap:download', (err, value) => { + let limit = (config.imap.maxDownloadMB || 10) * 1024 * 1024; + if (!err && value && !isNaN(value)) { + limit = Number(value) || limit; } - if (isUpdated) { - server.notifier.fire(session.user.id, path); - } - return callback(...args); - }; - let cursor = db.database - .collection('messages') - .find(query) - .project(projection) - .sort([['uid', 1]]); - - let rowCount = 0; - let processNext = () => { - cursor.next((err, message) => { + messageHandler.counters.ttlcounter('idw:' + session.user.id, 0, limit, false, (err, res) => { if (err) { - return done(err); + return callback(err); } - if (!message) { - return cursor.close(() => { - done(null, true); - }); + if (!res.success) { + let err = new Error('Download was rate limited. Check again in ' + res.ttl + ' seconds'); + err.response = 'NO'; + return callback(err); } - if (queryAll && !session.selected.uidList.includes(message.uid)) { - // skip processing messages that we do not know about yet - return processNext(); + let projection = { + uid: true, + modseq: true, + idate: true, + flags: true, + envelope: true, + bodystructure: true, + size: true + }; + + if (!options.metadataOnly) { + projection.mimeTree = true; } - let markAsSeen = options.markAsSeen && !message.flags.includes('\\Seen'); - if (markAsSeen) { - message.flags.unshift('\\Seen'); - } + let query = { + mailbox: mailboxData._id + }; - let stream = imapHandler.compileStream( - session.formatResponse('FETCH', message.uid, { - query: options.query, - values: session.getQueryResponse(options.query, message, { - logger: server.logger, - fetchOptions: {}, - database: db.database, - attachmentStorage: messageHandler.attachmentStorage, - acceptUTF8Enabled: session.isUTF8Enabled() - }) - }) - ); - - stream.description = util.format('* FETCH #%s uid=%s size=%sB ', ++rowCount, message.uid, message.size); - - stream.once('error', err => { - err.processed = true; - server.logger.error( - { - err, - tnx: 'fetch', - cid: session.id - }, - '[%s] FETCHFAIL %s. %s', - session.id, - message._id, - err.message - ); - - session.socket.end('\n* BYE Internal Server Error\n'); - return cursor.close(() => done()); - }); - - let limiter = new LimitedFetch({ - key: 'idw:' + session.user.id, - ttlcounter: messageHandler.counters.ttlcounter, - maxBytes: config.imap.maxDownloadMB * 1024 * 1024 - }); - stream.pipe(limiter); - - // send formatted response to socket - session.writeStream.write(limiter, () => { - if (!markAsSeen) { - return processNext(); - } - - server.logger.debug( - { - tnx: 'flags', - cid: session.id - }, - '[%s] UPDATE FLAGS for "%s"', - session.id, - message.uid - ); - - isUpdated = true; - - updateEntries.push({ - updateOne: { - filter: { - _id: message._id, - // include sharding key in query - mailbox: mailboxData._id, - uid: message.uid - }, - update: { - $addToSet: { - flags: '\\Seen' - }, - $set: { - unseen: false - } - } + if (options.changedSince) { + query = { + mailbox: mailboxData._id, + modseq: { + $gt: options.changedSince } - }); + }; + } - notifyEntries.push({ - command: 'FETCH', - ignore: session.id, - uid: message.uid, - flags: message.flags, - message: message._id, - unseenChange: true - }); + let queryAll = false; + if (options.messages.length !== session.selected.uidList.length) { + // do not use uid selector for 1:* + query.uid = tools.checkRangeQuery(options.messages); + } else { + // 1:* + queryAll = true; + // uid is part of the sharding key so we need it somehow represented in the query + query.uid = { + $gt: 0, + $lt: mailboxData.uidNext + }; + } - if (updateEntries.length >= consts.BULK_BATCH_SIZE) { - return db.database.collection('messages').bulkWrite(updateEntries, { - ordered: false, - w: 1 - }, err => { - updateEntries = []; - if (err) { - return cursor.close(() => done(err)); + let isUpdated = false; + let updateEntries = []; + let notifyEntries = []; + + let done = (...args) => { + if (updateEntries.length) { + return db.database.collection('messages').bulkWrite( + updateEntries, + { + ordered: false, + w: 1 + }, + () => { + updateEntries = []; + server.notifier.addEntries(session.user.id, path, notifyEntries, () => { + notifyEntries = []; + server.notifier.fire(session.user.id, path); + return callback(...args); + }); + } + ); + } + if (isUpdated) { + server.notifier.fire(session.user.id, path); + } + return callback(...args); + }; + + let cursor = db.database + .collection('messages') + .find(query) + .project(projection) + .sort([['uid', 1]]); + + let rowCount = 0; + let processNext = () => { + cursor.next((err, message) => { + if (err) { + return done(err); + } + if (!message) { + return cursor.close(() => { + done(null, true); + }); + } + + if (queryAll && !session.selected.uidList.includes(message.uid)) { + // skip processing messages that we do not know about yet + return processNext(); + } + + let markAsSeen = options.markAsSeen && !message.flags.includes('\\Seen'); + if (markAsSeen) { + message.flags.unshift('\\Seen'); + } + + let stream = imapHandler.compileStream( + session.formatResponse('FETCH', message.uid, { + query: options.query, + values: session.getQueryResponse(options.query, message, { + logger: server.logger, + fetchOptions: {}, + database: db.database, + attachmentStorage: messageHandler.attachmentStorage, + acceptUTF8Enabled: session.isUTF8Enabled() + }) + }) + ); + + stream.description = util.format('* FETCH #%s uid=%s size=%sB ', ++rowCount, message.uid, message.size); + + stream.once('error', err => { + err.processed = true; + server.logger.error( + { + err, + tnx: 'fetch', + cid: session.id + }, + '[%s] FETCHFAIL %s. %s', + session.id, + message._id, + err.message + ); + + session.socket.end('\n* BYE Internal Server Error\n'); + return cursor.close(() => done()); + }); + + let limiter = new LimitedFetch({ + key: 'idw:' + session.user.id, + ttlcounter: messageHandler.counters.ttlcounter, + maxBytes: limit + }); + stream.pipe(limiter); + + // send formatted response to socket + session.writeStream.write(limiter, () => { + if (!markAsSeen) { + return processNext(); } - server.notifier.addEntries(session.user.id, path, notifyEntries, () => { - notifyEntries = []; - server.notifier.fire(session.user.id, path); - processNext(); - }); - }); - } else { - processNext(); - } - }); - }); - }; + server.logger.debug( + { + tnx: 'flags', + cid: session.id + }, + '[%s] UPDATE FLAGS for "%s"', + session.id, + message.uid + ); - processNext(); - }); - }); + isUpdated = true; + + updateEntries.push({ + updateOne: { + filter: { + _id: message._id, + // include sharding key in query + mailbox: mailboxData._id, + uid: message.uid + }, + update: { + $addToSet: { + flags: '\\Seen' + }, + $set: { + unseen: false + } + } + } + }); + + notifyEntries.push({ + command: 'FETCH', + ignore: session.id, + uid: message.uid, + flags: message.flags, + message: message._id, + unseenChange: true + }); + + if (updateEntries.length >= consts.BULK_BATCH_SIZE) { + return db.database.collection('messages').bulkWrite( + updateEntries, + { + ordered: false, + w: 1 + }, + err => { + updateEntries = []; + if (err) { + return cursor.close(() => done(err)); + } + + server.notifier.addEntries(session.user.id, path, notifyEntries, () => { + notifyEntries = []; + server.notifier.fire(session.user.id, path); + processNext(); + }); + } + ); + } else { + processNext(); + } + }); + }); + }; + + processNext(); + }); + }); + } + ); }; diff --git a/lib/user-handler.js b/lib/user-handler.js index 7121a0c4..678babba 100644 --- a/lib/user-handler.js +++ b/lib/user-handler.js @@ -2005,6 +2005,10 @@ class UserHandler { // This method deletes non expireing records from database delete(user, meta, callback) { meta = meta || {}; + + // clear limits in Redis + this.redis.del('limits:' + user, () => false); + this.database.collection('messages').updateMany( { user }, { diff --git a/package.json b/package.json index 7d0c3c5b..d1b7ac0d 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,10 @@ "test": "mongo --eval 'db.dropDatabase()' wildduck-test && redis-cli -n 13 flushdb && NODE_ENV=test grunt", "apidoc": "apidoc -i lib/api/ -o docs/" }, - "keywords": ["imap", "mail server"], + "keywords": [ + "imap", + "mail server" + ], "author": "Andris Reinman", "license": "EUPL-1.1", "devDependencies": { @@ -53,11 +56,11 @@ "mongodb-extended-json": "^1.10.0", "nodemailer": "4.4.0", "npmlog": "4.1.2", - "openpgp": "2.5.14", + "openpgp": "2.6.0", "qrcode": "1.0.0", "restify": "6.3.4", "seq-index": "1.1.0", - "smtp-server": "3.4.0", + "smtp-server": "3.4.1", "speakeasy": "2.0.0", "tlds": "1.199.0", "u2f": "0.1.3", diff --git a/pop3.js b/pop3.js index 87e5bb9d..56a94d39 100644 --- a/pop3.js +++ b/pop3.js @@ -146,50 +146,56 @@ const serverOptions = { }, onFetchMessage(message, session, callback) { - messageHandler.counters.ttlcounter('pdw:' + session.user.id, 0, config.pop3.maxDownloadMB * 1024 * 1024, false, (err, res) => { - if (err) { - return callback(err); + db.redis.hget('limits:' + session.user.id, 'pop3:download', (err, value) => { + let limit = (config.pop3.maxDownloadMB || 10) * 1024 * 1024; + if (!err && value && !isNaN(value)) { + limit = Number(value) || limit; } - if (!res.success) { - let err = new Error('Download was rate limited. Check again in ' + res.ttl + ' seconds'); - return callback(err); - } - db.database.collection('messages').findOne( - { - _id: new ObjectID(message.id), - // shard key - mailbox: message.mailbox, - uid: message.uid - }, - { - mimeTree: true, - size: true - }, - (err, message) => { - if (err) { - return callback(err); - } - if (!message) { - return callback(new Error('Message does not exist or is already deleted')); - } - - let response = messageHandler.indexer.rebuild(message.mimeTree); - if (!response || response.type !== 'stream' || !response.value) { - return callback(new Error('Can not fetch message')); - } - - let limiter = new LimitedFetch({ - key: 'pdw:' + session.user.id, - ttlcounter: messageHandler.counters.ttlcounter, - maxBytes: config.pop3.maxDownloadMB * 1024 * 1024 - }); - - response.value.pipe(limiter); - response.value.once('error', err => limiter.emit('error', err)); - - callback(null, limiter); + messageHandler.counters.ttlcounter('pdw:' + session.user.id, 0, limit, false, (err, res) => { + if (err) { + return callback(err); } - ); + if (!res.success) { + let err = new Error('Download was rate limited. Check again in ' + res.ttl + ' seconds'); + return callback(err); + } + db.database.collection('messages').findOne( + { + _id: new ObjectID(message.id), + // shard key + mailbox: message.mailbox, + uid: message.uid + }, + { + mimeTree: true, + size: true + }, + (err, message) => { + if (err) { + return callback(err); + } + if (!message) { + return callback(new Error('Message does not exist or is already deleted')); + } + + let response = messageHandler.indexer.rebuild(message.mimeTree); + if (!response || response.type !== 'stream' || !response.value) { + return callback(new Error('Can not fetch message')); + } + + let limiter = new LimitedFetch({ + key: 'pdw:' + session.user.id, + ttlcounter: messageHandler.counters.ttlcounter, + maxBytes: limit + }); + + response.value.pipe(limiter); + response.value.once('error', err => limiter.emit('error', err)); + + callback(null, limiter); + } + ); + }); }); },