From 08927831b7d0c9f8ac7bf975444219d5c255ffff Mon Sep 17 00:00:00 2001 From: Louis Laureys Date: Mon, 8 Jul 2019 18:14:55 +0200 Subject: [PATCH] an user > a user --- README.md | 2 +- bin/access-tokens | 2 +- docs/api.md | 30 +- docs/api_data.js | 13045 +++++++++++++++++++++++++++++++++++++++- docs/api_data.json | 13045 +++++++++++++++++++++++++++++++++++++++- lib/api/2fa/custom.js | 4 +- lib/api/2fa/totp.js | 8 +- lib/api/2fa/u2f.js | 2 +- lib/api/addresses.js | 8 +- lib/api/auth.js | 2 +- lib/api/filters.js | 2 +- lib/api/mailboxes.js | 2 +- lib/api/messages.js | 2 +- lib/api/submit.js | 2 +- lib/api/users.js | 10 +- lib/user-handler.js | 2 +- 16 files changed, 26127 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index e2f2d726..026003f2 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ node server.js --config=/etc/wildduck.toml > For additional config options, see the _wild-config_ [documentation](https://github.com/nodemailer/wild-config). -### Step 4\. Create an user account +### Step 4\. Create a user account See [API Docs](https://api.wildduck.email/#api-Users-PostUser) for details about creating new user accounts diff --git a/bin/access-tokens b/bin/access-tokens index 0ff82f52..15a24922 100755 --- a/bin/access-tokens +++ b/bin/access-tokens @@ -115,7 +115,7 @@ let argv = yargs ) .command( 'clear ', - 'Delete all tokens for an user', + 'Delete all tokens for a user', yargs => yargs.option('user', { alias: 'u', diff --git a/docs/api.md b/docs/api.md index 81efc64e..4bf1fa54 100644 --- a/docs/api.md +++ b/docs/api.md @@ -28,7 +28,7 @@ This API is not meant to be used by end users but your application. * [Reset user password](#reset-user-password) * [POST /users/{user}/password/reset](#post-usersuserpasswordreset) * [Authentication](#authentication-1) - * [Authenticate an user](#authenticate-an-user) + * [Authenticate a user](#authenticate-a-user) * [POST /authenticate](#post-authenticate) * [List the authentication log](#list-the-authentication-log) * [GET /users/{user}/authlog](#get-usersuserauthlog) @@ -199,8 +199,8 @@ Returns data about existing users * **query** is an optional string to filter username (partial match), by default all users are listed * **limit** is an optional number to limit listing length, defaults to 20 -* **tags** is an optional string of comma separated tags. At least a single tag must be set for an user to be listed -* **requiredTags** is an optional string of comma separated tags. All tags must be set for an user to be listed +* **tags** is an optional string of comma separated tags. At least a single tag must be set for a user to be listed +* **requiredTags** is an optional string of comma separated tags. All tags must be set for a user to be listed **Example** @@ -341,13 +341,13 @@ Response for a successful operation: } ``` -After you have created an user you can use these credentials to log in to the IMAP server. +After you have created a user you can use these credentials to log in to the IMAP server. ### Update user details #### PUT /users/{user} -Updates the properties of an user. Only specify these fields that you want to be updated. +Updates the properties of a user. Only specify these fields that you want to be updated. **Parameters** @@ -419,7 +419,7 @@ Response for a successful operation: #### PUT /users/{user}/logout -Forces closing all active IMAP session of an user +Forces closing all active IMAP session of a user **Parameters** @@ -472,11 +472,11 @@ Response for a successful operation: ## Authentication -### Authenticate an user +### Authenticate a user #### POST /authenticate -Authenticates an user +Authenticates a user **Parameters** @@ -574,7 +574,7 @@ correct scope for email clients using these protocols. 2FA checks do not happen magically, your application must be 2FA aware: -1. Authenticate user with the [/authenticate](#authenticate-an-user) call +1. Authenticate user with the [/authenticate](#authenticate-a-user) call 2. If authentication result includes `requirePasswordChange:true` then force user to change their password 3. If authentication result includes `require2fa:false` then do nothing, the user is now authenticated. Otherwise continue with Step 4. or Step 5. 4. If `require2fa` array includes 'totp' then: @@ -663,7 +663,7 @@ Response for a successful operation: #### POST /users/{user}/2fa/totp/check -Validates a TOTP token against user 2FA settings. This check should be performed when an user authentication response includes `request2fa:['totp']` +Validates a TOTP token against user 2FA settings. This check should be performed when a user authentication response includes `request2fa:['totp']` **Parameters** @@ -762,7 +762,7 @@ used to access IMAP, one for SMTP etc. #### GET /user/{user}/asps -Lists all application specific passwords for an user. +Lists all application specific passwords for a user. **Parameters** @@ -938,7 +938,7 @@ Response for a successful operation: #### GET /users/{user}/addresses -Lists all registered email addresses for an user. +Lists all registered email addresses for a user. **Parameters** @@ -1093,7 +1093,7 @@ Manage user mailboxes #### GET /user/{user}/mailboxes -Lists existing mailboxes for an user +Lists existing mailboxes for a user **Parameters** @@ -2019,7 +2019,7 @@ list and restore archived messages. Restoring an archived message resets the UID #### GET /user/{user}/archived -Lists archived messages for an user. This is similar to listing mailbox messages, major difference being that archived message IDs are not numeric but hex +Lists archived messages for a user. This is similar to listing mailbox messages, major difference being that archived message IDs are not numeric but hex strings **Parameters** @@ -2146,7 +2146,7 @@ Response for a successful operation includes the mailbox ID the message was rest #### POST /users/{user}/quota/reset -Recalculates used storage for an user. Use this when it seems that quota counters for an user do not match with reality. +Recalculates used storage for a user. Use this when it seems that quota counters for a user do not match with reality. **Parameters** diff --git a/docs/api_data.js b/docs/api_data.js index 951155ed..ef39aa1e 100644 --- a/docs/api_data.js +++ b/docs/api_data.js @@ -1 +1,13044 @@ -define({ "api": [ { "type": "delete", "url": "/addresses/forwarded/:address", "title": "Delete a forwarded Address", "name": "DeleteForwardedAddress", "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": "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\": \"This address does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/addresses/forwarded/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "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/resolve/:address", "title": "Get Address info", "name": "GetAddressInfo", "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": "address", "description": "

ID of the Address or e-mail address string

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

If true then resolves also wildcard addresses

" } ] } }, "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": "String", "optional": false, "field": "name", "description": "

Identity name

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

ID of the user if the address belongs to an User

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

List of forwarding targets if this is a Forwarded address

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

Account limits and usage for Forwarded address

" }, { "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": "Object", "optional": false, "field": "autoreply", "description": "

Autoreply information

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

If true, then autoreply is enabled for this address

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

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

List of tags associated with the Address

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

Datestring of the time the address was created

" } ] }, "examples": [ { "title": "User-Address:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"user\": \"59ef21aef255ed1d9d771bb\"\n \"created\": \"2017-10-24T11:19:10.911Z\"\n}", "type": "json" }, { "title": "Forwarded-Address:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"targets\": [\n \"my.other.address@example.com\"\n ],\n \"limits\": {\n \"forwards\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n }\n },\n \"autoreply\": {\n \"status\": false\n },\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 address does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/addresses/resolve/k%C3%A4ru%40j%C3%B5geva.ee", "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": "String", "optional": true, "field": "tags", "description": "

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

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

Comma separated list of tags. The Address 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": "

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.name", "description": "

Identity name

" }, { "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 if this is an User address

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

If true then it is a forwarded address

" } ] }, "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 \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"forwarded\": true\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": "/addresses/forwarded/:address", "title": "Request forwarded Addresses information", "name": "GetForwardedAddress", "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": "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": "String", "optional": false, "field": "name", "description": "

Identity name

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

List of forwarding targets

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

Account limits and usage

" }, { "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": "Object", "optional": false, "field": "autoreply", "description": "

Autoreply information

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

If true, then autoreply is enabled for this address

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

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

Datestring of the time the address was created

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

List of tags associated with the Address

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"targets\": [\n \"my.other.address@example.com\"\n ],\n \"limits\": {\n \"forwards\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n }\n },\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 address does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/addresses/forwarded/59ef21aef255ed1d9d790e81", "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": "name", "description": "

Identity name

" }, { "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.name", "description": "

Identity name

" }, { "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

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

List of tags associated with the Address

" } ] }, "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": "/addresses/forwarded", "title": "Create new forwarded Address", "name": "PostForwardedAddress", "group": "Addresses", "description": "

Add a new forwarded email address. 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": "address", "description": "

E-mail Address

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

Identity name

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

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

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

Daily allowed forwarding count for this address

" }, { "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

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

A list of tags associated with this address

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

Autoreply information

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

If true, then autoreply is enabled for this address

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

Either a date string or boolean false to disable start time checks

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

Either a date string or boolean false to disable end time checks

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

" } ] } }, "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 email address already exists\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/addresses/forwarded \\\n-H 'Content-type: application/json' \\\n-d '{\n \"address\": \"my.new.address@example.com\",\n \"targets\": [\n \"my.old.address@example.com\",\n \"smtp://mx2.zone.eu:25\"\n ],\n \"forwards\": 500\n}'", "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, *suffix@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": "String", "optional": true, "field": "name", "description": "

Identity name

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

A list of tags associated with this 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, *suffix@example.com and username@*, otherwise using * is not allowed. Static suffix can be up to 32 characters long.

" } ] } }, "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": "/addresses/forwarded/:address", "title": "Update forwarded Address information", "name": "PutForwardedAddress", "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": "id", "description": "

ID of the Address

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

New address. Only affects normal addresses, special addresses that include * can not be changed

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

Identity name

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

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to. If set then overwrites previous targets array

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

Daily allowed forwarding count for this address

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

A list of tags associated with this address

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

Autoreply information

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

If true, then autoreply is enabled for this address

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

Either a date string or boolean false to disable start time checks

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

Either a date string or boolean false to disable end time checks

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

" } ] } }, "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 address does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/addresses/forwarded/5a1d4541153888cdcd62a71b \\\n-H 'Content-type: application/json' \\\n-d '{\n \"targets\": [\n \"some.other.address@example.com\"\n ]\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "put", "url": "/addresses/renameDomain", "title": "Rename domain in addresses", "name": "PutRenameDomain", "group": "Addresses", "description": "

Renames domain names for addresses, DKIM keys and Domain Aliases

", "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": "oldDomain", "description": "

Old Domain Name

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

New Domain Name

" } ] } }, "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\": \"Failed to rename domain\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/addresses/renameDomain \\\n-H 'Content-type: application/json' \\\n-d '{\n \"oldDomain\": \"example.com\",\n \"newDomain\": \"blurdybloop.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": "String", "optional": false, "field": "id", "description": "

ID of the Address

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

Identity name

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

New address if you want to rename existing address. Only affects normal addresses, special addresses that include * can not be changed

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

Indicates if this is the default address for the User

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

A list of tags associated with this 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\": \"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/:asp", "title": "Request ASP information", "name": "GetASP", "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 Specific Password

" } ] } }, "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": "description", "description": "

Description

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

Allowed scopes for the Application Password

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

Information about last use

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

Datestring of last use or false if password has not been used

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

Event ID of the security log for the last authentication

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

Datestring

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1d6dd776e56b6d97e5dd48\",\n \"description\": \"Thunderbird\",\n \"scopes\": [\n \"imap\",\n \"smtp\"\n ],\n \"lastUse\": {\n \"time\": \"2018-06-21T16:51:53.807Z\",\n \"event\": \"5b2bd7a9d0ba2509deb88f40\"\n },\n \"created\": \"2017-11-28T14:08:23.520Z\"\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/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

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

If not true then skips entries with a TTL set

" } ] } }, "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": "Object", "optional": false, "field": "results.lastUse", "description": "

Information about last use

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

Datestring of last use or false if password has not been used

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

Event ID of the security log for the last authentication

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

Datestring

" } ] }, "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 \"lastUse\": {\n \"time\": \"2018-06-21T16:51:53.807Z\",\n \"event\": \"5b2bd7a9d0ba2509deb88f40\"\n },\n \"created\": \"2017-11-28T14:08:23.520Z\"\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": "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": "address", "description": "

E-mail address to be used as the account address in mobileconfig file. Must be one of the listed identity addresses of the user. Defaults to the main address of the user

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

TTL in seconds for this password. Every time password is used, TTL is reset to this value

" }, { "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/messages", "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": "Object[]", "optional": false, "field": "results.to", "description": "

Recipients in To: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Cc: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Bcc: field. Usually only available for drafts

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

Name of the recipient

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

Address of the recipient

" }, { "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/messages\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "post", "url": "/users/:user/archived/messages/:message/restore", "title": "Restore archived Message", "name": "RestoreMessage", "group": "Archive", "description": "

Restores a single 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/messages/59fc66a13e54454869460e58/restore\" \\\n-H 'Content-type: application/json' \\\n-d '{}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "post", "url": "/users/:user/archived/restore", "title": "Restore archived messages", "name": "RestoreMessages", "group": "Archive", "description": "

Initiates a restore task to move archived messages of a date range back to the mailboxes the messages were deleted from. If target mailbox does not exist, then the messages are 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": "String", "optional": false, "field": "start", "description": "

Datestring

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

Datestring

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

Indicates successful response

" } ] }, "examples": [ { "title": "Restore 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": "Restore a Message:", "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/restore\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"start\": \"2018-10-01T00:00:00.000Z\",\n \"end\": \"2018-10-08T23:59:59.999Z\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "delete", "url": "/authenticate", "title": "Invalidate authentication token", "name": "DeleteAuth", "group": "Authentication", "description": "

This method invalidates currently used authentication token. If token is not provided then nothing happens

", "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" } ] }, "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

" }, { "group": "Error 4xx", "optional": true, "field": "code", "description": "

Error code

" } ] } }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE \"http://localhost:8080/authenticate\" \\\n-H 'X-Access-Token: 59fc66a03e54454869460e45'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/auth.js", "groupTitle": "Authentication" }, { "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": "filterIp", "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": "get", "url": "/users/:user/authlog/:event", "title": "Request Event information", "name": "GetAuthlogEvent", "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": false, "field": "event", "description": "

ID of the Event

" } ] } }, "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 Event

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

Action identifier

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

Did the action succeed

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

Session identifier

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

IP address of the Event

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

Datestring of the Event time

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\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}", "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/59fc66a03e54454869460e4d\"", "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": "Boolean", "optional": true, "field": "token", "defaultValue": "false", "description": "

If true then generates a temporary access token that is valid for this user. Only available if scope is "master". When using user tokens then you can replace user ID in URLs with "me".

" }, { "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

" }, { "group": "Success 200", "type": "String", "optional": true, "field": "token", "description": "

If access token was requested then this is the value to use as access token when making API requests on behalf of logged in user.

" } ] }, "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

" }, { "group": "Error 4xx", "optional": true, "field": "code", "description": "

Error code

" }, { "group": "Error 4xx", "optional": true, "field": "id", "description": "

User ID if the user exists

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Authentication failed. Invalid scope\",\n \"code\": \"InvalidAuthScope\",\n \"id\": \"5b22283d45e8d47572eb0381\"\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 \"token\": \"true\"\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": "name", "description": "

Name that is used for the From: header in autoreply message

" }, { "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": "name", "description": "

Name that is used for the From: header in autoreply message

" }, { "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 or boolean false to disable start checks

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

Datestring of the end of the autoreply or boolean false to disable end checks

" } ] } }, "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": "/dkim/:dkim", "title": "Delete a DKIM key", "name": "DeleteDkim", "group": "DKIM", "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": "dkim", "description": "

ID of the DKIM

" } ] } }, "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/dkim/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/dkim.js", "groupTitle": "DKIM" }, { "type": "get", "url": "/dkim", "title": "List registered DKIM keys", "name": "GetDkim", "group": "DKIM", "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 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 DKIM

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

The domain this DKIM key applies to

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

DKIM selector

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

Key description

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

Key fingerprint (SHA1)

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

Datestring

" } ] }, "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 \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"fingerprint\": \"6a:aa:d7:ba:e4:99:b4:12:e0:f3:35:01:71:d4:f1:d6:b4:95:c4:f5\",\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\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/dkim", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/dkim.js", "groupTitle": "DKIM" }, { "type": "get", "url": "/dkim/:dkim", "title": "Request DKIM information", "name": "GetDkimKey", "group": "DKIM", "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": "dkim", "description": "

ID of the DKIM

" } ] } }, "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 DKIM

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

The domain this DKIM key applies to

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

DKIM selector

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

Key description

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

Key fingerprint (SHA1)

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

Public key in DNS format (no prefix/suffix, single line)

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

Value for DNS TXT entry

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

Is the domain name of TXT

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

Is the value of TXT

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

Datestring

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e7a\",\n \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"fingerprint\": \"6a:aa:d7:ba:e4:99:b4:12:e0:f3:35:01:71:d4:f1:d6:b4:95:c4:f5\",\n \"publicKey\": \"-----BEGIN PUBLIC KEY-----\\r\\nMIGfMA0...\",\n \"dnsTxt\": {\n \"name\": \"dec20._domainkey.example.com\",\n \"value\": \"v=DKIM1;t=s;p=MIGfMA0...\"\n }\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/dkim/59ef21aef255ed1d9d790e7a", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/dkim.js", "groupTitle": "DKIM" }, { "type": "post", "url": "/dkim", "title": "Create or update DKIM key for domain", "name": "PostDkim", "group": "DKIM", "description": "

Add a new DKIM key for a Domain or update existing one. There can be single DKIM key registered for each domain name.

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

Domain name this DKIM key applies to. Use "*" as a special value that will be used for domains that do not have their own DKIM key set

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

Selector for the key

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

Key description

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

Pem formatted DKIM private key. If not set then a new 2048 bit RSA key is generated, beware though that it can take several seconds to complete.

" } ] } }, "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 DKIM

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

The domain this DKIM key applies to

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

DKIM selector

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

Key description

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

Key fingerprint (SHA1)

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

Public key in DNS format (no prefix/suffix, single line)

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

Value for DNS TXT entry

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

Is the domain name of TXT

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

Is the value of TXT

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"fingerprint\": \"6a:aa:d7:ba:e4:99:b4:12:e0:f3:35:01:71:d4:f1:d6:b4:95:c4:f5\",\n \"publicKey\": \"-----BEGIN PUBLIC KEY-----\\r\\nMIGfMA0...\",\n \"dnsTxt\": {\n \"name\": \"dec20._domainkey.example.com\",\n \"value\": \"v=DKIM1;t=s;p=MIGfMA0...\"\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 -XPOST http://localhost:8080/dkim \\\n-H 'Content-type: application/json' \\\n-d '{\n \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"privateKey\": \"-----BEGIN RSA PRIVATE KEY-----\\r\\n...\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/dkim.js", "groupTitle": "DKIM" }, { "type": "get", "url": "/dkim/resolve/:domain", "title": "Resolve ID for a DKIM domain", "name": "ResolveDKIM", "group": "DKIM", "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": "domain", "description": "

DKIM domain

" } ] } }, "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": "

DKIM unique ID (24 byte hex)

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\"\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 domain does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/dkim/resolve/example.com", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/dkim.js", "groupTitle": "DKIM" }, { "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": "/domainaliases", "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", "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": "get", "url": "/domainaliases/resolve/:alias", "title": "Resolve ID for a domain aias", "name": "ResolveDomainAlias", "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": "

Alias domain

" } ] } }, "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": "

Alias unique ID (24 byte hex)

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\"\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/resolve/example.com", "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": "Object", "optional": false, "field": "query", "description": "

Rules that a message must match

" }, { "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.listId", "description": "

Partial match for the List-ID: header (case insensitive)

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

Fulltext search against message text

" }, { "group": "Success 200", "type": "Boolean", "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": "Object", "optional": false, "field": "action", "description": "

Action to take with a matching message

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

If true then mark matching messages as Seen

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "action.flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "action.delete", "description": "

If true then do not store matching messages

" }, { "group": "Success 200", "type": "Boolean", "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.targets", "description": "

A list of email addresses / HTTP URLs to forward the message to

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

If true, then this filter is ignored

" } ] }, "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\": {\n \"from\": \"Mäger\"\n },\n \"action\": {\n \"seen\": true\n },\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 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

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

If true, then this filter is ignored

" } ] }, "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 \"disabled\": false,\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": "Object", "optional": false, "field": "query", "description": "

Rules that a message must match

" }, { "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.listId", "description": "

Partial match for the List-ID: header (case insensitive)

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

Fulltext search against message text

" }, { "group": "Parameter", "type": "Boolean", "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": "Object", "optional": false, "field": "action", "description": "

Action to take with a matching message

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "action.seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "action.flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "action.delete", "description": "

If true then do not store matching messages

" }, { "group": "Parameter", "type": "Boolean", "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.targets", "description": "

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

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

If true then this filter is ignored

" } ] } }, "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\": {\n \"from\": \"Mäger\"\n },\n \"action\": {\n \"seen\": true\n }\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": "Object", "optional": false, "field": "query", "description": "

Rules that a message must match

" }, { "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.listId", "description": "

Partial match for the List-ID: header (case insensitive)

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

Fulltext search against message text

" }, { "group": "Parameter", "type": "Boolean", "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": "Object", "optional": false, "field": "action", "description": "

Action to take with a matching message

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "action.seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "action.flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "action.delete", "description": "

If true then do not store matching messages

" }, { "group": "Parameter", "type": "Boolean", "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.targets", "description": "

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

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

If true then this filter is ignored

" } ] } }, "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\": {\n \"seen\": \"\",\n \"flag\": true\n }\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": "specialUse", "defaultValue": "false", "description": "

Should the response include only folders with specialUse flag set.

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

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

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

Should the response include mailbox size in bytes. Size numbers come with a lot of overhead as an aggregated query is ran.

" } ] } }, "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\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes?counters=true", "type": "curl" }, { "title": "Special Use Only", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes?specialUse=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 Mailbox. Changing 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": "delete", "url": "/users/:user/mailboxes/:mailbox/messages", "title": "Delete all Messages from a Mailbox", "name": "DeleteMessages", "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

" } ] } }, "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": "deleted", "description": "

Indicates count of deleted messages

" } ] }, "examples": [ { "title": "Delete Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"deleted\": 51\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 all Messages:", "content": "curl -i -XDELETE \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages\"", "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": "ForwardStoredMessage", "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": "Forward 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": "envelope", "description": "

SMTP envelope (if available)

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

Address from MAIL FROM

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

Array of addresses from RCPT TO (should have just one normally)

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

RCPT TO address as provided by SMTP client

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "envelope.rcpt.formatted", "description": "

Normalized RCPT address

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

ID of the Thread

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

From: header info

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

Name of the sender

" }, { "group": "Success 200", "type": "String", "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": "String", "optional": false, "field": "to.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "String", "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": "String", "optional": false, "field": "cc.name", "description": "

Name of the recipient

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

Address of the recipient

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

Recipients in Bcc: field. Usually only available for drafts

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

Name of the recipient

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "bcc.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": true, "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": true, "field": "verificationResults", "description": "

Security verification info if message was received from MX. If this property is missing then do not automatically assume invalid TLS, SPF or DKIM.

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "verificationResults.tls", "description": "

TLS information. Value is false if TLS was not used

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

Cipher name, eg "ECDHE-RSA-AES128-GCM-SHA256"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "verificationResults.tls.version", "description": "

TLS version, eg "TLSv1/SSLv3"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "verificationResults.spf", "description": "

Domain name (either MFROM or HELO) of verified SPF or false if no SPF match was found

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "verificationResults.dkim", "description": "

Domain name of verified DKIM signature or false if no valid signature was found

" }, { "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

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

JSON formatted custom metadata object set for this message

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

Referenced message info

" }, { "group": "Success 200", "type": "Object[]", "optional": true, "field": "files", "description": "

List of files added to this message as attachments. Applies to Drafts, normal messages do not have this property. Needed to prevent uploading the same attachment every time a draft is updated

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

File ID

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

Filename of the attached file

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

MIME type

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "files.size", "description": "

MIME type

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\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 \"metaData\": \"{}\"\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/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": "unseen", "defaultValue": "false", "description": "

If true, then returns only unseen messages

" }, { "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": "Object[]", "optional": false, "field": "results.to", "description": "

Recipients in To: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Cc: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Bcc: field. Usually only available for drafts

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

Name of the recipient

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

Address of the recipient

" }, { "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": "Boolean", "optional": false, "field": "results.answered", "description": "

Does this message have a \\Answered flag

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

Does this message have a $Forwarded 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 \"answered\": false,\n \"forwarded\": 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": "thread", "description": "

Thread ID

" }, { "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": "Boolean", "optional": true, "field": "unseen", "description": "

If true, then matches only messages without \\Seen flags

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

If true, then matches messages not in Junk or Trash

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

Allows to specify some requests as OR (default is AND). At least one of the values in or block must match

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "or.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": "or.from", "description": "

Partial match for the From: header line

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

Partial match for the To: and Cc: header lines

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

Partial match for the Subject: header line

" }, { "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": "Object[]", "optional": false, "field": "results.to", "description": "

Recipients in To: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Cc: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Bcc: field. Usually only available for drafts

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

Name of the recipient

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

Address of the recipient

" }, { "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" }, { "title": "Using OR:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/search?or.from=Ryan&or.to=Ryan\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "put", "url": "/users/:user/mailboxes/:mailbox/messages", "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

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

Optional metadata, must be JSON formatted object

" } ] } }, "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\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"message\": \"1,2,3\",\n \"seen\": false\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "post", "url": "/users/:user/mailboxes/:mailbox/messages/:message/submit", "title": "Submit Draft for delivery", "name": "SubmitStoredMessage", "group": "Messages", "description": "

This method allows to submit a draft message for delivery. Draft is moved to Sent mail folder.

", "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": "Boolean", "optional": false, "field": "deleteFiles", "description": "

If true then deletes attachment files listed in metaData.files array

" } ] } }, "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": true, "field": "message", "description": "

Information about submitted Message

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

Mailbox ID the draft was moved to (usually Sent mail)

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

Message ID in Mailbox

" } ] }, "examples": [ { "title": "Submit Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"queueId\": \"1682f5a712f000dfb6\",\n \"message\": {\n \"id\": 3,\n \"mailbox\": \"5c279b4e17abae166446f968\"\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": "Submit a Message:", "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/1/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"deleteFiles\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "post", "url": "/users/:user/mailboxes/:mailbox/messages", "title": "Upload Message", "name": "UploadMessage", "group": "Messages", "description": "

This method allows to upload either an RFC822 formatted message or a message structure to a mailbox. Raw message is stored unmodified, no headers are added or removed. If you want to generate the uploaded message from strucutred data fields, then do not use the raw property.

", "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": "Boolean", "optional": true, "field": "unseen", "defaultValue": "false", "description": "

Is the message unseen or not

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

Is the message a draft or not

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

Is the message flagged or not

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

base64 encoded message source. Alternatively, you can provide this value as POST body by using message/rfc822 MIME type. If raw message is provided then it overrides any other mail configuration

" }, { "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": true, "field": "subject", "description": "

Message subject. If not then resolved from Reference message

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

Plaintext message

" }, { "group": "Parameter", "type": "String", "optional": true, "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 automaticall y

" }, { "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": "String[]", "optional": true, "field": "files", "description": "

Attachments as storage file IDs. NB! When retrieving message info then an array of objects is returned. When uploading a message then an array of IDs is used.

" }, { "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": "metaData", "description": "

Optional metadata, must be JSON formatted object

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

Optional referenced email. If uploaded message is a reply draft 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": false, "field": "reference.attachments", "defaultValue": "false", "description": "

If true, then includes all attachments from the original message. If it is an array of attachment ID's includes attachments from the list

" }, { "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": "

Message information

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

Message ID in mailbox

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

Mailbox ID the message was stored into

" } ] }, "examples": [ { "title": "Forward Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"message\": {\n \"id\": 2,\n \"mailbox\": \"5a2f9ca57308fc3a6f5f811e\"\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": "Upload a Message:", "content": "curl -i -XPOST \"http://localhost:8080/users/5a2f9ca57308fc3a6f5f811d/mailboxes/5a2f9ca57308fc3a6f5f811e/messages\" \\\n-H 'Content-type: message/rfc822' \\\n-d 'From: sender@example.com\nTo: recipient@example.com\nSubject: hello world!\n\nExample message'", "type": "curl" }, { "title": "Upload a Message Structure:", "content": "curl -i -XPOST \"http://localhost:8080/users/5a2f9ca57308fc3a6f5f811d/mailboxes/5a2f9ca57308fc3a6f5f811e/messages\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"from\": {\n \"name\": \"sender name\",\n \"address\": \"sender@example.com\"\n },\n \"to\": [{\n \"address\": \"andris@ethereal.email\"\n }],\n \"subject\": \"Hello world!\",\n \"text\": \"Test message\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "delete", "url": "/users/:user/storage/:file", "title": "Delete a File", "name": "DeleteStorage", "group": "Storage", "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 File

" } ] } }, "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/storage/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/storage.js", "groupTitle": "Storage" }, { "type": "get", "url": "/users/:user/storage", "title": "List stored files", "name": "GetStorage", "group": "Storage", "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": "query", "description": "

Partial match of a filename

" }, { "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": "

File listing

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

ID of the File

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

Filename

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

Content-Type of the file

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

File size

" } ] }, "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 \"filename\": \"hello.txt\",\n \"size\": 1024\n },\n {\n \"id\": \"59ef21aef255ed1d9d790e82\",\n \"filename\": \"finances.xls\",\n \"size\": 2084\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/storage", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/storage.js", "groupTitle": "Storage" }, { "type": "get", "url": "/users/:user/storage/:file", "title": "Download File", "name": "GetStorageFile", "group": "Storage", "description": "

This method returns stored 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": "file", "description": "

ID of the File

" } ] } }, "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/storage/59fc66a13e54454869460e57\"", "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/storage.js", "groupTitle": "Storage" }, { "type": "post", "url": "/users/:user/storage", "title": "Upload File", "name": "UploadStorage", "group": "Storage", "description": "

This method allows to upload an attachment to be linked from a draft

", "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": "Binary", "optional": false, "field": "content", "description": "

Request body is the file itself. Make sure to use 'application/binary' as content-type for the request, otherwise the server might try to process the input

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

Filename

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

MIME type for the file

" }, { "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": "id", "description": "

File ID

" } ] }, "examples": [ { "title": "Forward Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a2f9ca57308fc3a6f5f811e\"\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": "Upload a file from disk:", "content": "curl -i -XPOST \"http://localhost:8080/users/5c404c9ec1933085b59e7574/storage?filename=00-example.duck.png\" \\\n-H 'Content-type: application/binary' \\\n--data-binary \"@emails/00-example.duck.png\"", "type": "curl" }, { "title": "Upload a string:", "content": "curl -i -XPOST \"http://localhost:8080/users/5c404c9ec1933085b59e7574/storage?filename=hello.txt\" \\\n-H 'Content-type: application/binary' \\\n-d \"Hello world!\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/storage.js", "groupTitle": "Storage" }, { "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": "mailbox", "description": "

Mailbox ID where to upload the message. If not set then message is uploaded to Sent Mail folder.

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

If true then generated message is not added to the sending queue

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

If true then treats this message as draft (should be used with uploadOnly=true)

" }, { "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": "Object", "optional": true, "field": "meta", "description": "

Custom metainfo for the 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" }, { "title": "Upload only", "content": "# Recipients and subject line are derived from referenced message\ncurl -i -XPOST \"http://localhost:8080/users/5a2fe496ce76ede84f177ec3/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"reference\": {\n \"mailbox\": \"5a2fe496ce76ede84f177ec4\",\n \"id\": 1,\n \"action\": \"replyAll\"\n },\n \"uploadOnly\": true,\n \"mailbox\": \"5a33b45acf482d3219955bc4\",\n \"text\": \"Yeah, sure\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/submit.js", "groupTitle": "Submission" }, { "type": "post", "url": "/users/:user/2fa/totp/check", "title": "Validate TOTP Token", "name": "CheckTotp2FA", "group": "TwoFactorAuth", "description": "

This method checks if a TOTP token provided by an User is valid for 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": false, "field": "token", "description": "

6-digit number

" }, { "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\": \"Failed to validate TOTP\"\n \"code\": \"InvalidToken\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp/check \\\n-H 'Content-type: application/json' \\\n-d '{\n \"token\": \"123456\",\n \"ip\": \"127.0.0.1\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/2fa/totp.js", "groupTitle": "TwoFactorAuth" }, { "type": "delete", "url": "/users/:user/2fa", "title": "Disable 2FA", "name": "Disable2FA", "group": "TwoFactorAuth", "description": "

This method disables all 2FA mechanisms an user might have set up

", "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/2fa", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/2fa/totp.js", "groupTitle": "TwoFactorAuth" }, { "type": "delete", "url": "/users/:user/2fa/custom", "title": "Disable custom 2FA for an user", "name": "DisableCustom2FA", "group": "TwoFactorAuth", "description": "

This method disables custom 2FA. If it was the only 2FA set up, then account password for IMAP/POP3/SMTP gets enabled again

", "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/2fa/custom \\\n-H 'Content-type: application/json' \\\n-d '{\n \"ip\": \"127.0.0.1\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/2fa/custom.js", "groupTitle": "TwoFactorAuth" }, { "type": "delete", "url": "/users/:user/2fa/totp", "title": "Disable TOTP auth", "name": "DisableTotp2FA", "group": "TwoFactorAuth", "description": "

This method disables TOTP for an user. Does not affect other 2FA mechanisms an user might have set up

", "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/2fa/totp.js", "groupTitle": "TwoFactorAuth" }, { "type": "put", "url": "/users/:user/2fa/custom", "title": "Enable custom 2FA for an user", "name": "EnableCustom2FA", "group": "TwoFactorAuth", "description": "

This method disables account password for IMAP/POP3/SMTP

", "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/2fa/custom \\\n-H 'Content-type: application/json' \\\n-d '{\n \"ip\": \"127.0.0.1\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/2fa/custom.js", "groupTitle": "TwoFactorAuth" }, { "type": "post", "url": "/users/:user/2fa/totp/enable", "title": "Enable TOTP seed", "name": "EnableTotp2FA", "group": "TwoFactorAuth", "description": "

This method enables TOTP for an user by verifying the seed value generated from 2fa/totp/setup

", "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": "token", "description": "

6-digit number that matches seed value from 2fa/totp/setup

" }, { "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp/enable \\\n-H 'Content-type: application/json' \\\n-d '{\n \"token\": \"123456\",\n \"ip\": \"127.0.0.1\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/2fa/totp.js", "groupTitle": "TwoFactorAuth" }, { "type": "post", "url": "/users/:user/2fa/totp/setup", "title": "Generate TOTP seed", "name": "SetupTotp2FA", "group": "TwoFactorAuth", "description": "

This method generates TOTP seed and QR code for 2FA. User needs to verify the seed value using 2fa/totp/enable endpoint

", "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": "label", "description": "

Label text for QR code (defaults to username)

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

Description text for QR code (defaults to "WildDuck")

" }, { "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": "seed", "description": "

Generated TOTP seed value

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

Base64 encoded QR code

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"seed\": \"secretseed\",\n \"qrcode\": \"base64-encoded-image\"\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 does not exist\"\n \"code\": \"UserNotFound\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp/setup \\\n-H 'Content-type: application/json' \\\n-d '{\n \"label\": \"user@example.com\",\n \"issuer\": \"My Awesome Web Service\",\n \"ip\": \"127.0.0.1\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/2fa/totp.js", "groupTitle": "TwoFactorAuth" }, { "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": "metaData", "description": "

JSON formatted custom metadata object set for this user

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

List of forwarding targets

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

Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam

" }, { "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 hours 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 hours 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": "Object", "optional": false, "field": "limits.received", "description": "

Receiving quota

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

How many messages per 1 hour can be received

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

How many messages are received during current 1 hour period

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

Time until the end of current 1 hour period

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

IMAP upload quota

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

How many bytes per 24 hours can be uploaded via IMAP. Only message contents are counted, not protocol overhead.

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

How many bytes are uploaded during current 24 hour period

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

Time until the end of current 24 hour period

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

IMAP download quota

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

How many bytes per 24 hours can be downloaded via IMAP. Only message contents are counted, not protocol overhead.

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

How many bytes are downloaded during current 24 hour period

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

Time until the end of current 24 hour period

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

POP3 download quota

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

How many bytes per 24 hours can be downloaded via POP3. Only message contents are counted, not protocol overhead.

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

How many bytes are downloaded during current 24 hour period

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

Time until the end of current 24 hour period

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

How many parallel IMAP connections are permitted

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

How many parallel IMAP connections are currenlty in use

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

List of tags associated with the User

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

Disabled scopes for this 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 \"targets\": [\n \"my.old.address@example.com\",\n \"smtp://mx2.zone.eu:25\"\n ],\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 \"disabledScopes\": [\"pop3\"],\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/resolve/:username", "title": "Resolve ID for an username", "name": "GetUsername", "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": "username", "description": "

Username of the User. Alphanumeric value. Must start with a letter, dots are allowed but informational only ("user.name" is the same as "username")

" } ] } }, "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)

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\"\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/resolve/testuser", "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.targets", "description": "

List of forwarding targets

" }, { "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": "username", "description": "

Username of the User. Dots are allowed but informational only ("user.name" is the same as "username").

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

Name of the User

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

Password for the account. Set to boolean false to disable password usage

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

If true then password is already hashed, so store as. Hash needs to be bcrypt $2a, $2y or $2b. Additionally md5-crypt hashes $1 are allowed but these are rehashed on first successful authentication

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

If false then validates provided passwords against Have I Been Pwned API. Experimental, so validation is disabled by default but will be enabled automatically in some future version of WildDuck.

" }, { "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": "Boolean", "optional": true, "field": "requirePasswordChange", "description": "

If true then requires the user to change password, useful if password for the account was autogenerated

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

A list of tags associated with this user

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

If true then autogenerated address gets the same tags as the user

" }, { "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": "uploadSentMessages", "description": "

If true then all messages sent through MSA are also uploaded to the Sent Mail folder. Might cause duplicates with some email clients, so disabled by default.

" }, { "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": "metaData", "description": "

Optional metadata, must be JSON formatted object

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

Language code for the User

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

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "spamLevel", "defaultValue": "50", "description": "

Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam

" }, { "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": "Number", "optional": true, "field": "imapMaxUpload", "description": "

How many bytes can be uploaded via IMAP during 24 hour

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

How many bytes can be downloaded via IMAP during 24 hour

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

How many bytes can be downloaded via POP3 during 24 hour

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

How many parallel IMAP connections are alowed

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

How many messages can be received from MX during 60 seconds

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

Optional names for special mailboxes

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailboxes.sent", "defaultValue": "Sent Mail", "description": "

Path of Sent Mail folder

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailboxes.junk", "defaultValue": "Junk", "description": "

Path of spam folder

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailboxes.drafts", "defaultValue": "Drafts", "description": "

Path of drafts folder

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailboxes.trash", "defaultValue": "Trash", "description": "

Path of trash folder

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

List of scopes that are disabled for this user ("imap", "pop3", "smtp")

" }, { "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 \"address\": \"john.doe@example.com\",\n \"tags\": [\n \"status:regular_user\",\n \"subscription:business_big\"\n ]\n}'", "type": "curl" }, { "title": "Example address:", "content": "curl -i -XPOST http://localhost:8080/users \\\n-H 'Content-type: application/json' \\\n-d '{\n \"username\": \"john.doe@example.com\",\n \"password\": \"verysecret\",\n \"name\": \"John Doe\",\n \"tags\": [\n \"status:regular_user\",\n \"subscription:business_big\"\n ]\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.

" } ] } }, "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": "post", "url": "/quota/reset", "title": "Recalculate Quota for all Users", "name": "PostUserQuotaAll", "group": "Users", "description": "

This method recalculates quota usage for all Users. 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.

" } ] } }, "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\": \"Failed to process request\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/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. Set to boolean false to disable password usage

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

If true then password is already hashed, so store as. Hash needs to be bcrypt $2a, $2y or $2b. Additionally md5-crypt hashes $1 are allowed but these are rehashed on first successful authentication

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

If false then validates provided passwords against Have I Been Pwned API. Experimental, so validation is disabled by default but will be enabled automatically in some future version of WildDuck.

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

A list of tags associated with this user

" }, { "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": "uploadSentMessages", "description": "

If true then all messages sent through MSA are also uploaded to the Sent Mail folder. Might cause duplicates with some email clients, so disabled by default.

" }, { "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": "metaData", "description": "

Optional metadata, must be JSON formatted object

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

Language code for the User

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

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

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

Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam

" }, { "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": "Number", "optional": true, "field": "imapMaxUpload", "description": "

How many bytes can be uploaded via IMAP during 24 hour

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

How many bytes can be downloaded via IMAP during 24 hour

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

How many bytes can be downloaded via POP3 during 24 hour

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

How many parallel IMAP connections are alowed

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

How many messages can be received from MX during 60 seconds

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

If true, then disables 2FA for this user

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

List of scopes that are disabled for this user ("imap", "pop3", "smtp")

" }, { "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": "validAfter", "description": "

Allow using the generated password not earlier than provided time

" }, { "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": "/addresses/forwarded/:address", + "title": "Delete a forwarded Address", + "name": "DeleteForwardedAddress", + "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": "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\": \"This address does not exist\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XDELETE http://localhost:8080/addresses/forwarded/59ef21aef255ed1d9d790e81", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/addresses.js", + "groupTitle": "Addresses" + }, + { + "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/resolve/:address", + "title": "Get Address info", + "name": "GetAddressInfo", + "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": "address", + "description": "

ID of the Address or e-mail address string

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

If true then resolves also wildcard addresses

" + } + ] + } + }, + "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": "String", + "optional": false, + "field": "name", + "description": "

Identity name

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

ID of the user if the address belongs to a User

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

List of forwarding targets if this is a Forwarded address

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

Account limits and usage for Forwarded address

" + }, + { + "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": "Object", + "optional": false, + "field": "autoreply", + "description": "

Autoreply information

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

If true, then autoreply is enabled for this address

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

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

List of tags associated with the Address

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

Datestring of the time the address was created

" + } + ] + }, + "examples": [ + { + "title": "User-Address:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"user\": \"59ef21aef255ed1d9d771bb\"\n \"created\": \"2017-10-24T11:19:10.911Z\"\n}", + "type": "json" + }, + { + "title": "Forwarded-Address:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"targets\": [\n \"my.other.address@example.com\"\n ],\n \"limits\": {\n \"forwards\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n }\n },\n \"autoreply\": {\n \"status\": false\n },\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 address does not exist\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i http://localhost:8080/addresses/resolve/k%C3%A4ru%40j%C3%B5geva.ee", + "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": "String", + "optional": true, + "field": "tags", + "description": "

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

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

Comma separated list of tags. The Address 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": "

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.name", + "description": "

Identity name

" + }, + { + "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 if this is a User address

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

If true then it is a forwarded address

" + } + ] + }, + "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 \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"forwarded\": true\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": "/addresses/forwarded/:address", + "title": "Request forwarded Addresses information", + "name": "GetForwardedAddress", + "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": "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": "String", + "optional": false, + "field": "name", + "description": "

Identity name

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

List of forwarding targets

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

Account limits and usage

" + }, + { + "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": "Object", + "optional": false, + "field": "autoreply", + "description": "

Autoreply information

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

If true, then autoreply is enabled for this address

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

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

Datestring of the time the address was created

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

List of tags associated with the Address

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"targets\": [\n \"my.other.address@example.com\"\n ],\n \"limits\": {\n \"forwards\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n }\n },\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 address does not exist\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i http://localhost:8080/addresses/forwarded/59ef21aef255ed1d9d790e81", + "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": "name", + "description": "

Identity name

" + }, + { + "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 a 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.name", + "description": "

Identity name

" + }, + { + "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

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

List of tags associated with the Address

" + } + ] + }, + "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": "/addresses/forwarded", + "title": "Create new forwarded Address", + "name": "PostForwardedAddress", + "group": "Addresses", + "description": "

Add a new forwarded email address. 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": "address", + "description": "

E-mail Address

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

Identity name

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

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

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

Daily allowed forwarding count for this address

" + }, + { + "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

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

A list of tags associated with this address

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

Autoreply information

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

If true, then autoreply is enabled for this address

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

Either a date string or boolean false to disable start time checks

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

Either a date string or boolean false to disable end time checks

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

" + } + ] + } + }, + "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 email address already exists\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPOST http://localhost:8080/addresses/forwarded \\\n-H 'Content-type: application/json' \\\n-d '{\n \"address\": \"my.new.address@example.com\",\n \"targets\": [\n \"my.old.address@example.com\",\n \"smtp://mx2.zone.eu:25\"\n ],\n \"forwards\": 500\n}'", + "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 a 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, *suffix@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": "String", + "optional": true, + "field": "name", + "description": "

Identity name

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

A list of tags associated with this 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, *suffix@example.com and username@*, otherwise using * is not allowed. Static suffix can be up to 32 characters long.

" + } + ] + } + }, + "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": "/addresses/forwarded/:address", + "title": "Update forwarded Address information", + "name": "PutForwardedAddress", + "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": "id", + "description": "

ID of the Address

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

New address. Only affects normal addresses, special addresses that include * can not be changed

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

Identity name

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

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to. If set then overwrites previous targets array

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

Daily allowed forwarding count for this address

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

A list of tags associated with this address

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

Autoreply information

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

If true, then autoreply is enabled for this address

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

Either a date string or boolean false to disable start time checks

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

Either a date string or boolean false to disable end time checks

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

" + } + ] + } + }, + "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 address does not exist\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPUT http://localhost:8080/addresses/forwarded/5a1d4541153888cdcd62a71b \\\n-H 'Content-type: application/json' \\\n-d '{\n \"targets\": [\n \"some.other.address@example.com\"\n ]\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/addresses.js", + "groupTitle": "Addresses" + }, + { + "type": "put", + "url": "/addresses/renameDomain", + "title": "Rename domain in addresses", + "name": "PutRenameDomain", + "group": "Addresses", + "description": "

Renames domain names for addresses, DKIM keys and Domain Aliases

", + "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": "oldDomain", + "description": "

Old Domain Name

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

New Domain Name

" + } + ] + } + }, + "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\": \"Failed to rename domain\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPUT http://localhost:8080/addresses/renameDomain \\\n-H 'Content-type: application/json' \\\n-d '{\n \"oldDomain\": \"example.com\",\n \"newDomain\": \"blurdybloop.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": "String", + "optional": false, + "field": "id", + "description": "

ID of the Address

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

Identity name

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

New address if you want to rename existing address. Only affects normal addresses, special addresses that include * can not be changed

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

Indicates if this is the default address for the User

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

A list of tags associated with this 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\": \"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/:asp", + "title": "Request ASP information", + "name": "GetASP", + "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 Specific Password

" + } + ] + } + }, + "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": "description", + "description": "

Description

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

Allowed scopes for the Application Password

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

Information about last use

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "lastUse.time", + "description": "

Datestring of last use or false if password has not been used

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "lastUse.event", + "description": "

Event ID of the security log for the last authentication

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

Datestring

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1d6dd776e56b6d97e5dd48\",\n \"description\": \"Thunderbird\",\n \"scopes\": [\n \"imap\",\n \"smtp\"\n ],\n \"lastUse\": {\n \"time\": \"2018-06-21T16:51:53.807Z\",\n \"event\": \"5b2bd7a9d0ba2509deb88f40\"\n },\n \"created\": \"2017-11-28T14:08:23.520Z\"\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/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

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

If not true then skips entries with a TTL set

" + } + ] + } + }, + "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": "Object", + "optional": false, + "field": "results.lastUse", + "description": "

Information about last use

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

Datestring of last use or false if password has not been used

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

Event ID of the security log for the last authentication

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

Datestring

" + } + ] + }, + "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 \"lastUse\": {\n \"time\": \"2018-06-21T16:51:53.807Z\",\n \"event\": \"5b2bd7a9d0ba2509deb88f40\"\n },\n \"created\": \"2017-11-28T14:08:23.520Z\"\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": "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": "address", + "description": "

E-mail address to be used as the account address in mobileconfig file. Must be one of the listed identity addresses of the user. Defaults to the main address of the user

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

TTL in seconds for this password. Every time password is used, TTL is reset to this value

" + }, + { + "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/messages", + "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": "Object[]", + "optional": false, + "field": "results.to", + "description": "

Recipients in To: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Cc: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Bcc: field. Usually only available for drafts

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

Name of the recipient

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

Address of the recipient

" + }, + { + "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/messages\"", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/messages.js", + "groupTitle": "Archive" + }, + { + "type": "post", + "url": "/users/:user/archived/messages/:message/restore", + "title": "Restore archived Message", + "name": "RestoreMessage", + "group": "Archive", + "description": "

Restores a single 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/messages/59fc66a13e54454869460e58/restore\" \\\n-H 'Content-type: application/json' \\\n-d '{}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/messages.js", + "groupTitle": "Archive" + }, + { + "type": "post", + "url": "/users/:user/archived/restore", + "title": "Restore archived messages", + "name": "RestoreMessages", + "group": "Archive", + "description": "

Initiates a restore task to move archived messages of a date range back to the mailboxes the messages were deleted from. If target mailbox does not exist, then the messages are 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": "String", + "optional": false, + "field": "start", + "description": "

Datestring

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

Datestring

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

Indicates successful response

" + } + ] + }, + "examples": [ + { + "title": "Restore 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": "Restore a Message:", + "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/restore\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"start\": \"2018-10-01T00:00:00.000Z\",\n \"end\": \"2018-10-08T23:59:59.999Z\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/messages.js", + "groupTitle": "Archive" + }, + { + "type": "delete", + "url": "/authenticate", + "title": "Invalidate authentication token", + "name": "DeleteAuth", + "group": "Authentication", + "description": "

This method invalidates currently used authentication token. If token is not provided then nothing happens

", + "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" + } + ] + }, + "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

" + }, + { + "group": "Error 4xx", + "optional": true, + "field": "code", + "description": "

Error code

" + } + ] + } + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XDELETE \"http://localhost:8080/authenticate\" \\\n-H 'X-Access-Token: 59fc66a03e54454869460e45'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/auth.js", + "groupTitle": "Authentication" + }, + { + "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": "filterIp", + "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": "get", + "url": "/users/:user/authlog/:event", + "title": "Request Event information", + "name": "GetAuthlogEvent", + "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": false, + "field": "event", + "description": "

ID of the Event

" + } + ] + } + }, + "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 Event

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

Action identifier

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

Did the action succeed

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

Session identifier

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

IP address of the Event

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

Datestring of the Event time

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\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}", + "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/59fc66a03e54454869460e4d\"", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/auth.js", + "groupTitle": "Authentication" + }, + { + "type": "post", + "url": "/authenticate", + "title": "Authenticate a 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": "Boolean", + "optional": true, + "field": "token", + "defaultValue": "false", + "description": "

If true then generates a temporary access token that is valid for this user. Only available if scope is "master". When using user tokens then you can replace user ID in URLs with "me".

" + }, + { + "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

" + }, + { + "group": "Success 200", + "type": "String", + "optional": true, + "field": "token", + "description": "

If access token was requested then this is the value to use as access token when making API requests on behalf of logged in user.

" + } + ] + }, + "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

" + }, + { + "group": "Error 4xx", + "optional": true, + "field": "code", + "description": "

Error code

" + }, + { + "group": "Error 4xx", + "optional": true, + "field": "id", + "description": "

User ID if the user exists

" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Authentication failed. Invalid scope\",\n \"code\": \"InvalidAuthScope\",\n \"id\": \"5b22283d45e8d47572eb0381\"\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 \"token\": \"true\"\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": "name", + "description": "

Name that is used for the From: header in autoreply message

" + }, + { + "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": "name", + "description": "

Name that is used for the From: header in autoreply message

" + }, + { + "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 or boolean false to disable start checks

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

Datestring of the end of the autoreply or boolean false to disable end checks

" + } + ] + } + }, + "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": "/dkim/:dkim", + "title": "Delete a DKIM key", + "name": "DeleteDkim", + "group": "DKIM", + "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": "dkim", + "description": "

ID of the DKIM

" + } + ] + } + }, + "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/dkim/59ef21aef255ed1d9d790e81", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/dkim.js", + "groupTitle": "DKIM" + }, + { + "type": "get", + "url": "/dkim", + "title": "List registered DKIM keys", + "name": "GetDkim", + "group": "DKIM", + "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 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 DKIM

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

The domain this DKIM key applies to

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

DKIM selector

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

Key description

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

Key fingerprint (SHA1)

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

Datestring

" + } + ] + }, + "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 \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"fingerprint\": \"6a:aa:d7:ba:e4:99:b4:12:e0:f3:35:01:71:d4:f1:d6:b4:95:c4:f5\",\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\": \"Database error\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i http://localhost:8080/dkim", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/dkim.js", + "groupTitle": "DKIM" + }, + { + "type": "get", + "url": "/dkim/:dkim", + "title": "Request DKIM information", + "name": "GetDkimKey", + "group": "DKIM", + "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": "dkim", + "description": "

ID of the DKIM

" + } + ] + } + }, + "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 DKIM

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

The domain this DKIM key applies to

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

DKIM selector

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

Key description

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

Key fingerprint (SHA1)

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

Public key in DNS format (no prefix/suffix, single line)

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

Value for DNS TXT entry

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

Is the domain name of TXT

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

Is the value of TXT

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

Datestring

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e7a\",\n \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"fingerprint\": \"6a:aa:d7:ba:e4:99:b4:12:e0:f3:35:01:71:d4:f1:d6:b4:95:c4:f5\",\n \"publicKey\": \"-----BEGIN PUBLIC KEY-----\\r\\nMIGfMA0...\",\n \"dnsTxt\": {\n \"name\": \"dec20._domainkey.example.com\",\n \"value\": \"v=DKIM1;t=s;p=MIGfMA0...\"\n }\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/dkim/59ef21aef255ed1d9d790e7a", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/dkim.js", + "groupTitle": "DKIM" + }, + { + "type": "post", + "url": "/dkim", + "title": "Create or update DKIM key for domain", + "name": "PostDkim", + "group": "DKIM", + "description": "

Add a new DKIM key for a Domain or update existing one. There can be single DKIM key registered for each domain name.

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

Domain name this DKIM key applies to. Use "*" as a special value that will be used for domains that do not have their own DKIM key set

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

Selector for the key

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

Key description

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

Pem formatted DKIM private key. If not set then a new 2048 bit RSA key is generated, beware though that it can take several seconds to complete.

" + } + ] + } + }, + "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 DKIM

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

The domain this DKIM key applies to

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

DKIM selector

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

Key description

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

Key fingerprint (SHA1)

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

Public key in DNS format (no prefix/suffix, single line)

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

Value for DNS TXT entry

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

Is the domain name of TXT

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

Is the value of TXT

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"fingerprint\": \"6a:aa:d7:ba:e4:99:b4:12:e0:f3:35:01:71:d4:f1:d6:b4:95:c4:f5\",\n \"publicKey\": \"-----BEGIN PUBLIC KEY-----\\r\\nMIGfMA0...\",\n \"dnsTxt\": {\n \"name\": \"dec20._domainkey.example.com\",\n \"value\": \"v=DKIM1;t=s;p=MIGfMA0...\"\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 -XPOST http://localhost:8080/dkim \\\n-H 'Content-type: application/json' \\\n-d '{\n \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"privateKey\": \"-----BEGIN RSA PRIVATE KEY-----\\r\\n...\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/dkim.js", + "groupTitle": "DKIM" + }, + { + "type": "get", + "url": "/dkim/resolve/:domain", + "title": "Resolve ID for a DKIM domain", + "name": "ResolveDKIM", + "group": "DKIM", + "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": "domain", + "description": "

DKIM domain

" + } + ] + } + }, + "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": "

DKIM unique ID (24 byte hex)

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\"\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 domain does not exist\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i http://localhost:8080/dkim/resolve/example.com", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/dkim.js", + "groupTitle": "DKIM" + }, + { + "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": "/domainaliases", + "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", + "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": "get", + "url": "/domainaliases/resolve/:alias", + "title": "Resolve ID for a domain aias", + "name": "ResolveDomainAlias", + "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": "

Alias domain

" + } + ] + } + }, + "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": "

Alias unique ID (24 byte hex)

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\"\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/resolve/example.com", + "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": "Object", + "optional": false, + "field": "query", + "description": "

Rules that a message must match

" + }, + { + "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.listId", + "description": "

Partial match for the List-ID: header (case insensitive)

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

Fulltext search against message text

" + }, + { + "group": "Success 200", + "type": "Boolean", + "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": "Object", + "optional": false, + "field": "action", + "description": "

Action to take with a matching message

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

If true then mark matching messages as Seen

" + }, + { + "group": "Success 200", + "type": "Boolean", + "optional": false, + "field": "action.flag", + "description": "

If true then mark matching messages as Flagged

" + }, + { + "group": "Success 200", + "type": "Boolean", + "optional": false, + "field": "action.delete", + "description": "

If true then do not store matching messages

" + }, + { + "group": "Success 200", + "type": "Boolean", + "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.targets", + "description": "

A list of email addresses / HTTP URLs to forward the message to

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

If true, then this filter is ignored

" + } + ] + }, + "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\": {\n \"from\": \"Mäger\"\n },\n \"action\": {\n \"seen\": true\n },\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 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 a 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

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

If true, then this filter is ignored

" + } + ] + }, + "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 \"disabled\": false,\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": "Object", + "optional": false, + "field": "query", + "description": "

Rules that a message must match

" + }, + { + "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.listId", + "description": "

Partial match for the List-ID: header (case insensitive)

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

Fulltext search against message text

" + }, + { + "group": "Parameter", + "type": "Boolean", + "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": "Object", + "optional": false, + "field": "action", + "description": "

Action to take with a matching message

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "action.seen", + "description": "

If true then mark matching messages as Seen

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "action.flag", + "description": "

If true then mark matching messages as Flagged

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "action.delete", + "description": "

If true then do not store matching messages

" + }, + { + "group": "Parameter", + "type": "Boolean", + "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.targets", + "description": "

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

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

If true then this filter is ignored

" + } + ] + } + }, + "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\": {\n \"from\": \"Mäger\"\n },\n \"action\": {\n \"seen\": true\n }\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": "Object", + "optional": false, + "field": "query", + "description": "

Rules that a message must match

" + }, + { + "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.listId", + "description": "

Partial match for the List-ID: header (case insensitive)

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

Fulltext search against message text

" + }, + { + "group": "Parameter", + "type": "Boolean", + "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": "Object", + "optional": false, + "field": "action", + "description": "

Action to take with a matching message

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "action.seen", + "description": "

If true then mark matching messages as Seen

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "action.flag", + "description": "

If true then mark matching messages as Flagged

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "action.delete", + "description": "

If true then do not store matching messages

" + }, + { + "group": "Parameter", + "type": "Boolean", + "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.targets", + "description": "

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

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

If true then this filter is ignored

" + } + ] + } + }, + "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\": {\n \"seen\": \"\",\n \"flag\": true\n }\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 a 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": "specialUse", + "defaultValue": "false", + "description": "

Should the response include only folders with specialUse flag set.

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

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

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

Should the response include mailbox size in bytes. Size numbers come with a lot of overhead as an aggregated query is ran.

" + } + ] + } + }, + "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\": \"Database error\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes?counters=true", + "type": "curl" + }, + { + "title": "Special Use Only", + "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes?specialUse=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 Mailbox. Changing 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": "delete", + "url": "/users/:user/mailboxes/:mailbox/messages", + "title": "Delete all Messages from a Mailbox", + "name": "DeleteMessages", + "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

" + } + ] + } + }, + "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": "deleted", + "description": "

Indicates count of deleted messages

" + } + ] + }, + "examples": [ + { + "title": "Delete Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"deleted\": 51\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 all Messages:", + "content": "curl -i -XDELETE \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages\"", + "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": "ForwardStoredMessage", + "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": "Forward 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": "envelope", + "description": "

SMTP envelope (if available)

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

Address from MAIL FROM

" + }, + { + "group": "Success 200", + "type": "Object[]", + "optional": false, + "field": "envelope.rcpt", + "description": "

Array of addresses from RCPT TO (should have just one normally)

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

RCPT TO address as provided by SMTP client

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "envelope.rcpt.formatted", + "description": "

Normalized RCPT address

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

ID of the Thread

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

From: header info

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

Name of the sender

" + }, + { + "group": "Success 200", + "type": "String", + "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": "String", + "optional": false, + "field": "to.name", + "description": "

Name of the recipient

" + }, + { + "group": "Success 200", + "type": "String", + "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": "String", + "optional": false, + "field": "cc.name", + "description": "

Name of the recipient

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

Address of the recipient

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

Recipients in Bcc: field. Usually only available for drafts

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

Name of the recipient

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "bcc.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": true, + "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": true, + "field": "verificationResults", + "description": "

Security verification info if message was received from MX. If this property is missing then do not automatically assume invalid TLS, SPF or DKIM.

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "verificationResults.tls", + "description": "

TLS information. Value is false if TLS was not used

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

Cipher name, eg "ECDHE-RSA-AES128-GCM-SHA256"

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "verificationResults.tls.version", + "description": "

TLS version, eg "TLSv1/SSLv3"

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "verificationResults.spf", + "description": "

Domain name (either MFROM or HELO) of verified SPF or false if no SPF match was found

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "verificationResults.dkim", + "description": "

Domain name of verified DKIM signature or false if no valid signature was found

" + }, + { + "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

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

JSON formatted custom metadata object set for this message

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

Referenced message info

" + }, + { + "group": "Success 200", + "type": "Object[]", + "optional": true, + "field": "files", + "description": "

List of files added to this message as attachments. Applies to Drafts, normal messages do not have this property. Needed to prevent uploading the same attachment every time a draft is updated

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

File ID

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

Filename of the attached file

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

MIME type

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "files.size", + "description": "

MIME type

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\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 \"metaData\": \"{}\"\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/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": "unseen", + "defaultValue": "false", + "description": "

If true, then returns only unseen messages

" + }, + { + "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": "Object[]", + "optional": false, + "field": "results.to", + "description": "

Recipients in To: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Cc: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Bcc: field. Usually only available for drafts

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

Name of the recipient

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

Address of the recipient

" + }, + { + "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": "Boolean", + "optional": false, + "field": "results.answered", + "description": "

Does this message have a \\Answered flag

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

Does this message have a $Forwarded 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 \"answered\": false,\n \"forwarded\": 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": "thread", + "description": "

Thread ID

" + }, + { + "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": "Boolean", + "optional": true, + "field": "unseen", + "description": "

If true, then matches only messages without \\Seen flags

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

If true, then matches messages not in Junk or Trash

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

Allows to specify some requests as OR (default is AND). At least one of the values in or block must match

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "or.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": "or.from", + "description": "

Partial match for the From: header line

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

Partial match for the To: and Cc: header lines

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

Partial match for the Subject: header line

" + }, + { + "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": "Object[]", + "optional": false, + "field": "results.to", + "description": "

Recipients in To: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Cc: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Bcc: field. Usually only available for drafts

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

Name of the recipient

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

Address of the recipient

" + }, + { + "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" + }, + { + "title": "Using OR:", + "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/search?or.from=Ryan&or.to=Ryan\"", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/messages.js", + "groupTitle": "Messages" + }, + { + "type": "put", + "url": "/users/:user/mailboxes/:mailbox/messages", + "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

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

Optional metadata, must be JSON formatted object

" + } + ] + } + }, + "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\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"message\": \"1,2,3\",\n \"seen\": false\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/messages.js", + "groupTitle": "Messages" + }, + { + "type": "post", + "url": "/users/:user/mailboxes/:mailbox/messages/:message/submit", + "title": "Submit Draft for delivery", + "name": "SubmitStoredMessage", + "group": "Messages", + "description": "

This method allows to submit a draft message for delivery. Draft is moved to Sent mail folder.

", + "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": "Boolean", + "optional": false, + "field": "deleteFiles", + "description": "

If true then deletes attachment files listed in metaData.files array

" + } + ] + } + }, + "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": true, + "field": "message", + "description": "

Information about submitted Message

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

Mailbox ID the draft was moved to (usually Sent mail)

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

Message ID in Mailbox

" + } + ] + }, + "examples": [ + { + "title": "Submit Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"queueId\": \"1682f5a712f000dfb6\",\n \"message\": {\n \"id\": 3,\n \"mailbox\": \"5c279b4e17abae166446f968\"\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": "Submit a Message:", + "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/1/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"deleteFiles\": true\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/messages.js", + "groupTitle": "Messages" + }, + { + "type": "post", + "url": "/users/:user/mailboxes/:mailbox/messages", + "title": "Upload Message", + "name": "UploadMessage", + "group": "Messages", + "description": "

This method allows to upload either an RFC822 formatted message or a message structure to a mailbox. Raw message is stored unmodified, no headers are added or removed. If you want to generate the uploaded message from strucutred data fields, then do not use the raw property.

", + "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": "Boolean", + "optional": true, + "field": "unseen", + "defaultValue": "false", + "description": "

Is the message unseen or not

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

Is the message a draft or not

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

Is the message flagged or not

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

base64 encoded message source. Alternatively, you can provide this value as POST body by using message/rfc822 MIME type. If raw message is provided then it overrides any other mail configuration

" + }, + { + "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": true, + "field": "subject", + "description": "

Message subject. If not then resolved from Reference message

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

Plaintext message

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "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 automaticall y

" + }, + { + "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": "String[]", + "optional": true, + "field": "files", + "description": "

Attachments as storage file IDs. NB! When retrieving message info then an array of objects is returned. When uploading a message then an array of IDs is used.

" + }, + { + "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": "metaData", + "description": "

Optional metadata, must be JSON formatted object

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

Optional referenced email. If uploaded message is a reply draft 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": false, + "field": "reference.attachments", + "defaultValue": "false", + "description": "

If true, then includes all attachments from the original message. If it is an array of attachment ID's includes attachments from the list

" + }, + { + "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": "

Message information

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

Message ID in mailbox

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

Mailbox ID the message was stored into

" + } + ] + }, + "examples": [ + { + "title": "Forward Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"message\": {\n \"id\": 2,\n \"mailbox\": \"5a2f9ca57308fc3a6f5f811e\"\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": "Upload a Message:", + "content": "curl -i -XPOST \"http://localhost:8080/users/5a2f9ca57308fc3a6f5f811d/mailboxes/5a2f9ca57308fc3a6f5f811e/messages\" \\\n-H 'Content-type: message/rfc822' \\\n-d 'From: sender@example.com\nTo: recipient@example.com\nSubject: hello world!\n\nExample message'", + "type": "curl" + }, + { + "title": "Upload a Message Structure:", + "content": "curl -i -XPOST \"http://localhost:8080/users/5a2f9ca57308fc3a6f5f811d/mailboxes/5a2f9ca57308fc3a6f5f811e/messages\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"from\": {\n \"name\": \"sender name\",\n \"address\": \"sender@example.com\"\n },\n \"to\": [{\n \"address\": \"andris@ethereal.email\"\n }],\n \"subject\": \"Hello world!\",\n \"text\": \"Test message\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/messages.js", + "groupTitle": "Messages" + }, + { + "type": "delete", + "url": "/users/:user/storage/:file", + "title": "Delete a File", + "name": "DeleteStorage", + "group": "Storage", + "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 File

" + } + ] + } + }, + "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/storage/59ef21aef255ed1d9d790e81", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/storage.js", + "groupTitle": "Storage" + }, + { + "type": "get", + "url": "/users/:user/storage", + "title": "List stored files", + "name": "GetStorage", + "group": "Storage", + "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": "query", + "description": "

Partial match of a filename

" + }, + { + "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": "

File listing

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

ID of the File

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

Filename

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

Content-Type of the file

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

File size

" + } + ] + }, + "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 \"filename\": \"hello.txt\",\n \"size\": 1024\n },\n {\n \"id\": \"59ef21aef255ed1d9d790e82\",\n \"filename\": \"finances.xls\",\n \"size\": 2084\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/storage", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/storage.js", + "groupTitle": "Storage" + }, + { + "type": "get", + "url": "/users/:user/storage/:file", + "title": "Download File", + "name": "GetStorageFile", + "group": "Storage", + "description": "

This method returns stored 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": "file", + "description": "

ID of the File

" + } + ] + } + }, + "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/storage/59fc66a13e54454869460e57\"", + "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/storage.js", + "groupTitle": "Storage" + }, + { + "type": "post", + "url": "/users/:user/storage", + "title": "Upload File", + "name": "UploadStorage", + "group": "Storage", + "description": "

This method allows to upload an attachment to be linked from a draft

", + "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": "Binary", + "optional": false, + "field": "content", + "description": "

Request body is the file itself. Make sure to use 'application/binary' as content-type for the request, otherwise the server might try to process the input

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

Filename

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

MIME type for the file

" + }, + { + "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": "id", + "description": "

File ID

" + } + ] + }, + "examples": [ + { + "title": "Forward Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a2f9ca57308fc3a6f5f811e\"\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": "Upload a file from disk:", + "content": "curl -i -XPOST \"http://localhost:8080/users/5c404c9ec1933085b59e7574/storage?filename=00-example.duck.png\" \\\n-H 'Content-type: application/binary' \\\n--data-binary \"@emails/00-example.duck.png\"", + "type": "curl" + }, + { + "title": "Upload a string:", + "content": "curl -i -XPOST \"http://localhost:8080/users/5c404c9ec1933085b59e7574/storage?filename=hello.txt\" \\\n-H 'Content-type: application/binary' \\\n-d \"Hello world!\"", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/storage.js", + "groupTitle": "Storage" + }, + { + "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": "mailbox", + "description": "

Mailbox ID where to upload the message. If not set then message is uploaded to Sent Mail folder.

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

If true then generated message is not added to the sending queue

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

If true then treats this message as draft (should be used with uploadOnly=true)

" + }, + { + "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": "Object", + "optional": true, + "field": "meta", + "description": "

Custom metainfo for the 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" + }, + { + "title": "Upload only", + "content": "# Recipients and subject line are derived from referenced message\ncurl -i -XPOST \"http://localhost:8080/users/5a2fe496ce76ede84f177ec3/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"reference\": {\n \"mailbox\": \"5a2fe496ce76ede84f177ec4\",\n \"id\": 1,\n \"action\": \"replyAll\"\n },\n \"uploadOnly\": true,\n \"mailbox\": \"5a33b45acf482d3219955bc4\",\n \"text\": \"Yeah, sure\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/submit.js", + "groupTitle": "Submission" + }, + { + "type": "post", + "url": "/users/:user/2fa/totp/check", + "title": "Validate TOTP Token", + "name": "CheckTotp2FA", + "group": "TwoFactorAuth", + "description": "

This method checks if a TOTP token provided by a User is valid for 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": false, + "field": "token", + "description": "

6-digit number

" + }, + { + "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\": \"Failed to validate TOTP\"\n \"code\": \"InvalidToken\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp/check \\\n-H 'Content-type: application/json' \\\n-d '{\n \"token\": \"123456\",\n \"ip\": \"127.0.0.1\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/2fa/totp.js", + "groupTitle": "TwoFactorAuth" + }, + { + "type": "delete", + "url": "/users/:user/2fa", + "title": "Disable 2FA", + "name": "Disable2FA", + "group": "TwoFactorAuth", + "description": "

This method disables all 2FA mechanisms an user might have set up

", + "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/2fa", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/2fa/totp.js", + "groupTitle": "TwoFactorAuth" + }, + { + "type": "delete", + "url": "/users/:user/2fa/custom", + "title": "Disable custom 2FA for an user", + "name": "DisableCustom2FA", + "group": "TwoFactorAuth", + "description": "

This method disables custom 2FA. If it was the only 2FA set up, then account password for IMAP/POP3/SMTP gets enabled again

", + "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/2fa/custom \\\n-H 'Content-type: application/json' \\\n-d '{\n \"ip\": \"127.0.0.1\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/2fa/custom.js", + "groupTitle": "TwoFactorAuth" + }, + { + "type": "delete", + "url": "/users/:user/2fa/totp", + "title": "Disable TOTP auth", + "name": "DisableTotp2FA", + "group": "TwoFactorAuth", + "description": "

This method disables TOTP for an user. Does not affect other 2FA mechanisms an user might have set up

", + "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/2fa/totp.js", + "groupTitle": "TwoFactorAuth" + }, + { + "type": "put", + "url": "/users/:user/2fa/custom", + "title": "Enable custom 2FA for an user", + "name": "EnableCustom2FA", + "group": "TwoFactorAuth", + "description": "

This method disables account password for IMAP/POP3/SMTP

", + "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/2fa/custom \\\n-H 'Content-type: application/json' \\\n-d '{\n \"ip\": \"127.0.0.1\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/2fa/custom.js", + "groupTitle": "TwoFactorAuth" + }, + { + "type": "post", + "url": "/users/:user/2fa/totp/enable", + "title": "Enable TOTP seed", + "name": "EnableTotp2FA", + "group": "TwoFactorAuth", + "description": "

This method enables TOTP for an user by verifying the seed value generated from 2fa/totp/setup

", + "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": "token", + "description": "

6-digit number that matches seed value from 2fa/totp/setup

" + }, + { + "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp/enable \\\n-H 'Content-type: application/json' \\\n-d '{\n \"token\": \"123456\",\n \"ip\": \"127.0.0.1\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/2fa/totp.js", + "groupTitle": "TwoFactorAuth" + }, + { + "type": "post", + "url": "/users/:user/2fa/totp/setup", + "title": "Generate TOTP seed", + "name": "SetupTotp2FA", + "group": "TwoFactorAuth", + "description": "

This method generates TOTP seed and QR code for 2FA. User needs to verify the seed value using 2fa/totp/enable endpoint

", + "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": "label", + "description": "

Label text for QR code (defaults to username)

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

Description text for QR code (defaults to "WildDuck")

" + }, + { + "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": "seed", + "description": "

Generated TOTP seed value

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

Base64 encoded QR code

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"seed\": \"secretseed\",\n \"qrcode\": \"base64-encoded-image\"\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 does not exist\"\n \"code\": \"UserNotFound\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp/setup \\\n-H 'Content-type: application/json' \\\n-d '{\n \"label\": \"user@example.com\",\n \"issuer\": \"My Awesome Web Service\",\n \"ip\": \"127.0.0.1\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/2fa/totp.js", + "groupTitle": "TwoFactorAuth" + }, + { + "type": "delete", + "url": "/users/:id", + "title": "Delete a 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": "metaData", + "description": "

JSON formatted custom metadata object set for this user

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

List of forwarding targets

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

Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam

" + }, + { + "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 hours 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 hours 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": "Object", + "optional": false, + "field": "limits.received", + "description": "

Receiving quota

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

How many messages per 1 hour can be received

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

How many messages are received during current 1 hour period

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

Time until the end of current 1 hour period

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

IMAP upload quota

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

How many bytes per 24 hours can be uploaded via IMAP. Only message contents are counted, not protocol overhead.

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

How many bytes are uploaded during current 24 hour period

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

Time until the end of current 24 hour period

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

IMAP download quota

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

How many bytes per 24 hours can be downloaded via IMAP. Only message contents are counted, not protocol overhead.

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

How many bytes are downloaded during current 24 hour period

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

Time until the end of current 24 hour period

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

POP3 download quota

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

How many bytes per 24 hours can be downloaded via POP3. Only message contents are counted, not protocol overhead.

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

How many bytes are downloaded during current 24 hour period

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

Time until the end of current 24 hour period

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

How many parallel IMAP connections are permitted

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

How many parallel IMAP connections are currenlty in use

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

List of tags associated with the User

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

Disabled scopes for this 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 \"targets\": [\n \"my.old.address@example.com\",\n \"smtp://mx2.zone.eu:25\"\n ],\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 \"disabledScopes\": [\"pop3\"],\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/resolve/:username", + "title": "Resolve ID for an username", + "name": "GetUsername", + "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": "username", + "description": "

Username of the User. Alphanumeric value. Must start with a letter, dots are allowed but informational only ("user.name" is the same as "username")

" + } + ] + } + }, + "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)

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\"\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/resolve/testuser", + "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.targets", + "description": "

List of forwarding targets

" + }, + { + "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": "username", + "description": "

Username of the User. Dots are allowed but informational only ("user.name" is the same as "username").

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

Name of the User

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

Password for the account. Set to boolean false to disable password usage

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

If true then password is already hashed, so store as. Hash needs to be bcrypt $2a, $2y or $2b. Additionally md5-crypt hashes $1 are allowed but these are rehashed on first successful authentication

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "allowUnsafe", + "defaultValue": "true", + "description": "

If false then validates provided passwords against Have I Been Pwned API. Experimental, so validation is disabled by default but will be enabled automatically in some future version of WildDuck.

" + }, + { + "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": "Boolean", + "optional": true, + "field": "requirePasswordChange", + "description": "

If true then requires the user to change password, useful if password for the account was autogenerated

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

A list of tags associated with this user

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

If true then autogenerated address gets the same tags as the user

" + }, + { + "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": "uploadSentMessages", + "description": "

If true then all messages sent through MSA are also uploaded to the Sent Mail folder. Might cause duplicates with some email clients, so disabled by default.

" + }, + { + "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": "metaData", + "description": "

Optional metadata, must be JSON formatted object

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

Language code for the User

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

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

" + }, + { + "group": "Parameter", + "type": "Number", + "optional": true, + "field": "spamLevel", + "defaultValue": "50", + "description": "

Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam

" + }, + { + "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": "Number", + "optional": true, + "field": "imapMaxUpload", + "description": "

How many bytes can be uploaded via IMAP during 24 hour

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

How many bytes can be downloaded via IMAP during 24 hour

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

How many bytes can be downloaded via POP3 during 24 hour

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

How many parallel IMAP connections are alowed

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

How many messages can be received from MX during 60 seconds

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

Optional names for special mailboxes

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "mailboxes.sent", + "defaultValue": "Sent Mail", + "description": "

Path of Sent Mail folder

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "mailboxes.junk", + "defaultValue": "Junk", + "description": "

Path of spam folder

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "mailboxes.drafts", + "defaultValue": "Drafts", + "description": "

Path of drafts folder

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "mailboxes.trash", + "defaultValue": "Trash", + "description": "

Path of trash folder

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

List of scopes that are disabled for this user ("imap", "pop3", "smtp")

" + }, + { + "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 \"address\": \"john.doe@example.com\",\n \"tags\": [\n \"status:regular_user\",\n \"subscription:business_big\"\n ]\n}'", + "type": "curl" + }, + { + "title": "Example address:", + "content": "curl -i -XPOST http://localhost:8080/users \\\n-H 'Content-type: application/json' \\\n-d '{\n \"username\": \"john.doe@example.com\",\n \"password\": \"verysecret\",\n \"name\": \"John Doe\",\n \"tags\": [\n \"status:regular_user\",\n \"subscription:business_big\"\n ]\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 a 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.

" + } + ] + } + }, + "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": "post", + "url": "/quota/reset", + "title": "Recalculate Quota for all Users", + "name": "PostUserQuotaAll", + "group": "Users", + "description": "

This method recalculates quota usage for all Users. 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.

" + } + ] + } + }, + "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\": \"Failed to process request\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPOST http://localhost:8080/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. Set to boolean false to disable password usage

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

If true then password is already hashed, so store as. Hash needs to be bcrypt $2a, $2y or $2b. Additionally md5-crypt hashes $1 are allowed but these are rehashed on first successful authentication

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "allowUnsafe", + "defaultValue": "true", + "description": "

If false then validates provided passwords against Have I Been Pwned API. Experimental, so validation is disabled by default but will be enabled automatically in some future version of WildDuck.

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

A list of tags associated with this user

" + }, + { + "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": "uploadSentMessages", + "description": "

If true then all messages sent through MSA are also uploaded to the Sent Mail folder. Might cause duplicates with some email clients, so disabled by default.

" + }, + { + "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": "metaData", + "description": "

Optional metadata, must be JSON formatted object

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

Language code for the User

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

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

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

Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam

" + }, + { + "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": "Number", + "optional": true, + "field": "imapMaxUpload", + "description": "

How many bytes can be uploaded via IMAP during 24 hour

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

How many bytes can be downloaded via IMAP during 24 hour

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

How many bytes can be downloaded via POP3 during 24 hour

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

How many parallel IMAP connections are alowed

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

How many messages can be received from MX during 60 seconds

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

If true, then disables 2FA for this user

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

List of scopes that are disabled for this user ("imap", "pop3", "smtp")

" + }, + { + "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 a User", + "name": "ResetUserPassword", + "group": "Users", + "description": "

This method generates a new temporary password for a 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": "validAfter", + "description": "

Allow using the generated password not earlier than provided time

" + }, + { + "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 233f3623..84122c83 100644 --- a/docs/api_data.json +++ b/docs/api_data.json @@ -1 +1,13044 @@ -[ { "type": "delete", "url": "/addresses/forwarded/:address", "title": "Delete a forwarded Address", "name": "DeleteForwardedAddress", "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": "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\": \"This address does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/addresses/forwarded/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "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/resolve/:address", "title": "Get Address info", "name": "GetAddressInfo", "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": "address", "description": "

ID of the Address or e-mail address string

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

If true then resolves also wildcard addresses

" } ] } }, "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": "String", "optional": false, "field": "name", "description": "

Identity name

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

ID of the user if the address belongs to an User

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

List of forwarding targets if this is a Forwarded address

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

Account limits and usage for Forwarded address

" }, { "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": "Object", "optional": false, "field": "autoreply", "description": "

Autoreply information

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

If true, then autoreply is enabled for this address

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

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

List of tags associated with the Address

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

Datestring of the time the address was created

" } ] }, "examples": [ { "title": "User-Address:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"user\": \"59ef21aef255ed1d9d771bb\"\n \"created\": \"2017-10-24T11:19:10.911Z\"\n}", "type": "json" }, { "title": "Forwarded-Address:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"targets\": [\n \"my.other.address@example.com\"\n ],\n \"limits\": {\n \"forwards\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n }\n },\n \"autoreply\": {\n \"status\": false\n },\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 address does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/addresses/resolve/k%C3%A4ru%40j%C3%B5geva.ee", "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": "String", "optional": true, "field": "tags", "description": "

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

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

Comma separated list of tags. The Address 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": "

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.name", "description": "

Identity name

" }, { "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 if this is an User address

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

If true then it is a forwarded address

" } ] }, "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 \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"forwarded\": true\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": "/addresses/forwarded/:address", "title": "Request forwarded Addresses information", "name": "GetForwardedAddress", "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": "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": "String", "optional": false, "field": "name", "description": "

Identity name

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

List of forwarding targets

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

Account limits and usage

" }, { "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": "Object", "optional": false, "field": "autoreply", "description": "

Autoreply information

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

If true, then autoreply is enabled for this address

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

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

Datestring of the time the address was created

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

List of tags associated with the Address

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"targets\": [\n \"my.other.address@example.com\"\n ],\n \"limits\": {\n \"forwards\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n }\n },\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 address does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/addresses/forwarded/59ef21aef255ed1d9d790e81", "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": "name", "description": "

Identity name

" }, { "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.name", "description": "

Identity name

" }, { "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

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

List of tags associated with the Address

" } ] }, "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": "/addresses/forwarded", "title": "Create new forwarded Address", "name": "PostForwardedAddress", "group": "Addresses", "description": "

Add a new forwarded email address. 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": "address", "description": "

E-mail Address

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

Identity name

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

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

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

Daily allowed forwarding count for this address

" }, { "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

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

A list of tags associated with this address

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

Autoreply information

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

If true, then autoreply is enabled for this address

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

Either a date string or boolean false to disable start time checks

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

Either a date string or boolean false to disable end time checks

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

" } ] } }, "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 email address already exists\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/addresses/forwarded \\\n-H 'Content-type: application/json' \\\n-d '{\n \"address\": \"my.new.address@example.com\",\n \"targets\": [\n \"my.old.address@example.com\",\n \"smtp://mx2.zone.eu:25\"\n ],\n \"forwards\": 500\n}'", "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, *suffix@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": "String", "optional": true, "field": "name", "description": "

Identity name

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

A list of tags associated with this 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, *suffix@example.com and username@*, otherwise using * is not allowed. Static suffix can be up to 32 characters long.

" } ] } }, "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": "/addresses/forwarded/:address", "title": "Update forwarded Address information", "name": "PutForwardedAddress", "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": "id", "description": "

ID of the Address

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

New address. Only affects normal addresses, special addresses that include * can not be changed

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

Identity name

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

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to. If set then overwrites previous targets array

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

Daily allowed forwarding count for this address

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

A list of tags associated with this address

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

Autoreply information

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

If true, then autoreply is enabled for this address

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

Either a date string or boolean false to disable start time checks

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

Either a date string or boolean false to disable end time checks

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

" } ] } }, "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 address does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/addresses/forwarded/5a1d4541153888cdcd62a71b \\\n-H 'Content-type: application/json' \\\n-d '{\n \"targets\": [\n \"some.other.address@example.com\"\n ]\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/addresses.js", "groupTitle": "Addresses" }, { "type": "put", "url": "/addresses/renameDomain", "title": "Rename domain in addresses", "name": "PutRenameDomain", "group": "Addresses", "description": "

Renames domain names for addresses, DKIM keys and Domain Aliases

", "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": "oldDomain", "description": "

Old Domain Name

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

New Domain Name

" } ] } }, "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\": \"Failed to rename domain\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/addresses/renameDomain \\\n-H 'Content-type: application/json' \\\n-d '{\n \"oldDomain\": \"example.com\",\n \"newDomain\": \"blurdybloop.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": "String", "optional": false, "field": "id", "description": "

ID of the Address

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

Identity name

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

New address if you want to rename existing address. Only affects normal addresses, special addresses that include * can not be changed

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

Indicates if this is the default address for the User

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

A list of tags associated with this 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\": \"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/:asp", "title": "Request ASP information", "name": "GetASP", "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 Specific Password

" } ] } }, "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": "description", "description": "

Description

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

Allowed scopes for the Application Password

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

Information about last use

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

Datestring of last use or false if password has not been used

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

Event ID of the security log for the last authentication

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

Datestring

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1d6dd776e56b6d97e5dd48\",\n \"description\": \"Thunderbird\",\n \"scopes\": [\n \"imap\",\n \"smtp\"\n ],\n \"lastUse\": {\n \"time\": \"2018-06-21T16:51:53.807Z\",\n \"event\": \"5b2bd7a9d0ba2509deb88f40\"\n },\n \"created\": \"2017-11-28T14:08:23.520Z\"\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/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

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

If not true then skips entries with a TTL set

" } ] } }, "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": "Object", "optional": false, "field": "results.lastUse", "description": "

Information about last use

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

Datestring of last use or false if password has not been used

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

Event ID of the security log for the last authentication

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

Datestring

" } ] }, "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 \"lastUse\": {\n \"time\": \"2018-06-21T16:51:53.807Z\",\n \"event\": \"5b2bd7a9d0ba2509deb88f40\"\n },\n \"created\": \"2017-11-28T14:08:23.520Z\"\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": "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": "address", "description": "

E-mail address to be used as the account address in mobileconfig file. Must be one of the listed identity addresses of the user. Defaults to the main address of the user

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

TTL in seconds for this password. Every time password is used, TTL is reset to this value

" }, { "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/messages", "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": "Object[]", "optional": false, "field": "results.to", "description": "

Recipients in To: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Cc: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Bcc: field. Usually only available for drafts

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

Name of the recipient

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

Address of the recipient

" }, { "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/messages\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "post", "url": "/users/:user/archived/messages/:message/restore", "title": "Restore archived Message", "name": "RestoreMessage", "group": "Archive", "description": "

Restores a single 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/messages/59fc66a13e54454869460e58/restore\" \\\n-H 'Content-type: application/json' \\\n-d '{}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "post", "url": "/users/:user/archived/restore", "title": "Restore archived messages", "name": "RestoreMessages", "group": "Archive", "description": "

Initiates a restore task to move archived messages of a date range back to the mailboxes the messages were deleted from. If target mailbox does not exist, then the messages are 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": "String", "optional": false, "field": "start", "description": "

Datestring

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

Datestring

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

Indicates successful response

" } ] }, "examples": [ { "title": "Restore 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": "Restore a Message:", "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/restore\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"start\": \"2018-10-01T00:00:00.000Z\",\n \"end\": \"2018-10-08T23:59:59.999Z\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Archive" }, { "type": "delete", "url": "/authenticate", "title": "Invalidate authentication token", "name": "DeleteAuth", "group": "Authentication", "description": "

This method invalidates currently used authentication token. If token is not provided then nothing happens

", "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" } ] }, "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

" }, { "group": "Error 4xx", "optional": true, "field": "code", "description": "

Error code

" } ] } }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE \"http://localhost:8080/authenticate\" \\\n-H 'X-Access-Token: 59fc66a03e54454869460e45'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/auth.js", "groupTitle": "Authentication" }, { "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": "filterIp", "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": "get", "url": "/users/:user/authlog/:event", "title": "Request Event information", "name": "GetAuthlogEvent", "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": false, "field": "event", "description": "

ID of the Event

" } ] } }, "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 Event

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

Action identifier

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

Did the action succeed

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

Session identifier

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

IP address of the Event

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

Datestring of the Event time

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\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}", "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/59fc66a03e54454869460e4d\"", "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": "Boolean", "optional": true, "field": "token", "defaultValue": "false", "description": "

If true then generates a temporary access token that is valid for this user. Only available if scope is "master". When using user tokens then you can replace user ID in URLs with "me".

" }, { "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

" }, { "group": "Success 200", "type": "String", "optional": true, "field": "token", "description": "

If access token was requested then this is the value to use as access token when making API requests on behalf of logged in user.

" } ] }, "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

" }, { "group": "Error 4xx", "optional": true, "field": "code", "description": "

Error code

" }, { "group": "Error 4xx", "optional": true, "field": "id", "description": "

User ID if the user exists

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Authentication failed. Invalid scope\",\n \"code\": \"InvalidAuthScope\",\n \"id\": \"5b22283d45e8d47572eb0381\"\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 \"token\": \"true\"\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": "name", "description": "

Name that is used for the From: header in autoreply message

" }, { "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": "name", "description": "

Name that is used for the From: header in autoreply message

" }, { "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 or boolean false to disable start checks

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

Datestring of the end of the autoreply or boolean false to disable end checks

" } ] } }, "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": "/dkim/:dkim", "title": "Delete a DKIM key", "name": "DeleteDkim", "group": "DKIM", "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": "dkim", "description": "

ID of the DKIM

" } ] } }, "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/dkim/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/dkim.js", "groupTitle": "DKIM" }, { "type": "get", "url": "/dkim", "title": "List registered DKIM keys", "name": "GetDkim", "group": "DKIM", "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 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 DKIM

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

The domain this DKIM key applies to

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

DKIM selector

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

Key description

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

Key fingerprint (SHA1)

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

Datestring

" } ] }, "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 \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"fingerprint\": \"6a:aa:d7:ba:e4:99:b4:12:e0:f3:35:01:71:d4:f1:d6:b4:95:c4:f5\",\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\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/dkim", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/dkim.js", "groupTitle": "DKIM" }, { "type": "get", "url": "/dkim/:dkim", "title": "Request DKIM information", "name": "GetDkimKey", "group": "DKIM", "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": "dkim", "description": "

ID of the DKIM

" } ] } }, "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 DKIM

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

The domain this DKIM key applies to

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

DKIM selector

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

Key description

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

Key fingerprint (SHA1)

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

Public key in DNS format (no prefix/suffix, single line)

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

Value for DNS TXT entry

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

Is the domain name of TXT

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

Is the value of TXT

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

Datestring

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e7a\",\n \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"fingerprint\": \"6a:aa:d7:ba:e4:99:b4:12:e0:f3:35:01:71:d4:f1:d6:b4:95:c4:f5\",\n \"publicKey\": \"-----BEGIN PUBLIC KEY-----\\r\\nMIGfMA0...\",\n \"dnsTxt\": {\n \"name\": \"dec20._domainkey.example.com\",\n \"value\": \"v=DKIM1;t=s;p=MIGfMA0...\"\n }\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/dkim/59ef21aef255ed1d9d790e7a", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/dkim.js", "groupTitle": "DKIM" }, { "type": "post", "url": "/dkim", "title": "Create or update DKIM key for domain", "name": "PostDkim", "group": "DKIM", "description": "

Add a new DKIM key for a Domain or update existing one. There can be single DKIM key registered for each domain name.

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

Domain name this DKIM key applies to. Use "*" as a special value that will be used for domains that do not have their own DKIM key set

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

Selector for the key

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

Key description

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

Pem formatted DKIM private key. If not set then a new 2048 bit RSA key is generated, beware though that it can take several seconds to complete.

" } ] } }, "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 DKIM

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

The domain this DKIM key applies to

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

DKIM selector

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

Key description

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

Key fingerprint (SHA1)

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

Public key in DNS format (no prefix/suffix, single line)

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

Value for DNS TXT entry

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

Is the domain name of TXT

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

Is the value of TXT

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"fingerprint\": \"6a:aa:d7:ba:e4:99:b4:12:e0:f3:35:01:71:d4:f1:d6:b4:95:c4:f5\",\n \"publicKey\": \"-----BEGIN PUBLIC KEY-----\\r\\nMIGfMA0...\",\n \"dnsTxt\": {\n \"name\": \"dec20._domainkey.example.com\",\n \"value\": \"v=DKIM1;t=s;p=MIGfMA0...\"\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 -XPOST http://localhost:8080/dkim \\\n-H 'Content-type: application/json' \\\n-d '{\n \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"privateKey\": \"-----BEGIN RSA PRIVATE KEY-----\\r\\n...\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/dkim.js", "groupTitle": "DKIM" }, { "type": "get", "url": "/dkim/resolve/:domain", "title": "Resolve ID for a DKIM domain", "name": "ResolveDKIM", "group": "DKIM", "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": "domain", "description": "

DKIM domain

" } ] } }, "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": "

DKIM unique ID (24 byte hex)

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\"\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 domain does not exist\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/dkim/resolve/example.com", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/dkim.js", "groupTitle": "DKIM" }, { "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": "/domainaliases", "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", "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": "get", "url": "/domainaliases/resolve/:alias", "title": "Resolve ID for a domain aias", "name": "ResolveDomainAlias", "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": "

Alias domain

" } ] } }, "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": "

Alias unique ID (24 byte hex)

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\"\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/resolve/example.com", "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": "Object", "optional": false, "field": "query", "description": "

Rules that a message must match

" }, { "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.listId", "description": "

Partial match for the List-ID: header (case insensitive)

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

Fulltext search against message text

" }, { "group": "Success 200", "type": "Boolean", "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": "Object", "optional": false, "field": "action", "description": "

Action to take with a matching message

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

If true then mark matching messages as Seen

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "action.flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Success 200", "type": "Boolean", "optional": false, "field": "action.delete", "description": "

If true then do not store matching messages

" }, { "group": "Success 200", "type": "Boolean", "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.targets", "description": "

A list of email addresses / HTTP URLs to forward the message to

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

If true, then this filter is ignored

" } ] }, "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\": {\n \"from\": \"Mäger\"\n },\n \"action\": {\n \"seen\": true\n },\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 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

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

If true, then this filter is ignored

" } ] }, "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 \"disabled\": false,\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": "Object", "optional": false, "field": "query", "description": "

Rules that a message must match

" }, { "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.listId", "description": "

Partial match for the List-ID: header (case insensitive)

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

Fulltext search against message text

" }, { "group": "Parameter", "type": "Boolean", "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": "Object", "optional": false, "field": "action", "description": "

Action to take with a matching message

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "action.seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "action.flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "action.delete", "description": "

If true then do not store matching messages

" }, { "group": "Parameter", "type": "Boolean", "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.targets", "description": "

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

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

If true then this filter is ignored

" } ] } }, "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\": {\n \"from\": \"Mäger\"\n },\n \"action\": {\n \"seen\": true\n }\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": "Object", "optional": false, "field": "query", "description": "

Rules that a message must match

" }, { "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.listId", "description": "

Partial match for the List-ID: header (case insensitive)

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

Fulltext search against message text

" }, { "group": "Parameter", "type": "Boolean", "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": "Object", "optional": false, "field": "action", "description": "

Action to take with a matching message

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "action.seen", "description": "

If true then mark matching messages as Seen

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "action.flag", "description": "

If true then mark matching messages as Flagged

" }, { "group": "Parameter", "type": "Boolean", "optional": true, "field": "action.delete", "description": "

If true then do not store matching messages

" }, { "group": "Parameter", "type": "Boolean", "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.targets", "description": "

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

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

If true then this filter is ignored

" } ] } }, "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\": {\n \"seen\": \"\",\n \"flag\": true\n }\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": "specialUse", "defaultValue": "false", "description": "

Should the response include only folders with specialUse flag set.

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

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

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

Should the response include mailbox size in bytes. Size numbers come with a lot of overhead as an aggregated query is ran.

" } ] } }, "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\": \"Database error\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes?counters=true", "type": "curl" }, { "title": "Special Use Only", "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes?specialUse=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 Mailbox. Changing 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": "delete", "url": "/users/:user/mailboxes/:mailbox/messages", "title": "Delete all Messages from a Mailbox", "name": "DeleteMessages", "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

" } ] } }, "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": "deleted", "description": "

Indicates count of deleted messages

" } ] }, "examples": [ { "title": "Delete Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"deleted\": 51\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 all Messages:", "content": "curl -i -XDELETE \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages\"", "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": "ForwardStoredMessage", "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": "Forward 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": "envelope", "description": "

SMTP envelope (if available)

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

Address from MAIL FROM

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

Array of addresses from RCPT TO (should have just one normally)

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

RCPT TO address as provided by SMTP client

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "envelope.rcpt.formatted", "description": "

Normalized RCPT address

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

ID of the Thread

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

From: header info

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

Name of the sender

" }, { "group": "Success 200", "type": "String", "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": "String", "optional": false, "field": "to.name", "description": "

Name of the recipient

" }, { "group": "Success 200", "type": "String", "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": "String", "optional": false, "field": "cc.name", "description": "

Name of the recipient

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

Address of the recipient

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

Recipients in Bcc: field. Usually only available for drafts

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

Name of the recipient

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "bcc.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": true, "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": true, "field": "verificationResults", "description": "

Security verification info if message was received from MX. If this property is missing then do not automatically assume invalid TLS, SPF or DKIM.

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "verificationResults.tls", "description": "

TLS information. Value is false if TLS was not used

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

Cipher name, eg "ECDHE-RSA-AES128-GCM-SHA256"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "verificationResults.tls.version", "description": "

TLS version, eg "TLSv1/SSLv3"

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "verificationResults.spf", "description": "

Domain name (either MFROM or HELO) of verified SPF or false if no SPF match was found

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "verificationResults.dkim", "description": "

Domain name of verified DKIM signature or false if no valid signature was found

" }, { "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

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

JSON formatted custom metadata object set for this message

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

Referenced message info

" }, { "group": "Success 200", "type": "Object[]", "optional": true, "field": "files", "description": "

List of files added to this message as attachments. Applies to Drafts, normal messages do not have this property. Needed to prevent uploading the same attachment every time a draft is updated

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

File ID

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

Filename of the attached file

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

MIME type

" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "files.size", "description": "

MIME type

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\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 \"metaData\": \"{}\"\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/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": "unseen", "defaultValue": "false", "description": "

If true, then returns only unseen messages

" }, { "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": "Object[]", "optional": false, "field": "results.to", "description": "

Recipients in To: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Cc: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Bcc: field. Usually only available for drafts

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

Name of the recipient

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

Address of the recipient

" }, { "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": "Boolean", "optional": false, "field": "results.answered", "description": "

Does this message have a \\Answered flag

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

Does this message have a $Forwarded 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 \"answered\": false,\n \"forwarded\": 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": "thread", "description": "

Thread ID

" }, { "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": "Boolean", "optional": true, "field": "unseen", "description": "

If true, then matches only messages without \\Seen flags

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

If true, then matches messages not in Junk or Trash

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

Allows to specify some requests as OR (default is AND). At least one of the values in or block must match

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "or.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": "or.from", "description": "

Partial match for the From: header line

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

Partial match for the To: and Cc: header lines

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

Partial match for the Subject: header line

" }, { "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": "Object[]", "optional": false, "field": "results.to", "description": "

Recipients in To: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Cc: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Bcc: field. Usually only available for drafts

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

Name of the recipient

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

Address of the recipient

" }, { "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" }, { "title": "Using OR:", "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/search?or.from=Ryan&or.to=Ryan\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "put", "url": "/users/:user/mailboxes/:mailbox/messages", "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

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

Optional metadata, must be JSON formatted object

" } ] } }, "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\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"message\": \"1,2,3\",\n \"seen\": false\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "post", "url": "/users/:user/mailboxes/:mailbox/messages/:message/submit", "title": "Submit Draft for delivery", "name": "SubmitStoredMessage", "group": "Messages", "description": "

This method allows to submit a draft message for delivery. Draft is moved to Sent mail folder.

", "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": "Boolean", "optional": false, "field": "deleteFiles", "description": "

If true then deletes attachment files listed in metaData.files array

" } ] } }, "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": true, "field": "message", "description": "

Information about submitted Message

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

Mailbox ID the draft was moved to (usually Sent mail)

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

Message ID in Mailbox

" } ] }, "examples": [ { "title": "Submit Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"queueId\": \"1682f5a712f000dfb6\",\n \"message\": {\n \"id\": 3,\n \"mailbox\": \"5c279b4e17abae166446f968\"\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": "Submit a Message:", "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/1/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"deleteFiles\": true\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "post", "url": "/users/:user/mailboxes/:mailbox/messages", "title": "Upload Message", "name": "UploadMessage", "group": "Messages", "description": "

This method allows to upload either an RFC822 formatted message or a message structure to a mailbox. Raw message is stored unmodified, no headers are added or removed. If you want to generate the uploaded message from strucutred data fields, then do not use the raw property.

", "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": "Boolean", "optional": true, "field": "unseen", "defaultValue": "false", "description": "

Is the message unseen or not

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

Is the message a draft or not

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

Is the message flagged or not

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

base64 encoded message source. Alternatively, you can provide this value as POST body by using message/rfc822 MIME type. If raw message is provided then it overrides any other mail configuration

" }, { "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": true, "field": "subject", "description": "

Message subject. If not then resolved from Reference message

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

Plaintext message

" }, { "group": "Parameter", "type": "String", "optional": true, "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 automaticall y

" }, { "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": "String[]", "optional": true, "field": "files", "description": "

Attachments as storage file IDs. NB! When retrieving message info then an array of objects is returned. When uploading a message then an array of IDs is used.

" }, { "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": "metaData", "description": "

Optional metadata, must be JSON formatted object

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

Optional referenced email. If uploaded message is a reply draft 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": false, "field": "reference.attachments", "defaultValue": "false", "description": "

If true, then includes all attachments from the original message. If it is an array of attachment ID's includes attachments from the list

" }, { "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": "

Message information

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

Message ID in mailbox

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

Mailbox ID the message was stored into

" } ] }, "examples": [ { "title": "Forward Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"message\": {\n \"id\": 2,\n \"mailbox\": \"5a2f9ca57308fc3a6f5f811e\"\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": "Upload a Message:", "content": "curl -i -XPOST \"http://localhost:8080/users/5a2f9ca57308fc3a6f5f811d/mailboxes/5a2f9ca57308fc3a6f5f811e/messages\" \\\n-H 'Content-type: message/rfc822' \\\n-d 'From: sender@example.com\nTo: recipient@example.com\nSubject: hello world!\n\nExample message'", "type": "curl" }, { "title": "Upload a Message Structure:", "content": "curl -i -XPOST \"http://localhost:8080/users/5a2f9ca57308fc3a6f5f811d/mailboxes/5a2f9ca57308fc3a6f5f811e/messages\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"from\": {\n \"name\": \"sender name\",\n \"address\": \"sender@example.com\"\n },\n \"to\": [{\n \"address\": \"andris@ethereal.email\"\n }],\n \"subject\": \"Hello world!\",\n \"text\": \"Test message\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/messages.js", "groupTitle": "Messages" }, { "type": "delete", "url": "/users/:user/storage/:file", "title": "Delete a File", "name": "DeleteStorage", "group": "Storage", "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 File

" } ] } }, "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/storage/59ef21aef255ed1d9d790e81", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/storage.js", "groupTitle": "Storage" }, { "type": "get", "url": "/users/:user/storage", "title": "List stored files", "name": "GetStorage", "group": "Storage", "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": "query", "description": "

Partial match of a filename

" }, { "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": "

File listing

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

ID of the File

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

Filename

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

Content-Type of the file

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

File size

" } ] }, "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 \"filename\": \"hello.txt\",\n \"size\": 1024\n },\n {\n \"id\": \"59ef21aef255ed1d9d790e82\",\n \"filename\": \"finances.xls\",\n \"size\": 2084\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/storage", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/storage.js", "groupTitle": "Storage" }, { "type": "get", "url": "/users/:user/storage/:file", "title": "Download File", "name": "GetStorageFile", "group": "Storage", "description": "

This method returns stored 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": "file", "description": "

ID of the File

" } ] } }, "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/storage/59fc66a13e54454869460e57\"", "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/storage.js", "groupTitle": "Storage" }, { "type": "post", "url": "/users/:user/storage", "title": "Upload File", "name": "UploadStorage", "group": "Storage", "description": "

This method allows to upload an attachment to be linked from a draft

", "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": "Binary", "optional": false, "field": "content", "description": "

Request body is the file itself. Make sure to use 'application/binary' as content-type for the request, otherwise the server might try to process the input

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

Filename

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

MIME type for the file

" }, { "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": "id", "description": "

File ID

" } ] }, "examples": [ { "title": "Forward Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a2f9ca57308fc3a6f5f811e\"\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": "Upload a file from disk:", "content": "curl -i -XPOST \"http://localhost:8080/users/5c404c9ec1933085b59e7574/storage?filename=00-example.duck.png\" \\\n-H 'Content-type: application/binary' \\\n--data-binary \"@emails/00-example.duck.png\"", "type": "curl" }, { "title": "Upload a string:", "content": "curl -i -XPOST \"http://localhost:8080/users/5c404c9ec1933085b59e7574/storage?filename=hello.txt\" \\\n-H 'Content-type: application/binary' \\\n-d \"Hello world!\"", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/storage.js", "groupTitle": "Storage" }, { "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": "mailbox", "description": "

Mailbox ID where to upload the message. If not set then message is uploaded to Sent Mail folder.

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

If true then generated message is not added to the sending queue

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

If true then treats this message as draft (should be used with uploadOnly=true)

" }, { "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": "Object", "optional": true, "field": "meta", "description": "

Custom metainfo for the 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" }, { "title": "Upload only", "content": "# Recipients and subject line are derived from referenced message\ncurl -i -XPOST \"http://localhost:8080/users/5a2fe496ce76ede84f177ec3/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"reference\": {\n \"mailbox\": \"5a2fe496ce76ede84f177ec4\",\n \"id\": 1,\n \"action\": \"replyAll\"\n },\n \"uploadOnly\": true,\n \"mailbox\": \"5a33b45acf482d3219955bc4\",\n \"text\": \"Yeah, sure\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/submit.js", "groupTitle": "Submission" }, { "type": "post", "url": "/users/:user/2fa/totp/check", "title": "Validate TOTP Token", "name": "CheckTotp2FA", "group": "TwoFactorAuth", "description": "

This method checks if a TOTP token provided by an User is valid for 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": false, "field": "token", "description": "

6-digit number

" }, { "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\": \"Failed to validate TOTP\"\n \"code\": \"InvalidToken\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp/check \\\n-H 'Content-type: application/json' \\\n-d '{\n \"token\": \"123456\",\n \"ip\": \"127.0.0.1\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/2fa/totp.js", "groupTitle": "TwoFactorAuth" }, { "type": "delete", "url": "/users/:user/2fa", "title": "Disable 2FA", "name": "Disable2FA", "group": "TwoFactorAuth", "description": "

This method disables all 2FA mechanisms an user might have set up

", "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/2fa", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/2fa/totp.js", "groupTitle": "TwoFactorAuth" }, { "type": "delete", "url": "/users/:user/2fa/custom", "title": "Disable custom 2FA for an user", "name": "DisableCustom2FA", "group": "TwoFactorAuth", "description": "

This method disables custom 2FA. If it was the only 2FA set up, then account password for IMAP/POP3/SMTP gets enabled again

", "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/2fa/custom \\\n-H 'Content-type: application/json' \\\n-d '{\n \"ip\": \"127.0.0.1\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/2fa/custom.js", "groupTitle": "TwoFactorAuth" }, { "type": "delete", "url": "/users/:user/2fa/totp", "title": "Disable TOTP auth", "name": "DisableTotp2FA", "group": "TwoFactorAuth", "description": "

This method disables TOTP for an user. Does not affect other 2FA mechanisms an user might have set up

", "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/2fa/totp.js", "groupTitle": "TwoFactorAuth" }, { "type": "put", "url": "/users/:user/2fa/custom", "title": "Enable custom 2FA for an user", "name": "EnableCustom2FA", "group": "TwoFactorAuth", "description": "

This method disables account password for IMAP/POP3/SMTP

", "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/2fa/custom \\\n-H 'Content-type: application/json' \\\n-d '{\n \"ip\": \"127.0.0.1\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/2fa/custom.js", "groupTitle": "TwoFactorAuth" }, { "type": "post", "url": "/users/:user/2fa/totp/enable", "title": "Enable TOTP seed", "name": "EnableTotp2FA", "group": "TwoFactorAuth", "description": "

This method enables TOTP for an user by verifying the seed value generated from 2fa/totp/setup

", "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": "token", "description": "

6-digit number that matches seed value from 2fa/totp/setup

" }, { "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp/enable \\\n-H 'Content-type: application/json' \\\n-d '{\n \"token\": \"123456\",\n \"ip\": \"127.0.0.1\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/2fa/totp.js", "groupTitle": "TwoFactorAuth" }, { "type": "post", "url": "/users/:user/2fa/totp/setup", "title": "Generate TOTP seed", "name": "SetupTotp2FA", "group": "TwoFactorAuth", "description": "

This method generates TOTP seed and QR code for 2FA. User needs to verify the seed value using 2fa/totp/enable endpoint

", "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": "label", "description": "

Label text for QR code (defaults to username)

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

Description text for QR code (defaults to "WildDuck")

" }, { "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": "seed", "description": "

Generated TOTP seed value

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

Base64 encoded QR code

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"seed\": \"secretseed\",\n \"qrcode\": \"base64-encoded-image\"\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 does not exist\"\n \"code\": \"UserNotFound\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp/setup \\\n-H 'Content-type: application/json' \\\n-d '{\n \"label\": \"user@example.com\",\n \"issuer\": \"My Awesome Web Service\",\n \"ip\": \"127.0.0.1\"\n}'", "type": "curl" } ], "version": "0.0.0", "filename": "lib/api/2fa/totp.js", "groupTitle": "TwoFactorAuth" }, { "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": "metaData", "description": "

JSON formatted custom metadata object set for this user

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

List of forwarding targets

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

Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam

" }, { "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 hours 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 hours 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": "Object", "optional": false, "field": "limits.received", "description": "

Receiving quota

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

How many messages per 1 hour can be received

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

How many messages are received during current 1 hour period

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

Time until the end of current 1 hour period

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

IMAP upload quota

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

How many bytes per 24 hours can be uploaded via IMAP. Only message contents are counted, not protocol overhead.

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

How many bytes are uploaded during current 24 hour period

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

Time until the end of current 24 hour period

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

IMAP download quota

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

How many bytes per 24 hours can be downloaded via IMAP. Only message contents are counted, not protocol overhead.

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

How many bytes are downloaded during current 24 hour period

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

Time until the end of current 24 hour period

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

POP3 download quota

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

How many bytes per 24 hours can be downloaded via POP3. Only message contents are counted, not protocol overhead.

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

How many bytes are downloaded during current 24 hour period

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

Time until the end of current 24 hour period

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

How many parallel IMAP connections are permitted

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

How many parallel IMAP connections are currenlty in use

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

List of tags associated with the User

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

Disabled scopes for this 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 \"targets\": [\n \"my.old.address@example.com\",\n \"smtp://mx2.zone.eu:25\"\n ],\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 \"disabledScopes\": [\"pop3\"],\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/resolve/:username", "title": "Resolve ID for an username", "name": "GetUsername", "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": "username", "description": "

Username of the User. Alphanumeric value. Must start with a letter, dots are allowed but informational only ("user.name" is the same as "username")

" } ] } }, "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)

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\"\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/resolve/testuser", "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.targets", "description": "

List of forwarding targets

" }, { "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": "username", "description": "

Username of the User. Dots are allowed but informational only ("user.name" is the same as "username").

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

Name of the User

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

Password for the account. Set to boolean false to disable password usage

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

If true then password is already hashed, so store as. Hash needs to be bcrypt $2a, $2y or $2b. Additionally md5-crypt hashes $1 are allowed but these are rehashed on first successful authentication

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

If false then validates provided passwords against Have I Been Pwned API. Experimental, so validation is disabled by default but will be enabled automatically in some future version of WildDuck.

" }, { "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": "Boolean", "optional": true, "field": "requirePasswordChange", "description": "

If true then requires the user to change password, useful if password for the account was autogenerated

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

A list of tags associated with this user

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

If true then autogenerated address gets the same tags as the user

" }, { "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": "uploadSentMessages", "description": "

If true then all messages sent through MSA are also uploaded to the Sent Mail folder. Might cause duplicates with some email clients, so disabled by default.

" }, { "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": "metaData", "description": "

Optional metadata, must be JSON formatted object

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

Language code for the User

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

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

" }, { "group": "Parameter", "type": "Number", "optional": true, "field": "spamLevel", "defaultValue": "50", "description": "

Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam

" }, { "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": "Number", "optional": true, "field": "imapMaxUpload", "description": "

How many bytes can be uploaded via IMAP during 24 hour

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

How many bytes can be downloaded via IMAP during 24 hour

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

How many bytes can be downloaded via POP3 during 24 hour

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

How many parallel IMAP connections are alowed

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

How many messages can be received from MX during 60 seconds

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

Optional names for special mailboxes

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailboxes.sent", "defaultValue": "Sent Mail", "description": "

Path of Sent Mail folder

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailboxes.junk", "defaultValue": "Junk", "description": "

Path of spam folder

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailboxes.drafts", "defaultValue": "Drafts", "description": "

Path of drafts folder

" }, { "group": "Parameter", "type": "String", "optional": true, "field": "mailboxes.trash", "defaultValue": "Trash", "description": "

Path of trash folder

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

List of scopes that are disabled for this user ("imap", "pop3", "smtp")

" }, { "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 \"address\": \"john.doe@example.com\",\n \"tags\": [\n \"status:regular_user\",\n \"subscription:business_big\"\n ]\n}'", "type": "curl" }, { "title": "Example address:", "content": "curl -i -XPOST http://localhost:8080/users \\\n-H 'Content-type: application/json' \\\n-d '{\n \"username\": \"john.doe@example.com\",\n \"password\": \"verysecret\",\n \"name\": \"John Doe\",\n \"tags\": [\n \"status:regular_user\",\n \"subscription:business_big\"\n ]\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.

" } ] } }, "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": "post", "url": "/quota/reset", "title": "Recalculate Quota for all Users", "name": "PostUserQuotaAll", "group": "Users", "description": "

This method recalculates quota usage for all Users. 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.

" } ] } }, "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\": \"Failed to process request\"\n}", "type": "json" } ] }, "examples": [ { "title": "Example usage:", "content": "curl -i -XPOST http://localhost:8080/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. Set to boolean false to disable password usage

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

If true then password is already hashed, so store as. Hash needs to be bcrypt $2a, $2y or $2b. Additionally md5-crypt hashes $1 are allowed but these are rehashed on first successful authentication

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

If false then validates provided passwords against Have I Been Pwned API. Experimental, so validation is disabled by default but will be enabled automatically in some future version of WildDuck.

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

A list of tags associated with this user

" }, { "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": "uploadSentMessages", "description": "

If true then all messages sent through MSA are also uploaded to the Sent Mail folder. Might cause duplicates with some email clients, so disabled by default.

" }, { "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": "metaData", "description": "

Optional metadata, must be JSON formatted object

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

Language code for the User

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

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

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

Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam

" }, { "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": "Number", "optional": true, "field": "imapMaxUpload", "description": "

How many bytes can be uploaded via IMAP during 24 hour

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

How many bytes can be downloaded via IMAP during 24 hour

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

How many bytes can be downloaded via POP3 during 24 hour

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

How many parallel IMAP connections are alowed

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

How many messages can be received from MX during 60 seconds

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

If true, then disables 2FA for this user

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

List of scopes that are disabled for this user ("imap", "pop3", "smtp")

" }, { "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": "validAfter", "description": "

Allow using the generated password not earlier than provided time

" }, { "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": "/addresses/forwarded/:address", + "title": "Delete a forwarded Address", + "name": "DeleteForwardedAddress", + "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": "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\": \"This address does not exist\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XDELETE http://localhost:8080/addresses/forwarded/59ef21aef255ed1d9d790e81", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/addresses.js", + "groupTitle": "Addresses" + }, + { + "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/resolve/:address", + "title": "Get Address info", + "name": "GetAddressInfo", + "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": "address", + "description": "

ID of the Address or e-mail address string

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

If true then resolves also wildcard addresses

" + } + ] + } + }, + "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": "String", + "optional": false, + "field": "name", + "description": "

Identity name

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

ID of the user if the address belongs to a User

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

List of forwarding targets if this is a Forwarded address

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

Account limits and usage for Forwarded address

" + }, + { + "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": "Object", + "optional": false, + "field": "autoreply", + "description": "

Autoreply information

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

If true, then autoreply is enabled for this address

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

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

List of tags associated with the Address

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

Datestring of the time the address was created

" + } + ] + }, + "examples": [ + { + "title": "User-Address:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"user\": \"59ef21aef255ed1d9d771bb\"\n \"created\": \"2017-10-24T11:19:10.911Z\"\n}", + "type": "json" + }, + { + "title": "Forwarded-Address:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"targets\": [\n \"my.other.address@example.com\"\n ],\n \"limits\": {\n \"forwards\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n }\n },\n \"autoreply\": {\n \"status\": false\n },\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 address does not exist\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i http://localhost:8080/addresses/resolve/k%C3%A4ru%40j%C3%B5geva.ee", + "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": "String", + "optional": true, + "field": "tags", + "description": "

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

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

Comma separated list of tags. The Address 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": "

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.name", + "description": "

Identity name

" + }, + { + "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 if this is a User address

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

If true then it is a forwarded address

" + } + ] + }, + "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 \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"forwarded\": true\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": "/addresses/forwarded/:address", + "title": "Request forwarded Addresses information", + "name": "GetForwardedAddress", + "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": "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": "String", + "optional": false, + "field": "name", + "description": "

Identity name

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

List of forwarding targets

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

Account limits and usage

" + }, + { + "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": "Object", + "optional": false, + "field": "autoreply", + "description": "

Autoreply information

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

If true, then autoreply is enabled for this address

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

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

Datestring of the time the address was created

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

List of tags associated with the Address

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"address\": \"user@example.com\",\n \"targets\": [\n \"my.other.address@example.com\"\n ],\n \"limits\": {\n \"forwards\": {\n \"allowed\": 2000,\n \"used\": 0,\n \"ttl\": false\n }\n },\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 address does not exist\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i http://localhost:8080/addresses/forwarded/59ef21aef255ed1d9d790e81", + "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": "name", + "description": "

Identity name

" + }, + { + "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 a 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.name", + "description": "

Identity name

" + }, + { + "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

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

List of tags associated with the Address

" + } + ] + }, + "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": "/addresses/forwarded", + "title": "Create new forwarded Address", + "name": "PostForwardedAddress", + "group": "Addresses", + "description": "

Add a new forwarded email address. 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": "address", + "description": "

E-mail Address

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

Identity name

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

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

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

Daily allowed forwarding count for this address

" + }, + { + "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

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

A list of tags associated with this address

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

Autoreply information

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

If true, then autoreply is enabled for this address

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

Either a date string or boolean false to disable start time checks

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

Either a date string or boolean false to disable end time checks

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

" + } + ] + } + }, + "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 email address already exists\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPOST http://localhost:8080/addresses/forwarded \\\n-H 'Content-type: application/json' \\\n-d '{\n \"address\": \"my.new.address@example.com\",\n \"targets\": [\n \"my.old.address@example.com\",\n \"smtp://mx2.zone.eu:25\"\n ],\n \"forwards\": 500\n}'", + "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 a 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, *suffix@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": "String", + "optional": true, + "field": "name", + "description": "

Identity name

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

A list of tags associated with this 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, *suffix@example.com and username@*, otherwise using * is not allowed. Static suffix can be up to 32 characters long.

" + } + ] + } + }, + "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": "/addresses/forwarded/:address", + "title": "Update forwarded Address information", + "name": "PutForwardedAddress", + "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": "id", + "description": "

ID of the Address

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

New address. Only affects normal addresses, special addresses that include * can not be changed

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

Identity name

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

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to. If set then overwrites previous targets array

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

Daily allowed forwarding count for this address

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

A list of tags associated with this address

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

Autoreply information

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

If true, then autoreply is enabled for this address

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

Either a date string or boolean false to disable start time checks

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

Either a date string or boolean false to disable end time checks

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

Name that is used for the From: header in autoreply message

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

Autoreply subject line

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

Autoreply plaintext content

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

Autoreply HTML content

" + } + ] + } + }, + "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 address does not exist\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPUT http://localhost:8080/addresses/forwarded/5a1d4541153888cdcd62a71b \\\n-H 'Content-type: application/json' \\\n-d '{\n \"targets\": [\n \"some.other.address@example.com\"\n ]\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/addresses.js", + "groupTitle": "Addresses" + }, + { + "type": "put", + "url": "/addresses/renameDomain", + "title": "Rename domain in addresses", + "name": "PutRenameDomain", + "group": "Addresses", + "description": "

Renames domain names for addresses, DKIM keys and Domain Aliases

", + "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": "oldDomain", + "description": "

Old Domain Name

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

New Domain Name

" + } + ] + } + }, + "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\": \"Failed to rename domain\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPUT http://localhost:8080/addresses/renameDomain \\\n-H 'Content-type: application/json' \\\n-d '{\n \"oldDomain\": \"example.com\",\n \"newDomain\": \"blurdybloop.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": "String", + "optional": false, + "field": "id", + "description": "

ID of the Address

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

Identity name

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

New address if you want to rename existing address. Only affects normal addresses, special addresses that include * can not be changed

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

Indicates if this is the default address for the User

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

A list of tags associated with this 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\": \"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/:asp", + "title": "Request ASP information", + "name": "GetASP", + "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 Specific Password

" + } + ] + } + }, + "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": "description", + "description": "

Description

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

Allowed scopes for the Application Password

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

Information about last use

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "lastUse.time", + "description": "

Datestring of last use or false if password has not been used

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "lastUse.event", + "description": "

Event ID of the security log for the last authentication

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

Datestring

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a1d6dd776e56b6d97e5dd48\",\n \"description\": \"Thunderbird\",\n \"scopes\": [\n \"imap\",\n \"smtp\"\n ],\n \"lastUse\": {\n \"time\": \"2018-06-21T16:51:53.807Z\",\n \"event\": \"5b2bd7a9d0ba2509deb88f40\"\n },\n \"created\": \"2017-11-28T14:08:23.520Z\"\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/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

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

If not true then skips entries with a TTL set

" + } + ] + } + }, + "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": "Object", + "optional": false, + "field": "results.lastUse", + "description": "

Information about last use

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

Datestring of last use or false if password has not been used

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

Event ID of the security log for the last authentication

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

Datestring

" + } + ] + }, + "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 \"lastUse\": {\n \"time\": \"2018-06-21T16:51:53.807Z\",\n \"event\": \"5b2bd7a9d0ba2509deb88f40\"\n },\n \"created\": \"2017-11-28T14:08:23.520Z\"\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": "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": "address", + "description": "

E-mail address to be used as the account address in mobileconfig file. Must be one of the listed identity addresses of the user. Defaults to the main address of the user

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

TTL in seconds for this password. Every time password is used, TTL is reset to this value

" + }, + { + "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/messages", + "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": "Object[]", + "optional": false, + "field": "results.to", + "description": "

Recipients in To: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Cc: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Bcc: field. Usually only available for drafts

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

Name of the recipient

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

Address of the recipient

" + }, + { + "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/messages\"", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/messages.js", + "groupTitle": "Archive" + }, + { + "type": "post", + "url": "/users/:user/archived/messages/:message/restore", + "title": "Restore archived Message", + "name": "RestoreMessage", + "group": "Archive", + "description": "

Restores a single 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/messages/59fc66a13e54454869460e58/restore\" \\\n-H 'Content-type: application/json' \\\n-d '{}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/messages.js", + "groupTitle": "Archive" + }, + { + "type": "post", + "url": "/users/:user/archived/restore", + "title": "Restore archived messages", + "name": "RestoreMessages", + "group": "Archive", + "description": "

Initiates a restore task to move archived messages of a date range back to the mailboxes the messages were deleted from. If target mailbox does not exist, then the messages are 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": "String", + "optional": false, + "field": "start", + "description": "

Datestring

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

Datestring

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

Indicates successful response

" + } + ] + }, + "examples": [ + { + "title": "Restore 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": "Restore a Message:", + "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/archived/restore\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"start\": \"2018-10-01T00:00:00.000Z\",\n \"end\": \"2018-10-08T23:59:59.999Z\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/messages.js", + "groupTitle": "Archive" + }, + { + "type": "delete", + "url": "/authenticate", + "title": "Invalidate authentication token", + "name": "DeleteAuth", + "group": "Authentication", + "description": "

This method invalidates currently used authentication token. If token is not provided then nothing happens

", + "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" + } + ] + }, + "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

" + }, + { + "group": "Error 4xx", + "optional": true, + "field": "code", + "description": "

Error code

" + } + ] + } + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XDELETE \"http://localhost:8080/authenticate\" \\\n-H 'X-Access-Token: 59fc66a03e54454869460e45'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/auth.js", + "groupTitle": "Authentication" + }, + { + "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": "filterIp", + "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": "get", + "url": "/users/:user/authlog/:event", + "title": "Request Event information", + "name": "GetAuthlogEvent", + "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": false, + "field": "event", + "description": "

ID of the Event

" + } + ] + } + }, + "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 Event

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

Action identifier

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

Did the action succeed

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

Session identifier

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

IP address of the Event

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

Datestring of the Event time

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\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}", + "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/59fc66a03e54454869460e4d\"", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/auth.js", + "groupTitle": "Authentication" + }, + { + "type": "post", + "url": "/authenticate", + "title": "Authenticate a 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": "Boolean", + "optional": true, + "field": "token", + "defaultValue": "false", + "description": "

If true then generates a temporary access token that is valid for this user. Only available if scope is "master". When using user tokens then you can replace user ID in URLs with "me".

" + }, + { + "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

" + }, + { + "group": "Success 200", + "type": "String", + "optional": true, + "field": "token", + "description": "

If access token was requested then this is the value to use as access token when making API requests on behalf of logged in user.

" + } + ] + }, + "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

" + }, + { + "group": "Error 4xx", + "optional": true, + "field": "code", + "description": "

Error code

" + }, + { + "group": "Error 4xx", + "optional": true, + "field": "id", + "description": "

User ID if the user exists

" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"error\": \"Authentication failed. Invalid scope\",\n \"code\": \"InvalidAuthScope\",\n \"id\": \"5b22283d45e8d47572eb0381\"\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 \"token\": \"true\"\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": "name", + "description": "

Name that is used for the From: header in autoreply message

" + }, + { + "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": "name", + "description": "

Name that is used for the From: header in autoreply message

" + }, + { + "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 or boolean false to disable start checks

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

Datestring of the end of the autoreply or boolean false to disable end checks

" + } + ] + } + }, + "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": "/dkim/:dkim", + "title": "Delete a DKIM key", + "name": "DeleteDkim", + "group": "DKIM", + "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": "dkim", + "description": "

ID of the DKIM

" + } + ] + } + }, + "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/dkim/59ef21aef255ed1d9d790e81", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/dkim.js", + "groupTitle": "DKIM" + }, + { + "type": "get", + "url": "/dkim", + "title": "List registered DKIM keys", + "name": "GetDkim", + "group": "DKIM", + "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 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 DKIM

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

The domain this DKIM key applies to

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

DKIM selector

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

Key description

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

Key fingerprint (SHA1)

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

Datestring

" + } + ] + }, + "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 \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"fingerprint\": \"6a:aa:d7:ba:e4:99:b4:12:e0:f3:35:01:71:d4:f1:d6:b4:95:c4:f5\",\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\": \"Database error\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i http://localhost:8080/dkim", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/dkim.js", + "groupTitle": "DKIM" + }, + { + "type": "get", + "url": "/dkim/:dkim", + "title": "Request DKIM information", + "name": "GetDkimKey", + "group": "DKIM", + "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": "dkim", + "description": "

ID of the DKIM

" + } + ] + } + }, + "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 DKIM

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

The domain this DKIM key applies to

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

DKIM selector

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

Key description

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

Key fingerprint (SHA1)

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

Public key in DNS format (no prefix/suffix, single line)

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

Value for DNS TXT entry

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

Is the domain name of TXT

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

Is the value of TXT

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

Datestring

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e7a\",\n \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"fingerprint\": \"6a:aa:d7:ba:e4:99:b4:12:e0:f3:35:01:71:d4:f1:d6:b4:95:c4:f5\",\n \"publicKey\": \"-----BEGIN PUBLIC KEY-----\\r\\nMIGfMA0...\",\n \"dnsTxt\": {\n \"name\": \"dec20._domainkey.example.com\",\n \"value\": \"v=DKIM1;t=s;p=MIGfMA0...\"\n }\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/dkim/59ef21aef255ed1d9d790e7a", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/dkim.js", + "groupTitle": "DKIM" + }, + { + "type": "post", + "url": "/dkim", + "title": "Create or update DKIM key for domain", + "name": "PostDkim", + "group": "DKIM", + "description": "

Add a new DKIM key for a Domain or update existing one. There can be single DKIM key registered for each domain name.

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

Domain name this DKIM key applies to. Use "*" as a special value that will be used for domains that do not have their own DKIM key set

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

Selector for the key

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

Key description

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

Pem formatted DKIM private key. If not set then a new 2048 bit RSA key is generated, beware though that it can take several seconds to complete.

" + } + ] + } + }, + "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 DKIM

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

The domain this DKIM key applies to

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

DKIM selector

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

Key description

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

Key fingerprint (SHA1)

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

Public key in DNS format (no prefix/suffix, single line)

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

Value for DNS TXT entry

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

Is the domain name of TXT

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

Is the value of TXT

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59ef21aef255ed1d9d790e81\",\n \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"fingerprint\": \"6a:aa:d7:ba:e4:99:b4:12:e0:f3:35:01:71:d4:f1:d6:b4:95:c4:f5\",\n \"publicKey\": \"-----BEGIN PUBLIC KEY-----\\r\\nMIGfMA0...\",\n \"dnsTxt\": {\n \"name\": \"dec20._domainkey.example.com\",\n \"value\": \"v=DKIM1;t=s;p=MIGfMA0...\"\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 -XPOST http://localhost:8080/dkim \\\n-H 'Content-type: application/json' \\\n-d '{\n \"domain\": \"example.com\",\n \"selector\": \"oct17\",\n \"description\": \"Key for marketing emails\",\n \"privateKey\": \"-----BEGIN RSA PRIVATE KEY-----\\r\\n...\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/dkim.js", + "groupTitle": "DKIM" + }, + { + "type": "get", + "url": "/dkim/resolve/:domain", + "title": "Resolve ID for a DKIM domain", + "name": "ResolveDKIM", + "group": "DKIM", + "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": "domain", + "description": "

DKIM domain

" + } + ] + } + }, + "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": "

DKIM unique ID (24 byte hex)

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\"\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 domain does not exist\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i http://localhost:8080/dkim/resolve/example.com", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/dkim.js", + "groupTitle": "DKIM" + }, + { + "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": "/domainaliases", + "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", + "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": "get", + "url": "/domainaliases/resolve/:alias", + "title": "Resolve ID for a domain aias", + "name": "ResolveDomainAlias", + "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": "

Alias domain

" + } + ] + } + }, + "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": "

Alias unique ID (24 byte hex)

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\"\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/resolve/example.com", + "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": "Object", + "optional": false, + "field": "query", + "description": "

Rules that a message must match

" + }, + { + "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.listId", + "description": "

Partial match for the List-ID: header (case insensitive)

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

Fulltext search against message text

" + }, + { + "group": "Success 200", + "type": "Boolean", + "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": "Object", + "optional": false, + "field": "action", + "description": "

Action to take with a matching message

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

If true then mark matching messages as Seen

" + }, + { + "group": "Success 200", + "type": "Boolean", + "optional": false, + "field": "action.flag", + "description": "

If true then mark matching messages as Flagged

" + }, + { + "group": "Success 200", + "type": "Boolean", + "optional": false, + "field": "action.delete", + "description": "

If true then do not store matching messages

" + }, + { + "group": "Success 200", + "type": "Boolean", + "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.targets", + "description": "

A list of email addresses / HTTP URLs to forward the message to

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

If true, then this filter is ignored

" + } + ] + }, + "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\": {\n \"from\": \"Mäger\"\n },\n \"action\": {\n \"seen\": true\n },\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 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 a 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

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

If true, then this filter is ignored

" + } + ] + }, + "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 \"disabled\": false,\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": "Object", + "optional": false, + "field": "query", + "description": "

Rules that a message must match

" + }, + { + "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.listId", + "description": "

Partial match for the List-ID: header (case insensitive)

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

Fulltext search against message text

" + }, + { + "group": "Parameter", + "type": "Boolean", + "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": "Object", + "optional": false, + "field": "action", + "description": "

Action to take with a matching message

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "action.seen", + "description": "

If true then mark matching messages as Seen

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "action.flag", + "description": "

If true then mark matching messages as Flagged

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "action.delete", + "description": "

If true then do not store matching messages

" + }, + { + "group": "Parameter", + "type": "Boolean", + "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.targets", + "description": "

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

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

If true then this filter is ignored

" + } + ] + } + }, + "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\": {\n \"from\": \"Mäger\"\n },\n \"action\": {\n \"seen\": true\n }\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": "Object", + "optional": false, + "field": "query", + "description": "

Rules that a message must match

" + }, + { + "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.listId", + "description": "

Partial match for the List-ID: header (case insensitive)

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

Fulltext search against message text

" + }, + { + "group": "Parameter", + "type": "Boolean", + "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": "Object", + "optional": false, + "field": "action", + "description": "

Action to take with a matching message

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "action.seen", + "description": "

If true then mark matching messages as Seen

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "action.flag", + "description": "

If true then mark matching messages as Flagged

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "action.delete", + "description": "

If true then do not store matching messages

" + }, + { + "group": "Parameter", + "type": "Boolean", + "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.targets", + "description": "

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

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

If true then this filter is ignored

" + } + ] + } + }, + "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\": {\n \"seen\": \"\",\n \"flag\": true\n }\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 a 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": "specialUse", + "defaultValue": "false", + "description": "

Should the response include only folders with specialUse flag set.

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

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

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

Should the response include mailbox size in bytes. Size numbers come with a lot of overhead as an aggregated query is ran.

" + } + ] + } + }, + "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\": \"Database error\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes?counters=true", + "type": "curl" + }, + { + "title": "Special Use Only", + "content": "curl -i http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes?specialUse=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 Mailbox. Changing 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": "delete", + "url": "/users/:user/mailboxes/:mailbox/messages", + "title": "Delete all Messages from a Mailbox", + "name": "DeleteMessages", + "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

" + } + ] + } + }, + "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": "deleted", + "description": "

Indicates count of deleted messages

" + } + ] + }, + "examples": [ + { + "title": "Delete Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"deleted\": 51\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 all Messages:", + "content": "curl -i -XDELETE \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages\"", + "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": "ForwardStoredMessage", + "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": "Forward 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": "envelope", + "description": "

SMTP envelope (if available)

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

Address from MAIL FROM

" + }, + { + "group": "Success 200", + "type": "Object[]", + "optional": false, + "field": "envelope.rcpt", + "description": "

Array of addresses from RCPT TO (should have just one normally)

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

RCPT TO address as provided by SMTP client

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "envelope.rcpt.formatted", + "description": "

Normalized RCPT address

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

ID of the Thread

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

From: header info

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

Name of the sender

" + }, + { + "group": "Success 200", + "type": "String", + "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": "String", + "optional": false, + "field": "to.name", + "description": "

Name of the recipient

" + }, + { + "group": "Success 200", + "type": "String", + "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": "String", + "optional": false, + "field": "cc.name", + "description": "

Name of the recipient

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

Address of the recipient

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

Recipients in Bcc: field. Usually only available for drafts

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

Name of the recipient

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "bcc.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": true, + "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": true, + "field": "verificationResults", + "description": "

Security verification info if message was received from MX. If this property is missing then do not automatically assume invalid TLS, SPF or DKIM.

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "verificationResults.tls", + "description": "

TLS information. Value is false if TLS was not used

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

Cipher name, eg "ECDHE-RSA-AES128-GCM-SHA256"

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "verificationResults.tls.version", + "description": "

TLS version, eg "TLSv1/SSLv3"

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "verificationResults.spf", + "description": "

Domain name (either MFROM or HELO) of verified SPF or false if no SPF match was found

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "verificationResults.dkim", + "description": "

Domain name of verified DKIM signature or false if no valid signature was found

" + }, + { + "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

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

JSON formatted custom metadata object set for this message

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

Referenced message info

" + }, + { + "group": "Success 200", + "type": "Object[]", + "optional": true, + "field": "files", + "description": "

List of files added to this message as attachments. Applies to Drafts, normal messages do not have this property. Needed to prevent uploading the same attachment every time a draft is updated

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

File ID

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

Filename of the attached file

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

MIME type

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "files.size", + "description": "

MIME type

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": 1,\n \"mailbox\": \"59fc66a03e54454869460e46\",\n \"thread\": \"59fc66a13e54454869460e50\",\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 \"metaData\": \"{}\"\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/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": "unseen", + "defaultValue": "false", + "description": "

If true, then returns only unseen messages

" + }, + { + "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": "Object[]", + "optional": false, + "field": "results.to", + "description": "

Recipients in To: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Cc: field

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

Name of the recipient

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

Address of the recipient

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

Recipients in Bcc: field. Usually only available for drafts

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

Name of the recipient

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

Address of the recipient

" + }, + { + "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": "Boolean", + "optional": false, + "field": "results.answered", + "description": "

Does this message have a \\Answered flag

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

Does this message have a $Forwarded 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 \"answered\": false,\n \"forwarded\": 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": "thread", + "description": "

Thread ID

" + }, + { + "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": "Boolean", + "optional": true, + "field": "unseen", + "description": "

If true, then matches only messages without \\Seen flags

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

If true, then matches messages not in Junk or Trash

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

Allows to specify some requests as OR (default is AND). At least one of the values in or block must match

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "or.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": "or.from", + "description": "

Partial match for the From: header line

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

Partial match for the To: and Cc: header lines

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "or.subject", + "description": "

Partial match for the Subject: header line

" + }, + { + "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": "Object[]", + "optional": false, + "field": "results.to", + "description": "

Recipients in To: field

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "results.to.name", + "description": "

Name of the recipient

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "results.to.address", + "description": "

Address of the recipient

" + }, + { + "group": "Success 200", + "type": "Object[]", + "optional": false, + "field": "results.cc", + "description": "

Recipients in Cc: field

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "results.cc.name", + "description": "

Name of the recipient

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "results.cc.address", + "description": "

Address of the recipient

" + }, + { + "group": "Success 200", + "type": "Object[]", + "optional": false, + "field": "results.bcc", + "description": "

Recipients in Bcc: field. Usually only available for drafts

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "results.bcc.name", + "description": "

Name of the recipient

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "results.bcc.address", + "description": "

Address of the recipient

" + }, + { + "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" + }, + { + "title": "Using OR:", + "content": "curl -i \"http://localhost:8080/users/59fc66a03e54454869460e45/search?or.from=Ryan&or.to=Ryan\"", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/messages.js", + "groupTitle": "Messages" + }, + { + "type": "put", + "url": "/users/:user/mailboxes/:mailbox/messages", + "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

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "metaData", + "description": "

Optional metadata, must be JSON formatted object

" + } + ] + } + }, + "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\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"message\": \"1,2,3\",\n \"seen\": false\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/messages.js", + "groupTitle": "Messages" + }, + { + "type": "post", + "url": "/users/:user/mailboxes/:mailbox/messages/:message/submit", + "title": "Submit Draft for delivery", + "name": "SubmitStoredMessage", + "group": "Messages", + "description": "

This method allows to submit a draft message for delivery. Draft is moved to Sent mail folder.

", + "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": "Boolean", + "optional": false, + "field": "deleteFiles", + "description": "

If true then deletes attachment files listed in metaData.files array

" + } + ] + } + }, + "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": true, + "field": "message", + "description": "

Information about submitted Message

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message.mailbox", + "description": "

Mailbox ID the draft was moved to (usually Sent mail)

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "message.id", + "description": "

Message ID in Mailbox

" + } + ] + }, + "examples": [ + { + "title": "Submit Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"queueId\": \"1682f5a712f000dfb6\",\n \"message\": {\n \"id\": 3,\n \"mailbox\": \"5c279b4e17abae166446f968\"\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": "Submit a Message:", + "content": "curl -i -XPOST \"http://localhost:8080/users/59fc66a03e54454869460e45/mailboxes/59fc66a13e54454869460e57/messages/1/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"deleteFiles\": true\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/messages.js", + "groupTitle": "Messages" + }, + { + "type": "post", + "url": "/users/:user/mailboxes/:mailbox/messages", + "title": "Upload Message", + "name": "UploadMessage", + "group": "Messages", + "description": "

This method allows to upload either an RFC822 formatted message or a message structure to a mailbox. Raw message is stored unmodified, no headers are added or removed. If you want to generate the uploaded message from strucutred data fields, then do not use the raw property.

", + "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": "Boolean", + "optional": true, + "field": "unseen", + "defaultValue": "false", + "description": "

Is the message unseen or not

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "draft", + "defaultValue": "false", + "description": "

Is the message a draft or not

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "flagged", + "defaultValue": "false", + "description": "

Is the message flagged or not

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "raw", + "description": "

base64 encoded message source. Alternatively, you can provide this value as POST body by using message/rfc822 MIME type. If raw message is provided then it overrides any other mail configuration

" + }, + { + "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": true, + "field": "subject", + "description": "

Message subject. If not then resolved from Reference message

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "text", + "description": "

Plaintext message

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "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 automaticall y

" + }, + { + "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": "String[]", + "optional": true, + "field": "files", + "description": "

Attachments as storage file IDs. NB! When retrieving message info then an array of objects is returned. When uploading a message then an array of IDs is used.

" + }, + { + "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": "metaData", + "description": "

Optional metadata, must be JSON formatted object

" + }, + { + "group": "Parameter", + "type": "Object", + "optional": true, + "field": "reference", + "description": "

Optional referenced email. If uploaded message is a reply draft 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": false, + "field": "reference.attachments", + "defaultValue": "false", + "description": "

If true, then includes all attachments from the original message. If it is an array of attachment ID's includes attachments from the list

" + }, + { + "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": "

Message information

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "message.id", + "description": "

Message ID in mailbox

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message.mailbox", + "description": "

Mailbox ID the message was stored into

" + } + ] + }, + "examples": [ + { + "title": "Forward Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"message\": {\n \"id\": 2,\n \"mailbox\": \"5a2f9ca57308fc3a6f5f811e\"\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": "Upload a Message:", + "content": "curl -i -XPOST \"http://localhost:8080/users/5a2f9ca57308fc3a6f5f811d/mailboxes/5a2f9ca57308fc3a6f5f811e/messages\" \\\n-H 'Content-type: message/rfc822' \\\n-d 'From: sender@example.com\nTo: recipient@example.com\nSubject: hello world!\n\nExample message'", + "type": "curl" + }, + { + "title": "Upload a Message Structure:", + "content": "curl -i -XPOST \"http://localhost:8080/users/5a2f9ca57308fc3a6f5f811d/mailboxes/5a2f9ca57308fc3a6f5f811e/messages\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"from\": {\n \"name\": \"sender name\",\n \"address\": \"sender@example.com\"\n },\n \"to\": [{\n \"address\": \"andris@ethereal.email\"\n }],\n \"subject\": \"Hello world!\",\n \"text\": \"Test message\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/messages.js", + "groupTitle": "Messages" + }, + { + "type": "delete", + "url": "/users/:user/storage/:file", + "title": "Delete a File", + "name": "DeleteStorage", + "group": "Storage", + "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 File

" + } + ] + } + }, + "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/storage/59ef21aef255ed1d9d790e81", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/storage.js", + "groupTitle": "Storage" + }, + { + "type": "get", + "url": "/users/:user/storage", + "title": "List stored files", + "name": "GetStorage", + "group": "Storage", + "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": "query", + "description": "

Partial match of a filename

" + }, + { + "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": "

File listing

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "results.id", + "description": "

ID of the File

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "results.filename", + "description": "

Filename

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "results.contentType", + "description": "

Content-Type of the file

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "results.size", + "description": "

File size

" + } + ] + }, + "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 \"filename\": \"hello.txt\",\n \"size\": 1024\n },\n {\n \"id\": \"59ef21aef255ed1d9d790e82\",\n \"filename\": \"finances.xls\",\n \"size\": 2084\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/storage", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/storage.js", + "groupTitle": "Storage" + }, + { + "type": "get", + "url": "/users/:user/storage/:file", + "title": "Download File", + "name": "GetStorageFile", + "group": "Storage", + "description": "

This method returns stored 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": "file", + "description": "

ID of the File

" + } + ] + } + }, + "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/storage/59fc66a13e54454869460e57\"", + "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/storage.js", + "groupTitle": "Storage" + }, + { + "type": "post", + "url": "/users/:user/storage", + "title": "Upload File", + "name": "UploadStorage", + "group": "Storage", + "description": "

This method allows to upload an attachment to be linked from a draft

", + "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": "Binary", + "optional": false, + "field": "content", + "description": "

Request body is the file itself. Make sure to use 'application/binary' as content-type for the request, otherwise the server might try to process the input

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "filename", + "description": "

Filename

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "contentType", + "description": "

MIME type for the file

" + }, + { + "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": "id", + "description": "

File ID

" + } + ] + }, + "examples": [ + { + "title": "Forward Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"5a2f9ca57308fc3a6f5f811e\"\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": "Upload a file from disk:", + "content": "curl -i -XPOST \"http://localhost:8080/users/5c404c9ec1933085b59e7574/storage?filename=00-example.duck.png\" \\\n-H 'Content-type: application/binary' \\\n--data-binary \"@emails/00-example.duck.png\"", + "type": "curl" + }, + { + "title": "Upload a string:", + "content": "curl -i -XPOST \"http://localhost:8080/users/5c404c9ec1933085b59e7574/storage?filename=hello.txt\" \\\n-H 'Content-type: application/binary' \\\n-d \"Hello world!\"", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/storage.js", + "groupTitle": "Storage" + }, + { + "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": "mailbox", + "description": "

Mailbox ID where to upload the message. If not set then message is uploaded to Sent Mail folder.

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "uploadOnly", + "defaultValue": "false", + "description": "

If true then generated message is not added to the sending queue

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "isDraft", + "defaultValue": "false", + "description": "

If true then treats this message as draft (should be used with uploadOnly=true)

" + }, + { + "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": "Object", + "optional": true, + "field": "meta", + "description": "

Custom metainfo for the 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" + }, + { + "title": "Upload only", + "content": "# Recipients and subject line are derived from referenced message\ncurl -i -XPOST \"http://localhost:8080/users/5a2fe496ce76ede84f177ec3/submit\" \\\n-H 'Content-type: application/json' \\\n-d '{\n \"reference\": {\n \"mailbox\": \"5a2fe496ce76ede84f177ec4\",\n \"id\": 1,\n \"action\": \"replyAll\"\n },\n \"uploadOnly\": true,\n \"mailbox\": \"5a33b45acf482d3219955bc4\",\n \"text\": \"Yeah, sure\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/submit.js", + "groupTitle": "Submission" + }, + { + "type": "post", + "url": "/users/:user/2fa/totp/check", + "title": "Validate TOTP Token", + "name": "CheckTotp2FA", + "group": "TwoFactorAuth", + "description": "

This method checks if a TOTP token provided by a User is valid for 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": false, + "field": "token", + "description": "

6-digit number

" + }, + { + "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\": \"Failed to validate TOTP\"\n \"code\": \"InvalidToken\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp/check \\\n-H 'Content-type: application/json' \\\n-d '{\n \"token\": \"123456\",\n \"ip\": \"127.0.0.1\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/2fa/totp.js", + "groupTitle": "TwoFactorAuth" + }, + { + "type": "delete", + "url": "/users/:user/2fa", + "title": "Disable 2FA", + "name": "Disable2FA", + "group": "TwoFactorAuth", + "description": "

This method disables all 2FA mechanisms an user might have set up

", + "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/2fa", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/2fa/totp.js", + "groupTitle": "TwoFactorAuth" + }, + { + "type": "delete", + "url": "/users/:user/2fa/custom", + "title": "Disable custom 2FA for an user", + "name": "DisableCustom2FA", + "group": "TwoFactorAuth", + "description": "

This method disables custom 2FA. If it was the only 2FA set up, then account password for IMAP/POP3/SMTP gets enabled again

", + "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/2fa/custom \\\n-H 'Content-type: application/json' \\\n-d '{\n \"ip\": \"127.0.0.1\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/2fa/custom.js", + "groupTitle": "TwoFactorAuth" + }, + { + "type": "delete", + "url": "/users/:user/2fa/totp", + "title": "Disable TOTP auth", + "name": "DisableTotp2FA", + "group": "TwoFactorAuth", + "description": "

This method disables TOTP for an user. Does not affect other 2FA mechanisms an user might have set up

", + "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XDELETE http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/2fa/totp.js", + "groupTitle": "TwoFactorAuth" + }, + { + "type": "put", + "url": "/users/:user/2fa/custom", + "title": "Enable custom 2FA for an user", + "name": "EnableCustom2FA", + "group": "TwoFactorAuth", + "description": "

This method disables account password for IMAP/POP3/SMTP

", + "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": "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPUT http://localhost:8080/users/59fc66a03e54454869460e45/2fa/custom \\\n-H 'Content-type: application/json' \\\n-d '{\n \"ip\": \"127.0.0.1\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/2fa/custom.js", + "groupTitle": "TwoFactorAuth" + }, + { + "type": "post", + "url": "/users/:user/2fa/totp/enable", + "title": "Enable TOTP seed", + "name": "EnableTotp2FA", + "group": "TwoFactorAuth", + "description": "

This method enables TOTP for an user by verifying the seed value generated from 2fa/totp/setup

", + "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": "token", + "description": "

6-digit number that matches seed value from 2fa/totp/setup

" + }, + { + "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 username does not exist\"\n \"code\": \"UserNotFound\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp/enable \\\n-H 'Content-type: application/json' \\\n-d '{\n \"token\": \"123456\",\n \"ip\": \"127.0.0.1\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/2fa/totp.js", + "groupTitle": "TwoFactorAuth" + }, + { + "type": "post", + "url": "/users/:user/2fa/totp/setup", + "title": "Generate TOTP seed", + "name": "SetupTotp2FA", + "group": "TwoFactorAuth", + "description": "

This method generates TOTP seed and QR code for 2FA. User needs to verify the seed value using 2fa/totp/enable endpoint

", + "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": "label", + "description": "

Label text for QR code (defaults to username)

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "issuer", + "description": "

Description text for QR code (defaults to "WildDuck")

" + }, + { + "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": "seed", + "description": "

Generated TOTP seed value

" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "qrcode", + "description": "

Base64 encoded QR code

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"seed\": \"secretseed\",\n \"qrcode\": \"base64-encoded-image\"\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 does not exist\"\n \"code\": \"UserNotFound\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPOST http://localhost:8080/users/59fc66a03e54454869460e45/2fa/totp/setup \\\n-H 'Content-type: application/json' \\\n-d '{\n \"label\": \"user@example.com\",\n \"issuer\": \"My Awesome Web Service\",\n \"ip\": \"127.0.0.1\"\n}'", + "type": "curl" + } + ], + "version": "0.0.0", + "filename": "lib/api/2fa/totp.js", + "groupTitle": "TwoFactorAuth" + }, + { + "type": "delete", + "url": "/users/:id", + "title": "Delete a 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": "metaData", + "description": "

JSON formatted custom metadata object set for this user

" + }, + { + "group": "Success 200", + "type": "String[]", + "optional": false, + "field": "targets", + "description": "

List of forwarding targets

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "spamLevel", + "description": "

Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam

" + }, + { + "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 hours 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 hours 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": "Object", + "optional": false, + "field": "limits.received", + "description": "

Receiving quota

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "limits.received.allowed", + "description": "

How many messages per 1 hour can be received

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "limits.received.used", + "description": "

How many messages are received during current 1 hour period

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "limits.received.ttl", + "description": "

Time until the end of current 1 hour period

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "limits.imapUpload", + "description": "

IMAP upload quota

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "limits.imapUpload.allowed", + "description": "

How many bytes per 24 hours can be uploaded via IMAP. Only message contents are counted, not protocol overhead.

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "limits.imapUpload.used", + "description": "

How many bytes are uploaded during current 24 hour period

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "limits.imapUpload.ttl", + "description": "

Time until the end of current 24 hour period

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "limits.imapDownload", + "description": "

IMAP download quota

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "limits.imapDownload.allowed", + "description": "

How many bytes per 24 hours can be downloaded via IMAP. Only message contents are counted, not protocol overhead.

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "limits.imapDownload.used", + "description": "

How many bytes are downloaded during current 24 hour period

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "limits.imapDownload.ttl", + "description": "

Time until the end of current 24 hour period

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "limits.pop3Download", + "description": "

POP3 download quota

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "limits.pop3Download.allowed", + "description": "

How many bytes per 24 hours can be downloaded via POP3. Only message contents are counted, not protocol overhead.

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "limits.pop3Download.used", + "description": "

How many bytes are downloaded during current 24 hour period

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "limits.pop3Download.ttl", + "description": "

Time until the end of current 24 hour period

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "limits.imapMaxConnections.allowed", + "description": "

How many parallel IMAP connections are permitted

" + }, + { + "group": "Success 200", + "type": "Number", + "optional": false, + "field": "limits.imapMaxConnections.used", + "description": "

How many parallel IMAP connections are currenlty in use

" + }, + { + "group": "Success 200", + "type": "String[]", + "optional": false, + "field": "tags", + "description": "

List of tags associated with the User

" + }, + { + "group": "Success 200", + "type": "String[]", + "optional": false, + "field": "disabledScopes", + "description": "

Disabled scopes for this 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 \"targets\": [\n \"my.old.address@example.com\",\n \"smtp://mx2.zone.eu:25\"\n ],\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 \"disabledScopes\": [\"pop3\"],\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/resolve/:username", + "title": "Resolve ID for an username", + "name": "GetUsername", + "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": "username", + "description": "

Username of the User. Alphanumeric value. Must start with a letter, dots are allowed but informational only ("user.name" is the same as "username")

" + } + ] + } + }, + "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)

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n \"success\": true,\n \"id\": \"59fc66a03e54454869460e45\"\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/resolve/testuser", + "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.targets", + "description": "

List of forwarding targets

" + }, + { + "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": "username", + "description": "

Username of the User. Dots are allowed but informational only ("user.name" is the same as "username").

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "name", + "description": "

Name of the User

" + }, + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "password", + "description": "

Password for the account. Set to boolean false to disable password usage

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "hashedPassword", + "description": "

If true then password is already hashed, so store as. Hash needs to be bcrypt $2a, $2y or $2b. Additionally md5-crypt hashes $1 are allowed but these are rehashed on first successful authentication

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "allowUnsafe", + "defaultValue": "true", + "description": "

If false then validates provided passwords against Have I Been Pwned API. Experimental, so validation is disabled by default but will be enabled automatically in some future version of WildDuck.

" + }, + { + "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": "Boolean", + "optional": true, + "field": "requirePasswordChange", + "description": "

If true then requires the user to change password, useful if password for the account was autogenerated

" + }, + { + "group": "Parameter", + "type": "String[]", + "optional": true, + "field": "tags", + "description": "

A list of tags associated with this user

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "addTagsToAddress", + "description": "

If true then autogenerated address gets the same tags as the user

" + }, + { + "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": "uploadSentMessages", + "description": "

If true then all messages sent through MSA are also uploaded to the Sent Mail folder. Might cause duplicates with some email clients, so disabled by default.

" + }, + { + "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": "metaData", + "description": "

Optional metadata, must be JSON formatted object

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "language", + "description": "

Language code for the User

" + }, + { + "group": "Parameter", + "type": "String[]", + "optional": true, + "field": "targets", + "description": "

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

" + }, + { + "group": "Parameter", + "type": "Number", + "optional": true, + "field": "spamLevel", + "defaultValue": "50", + "description": "

Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam

" + }, + { + "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": "Number", + "optional": true, + "field": "imapMaxUpload", + "description": "

How many bytes can be uploaded via IMAP during 24 hour

" + }, + { + "group": "Parameter", + "type": "Number", + "optional": true, + "field": "imapMaxDownload", + "description": "

How many bytes can be downloaded via IMAP during 24 hour

" + }, + { + "group": "Parameter", + "type": "Number", + "optional": true, + "field": "pop3MaxDownload", + "description": "

How many bytes can be downloaded via POP3 during 24 hour

" + }, + { + "group": "Parameter", + "type": "Number", + "optional": true, + "field": "imapMaxConnections", + "description": "

How many parallel IMAP connections are alowed

" + }, + { + "group": "Parameter", + "type": "Number", + "optional": true, + "field": "receivedMax", + "description": "

How many messages can be received from MX during 60 seconds

" + }, + { + "group": "Parameter", + "type": "Object", + "optional": true, + "field": "mailboxes", + "description": "

Optional names for special mailboxes

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "mailboxes.sent", + "defaultValue": "Sent Mail", + "description": "

Path of Sent Mail folder

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "mailboxes.junk", + "defaultValue": "Junk", + "description": "

Path of spam folder

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "mailboxes.drafts", + "defaultValue": "Drafts", + "description": "

Path of drafts folder

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "mailboxes.trash", + "defaultValue": "Trash", + "description": "

Path of trash folder

" + }, + { + "group": "Parameter", + "type": "String[]", + "optional": false, + "field": "disabledScopes", + "description": "

List of scopes that are disabled for this user ("imap", "pop3", "smtp")

" + }, + { + "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 \"address\": \"john.doe@example.com\",\n \"tags\": [\n \"status:regular_user\",\n \"subscription:business_big\"\n ]\n}'", + "type": "curl" + }, + { + "title": "Example address:", + "content": "curl -i -XPOST http://localhost:8080/users \\\n-H 'Content-type: application/json' \\\n-d '{\n \"username\": \"john.doe@example.com\",\n \"password\": \"verysecret\",\n \"name\": \"John Doe\",\n \"tags\": [\n \"status:regular_user\",\n \"subscription:business_big\"\n ]\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 a 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.

" + } + ] + } + }, + "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": "post", + "url": "/quota/reset", + "title": "Recalculate Quota for all Users", + "name": "PostUserQuotaAll", + "group": "Users", + "description": "

This method recalculates quota usage for all Users. 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.

" + } + ] + } + }, + "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\": \"Failed to process request\"\n}", + "type": "json" + } + ] + }, + "examples": [ + { + "title": "Example usage:", + "content": "curl -i -XPOST http://localhost:8080/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. Set to boolean false to disable password usage

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "hashedPassword", + "description": "

If true then password is already hashed, so store as. Hash needs to be bcrypt $2a, $2y or $2b. Additionally md5-crypt hashes $1 are allowed but these are rehashed on first successful authentication

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "allowUnsafe", + "defaultValue": "true", + "description": "

If false then validates provided passwords against Have I Been Pwned API. Experimental, so validation is disabled by default but will be enabled automatically in some future version of WildDuck.

" + }, + { + "group": "Parameter", + "type": "String[]", + "optional": true, + "field": "tags", + "description": "

A list of tags associated with this user

" + }, + { + "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": "uploadSentMessages", + "description": "

If true then all messages sent through MSA are also uploaded to the Sent Mail folder. Might cause duplicates with some email clients, so disabled by default.

" + }, + { + "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": "metaData", + "description": "

Optional metadata, must be JSON formatted object

" + }, + { + "group": "Parameter", + "type": "String", + "optional": true, + "field": "language", + "description": "

Language code for the User

" + }, + { + "group": "Parameter", + "type": "String[]", + "optional": true, + "field": "targets", + "description": "

An array of forwarding targets. The value could either be an email address or a relay url to next MX server ("smtp://mx2.zone.eu:25") or an URL where mail contents are POSTed to

" + }, + { + "group": "Parameter", + "type": "Number", + "optional": true, + "field": "spamLevel", + "description": "

Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam

" + }, + { + "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": "Number", + "optional": true, + "field": "imapMaxUpload", + "description": "

How many bytes can be uploaded via IMAP during 24 hour

" + }, + { + "group": "Parameter", + "type": "Number", + "optional": true, + "field": "imapMaxDownload", + "description": "

How many bytes can be downloaded via IMAP during 24 hour

" + }, + { + "group": "Parameter", + "type": "Number", + "optional": true, + "field": "pop3MaxDownload", + "description": "

How many bytes can be downloaded via POP3 during 24 hour

" + }, + { + "group": "Parameter", + "type": "Number", + "optional": true, + "field": "imapMaxConnections", + "description": "

How many parallel IMAP connections are alowed

" + }, + { + "group": "Parameter", + "type": "Number", + "optional": true, + "field": "receivedMax", + "description": "

How many messages can be received from MX during 60 seconds

" + }, + { + "group": "Parameter", + "type": "Boolean", + "optional": true, + "field": "disable2fa", + "description": "

If true, then disables 2FA for this user

" + }, + { + "group": "Parameter", + "type": "String[]", + "optional": false, + "field": "disabledScopes", + "description": "

List of scopes that are disabled for this user ("imap", "pop3", "smtp")

" + }, + { + "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 a User", + "name": "ResetUserPassword", + "group": "Users", + "description": "

This method generates a new temporary password for a 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": "validAfter", + "description": "

Allow using the generated password not earlier than provided time

" + }, + { + "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/lib/api/2fa/custom.js b/lib/api/2fa/custom.js index 9231fb98..f8f986ef 100644 --- a/lib/api/2fa/custom.js +++ b/lib/api/2fa/custom.js @@ -14,7 +14,7 @@ module.exports = (db, server, userHandler) => { const disableCustom2fa = util.promisify(userHandler.disableCustom2fa.bind(userHandler)); /** - * @api {put} /users/:user/2fa/custom Enable custom 2FA for an user + * @api {put} /users/:user/2fa/custom Enable custom 2FA for a user * @apiName EnableCustom2FA * @apiGroup TwoFactorAuth * @apiDescription This method disables account password for IMAP/POP3/SMTP @@ -102,7 +102,7 @@ module.exports = (db, server, userHandler) => { ); /** - * @api {delete} /users/:user/2fa/custom Disable custom 2FA for an user + * @api {delete} /users/:user/2fa/custom Disable custom 2FA for a user * @apiName DisableCustom2FA * @apiGroup TwoFactorAuth * @apiDescription This method disables custom 2FA. If it was the only 2FA set up, then account password for IMAP/POP3/SMTP gets enabled again diff --git a/lib/api/2fa/totp.js b/lib/api/2fa/totp.js index b18893a7..6c0b6fb8 100644 --- a/lib/api/2fa/totp.js +++ b/lib/api/2fa/totp.js @@ -124,7 +124,7 @@ module.exports = (db, server, userHandler) => { * @api {post} /users/:user/2fa/totp/enable Enable TOTP seed * @apiName EnableTotp2FA * @apiGroup TwoFactorAuth - * @apiDescription This method enables TOTP for an user by verifying the seed value generated from 2fa/totp/setup + * @apiDescription This method enables TOTP for a user by verifying the seed value generated from 2fa/totp/setup * @apiHeader {String} X-Access-Token Optional access token if authentication is enabled * @apiHeaderExample {json} Header-Example: * { @@ -225,7 +225,7 @@ module.exports = (db, server, userHandler) => { * @api {delete} /users/:user/2fa/totp Disable TOTP auth * @apiName DisableTotp2FA * @apiGroup TwoFactorAuth - * @apiDescription This method disables TOTP for an user. Does not affect other 2FA mechanisms an user might have set up + * @apiDescription This method disables TOTP for a user. Does not affect other 2FA mechanisms a user might have set up * @apiHeader {String} X-Access-Token Optional access token if authentication is enabled * @apiHeaderExample {json} Header-Example: * { @@ -311,7 +311,7 @@ module.exports = (db, server, userHandler) => { * @api {post} /users/:user/2fa/totp/check Validate TOTP Token * @apiName CheckTotp2FA * @apiGroup TwoFactorAuth - * @apiDescription This method checks if a TOTP token provided by an User is valid for authentication + * @apiDescription This method checks if a TOTP token provided by a User is valid for authentication * @apiHeader {String} X-Access-Token Optional access token if authentication is enabled * @apiHeaderExample {json} Header-Example: * { @@ -412,7 +412,7 @@ module.exports = (db, server, userHandler) => { * @api {delete} /users/:user/2fa Disable 2FA * @apiName Disable2FA * @apiGroup TwoFactorAuth - * @apiDescription This method disables all 2FA mechanisms an user might have set up + * @apiDescription This method disables all 2FA mechanisms a user might have set up * @apiHeader {String} X-Access-Token Optional access token if authentication is enabled * @apiHeaderExample {json} Header-Example: * { diff --git a/lib/api/2fa/u2f.js b/lib/api/2fa/u2f.js index 8974f2c3..c8e412db 100644 --- a/lib/api/2fa/u2f.js +++ b/lib/api/2fa/u2f.js @@ -170,7 +170,7 @@ module.exports = (db, server, userHandler) => { }) ); - // Disable U2F auth for an user + // Disable U2F auth for a user server.del( '/users/:user/2fa/u2f', tools.asyncifyJson(async (req, res, next) => { diff --git a/lib/api/addresses.js b/lib/api/addresses.js index 959e5a5f..d54e8516 100644 --- a/lib/api/addresses.js +++ b/lib/api/addresses.js @@ -38,7 +38,7 @@ module.exports = (db, server, userHandler) => { * @apiSuccess {String} results.id ID of the Address * @apiSuccess {String} results.name Identity name * @apiSuccess {String} results.address E-mail address string - * @apiSuccess {String} results.user User ID this address belongs to if this is an User address + * @apiSuccess {String} results.user User ID this address belongs to if this is a User address * @apiSuccess {Boolean} results.forwarded If true then it is a forwarded address * * @apiError error Description of the error @@ -264,7 +264,7 @@ module.exports = (db, server, userHandler) => { * @api {post} /users/:user/addresses Create new Address * @apiName PostUserAddress * @apiGroup Addresses - * @apiDescription Add a new email address for an User. Addresses can contain unicode characters. + * @apiDescription Add a new email address for a 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, \*suffix@example.com and username@\* catches all emails to these domains or users without a registered destination (requires allowWildcard argument) @@ -579,7 +579,7 @@ module.exports = (db, server, userHandler) => { ); /** - * @api {get} /users/:user/addresses List registered Addresses for an User + * @api {get} /users/:user/addresses List registered Addresses for a User * @apiName GetUserAddresses * @apiGroup Addresses * @apiHeader {String} X-Access-Token Optional access token if authentication is enabled @@ -2310,7 +2310,7 @@ module.exports = (db, server, userHandler) => { * @apiSuccess {String} id ID of the Address * @apiSuccess {String} address E-mail address string * @apiSuccess {String} name Identity name - * @apiSuccess {String} user ID of the user if the address belongs to an User + * @apiSuccess {String} user ID of the user if the address belongs to a User * @apiSuccess {String[]} targets List of forwarding targets if this is a Forwarded address * @apiSuccess {Object} limits Account limits and usage for Forwarded address * @apiSuccess {Object} limits.forwards Forwarding quota diff --git a/lib/api/auth.js b/lib/api/auth.js index 0729a485..85f00281 100644 --- a/lib/api/auth.js +++ b/lib/api/auth.js @@ -19,7 +19,7 @@ module.exports = (db, server, userHandler) => { }); /** - * @api {post} /authenticate Authenticate an User + * @api {post} /authenticate Authenticate a User * @apiName PostAuth * @apiGroup Authentication * @apiHeader {String} X-Access-Token Optional access token if authentication is enabled diff --git a/lib/api/filters.js b/lib/api/filters.js index 5236acbf..3b33be26 100644 --- a/lib/api/filters.js +++ b/lib/api/filters.js @@ -8,7 +8,7 @@ const roles = require('../roles'); module.exports = (db, server) => { /** - * @api {get} /users/:user/filters List Filters for an User + * @api {get} /users/:user/filters List Filters for a User * @apiName GetFilters * @apiGroup Filters * @apiHeader {String} X-Access-Token Optional access token if authentication is enabled diff --git a/lib/api/mailboxes.js b/lib/api/mailboxes.js index 323ebe7e..8c23f8b7 100644 --- a/lib/api/mailboxes.js +++ b/lib/api/mailboxes.js @@ -22,7 +22,7 @@ module.exports = (db, server, mailboxHandler) => { }); /** - * @api {get} /users/:user/mailboxes List Mailboxes for an User + * @api {get} /users/:user/mailboxes List Mailboxes for a User * @apiName GetMailboxes * @apiGroup Mailboxes * @apiHeader {String} X-Access-Token Optional access token if authentication is enabled diff --git a/lib/api/messages.js b/lib/api/messages.js index 5ad2786f..3ea59e6f 100644 --- a/lib/api/messages.js +++ b/lib/api/messages.js @@ -2714,7 +2714,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler) => { * @apiName ForwardStoredMessage * @apiGroup Messages * @apiDescription 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 + * or forward it to some other address. This is useful if a user had forwarding turned on but the * message was not delivered so you can try again. Forwarding does not modify the original message. * @apiHeader {String} X-Access-Token Optional access token if authentication is enabled * @apiHeaderExample {json} Header-Example: diff --git a/lib/api/submit.js b/lib/api/submit.js index 9885cadf..db399e5b 100644 --- a/lib/api/submit.js +++ b/lib/api/submit.js @@ -567,7 +567,7 @@ module.exports = (db, server, messageHandler, userHandler) => { * @api {post} /users/:user/submit Submit a Message for Delivery * @apiName PostSubmit * @apiGroup Submission - * @apiDescription Use this method to send emails from an user account + * @apiDescription Use this method to send emails from a user account * @apiHeader {String} X-Access-Token Optional access token if authentication is enabled * @apiHeaderExample {json} Header-Example: * { diff --git a/lib/api/users.js b/lib/api/users.js index 14466b46..4f5cd146 100644 --- a/lib/api/users.js +++ b/lib/api/users.js @@ -333,7 +333,7 @@ module.exports = (db, server, userHandler) => { * @apiParam {Boolean} [hashedPassword] If true then password is already hashed, so store as. Hash needs to be bcrypt $2a, $2y or $2b. Additionally md5-crypt hashes $1 are allowed but these are rehashed on first successful authentication * @apiParam {Boolean} [allowUnsafe=true] If false then validates provided passwords against Have I Been Pwned API. Experimental, so validation is disabled by default but will be enabled automatically in some future version of WildDuck. * @apiParam {String} [address] Default email address for the User (autogenerated if not set) - * @apiParam {Boolean} [emptyAddress] 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 + * @apiParam {Boolean} [emptyAddress] If true then do not autogenerate missing email address for the User. Only needed if you want to create a user account that does not have any email address associated * @apiParam {Boolean} [requirePasswordChange] If true then requires the user to change password, useful if password for the account was autogenerated * @apiParam {String[]} [tags] A list of tags associated with this user * @apiParam {Boolean} [addTagsToAddress] If true then autogenerated address gets the same tags as the user @@ -1619,7 +1619,7 @@ module.exports = (db, server, userHandler) => { * @api {post} /users/:id/quota/reset Recalculate User quota * @apiName PostUserQuota * @apiGroup Users - * @apiDescription This method recalculates quota usage for an User. Normally not needed, only use it if quota numbers are way off. + * @apiDescription This method recalculates quota usage for a 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. * @apiHeader {String} X-Access-Token Optional access token if authentication is enabled * @apiHeaderExample {json} Header-Example: @@ -1888,10 +1888,10 @@ module.exports = (db, server, userHandler) => { ); /** - * @api {post} /users/:id/password/reset Reset password for an User + * @api {post} /users/:id/password/reset Reset password for a User * @apiName ResetUserPassword * @apiGroup Users - * @apiDescription This method generates a new temporary password for an User. + * @apiDescription This method generates a new temporary password for a User. * Additionally it removes all two-factor authentication settings * * @apiHeader {String} X-Access-Token Optional access token if authentication is enabled @@ -1990,7 +1990,7 @@ module.exports = (db, server, userHandler) => { ); /** - * @api {delete} /users/:id Delete an User + * @api {delete} /users/:id Delete a User * @apiName DeleteUser * @apiGroup Users * @apiHeader {String} X-Access-Token Optional access token if authentication is enabled diff --git a/lib/user-handler.js b/lib/user-handler.js index 6e94ae74..ba3cfb9d 100644 --- a/lib/user-handler.js +++ b/lib/user-handler.js @@ -3292,7 +3292,7 @@ class UserHandler { setImmediate(tryDelete); } - // returns a query to find an user based on address or username + // returns a query to find a user based on address or username checkAddress(username, callback) { if (username.indexOf('@') < 0) { // not formatted as an address, assume regular username