diff --git a/docs/api/openapidocs.json b/docs/api/openapidocs.json index 3fe65cb9..3955cf51 100644 --- a/docs/api/openapidocs.json +++ b/docs/api/openapidocs.json @@ -85,7 +85,7 @@ "Users" ], "summary": "List registered Users", - "operationId": "users", + "operationId": "getUsers", "parameters": [ { "name": "query", @@ -206,66 +206,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "total": { - "type": "number", - "description": "How many results were found", - "example": 541 - }, - "page": { - "type": "number", - "description": "Current page number. Derived from page query argument", - "example": 1 - }, - "previousCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any previous results" - }, - "nextCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any next results" - }, - "query": { - "type": "string", - "description": "Partial match of username or default email address" - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetUsersResult" - }, - "description": "User listing" - } - }, - "required": [ - "success", - "total", - "page", - "previousCursor", - "nextCursor", - "query", - "results" - ] + "$ref": "#/components/schemas/GetUsersResponse" } } } @@ -277,7 +218,7 @@ "Users" ], "summary": "Create new user", - "operationId": "postusers", + "operationId": "createUser", "requestBody": { "content": { "application/json": { @@ -472,22 +413,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "Example: `507f1f77bcf86cd799439011`\nID of the User" - } - }, - "required": [ - "success", - "id" - ] + "$ref": "#/components/schemas/CreateUserResponse" } } } @@ -501,7 +427,7 @@ "Users" ], "summary": "Resolve ID for a username", - "operationId": "getusersresolveusername", + "operationId": "resolveUser", "parameters": [ { "name": "username", @@ -537,23 +463,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "Unique ID (24 byte hex)", - "example": "609d201236d1d936948f23b1" - } - }, - "required": [ - "success", - "id" - ] + "$ref": "#/components/schemas/ResolveIdForUsernameResponse" } } } @@ -567,7 +477,7 @@ "Users" ], "summary": "Request User information", - "operationId": "getusersuser", + "operationId": "getUser", "parameters": [ { "name": "user", @@ -603,151 +513,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "Users unique ID (24 byte hex)" - }, - "username": { - "type": "string", - "description": "Username of the User" - }, - "name": { - "type": "string", - "description": "Name of the User" - }, - "address": { - "type": "string", - "description": "Main email address of the User" - }, - "retention": { - "type": "number", - "description": "Default retention time (in ms). false if not enabled" - }, - "enabled2fa": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of enabled 2FA methods" - }, - "autoreply": { - "type": "boolean", - "description": "Is autoreply enabled or not (start time may still be in the future or end time in the past)" - }, - "encryptMessages": { - "type": "boolean", - "description": "If true then received messages are encrypted" - }, - "encryptForwarded": { - "type": "boolean", - "description": "If true then forwarded messages are encrypted" - }, - "pubKey": { - "type": "string", - "description": "Public PGP key for the User that is used for encryption" - }, - "keyInfo": { - "$ref": "#/components/schemas/KeyInfo" - }, - "metaData": { - "type": "object", - "description": "Custom metadata object set for this user", - "format": "any" - }, - "internalData": { - "type": "object", - "description": "Custom internal metadata object set for this user. Not available for user-role tokens", - "properties": {} - }, - "targets": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of forwarding targets" - }, - "spamLevel": { - "type": "number", - "description": "Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam" - }, - "limits": { - "$ref": "#/components/schemas/UserLimits" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of tags associated with the User" - }, - "fromWhitelist": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of additional email addresses this user can send mail from. Wildcard is allowed." - }, - "disabledScopes": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "imap", - "pop3", - "smtp" - ] - }, - "description": "Disabled scopes for this user" - }, - "hasPasswordSet": { - "type": "boolean", - "description": "If true then the User has a password set and can authenticate" - }, - "activated": { - "type": "boolean", - "description": "Is the account activated" - }, - "disabled": { - "type": "boolean", - "description": "If true then the user can not authenticate or receive any new mail" - }, - "suspended": { - "type": "boolean", - "description": "If true then the user can not authenticate" - } - }, - "required": [ - "success", - "id", - "username", - "name", - "address", - "retention", - "enabled2fa", - "autoreply", - "encryptMessages", - "encryptForwarded", - "pubKey", - "keyInfo", - "metaData", - "internalData", - "targets", - "spamLevel", - "limits", - "tags", - "disabledScopes", - "hasPasswordSet", - "activated", - "disabled", - "suspended" - ] + "$ref": "#/components/schemas/GetUserResponse" } } } @@ -759,7 +525,7 @@ "Users" ], "summary": "Update User information", - "operationId": "putusersuser", + "operationId": "updateUser", "requestBody": { "content": { "application/json": { @@ -953,17 +719,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -976,7 +732,7 @@ ], "summary": "Delete a User", "description": "This method deletes user and address entries from DB and schedules a background task to delete messages. You can call this method several times even if the user has already been deleted, in case there are still some pending messages.", - "operationId": "deleteusersuser", + "operationId": "deleteUser", "parameters": [ { "name": "user", @@ -1025,44 +781,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "code": { - "type": "string", - "description": "Task code. Should be TaskScheduled", - "example": "TaskScheduled" - }, - "user": { - "type": "string", - "description": "User ID" - }, - "addresses": { - "type": "object", - "properties": { - "deleted": { - "type": "number", - "description": "Number of deleted addresses" - } - } - }, - "deleteAfter": { - "type": "string", - "description": "Delete after date", - "format": "date-time" - }, - "task": { - "type": "string", - "description": "Task ID" - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/DeleteUserResponse" } } } @@ -1076,7 +795,7 @@ "Users" ], "summary": "Log out User", - "operationId": "putusersuserlogout", + "operationId": "logoutUser", "requestBody": { "content": { "application/json": { @@ -1118,17 +837,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -1143,7 +852,7 @@ ], "summary": "Recalculate User quota", "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.", - "operationId": "postusersuserquotareset", + "operationId": "recalculateQuota", "requestBody": { "content": { "application/json": { @@ -1181,27 +890,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "storageUsed": { - "type": "number", - "description": "Calculated quota usage for the user" - }, - "previousStorageUsed": { - "type": "number", - "description": "Previous storage used" - } - }, - "required": [ - "success", - "storageUsed", - "previousStorageUsed" - ] + "$ref": "#/components/schemas/RecalculateQuotaResponse" } } } @@ -1216,7 +905,7 @@ ], "summary": "Recalculate Quota for all 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.", - "operationId": "postquotareset", + "operationId": "recalculateQuotaAllUsers", "requestBody": { "content": { "application/json": { @@ -1274,7 +963,7 @@ ], "summary": "Export data", "description": "Export data for matching users. Export dump does not include emails, only account structure (user data, password hashes, mailboxes, filters, etc.). A special \"export\"-role access token is required for exporting and importing.", - "operationId": "postdataexport", + "operationId": "createExport", "requestBody": { "content": { "application/json": { @@ -1332,7 +1021,7 @@ ], "summary": "Import user data", "description": "Import data from an export dump. If a database entry already exists, it is not modified. A special \"export\"-role access token is required for exporting and importing.", - "operationId": "postdataimport", + "operationId": "createImport", "parameters": [], "responses": { "200": { @@ -1340,25 +1029,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "entries": { - "type": "number", - "description": "How many database entries were found from the export file" - }, - "imported": { - "type": "number", - "description": "How many database entries were imported from the export file" - }, - "failed": { - "type": "number", - "description": "How many database entries were not imported due to some error" - }, - "existing": { - "type": "number", - "description": "How many database existing entries were not imported" - } - } + "$ref": "#/components/schemas/CreateImportResponse" } } } @@ -1373,7 +1044,7 @@ ], "summary": "Reset password for a User", "description": "This method generates a new temporary password for a User. Additionally it removes all two-factor authentication settings", - "operationId": "postusersuserpasswordreset", + "operationId": "resetUserPassword", "requestBody": { "content": { "application/json": { @@ -1419,27 +1090,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "password": { - "type": "string", - "description": "Temporary password" - }, - "validAfter": { - "type": "string", - "description": "The date password is valid after", - "format": "date-time" - } - }, - "required": [ - "success", - "password" - ] + "$ref": "#/components/schemas/ResetUserPasswordResponse" } } } @@ -1453,7 +1104,7 @@ "Users" ], "summary": "Return recovery info for a deleted user", - "operationId": "getusersuserrestore", + "operationId": "restoreUserInfo", "parameters": [ { "name": "user", @@ -1489,54 +1140,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "user": { - "type": "string", - "description": "ID of the deleted User" - }, - "username": { - "type": "string", - "description": "Username of the User" - }, - "storageUsed": { - "type": "number", - "description": "Calculated quota usage for the user" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of tags associated with the User" - }, - "deleted": { - "type": "string", - "description": "Datestring of the time the user was deleted", - "format": "date-time" - }, - "recoverableAddresses": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of email addresses that can be restored" - } - }, - "required": [ - "success", - "user", - "username", - "storageUsed", - "tags", - "deleted", - "recoverableAddresses" - ] + "$ref": "#/components/schemas/RecoverInfoResponse" } } } @@ -1549,7 +1153,7 @@ ], "summary": "Cancel user deletion task", "description": "Use this endpoint to cancel a timed deletion task scheduled by DELETE /user/{id}. If user data is not yet deleted then the account is fully recovered, except any email addresses that might have been already recycled", - "operationId": "postusersuserrestore", + "operationId": "cancelUserDelete", "requestBody": { "content": { "application/json": { @@ -1587,43 +1191,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "code": { - "type": "string", - "description": "Task status code" - }, - "user": { - "type": "string", - "description": "User ID" - }, - "task": { - "type": "string", - "description": "Existing task id" - }, - "addresses": { - "type": "object", - "properties": { - "recovered": { - "type": "number", - "description": "Number of recovered addresses" - }, - "main": { - "type": "string", - "description": "Main address" - } - } - } - }, - "required": [ - "success", - "code" - ] + "$ref": "#/components/schemas/CancelUserDeletionResponse" } } } @@ -1637,7 +1205,7 @@ "Addresses" ], "summary": "List registered Addresses", - "operationId": "addresses", + "operationId": "getAddresses", "parameters": [ { "name": "query", @@ -1758,64 +1326,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "query": { - "type": "string", - "description": "Partial match of an address" - }, - "total": { - "type": "number", - "description": "How many results were found" - }, - "page": { - "type": "number", - "description": "Current page number. Derived from page query argument" - }, - "previousCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any previous results" - }, - "nextCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any next results" - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetAddressesResult" - }, - "description": "Address listing" - } - }, - "required": [ - "success", - "query", - "total", - "page", - "previousCursor", - "nextCursor", - "results" - ] + "$ref": "#/components/schemas/GetAddressesResponse" } } } @@ -1830,7 +1341,7 @@ ], "summary": "Create new Address", "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)", - "operationId": "postusersuseraddresses", + "operationId": "createUserAddress", "requestBody": { "content": { "application/json": { @@ -1909,22 +1420,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the address" - } - }, - "required": [ - "success", - "id" - ] + "$ref": "#/components/schemas/CreateUserAddressResponse" } } } @@ -1936,7 +1432,7 @@ "Addresses" ], "summary": "List registered Addresses for a User", - "operationId": "getusersuseraddresses", + "operationId": "getUserAddresses", "parameters": [ { "name": "user", @@ -1990,25 +1486,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetUserAddressesResult" - }, - "description": "Address listing" - } - }, - "required": [ - "success", - "results" - ] + "$ref": "#/components/schemas/GetUserAddressesResponse" } } } @@ -2022,7 +1500,7 @@ "Addresses" ], "summary": "Request Addresses information", - "operationId": "getusersuseraddressesaddress", + "operationId": "getUserAddress", "parameters": [ { "name": "user", @@ -2067,61 +1545,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the Address" - }, - "name": { - "type": "string", - "description": "Identity name" - }, - "address": { - "type": "string", - "description": "E-mail Address" - }, - "main": { - "type": "boolean", - "description": "Indicates if this is the default address for the User" - }, - "created": { - "type": "string", - "description": "Datestring of the time the address was created", - "format": "date-time" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of tags associated with the Address" - }, - "metaData": { - "type": "object", - "description": "Metadata object (if available)", - "properties": {} - }, - "internalData": { - "type": "object", - "description": "Internal metadata object (if available), not included for user-role requests", - "properties": {} - } - }, - "required": [ - "success", - "id", - "name", - "address", - "main", - "created", - "tags" - ] + "$ref": "#/components/schemas/GetUserAddressResponse" } } } @@ -2133,7 +1557,7 @@ "Addresses" ], "summary": "Delete an Address", - "operationId": "deleteusersuseraddressesaddress", + "operationId": "deleteUserAddress", "parameters": [ { "name": "user", @@ -2178,17 +1602,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -2202,7 +1616,7 @@ "Addresses" ], "summary": "Update Address information", - "operationId": "putusersuseraddressesid", + "operationId": "updateUserAddress", "requestBody": { "content": { "application/json": { @@ -2278,17 +1692,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -2302,7 +1706,7 @@ "Addresses" ], "summary": "List addresses from communication register", - "operationId": "getusersuseraddressregister", + "operationId": "getUserAddressregister", "parameters": [ { "name": "user", @@ -2360,25 +1764,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetUserAddressesregisterResult" - }, - "description": "Address listing" - } - }, - "required": [ - "success", - "results" - ] + "$ref": "#/components/schemas/GetUserAddressregisterResponse" } } } @@ -2393,7 +1779,7 @@ ], "summary": "Create new forwarded Address", "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)", - "operationId": "postaddressesforwarded", + "operationId": "createForwardedAddress", "requestBody": { "content": { "application/json": { @@ -2475,22 +1861,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the Address" - } - }, - "required": [ - "success", - "id" - ] + "$ref": "#/components/schemas/CreateForwardedAddressResponse" } } } @@ -2504,7 +1875,7 @@ "Addresses" ], "summary": "Update forwarded Address information", - "operationId": "putaddressesforwardedid", + "operationId": "updateForwardedAddress", "requestBody": { "content": { "application/json": { @@ -2585,17 +1956,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -2609,7 +1970,7 @@ "Addresses" ], "summary": "Delete a forwarded Address", - "operationId": "deleteaddressesforwardedaddress", + "operationId": "deleteForwardedAddress", "parameters": [ { "name": "address", @@ -2645,17 +2006,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -2667,7 +2018,7 @@ "Addresses" ], "summary": "Request forwarded Addresses information", - "operationId": "getaddressesforwardedaddress", + "operationId": "getForwardedAddress", "parameters": [ { "name": "address", @@ -2703,75 +2054,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the Address" - }, - "address": { - "type": "string", - "description": "E-mail Address" - }, - "name": { - "type": "string", - "description": "Identity name" - }, - "targets": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of forwarding targets" - }, - "limits": { - "$ref": "#/components/schemas/AddressLimits" - }, - "autoreply": { - "$ref": "#/components/schemas/AutoreplyInfo" - }, - "created": { - "type": "string", - "description": "Datestring of the time the address was created", - "format": "date-time" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of tags associated with the Address" - }, - "metaData": { - "type": "object", - "description": "Metadata object (if available)", - "properties": {} - }, - "internalData": { - "type": "object", - "description": "Internal metadata object (if available), not included for user-role requests", - "properties": {} - }, - "forwardedDisabled": { - "type": "boolean", - "description": "Specifies whether forwarding is disabled" - } - }, - "required": [ - "success", - "id", - "address", - "name", - "limits", - "autoreply", - "created", - "tags" - ] + "$ref": "#/components/schemas/GetForwardedAddressResponse" } } } @@ -2785,7 +2068,7 @@ "Addresses" ], "summary": "Get Address info", - "operationId": "getaddressesresolveaddress", + "operationId": "resolveAddress", "parameters": [ { "name": "address", @@ -2839,71 +2122,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the Address" - }, - "address": { - "type": "string", - "description": "E-mail Address" - }, - "name": { - "type": "string", - "description": "Identity name" - }, - "targets": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of forwarding targets if this is a Forwarded address" - }, - "limits": { - "$ref": "#/components/schemas/AddressLimits" - }, - "autoreply": { - "$ref": "#/components/schemas/AutoreplyInfo" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of tags associated with the Address" - }, - "created": { - "type": "string", - "description": "Datestring of the time the address was created", - "format": "date-time" - }, - "metaData": { - "type": "object", - "description": "Metadata object (if available)", - "properties": {} - }, - "internalData": { - "type": "object", - "description": "Internal metadata object (if available), not included for user-role requests", - "properties": {} - } - }, - "required": [ - "success", - "id", - "address", - "name", - "limits", - "autoreply", - "tags", - "created" - ] + "$ref": "#/components/schemas/ResolveAddressResponse" } } } @@ -2918,7 +2137,7 @@ ], "summary": "Rename domain in addresses", "description": "Renames domain names for addresses, DKIM keys and Domain Aliases", - "operationId": "putaddressesrenamedomain", + "operationId": "renameDomain", "requestBody": { "content": { "application/json": { @@ -2958,37 +2177,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "modifiedAddresses": { - "type": "number", - "description": "Number of modified addresses" - }, - "modifiedUsers": { - "type": "number", - "description": "Number of modified users" - }, - "modifiedDkim": { - "type": "number", - "description": "Number of modified DKIM keys" - }, - "modifiedAliases": { - "type": "number", - "description": "Number of modified Domain Aliases" - } - }, - "required": [ - "success", - "modifiedAddresses", - "modifiedUsers", - "modifiedDkim", - "modifiedAliases" - ] + "$ref": "#/components/schemas/ResolveDomainAddressesResponse" } } } @@ -3002,7 +2191,7 @@ "Mailboxes" ], "summary": "List Mailboxes for a User", - "operationId": "getusersusermailboxes", + "operationId": "getMailboxes", "parameters": [ { "name": "user", @@ -3074,82 +2263,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "results": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "ID of the Mailbox" - }, - "name": { - "type": "string", - "description": "Name for the mailbox (unicode string)" - }, - "path": { - "type": "string", - "description": "Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)" - }, - "specialUse": { - "type": "string", - "description": "Either special use identifier or null. One of Drafts, Junk, Sent or Trash" - }, - "modifyIndex": { - "type": "number", - "description": "Modification sequence number. Incremented on every change in the mailbox." - }, - "subscribed": { - "type": "boolean", - "description": "Mailbox subscription status. IMAP clients may unsubscribe from a folder." - }, - "retention": { - "type": "number", - "description": "Default retention policy for this mailbox (in ms). If set then messages added to this mailbox will be automatically deleted after retention time." - }, - "hidden": { - "type": "boolean", - "description": "Is the folder hidden or not" - }, - "total": { - "type": "number", - "description": "How many messages are stored in this mailbox" - }, - "unseen": { - "type": "number", - "description": "How many unseen messages are stored in this mailbox" - }, - "size": { - "type": "number", - "description": "Total size of mailbox in bytes." - } - }, - "required": [ - "id", - "name", - "path", - "specialUse", - "modifyIndex", - "subscribed", - "hidden", - "total", - "unseen" - ] - }, - "description": "List of user mailboxes" - } - }, - "required": [ - "success", - "results" - ] + "$ref": "#/components/schemas/GetMailboxesResponse" } } } @@ -3161,7 +2275,7 @@ "Mailboxes" ], "summary": "Create new Mailbox", - "operationId": "postusersusermailboxes", + "operationId": "createMailbox", "requestBody": { "content": { "application/json": { @@ -3214,22 +2328,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the Mailbox" - } - }, - "required": [ - "success", - "id" - ] + "$ref": "#/components/schemas/CreateMailboxResponse" } } } @@ -3243,7 +2342,7 @@ "Mailboxes" ], "summary": "Request Mailbox information", - "operationId": "getusersusermailboxesmailbox", + "operationId": "getMailbox", "parameters": [ { "name": "user", @@ -3297,63 +2396,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the Mailbox" - }, - "name": { - "type": "string", - "description": "Name for the mailbox (unicode string)" - }, - "path": { - "type": "string", - "description": "Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)" - }, - "specialUse": { - "type": "string", - "description": "Either special use identifier or null. One of Drafts, Junk, Sent or Trash", - "example": "\\Draft" - }, - "modifyIndex": { - "type": "number", - "description": "Modification sequence number. Incremented on every change in the mailbox." - }, - "subscribed": { - "type": "boolean", - "description": "Mailbox subscription status. IMAP clients may unsubscribe from a folder." - }, - "hidden": { - "type": "boolean", - "description": "Is the folder hidden or not" - }, - "total": { - "type": "number", - "description": "How many messages are stored in this mailbox" - }, - "unseen": { - "type": "number", - "description": "How many unseen messages are stored in this mailbox" - } - }, - "required": [ - "success", - "id", - "name", - "path", - "specialUse", - "modifyIndex", - "subscribed", - "hidden", - "total", - "unseen" - ] + "$ref": "#/components/schemas/GetMailboxResponse" } } } @@ -3365,7 +2408,7 @@ "Mailboxes" ], "summary": "Update Mailbox information", - "operationId": "putusersusermailboxesmailbox", + "operationId": "updateMailbox", "requestBody": { "content": { "application/json": { @@ -3428,17 +2471,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -3450,7 +2483,7 @@ "Mailboxes" ], "summary": "Delete a Mailbox", - "operationId": "deleteusersusermailboxesmailbox", + "operationId": "deleteMailbox", "parameters": [ { "name": "user", @@ -3495,17 +2528,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -3520,7 +2543,7 @@ ], "summary": "List messages in a Mailbox", "description": "Lists all messages in a mailbox", - "operationId": "messages", + "operationId": "getMessages", "parameters": [ { "name": "user", @@ -3662,63 +2685,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response" - }, - "total": { - "type": "number", - "description": "How many results were found" - }, - "page": { - "type": "number", - "description": "Current page number. Derived from page query argument" - }, - "previousCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any previous results" - }, - "nextCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any next results" - }, - "specialUse": { - "type": "string", - "description": "Special use. If available" - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetMessagesResult" - }, - "description": "Message listing" - } - }, - "required": [ - "success", - "total", - "page", - "previousCursor", - "nextCursor", - "specialUse", - "results" - ] + "$ref": "#/components/schemas/GetMessagesResponse" } } } @@ -3731,7 +2698,7 @@ ], "summary": "Update Message information", "description": "This method updates message flags and also allows to move messages to a different mailbox", - "operationId": "putusersusermailboxesmailboxmessages", + "operationId": "updateMessage", "requestBody": { "content": { "application/json": { @@ -3825,33 +2792,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "array", - "items": { - "type": "object", - "properties": {} - }, - "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" - }, - "mailbox": { - "type": "string", - "description": "MoveTo mailbox address" - }, - "updated": { - "type": "number", - "description": "If messages were not moved, then indicates the number of updated messages" - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/UpdateMessageResponse" } } } @@ -3863,7 +2804,7 @@ "Messages" ], "summary": "Delete all Messages from a Mailbox", - "operationId": "deleteusersusermailboxesmailboxmessages", + "operationId": "deleteMessagesInMailbox", "parameters": [ { "name": "user", @@ -3926,27 +2867,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "deleted": { - "type": "number", - "description": "Indicates the count of deleted messages" - }, - "errors": { - "type": "number", - "description": "Indicate the count of errors during the delete" - } - }, - "required": [ - "success", - "deleted", - "errors" - ] + "$ref": "#/components/schemas/DeleteMessagesInMailboxResponse" } } } @@ -3959,7 +2880,7 @@ ], "summary": "Upload Message", "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 structured data fields, then do not use the raw property.", - "operationId": "postusersusermailboxesmailboxmessages", + "operationId": "uploadMessage", "requestBody": { "content": { "application/json": { @@ -4114,49 +3035,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "message": { - "type": "object", - "description": "Message information", - "properties": { - "id": { - "type": "number", - "description": "Message ID in mailbox" - }, - "malbox": { - "type": "string", - "description": "Mailbox ID the message was stored into" - }, - "size": { - "type": "number", - "description": "Size of the RFC822 formatted email" - } - }, - "required": [ - "id", - "malbox", - "size" - ] - }, - "previousDeleted": { - "type": "boolean", - "description": "Set if replacing a previous message was requested" - }, - "previousDeleteError": { - "type": "string", - "description": "Previous delete error message" - } - }, - "required": [ - "success", - "message" - ] + "$ref": "#/components/schemas/UploadMessageResponse" } } } @@ -4171,7 +3050,7 @@ ], "summary": "Search for messages", "description": "This method allows searching for matching messages.", - "operationId": "search", + "operationId": "searchMessages", "parameters": [ { "name": "user", @@ -4436,60 +3315,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response" - }, - "query": { - "type": "string" - }, - "total": { - "type": "number" - }, - "page": { - "type": "number" - }, - "previousCursor": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "string" - } - ], - "description": "Either a cursor string or false if there are not any previous results" - }, - "nextCursor": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "string" - } - ], - "description": "Either a cursor string or false if there are not any next results" - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetMessagesResult" - }, - "description": "Message listing" - } - }, - "required": [ - "success", - "query", - "total", - "page", - "previousCursor", - "nextCursor", - "results" - ] + "$ref": "#/components/schemas/SearchMessagesResponse" } } } @@ -4502,7 +3328,7 @@ ], "summary": "Search and update messages", "description": "This method allows applying an action to all matching messages. This is an async method so that it will return immediately. Actual modifications are run in the background.", - "operationId": "searchApply", + "operationId": "searchApplyMessages", "requestBody": { "content": { "application/json": { @@ -4653,26 +3479,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates if the action succeeded or not" - }, - "scheduled": { - "type": "string", - "description": "ID of the scheduled operation" - }, - "existing": { - "type": "boolean", - "description": "Indicates if the scheduled operation already exists" - } - }, - "required": [ - "success", - "scheduled", - "existing" - ] + "$ref": "#/components/schemas/SearchApplyMessagesResponse" } } } @@ -4686,7 +3493,7 @@ "Messages" ], "summary": "Request Message information", - "operationId": "message", + "operationId": "getMessage", "parameters": [ { "name": "user", @@ -4758,291 +3565,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "number", - "description": "Message ID" - }, - "mailbox": { - "type": "string", - "description": "ID of the Mailbox" - }, - "user": { - "type": "string", - "description": "Example: `507f1f77bcf86cd799439011`\nID of the User" - }, - "envelope": { - "$ref": "#/components/schemas/Envelope" - }, - "thread": { - "type": "string", - "description": "ID of the Thread" - }, - "from": { - "$ref": "#/components/schemas/Address" - }, - "replyTo": { - "$ref": "#/components/schemas/Address" - }, - "to": { - "$ref": "#/components/schemas/Address" - }, - "cc": { - "$ref": "#/components/schemas/Address" - }, - "bcc": { - "$ref": "#/components/schemas/Address" - }, - "subject": { - "type": "string", - "description": "Message subject" - }, - "messageId": { - "type": "string", - "description": "Message-ID header" - }, - "date": { - "type": "string", - "description": "Date string from header", - "format": "date-time" - }, - "idate": { - "type": "string", - "description": "Date string of receive time", - "format": "date-time" - }, - "list": { - "$ref": "#/components/schemas/List" - }, - "size": { - "type": "number", - "description": "Message size" - }, - "expires": { - "type": "string", - "description": "Datestring, if set then indicates the time after this message is automatically deleted" - }, - "seen": { - "type": "boolean", - "description": "Does this message have a \\Seen flag" - }, - "deleted": { - "type": "boolean", - "description": "Does this message have a \\Deleted flag" - }, - "flagged": { - "type": "boolean", - "description": "Does this message have a \\Flagged flag" - }, - "draft": { - "type": "boolean", - "description": "Does this message have a \\Draft flag" - }, - "html": { - "type": "array", - "items": { - "type": "string" - }, - "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" - }, - "text": { - "type": "string", - "description": "Plaintext content of the message" - }, - "attachments": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Attachment ID" - }, - "hash": { - "type": "string", - "description": "SHA-256 hash of the contents of the attachment" - }, - "filename": { - "type": "string", - "description": "Filename of the attachment" - }, - "contentType": { - "type": "string", - "description": "MIME type" - }, - "disposition": { - "type": "string", - "description": "Attachment disposition" - }, - "transferEncoding": { - "type": "string", - "description": "Which transfer encoding was used (actual content when fetching attachments is not encoded)" - }, - "related": { - "type": "boolean", - "description": "Was this attachment found from a multipart/related node. This usually means that this is an embedded image" - }, - "sizeKb": { - "type": "number", - "description": "Approximate size of the attachment in kilobytes" - } - }, - "required": [ - "id", - "filename", - "contentType", - "disposition", - "transferEncoding", - "related", - "sizeKb" - ] - }, - "description": "Attachments for the message" - }, - "verificationResults": { - "type": "object", - "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.", - "properties": { - "tls": { - "$ref": "#/components/schemas/Tls" - }, - "spf": { - "type": "object", - "description": "Domain name (either MFROM or HELO) of verified SPF or false if no SPF match was found", - "properties": {} - }, - "dkim": { - "type": "object", - "description": "Domain name of verified DKIM signature or false if no valid signature was found", - "properties": {} - } - }, - "required": [ - "tls", - "spf", - "dkim" - ] - }, - "bimi": { - "type": "object", - "description": "BIMI logo info. If logo validation failed in any way, then this property is not set", - "properties": { - "certified": { - "type": "boolean", - "description": "If true, then this logo is from a VMC file" - }, - "url": { - "type": "string", - "description": "URL of the resource the logo was retrieved from" - }, - "image": { - "type": "string", - "description": "Data URL for the SVG image" - }, - "type": { - "type": "string", - "description": "Certificate type (only for VMC files)", - "enum": [ - "VMC", - "CMC" - ] - } - } - }, - "contentType": { - "type": "object", - "description": "Parsed Content-Type header. Usually needed to identify encrypted messages and such", - "properties": { - "value": { - "type": "string", - "description": "MIME type of the message, eg. \"multipart/mixed" - }, - "params": { - "type": "object", - "description": "An object with Content-Type params as key-value pairs", - "properties": {} - } - }, - "required": [ - "value", - "params" - ] - }, - "metaData": { - "type": "object", - "description": "Custom metadata object set for this message", - "properties": {} - }, - "references": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReferenceWithAttachments" - }, - "description": "References" - }, - "files": { - "type": "object", - "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", - "properties": {} - }, - "outbound": { - "type": "array", - "items": { - "type": "object", - "properties": {} - }, - "description": "Outbound queue entries" - }, - "forwardTargets": { - "type": "object", - "description": "Forward targets", - "properties": {} - }, - "reference": { - "type": "object", - "description": "Referenced message info", - "properties": {} - }, - "answered": { - "type": "boolean", - "description": "\\Answered flag value" - }, - "forwarded": { - "type": "boolean", - "description": "$Forwarded flag value" - }, - "encrypted": { - "type": "boolean", - "description": "True if message is encrypted" - } - }, - "required": [ - "success", - "id", - "mailbox", - "user", - "envelope", - "thread", - "from", - "subject", - "messageId", - "date", - "size", - "seen", - "deleted", - "flagged", - "draft", - "contentType", - "references", - "answered", - "forwarded" - ] + "$ref": "#/components/schemas/GetMessageResponse" } } } @@ -5055,7 +3578,7 @@ ], "summary": "Update message information with path param", "description": "This method updates message flags and also allows to move messages to a different mailbox", - "operationId": "putusersusermailboxesmailboxmessagesmessage", + "operationId": "updateMessagePathParams", "requestBody": { "content": { "application/json": { @@ -5151,33 +3674,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "array", - "items": { - "type": "object", - "properties": {} - }, - "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" - }, - "mailbox": { - "type": "string", - "description": "MoveTo mailbox address" - }, - "updated": { - "type": "number", - "description": "If messages were not moved, then indicates the number of updated messages" - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/UpdateMessageResponse" } } } @@ -5189,7 +3686,7 @@ "Messages" ], "summary": "Delete a Message", - "operationId": "deleteusersusermailboxesmailboxmessagesmessage", + "operationId": "deleteMessage", "parameters": [ { "name": "user", @@ -5243,17 +3740,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -5268,7 +3755,7 @@ ], "summary": "Get Message source", "description": "This method returns the full RFC822 formatted source of the stored message", - "operationId": "raw", + "operationId": "getMessageSource", "parameters": [ { "name": "user", @@ -5344,7 +3831,7 @@ ], "summary": "Download Attachment", "description": "This method returns attachment file contents in binary form", - "operationId": "attachment", + "operationId": "getMessageAttachment", "parameters": [ { "name": "user", @@ -5419,7 +3906,7 @@ ], "summary": "Forward stored Message", "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 a user had forwarding turned on but the message was not delivered so you can try again. Forwarding does not modify the original message.", - "operationId": "postusersusermailboxesmailboxmessagesmessageforward", + "operationId": "forwardStoredMessage", "requestBody": { "content": { "application/json": { @@ -5486,28 +3973,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "queueId": { - "type": "string", - "description": "Message ID in outbound queue" - }, - "forwarded": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Forwarded" - }, - "description": "Information about forwarding targets" - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/ForwardStoredMessageResponse" } } } @@ -5522,7 +3988,7 @@ ], "summary": "Submit Draft for delivery", "description": "This method allows to submit a draft message for delivery. Draft is moved to Sent mail folder.", - "operationId": "postusersusermailboxesmailboxmessagesmessagesubmit", + "operationId": "submitStoredMessage", "requestBody": { "content": { "application/json": { @@ -5587,25 +4053,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "queueId": { - "type": "string", - "description": "Message ID in outbound queue" - }, - "message": { - "$ref": "#/components/schemas/Message" - } - }, - "required": [ - "success", - "queueId" - ] + "$ref": "#/components/schemas/SubmitStoredMessageResponse" } } } @@ -5620,7 +4068,7 @@ ], "summary": "Delete an Outbound Message", "description": "You can delete outbound emails that are still in queue. Queue ID can be found from the `outbound` property of a stored email.", - "operationId": "deleteusersuseroutboundqueueid", + "operationId": "deleteOutboundMessage", "parameters": [ { "name": "user", @@ -5665,17 +4113,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -5690,7 +4128,7 @@ ], "summary": "List archived messages", "description": "Archive contains all recently deleted messages besides Drafts etc.", - "operationId": "archived", + "operationId": "getArchivedMessages", "parameters": [ { "name": "user", @@ -5791,58 +4229,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response" - }, - "total": { - "type": "number", - "description": "How many results were found" - }, - "page": { - "type": "number", - "description": "Current page number. Derived from page query argument" - }, - "previousCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any previous results" - }, - "nextCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any next results" - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetMessagesResult" - }, - "description": "Message listing" - } - }, - "required": [ - "success", - "total", - "page", - "previousCursor", - "nextCursor", - "results" - ] + "$ref": "#/components/schemas/GetArchivedMessagesResponse" } } } @@ -5857,7 +4244,7 @@ ], "summary": "Restore archived messages", "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.", - "operationId": "create_restore_task", + "operationId": "restoreMessages", "requestBody": { "content": { "application/json": { @@ -5909,21 +4296,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response" - }, - "task": { - "type": "string", - "description": "Task ID" - } - }, - "required": [ - "success", - "task" - ] + "$ref": "#/components/schemas/RestoreMessagesResponse" } } } @@ -5938,7 +4311,7 @@ ], "summary": "Restore archived messages", "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.", - "operationId": "archived_restore", + "operationId": "restoreMessage", "requestBody": { "content": { "application/json": { @@ -5989,26 +4362,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response" - }, - "mailbox": { - "type": "string", - "description": "Mailbox ID the message was moved to" - }, - "id": { - "type": "number", - "description": "New ID for the Message" - } - }, - "required": [ - "success", - "mailbox", - "id" - ] + "$ref": "#/components/schemas/RestoreMessageResponse" } } } @@ -6023,7 +4377,7 @@ ], "summary": "Upload file", "description": "This method allows to upload an attachment to be linked from a draft", - "operationId": "postusersuserstorage", + "operationId": "uploadFile", "requestBody": { "content": { "application/json": { @@ -6088,22 +4442,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "File ID" - } - }, - "required": [ - "success", - "id" - ] + "$ref": "#/components/schemas/UploadFileResponse" } } } @@ -6115,7 +4454,7 @@ "Storage" ], "summary": "List stored files", - "operationId": "getusersuserstorage", + "operationId": "getFiles", "parameters": [ { "name": "user", @@ -6200,61 +4539,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "total": { - "type": "number", - "description": "How many results were found", - "example": 541 - }, - "page": { - "type": "number", - "description": "Current page number. Derived from page query argument", - "example": 1 - }, - "previousCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any previous results" - }, - "nextCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any next results" - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetFilesResult" - }, - "description": "File listing" - } - }, - "required": [ - "success", - "total", - "page", - "previousCursor", - "nextCursor", - "results" - ] + "$ref": "#/components/schemas/GetFilesResponse" } } } @@ -6268,7 +4553,7 @@ "Storage" ], "summary": "Delete a File", - "operationId": "deleteusersuserstoragefile", + "operationId": "deleteFile", "parameters": [ { "name": "user", @@ -6313,17 +4598,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -6336,7 +4611,7 @@ ], "summary": "Download File", "description": "This method returns stored file contents in binary form", - "operationId": "storagefile", + "operationId": "getFile", "parameters": [ { "name": "user", @@ -6378,7 +4653,7 @@ "Filters" ], "summary": "List all Filters", - "operationId": "filters", + "operationId": "getAllFilters", "parameters": [ { "name": "forward", @@ -6463,60 +4738,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "total": { - "type": "number", - "description": "How many results were found", - "example": 541 - }, - "page": { - "type": "number", - "description": "Current page number. Derived from page query argument." - }, - "previousCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any previous results" - }, - "nextCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any next results" - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetAllFiltersResult" - }, - "description": "Address listing" - } - }, - "required": [ - "success", - "total", - "page", - "previousCursor", - "nextCursor", - "results" - ] + "$ref": "#/components/schemas/GetAllFiltersResponse" } } } @@ -6530,7 +4752,7 @@ "Filters" ], "summary": "List Filters for a User", - "operationId": "getusersuserfilters", + "operationId": "getFilters", "parameters": [ { "name": "user", @@ -6575,40 +4797,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "limits": { - "type": "object", - "description": "Filter usage limits for the user account", - "properties": { - "allowed": { - "type": "number", - "description": "How many filters are allowed" - }, - "used": { - "type": "number", - "description": "How many filters have been created" - } - } - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetFiltersResult" - }, - "description": "Filter description" - } - }, - "required": [ - "success", - "limits", - "results" - ] + "$ref": "#/components/schemas/GetFiltersResponse" } } } @@ -6620,7 +4809,7 @@ "Filters" ], "summary": "Create a new Filter", - "operationId": "postusersuserfilters", + "operationId": "createFilter", "requestBody": { "content": { "application/json": { @@ -6681,22 +4870,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID for the created filter" - } - }, - "required": [ - "success", - "id" - ] + "$ref": "#/components/schemas/UpdateFilterResponse" } } } @@ -6710,7 +4884,7 @@ "Filters" ], "summary": "Request Filter information", - "operationId": "getusersuserfiltersfilter", + "operationId": "getFilter", "parameters": [ { "name": "user", @@ -6755,51 +4929,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "Filters unique ID" - }, - "name": { - "type": "string", - "description": "Name for the filter" - }, - "created": { - "type": "string", - "description": "Datestring of the time the filter was created", - "format": "date-time" - }, - "query": { - "$ref": "#/components/schemas/Query" - }, - "action": { - "$ref": "#/components/schemas/Action" - }, - "disabled": { - "type": "boolean", - "description": "If true, then this filter is ignored" - }, - "metaData": { - "type": "object", - "description": "Custom metadata value", - "properties": {} - } - }, - "required": [ - "success", - "id", - "name", - "created", - "query", - "action", - "disabled" - ] + "$ref": "#/components/schemas/GetFilterResponse" } } } @@ -6811,7 +4941,7 @@ "Filters" ], "summary": "Delete a Filter", - "operationId": "deleteusersuserfiltersfilter", + "operationId": "deleteFilter", "parameters": [ { "name": "user", @@ -6856,17 +4986,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -6878,7 +4998,7 @@ "Filters" ], "summary": "Update Filter information", - "operationId": "putusersuserfiltersfilter", + "operationId": "updateFilter", "requestBody": { "content": { "application/json": { @@ -6944,17 +5064,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/UpdateFilterResponse" } } } @@ -6969,7 +5079,7 @@ ], "summary": "Add domain to allowlist", "description": "If an email is sent from a domain that is listed in the allowlist then it is never marked as spam. Lists apply for tagged users.", - "operationId": "postdomainaccesstagallow", + "operationId": "createAllowedDomain", "requestBody": { "content": { "application/json": { @@ -7014,22 +5124,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID for the created record" - } - }, - "required": [ - "success", - "id" - ] + "$ref": "#/components/schemas/CreateAllowedDomainResponse" } } } @@ -7041,7 +5136,7 @@ "DomainAccess" ], "summary": "List allowlisted domains", - "operationId": "getdomainaccesstagallow", + "operationId": "getAllowedDomains", "parameters": [ { "name": "tag", @@ -7077,25 +5172,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetAllowedDomainResult" - }, - "description": "Domain list" - } - }, - "required": [ - "success", - "results" - ] + "$ref": "#/components/schemas/GetAllowedDomainsResponse" } } } @@ -7110,7 +5187,7 @@ ], "summary": "Add domain to blocklist", "description": "If an email is sent from a domain that is listed in the blocklist then it is always marked as spam. Lists apply for tagged users.", - "operationId": "postdomainaccesstagblock", + "operationId": "createBlockedDomain", "requestBody": { "content": { "application/json": { @@ -7155,22 +5232,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID for the created record" - } - }, - "required": [ - "success", - "id" - ] + "$ref": "#/components/schemas/CreateBlockedDomainResponse" } } } @@ -7182,7 +5244,7 @@ "DomainAccess" ], "summary": "List blocklisted domains", - "operationId": "getdomainaccesstagblock", + "operationId": "getBlockedDomains", "parameters": [ { "name": "tag", @@ -7218,25 +5280,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetBlockedDomainResult" - }, - "description": "Domain list" - } - }, - "required": [ - "success", - "results" - ] + "$ref": "#/components/schemas/GetBlockedDomainsResponse" } } } @@ -7250,7 +5294,7 @@ "DomainAccess" ], "summary": "Delete a Domain from listing", - "operationId": "deletedomainaccessdomain", + "operationId": "deleteDomainListing", "parameters": [ { "name": "domain", @@ -7286,22 +5330,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "deleted": { - "type": "string", - "description": "Deleted domain's unique ID" - } - }, - "required": [ - "success", - "deleted" - ] + "$ref": "#/components/schemas/DeleteDomainListingResponse" } } } @@ -7315,7 +5344,7 @@ "ApplicationPasswords" ], "summary": "List Application Passwords", - "operationId": "getusersuserasps", + "operationId": "getASPs", "parameters": [ { "name": "user", @@ -7360,25 +5389,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetASPsResult" - }, - "description": "Event listing" - } - }, - "required": [ - "success", - "results" - ] + "$ref": "#/components/schemas/GetASPsResponse" } } } @@ -7390,7 +5401,7 @@ "ApplicationPasswords" ], "summary": "Create new Application Password", - "operationId": "postusersuserasps", + "operationId": "createASP", "requestBody": { "content": { "application/json": { @@ -7464,42 +5475,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the Application Password" - }, - "password": { - "type": "string", - "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\"" - }, - "mobileconfig": { - "type": "string", - "description": "Base64 encoded mobileconfig file. Generated profile file should be sent to the client with Content-Type value of application/x-apple-aspen-config." - }, - "name": { - "type": "string", - "description": "Account name" - }, - "address": { - "type": "string", - "description": "Account address or the address specified in params of this endpoint" - } - }, - "required": [ - "success", - "id", - "password", - "mobileconfig", - "name", - "address" - ] + "$ref": "#/components/schemas/CreateASPResponse" } } } @@ -7513,7 +5489,7 @@ "ApplicationPasswords" ], "summary": "Request ASP information", - "operationId": "getusersuseraspsasp", + "operationId": "getASP", "parameters": [ { "name": "user", @@ -7558,57 +5534,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the Application Password" - }, - "description": { - "type": "string", - "description": "Description" - }, - "scopes": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "imap", - "pop3", - "smtp", - "*" - ] - }, - "description": "Allowed scopes for the Application Password" - }, - "lastUse": { - "$ref": "#/components/schemas/LastUse" - }, - "created": { - "type": "string", - "description": "Datestring", - "format": "date-time" - }, - "expires": { - "type": "string", - "description": "Application password expires after the given date", - "format": "date-time" - } - }, - "required": [ - "success", - "id", - "description", - "scopes", - "lastUse", - "created", - "expires" - ] + "$ref": "#/components/schemas/GetASPResponse" } } } @@ -7620,7 +5546,7 @@ "ApplicationPasswords" ], "summary": "Delete an Application Password", - "operationId": "deleteusersuseraspsasp", + "operationId": "deleteASP", "parameters": [ { "name": "user", @@ -7665,17 +5591,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -7690,7 +5606,7 @@ ], "summary": "Generate TOTP seed", "description": "This method generates TOTP seed and QR code for 2FA. User needs to verify the seed value using 2fa/totp/enable endpoint", - "operationId": "postusersuser2fatotpsetup", + "operationId": "generateTOTPSeed", "requestBody": { "content": { "application/json": { @@ -7739,27 +5655,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "seed": { - "type": "string", - "description": "Generated TOTP seed value" - }, - "qrcode": { - "type": "string", - "description": "Base64 encoded QR code" - } - }, - "required": [ - "success", - "seed", - "qrcode" - ] + "$ref": "#/components/schemas/GenerateTOTPSeedResponse" } } } @@ -7774,7 +5670,7 @@ ], "summary": "Enable TOTP seed", "description": "This method enables TOTP for a user by verifying the seed value generated from 2fa/totp/setup", - "operationId": "postusersuser2fatotpenable", + "operationId": "enableTOTPSeed", "requestBody": { "content": { "application/json": { @@ -7819,17 +5715,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -7844,7 +5730,7 @@ ], "summary": "Disable TOTP auth", "description": "This method disables TOTP for a user. Does not affect other 2FA mechanisms a user might have set up", - "operationId": "deleteusersuser2fatotp", + "operationId": "disableTOTPAuth", "parameters": [ { "name": "user", @@ -7880,17 +5766,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -7905,7 +5781,7 @@ ], "summary": "Validate TOTP Token", "description": "This method checks if a TOTP token provided by a User is valid for authentication", - "operationId": "postusersuser2fatotpcheck", + "operationId": "validateTOTPToken", "requestBody": { "content": { "application/json": { @@ -7950,17 +5826,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -7975,7 +5841,7 @@ ], "summary": "Disable 2FA", "description": "This method disables all 2FA mechanisms a user might have set up", - "operationId": "deleteusersuser2fa", + "operationId": "disable2FA", "parameters": [ { "name": "user", @@ -8011,17 +5877,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -8036,7 +5892,7 @@ ], "summary": "Enable custom 2FA for a user", "description": "This method disables account password for IMAP/POP3/SMTP", - "operationId": "putusersuser2facustom", + "operationId": "enableCustom2FA", "requestBody": { "content": { "application/json": { @@ -8074,17 +5930,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -8097,7 +5943,7 @@ ], "summary": "Disable custom 2FA for a user", "description": "This method disables custom 2FA. If it was the only 2FA set up, then account password for IMAP/POP3/SMTP gets enabled again", - "operationId": "deleteusersuser2facustom", + "operationId": "disableCustom2FA", "parameters": [ { "name": "user", @@ -8133,17 +5979,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -8158,7 +5994,7 @@ ], "summary": "Get WebAuthN credentials for a user", "description": "This method returns the list of WebAuthN credentials for a given user", - "operationId": "getusersuser2fawebauthncredentials", + "operationId": "getWebAuthN", "parameters": [ { "name": "user", @@ -8194,50 +6030,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "credentials": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Credential ID" - }, - "rawId": { - "type": "string", - "description": "Raw ID string of the credential in hex" - }, - "description": { - "type": "string", - "description": "Descriptive name for the authenticator" - }, - "authenticatorAttachment": { - "type": "string", - "description": "Indicates whether authenticators is a part of the OS (\"platform\"), or roaming authenticators (\"cross-platform\")", - "example": "platform" - } - }, - "required": [ - "id", - "rawId", - "description", - "authenticatorAttachment" - ] - }, - "description": "List of credentials" - } - }, - "required": [ - "success", - "credentials" - ] + "$ref": "#/components/schemas/GetWebAuthNResponse" } } } @@ -8252,7 +6045,7 @@ ], "summary": "Remove WebAuthN authenticator", "description": "This method deletes the given WebAuthN authenticator for given user.", - "operationId": "deleteusersuser2fawebauthncredentialscredential", + "operationId": "deleteWebAuthN", "parameters": [ { "name": "user", @@ -8297,22 +6090,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "deleted": { - "type": "boolean", - "description": "Specifies whether the given credential has been deleted" - } - }, - "required": [ - "success", - "deleted" - ] + "$ref": "#/components/schemas/DeleteWebAuthNResponse" } } } @@ -8327,7 +6105,7 @@ ], "summary": "Get the WebAuthN registration challenge", "description": "This method initiates the WebAuthN authenticator registration challenge", - "operationId": "postusersuser2fawebauthnregistrationchallenge", + "operationId": "initiateWebAuthNRegistration", "requestBody": { "content": { "application/json": { @@ -8390,117 +6168,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "registrationOptions": { - "type": "object", - "properties": { - "challenge": { - "type": "string", - "description": "Challenge as a hex string" - }, - "user": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Example: `507f1f77bcf86cd799439011`\nID of the User" - }, - "name": { - "type": "string", - "description": "User address or name" - }, - "displayName": { - "type": "string", - "description": "User display name or username" - } - }, - "required": [ - "id", - "name", - "displayName" - ] - }, - "authenticatorSelection": { - "type": "object", - "description": "Data about the authenticator", - "properties": { - "authenticatorAttachment": { - "type": "string", - "description": "\"platform\" or \"cross-platform\"" - } - }, - "required": [ - "authenticatorAttachment" - ] - }, - "rp": { - "type": "object", - "description": "Relaying party data", - "properties": { - "name": { - "type": "string", - "description": "Rp name" - }, - "id": { - "type": "string", - "description": "Rp ID. Domain" - }, - "icon": { - "type": "string", - "description": "Rp icon. data/image string in base64 format" - } - }, - "required": [ - "name", - "id" - ] - }, - "excludeCredentials": { - "type": "array", - "items": { - "type": "object", - "properties": { - "rawId": { - "type": "string", - "description": "Raw ID of the credential as hex string" - }, - "type": { - "type": "string", - "description": "Type of the credential" - }, - "transports": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Credential transports. If authenticatorAttachment is \"platform\" then [\"internal\"] otherwise [\"usb\", \"nfc\", \"ble\"]" - } - }, - "required": [ - "rawId", - "type", - "transports" - ] - }, - "description": "List of credentials to exclude" - } - }, - "required": [ - "challenge", - "authenticatorSelection", - "rp" - ] - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/InitiateWebAuthNRegistrationResponse" } } } @@ -8515,7 +6183,7 @@ ], "summary": "Attestate WebAuthN authenticator", "description": "Attestation is used to verify the authenticity of the authenticator and provide assurances about its features.", - "operationId": "postusersuser2fawebauthnregistrationattestation", + "operationId": "attestateWebAuthNRegistration", "requestBody": { "content": { "application/json": { @@ -8579,37 +6247,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "Credential ID" - }, - "rawId": { - "type": "string", - "description": "Credential RawID as a hex string" - }, - "description": { - "type": "string", - "description": "Description for the authenticator" - }, - "authenticatorAttachment": { - "type": "string", - "description": "Specifies whether authenticator is \"platform\" or \"cross-platform\"" - } - }, - "required": [ - "success", - "id", - "rawId", - "description", - "authenticatorAttachment" - ] + "$ref": "#/components/schemas/AttestateWebAuthNRegistrationResponse" } } } @@ -8624,7 +6262,7 @@ ], "summary": "Begin WebAuthN authentication challenge", "description": "This method retrieves the WebAuthN PublicKeyCredentialRequestOptions object to use it for authentication", - "operationId": "postusersuser2fawebauthnauthenticationchallenge", + "operationId": "authenticateWebAuthN", "requestBody": { "content": { "application/json": { @@ -8682,78 +6320,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "authenticationOptions": { - "type": "object", - "description": "PublicKeyCredentialRequestOptions object", - "properties": { - "challenge": { - "type": "string", - "description": "Challenge as hex string" - }, - "allowCredentials": { - "type": "array", - "items": { - "type": "object", - "properties": { - "rawId": { - "type": "string", - "description": "RawId of the credential as hex string" - }, - "type": { - "type": "string", - "description": "Credential type" - } - }, - "required": [ - "rawId", - "type" - ] - }, - "description": "Allowed credential(s) based on the request" - }, - "rpId": { - "type": "string", - "description": "Relaying Party ID. Domain" - }, - "rawChallenge": { - "type": "string", - "description": "Raw challenge bytes. ArrayBuffer" - }, - "attestation": { - "type": "string", - "description": "Attestation string. `direct`/`indirect`/`none`" - }, - "extensions": { - "type": "object", - "description": "Any credential extensions", - "properties": {} - }, - "userVerification": { - "type": "string", - "description": "User verification type. `required`/`preferred`/`discouraged`" - }, - "timeout": { - "type": "number", - "description": "Timeout in milliseconds (ms)" - } - }, - "required": [ - "challenge", - "allowCredentials" - ] - } - }, - "required": [ - "success", - "authenticationOptions" - ] + "$ref": "#/components/schemas/AuthenticateWebAuthNResponse" } } } @@ -8768,7 +6335,7 @@ ], "summary": "WebAuthN authentication Assertion", "description": "Assert WebAuthN authentication request and actually authenticate the user", - "operationId": "postusersuser2fawebauthnauthenticationassertion", + "operationId": "assertWebAuthN", "requestBody": { "content": { "application/json": { @@ -8841,40 +6408,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "response": { - "type": "object", - "description": "Auth data", - "properties": { - "authenticated": { - "type": "boolean", - "description": "Authentication status" - }, - "credential": { - "type": "string", - "description": "WebAuthN credential ID" - } - }, - "required": [ - "authenticated", - "credential" - ] - }, - "token": { - "type": "string", - "description": "User auth token" - } - }, - "required": [ - "success", - "response" - ] + "$ref": "#/components/schemas/AssertWebAuthNResponse" } } } @@ -8889,7 +6423,7 @@ ], "summary": "Open change stream", "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", - "operationId": "getusersuserupdates", + "operationId": "getUpdates", "parameters": [ { "name": "user", @@ -8949,7 +6483,7 @@ ], "summary": "Pre-auth check", "description": "Check if an username exists and can be used for authentication", - "operationId": "postpreauth", + "operationId": "preauth", "requestBody": { "content": { "application/json": { @@ -8995,45 +6529,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "Example: `507f1f77bcf86cd799439011`\nID of the User" - }, - "username": { - "type": "string", - "description": "Username of authenticated User" - }, - "address": { - "type": "string", - "description": "Default email address of authenticated User" - }, - "scope": { - "type": "string", - "description": "The scope this authentication is valid for" - }, - "require2fa": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of enabled 2FA mechanisms" - } - }, - "required": [ - "success", - "id", - "username", - "address", - "scope", - "require2fa" - ] + "$ref": "#/components/schemas/PreAuthCheckResponse" } } } @@ -9047,7 +6543,7 @@ "Authentication" ], "summary": "Authenticate a User", - "operationId": "postauthenticate", + "operationId": "authenticate", "requestBody": { "content": { "application/json": { @@ -9110,54 +6606,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "Example: `507f1f77bcf86cd799439011`\nID of the User" - }, - "username": { - "type": "string", - "description": "Username of authenticated User" - }, - "address": { - "type": "string", - "description": "Default email address of authenticated User" - }, - "scope": { - "type": "string", - "description": "The scope this authentication is valid for" - }, - "require2fa": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of enabled 2FA mechanisms" - }, - "requirePasswordChange": { - "type": "boolean", - "description": "Indicates if account hassword has been reset and should be replaced" - }, - "token": { - "type": "string", - "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." - } - }, - "required": [ - "success", - "id", - "username", - "address", - "scope", - "require2fa", - "requirePasswordChange" - ] + "$ref": "#/components/schemas/AuthenticateResponse" } } } @@ -9170,7 +6619,7 @@ ], "summary": "Invalidate authentication token", "description": "This method invalidates currently used authentication token. If token is not provided then nothing happens", - "operationId": "deleteauthenticate", + "operationId": "invalidateAccessToken", "parameters": [], "responses": { "200": { @@ -9178,17 +6627,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -9202,7 +6641,7 @@ "Authentication" ], "summary": "List authentication Events", - "operationId": "authlog", + "operationId": "getAuthlog", "parameters": [ { "name": "user", @@ -9296,49 +6735,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "action": { - "type": "string", - "description": "Limit listing only to values with specific action value" - }, - "total": { - "type": "number", - "description": "How many results were found" - }, - "page": { - "type": "number", - "description": "Current page number. Derived from page query argument" - }, - "previousCursor": { - "type": "string", - "description": "Cursor value for previous page, retrieved from previousCursor response value", - "example": "TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR" - }, - "nextCursor": { - "type": "string", - "description": "Cursor value for next page, retrieved from nextCursor response value", - "example": "eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0" - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetAuthlogResult" - } - } - }, - "required": [ - "success", - "action", - "total", - "page", - "results" - ] + "$ref": "#/components/schemas/GetAuthlogResponse" } } } @@ -9352,7 +6749,7 @@ "Authentication" ], "summary": "Request Event information", - "operationId": "getusersuserauthlogevent", + "operationId": "getAuthlogEvent", "parameters": [ { "name": "user", @@ -9397,69 +6794,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "ID of the event" - }, - "action": { - "type": "string", - "description": "Action identifier" - }, - "result": { - "type": "string", - "description": "Did the action succeed" - }, - "sess": { - "type": "string", - "description": "Session identifier for the logs" - }, - "ip": { - "type": "string", - "description": "IP address for the logs " - }, - "created": { - "type": "string", - "description": "Datestring of the Event time", - "format": "date-time" - }, - "protocol": { - "type": "string", - "description": "Protocol that the authentication was made from" - }, - "requiredScope": { - "type": "string", - "description": "Scope of the auth" - }, - "last": { - "type": "string", - "description": "Date of the last update of Event", - "format": "date-time" - }, - "events": { - "type": "number", - "description": "Number of times same auth Event has occurred" - }, - "source": { - "type": "string", - "description": "Source of auth. Example: `master` if password auth was used" - }, - "expires": { - "type": "string", - "description": "After this date the given auth Event will not be updated and instead a new one will be created", - "format": "date-time" - } - }, - "required": [ - "id", - "action", - "result", - "created", - "last", - "events", - "expires" - ] + "$ref": "#/components/schemas/GetAuthlogEventResponse" } } } @@ -9473,7 +6808,7 @@ "Autoreplies" ], "summary": "Update Autoreply information", - "operationId": "putusersuserautoreply", + "operationId": "updateAutoreply", "requestBody": { "content": { "application/json": { @@ -9559,22 +6894,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "Autoreply ID" - } - }, - "required": [ - "success", - "id" - ] + "$ref": "#/components/schemas/UpdateAutoreplyResponse" } } } @@ -9586,7 +6906,7 @@ "Autoreplies" ], "summary": "Request Autoreply information", - "operationId": "getusersuserautoreply", + "operationId": "getAutoreply", "parameters": [ { "name": "user", @@ -9622,71 +6942,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "status": { - "type": "boolean", - "description": "Is the autoreply enabled (true) or not (false)" - }, - "name": { - "type": "string", - "description": "Name that is used for the From: header in autoreply message", - "enum": [ - "" - ] - }, - "subject": { - "type": "string", - "description": "Subject line for the autoreply. If empty then uses subject of the original message", - "enum": [ - "" - ] - }, - "text": { - "type": "string", - "description": "Plaintext formatted content of the autoreply message", - "enum": [ - "" - ] - }, - "html": { - "type": "string", - "description": "HTML formatted content of the autoreply message", - "enum": [ - "" - ] - }, - "start": { - "type": "string", - "description": "Datestring of the start of the autoreply or boolean false to disable start checks", - "format": "date-time", - "enum": [ - false - ] - }, - "end": { - "type": "string", - "description": "Datestring of the end of the autoreply or boolean false to disable end checks", - "format": "date-time", - "enum": [ - false - ] - }, - "created": { - "type": "string", - "description": "Datestring of when the Autoreply was created", - "format": "date-time" - } - }, - "required": [ - "success", - "created" - ] + "$ref": "#/components/schemas/GetAutoreplyResponse" } } } @@ -9698,7 +6954,7 @@ "Autoreplies" ], "summary": "Delete Autoreply information", - "operationId": "deleteusersuserautoreply", + "operationId": "deleteAutoreply", "parameters": [ { "name": "user", @@ -9734,17 +6990,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -9759,7 +7005,7 @@ ], "summary": "Submit a Message for Delivery", "description": "Use this method to send emails from a user account", - "operationId": "send", + "operationId": "submitMessage", "requestBody": { "content": { "application/json": { @@ -9959,21 +7205,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "message": { - "$ref": "#/components/schemas/MessageWithQueueId" - } - }, - "required": [ - "success", - "message" - ] + "$ref": "#/components/schemas/SubmitMessageResponse" } } } @@ -9988,7 +7220,7 @@ ], "summary": "Create new audit", "description": "Initiates a message audit", - "operationId": "postaudit", + "operationId": "createAudit", "requestBody": { "content": { "application/json": { @@ -10045,22 +7277,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID for the created Audit" - } - }, - "required": [ - "success", - "id" - ] + "$ref": "#/components/schemas/CreateAuditResponse" } } } @@ -10075,7 +7292,7 @@ ], "summary": "Request Audit Info", "description": "This method returns information about stored audit", - "operationId": "getauditaudit", + "operationId": "getAudit", "parameters": [ { "name": "audit", @@ -10093,73 +7310,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the Audit" - }, - "user": { - "type": "string", - "description": "Example: `507f1f77bcf86cd799439011`\nID of the User" - }, - "start": { - "type": "string", - "description": "Start time as ISO date", - "format": "date-time", - "enum": [ - false - ] - }, - "end": { - "type": "string", - "description": "End time as ISO date", - "format": "date-time", - "enum": [ - false - ] - }, - "expires": { - "type": "string", - "description": "Expiration date. Audit data is deleted after this date", - "format": "date-time" - }, - "import": { - "type": "object", - "description": "Audit import data", - "properties": { - "status": { - "type": "string", - "description": "Status of the audit" - }, - "failed": { - "type": "number", - "description": "How many messages failed" - }, - "copied": { - "type": "number", - "description": "How many messages copied" - } - }, - "required": [ - "status", - "failed", - "copied" - ] - } - }, - "required": [ - "success", - "id", - "user", - "expires", - "import" - ] + "$ref": "#/components/schemas/GetAuditResponse" } } } @@ -10174,7 +7325,7 @@ ], "summary": "Export Audited Emails", "description": "This method returns a mailbox file that contains all audited emails", - "operationId": "getauditauditexportmbox", + "operationId": "getAuditEmails", "parameters": [ { "name": "audit", @@ -10207,7 +7358,7 @@ "DomainAliases" ], "summary": "List registered Domain Aliases", - "operationId": "domainaliases", + "operationId": "getDomainAliases", "parameters": [ { "name": "query", @@ -10283,61 +7434,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "total": { - "type": "number", - "description": "How many results were found", - "example": 541 - }, - "page": { - "type": "number", - "description": "Current page number. Derived from page query argument", - "example": 1 - }, - "previousCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any previous results" - }, - "nextCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any next results" - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetDomainAliasesResult" - }, - "description": "Aliases listing" - } - }, - "required": [ - "success", - "total", - "page", - "previousCursor", - "nextCursor", - "results" - ] + "$ref": "#/components/schemas/GetDomainAliasesResponse" } } } @@ -10350,7 +7447,7 @@ ], "summary": "Create new Domain Alias", "description": "Add a new Alias for a Domain. This allows to accept mail on username@domain and username@alias", - "operationId": "postdomainaliases", + "operationId": "createDomainAlias", "requestBody": { "content": { "application/json": { @@ -10419,7 +7516,7 @@ "DomainAliases" ], "summary": "Resolve ID for a domain alias", - "operationId": "getdomainaliasesresolvealias", + "operationId": "resolveDomainAlias", "parameters": [ { "name": "alias", @@ -10484,7 +7581,7 @@ "DomainAliases" ], "summary": "Request Alias information", - "operationId": "getdomainaliasesalias", + "operationId": "getDomainAlias", "parameters": [ { "name": "alias", @@ -10520,38 +7617,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the Alias" - }, - "alias": { - "type": "string", - "description": "Alias domain" - }, - "domain": { - "type": "string", - "description": "Alias target" - }, - "created": { - "type": "string", - "description": "Datestring of the time the alias was created", - "format": "date-time" - } - }, - "required": [ - "success", - "id", - "alias", - "domain", - "created" - ] + "$ref": "#/components/schemas/GetDomainAliasResponse" } } } @@ -10563,7 +7629,7 @@ "DomainAliases" ], "summary": "Delete an Alias", - "operationId": "deletedomainaliasesalias", + "operationId": "deleteDomainAlias", "parameters": [ { "name": "alias", @@ -10599,17 +7665,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -10623,7 +7679,7 @@ "DKIM" ], "summary": "List registered DKIM keys", - "operationId": "dkim", + "operationId": "getDkimKeys", "parameters": [ { "name": "query", @@ -10699,66 +7755,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "total": { - "type": "number", - "description": "How many results were found", - "example": 541 - }, - "page": { - "type": "number", - "description": "Current page number. Derived from page query argument", - "example": 1 - }, - "previousCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any previous results" - }, - "nextCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any next results" - }, - "query": { - "type": "string", - "description": "Query string. Partial match of a Domain name" - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetDkimKeysResult" - }, - "description": "DKIM listing" - } - }, - "required": [ - "success", - "total", - "page", - "previousCursor", - "nextCursor", - "query", - "results" - ] + "$ref": "#/components/schemas/GetDkimKeysResponse" } } } @@ -10771,7 +7768,7 @@ ], "summary": "Create or update DKIM key for domain", "description": "Add a new DKIM key for a Domain or update existing one. There can be single DKIM key registered for each domain name.", - "operationId": "postdkim", + "operationId": "updateDkimKey", "requestBody": { "content": { "application/json": { @@ -10828,51 +7825,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the DKIM" - }, - "domain": { - "type": "string", - "description": "The domain this DKIM key applies to" - }, - "selector": { - "type": "string", - "description": "DKIM selector" - }, - "description": { - "type": "string", - "description": "Key description" - }, - "fingerprint": { - "type": "string", - "description": "Key fingerprint (SHA1)" - }, - "publicKey": { - "type": "string", - "description": "Public key in DNS format (no prefix/suffix, single line)" - }, - "dnsTxt": { - "$ref": "#/components/schemas/DnsTxt" - } - }, - "required": [ - "success", - "id", - "domain", - "selector", - "description", - "fingerprint", - "publicKey", - "dnsTxt" - ] + "$ref": "#/components/schemas/UpdateDkimKeyResponse" } } } @@ -10886,7 +7839,7 @@ "DKIM" ], "summary": "Resolve ID for a DKIM domain", - "operationId": "getdkimresolvedomain", + "operationId": "resolveDkim", "parameters": [ { "name": "domain", @@ -10922,23 +7875,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "DKIM unique ID (24 byte hex)", - "example": "609d201236d1d936948f23b1" - } - }, - "required": [ - "success", - "id" - ] + "$ref": "#/components/schemas/ResolveIdResponse" } } } @@ -10952,7 +7889,7 @@ "DKIM" ], "summary": "Request DKIM information", - "operationId": "getdkimdkim", + "operationId": "getDkimKey", "parameters": [ { "name": "dkim", @@ -10988,57 +7925,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the DKIM" - }, - "domain": { - "type": "string", - "description": "The domain this DKIM key applies to" - }, - "selector": { - "type": "string", - "description": "DKIM selector" - }, - "description": { - "type": "string", - "description": "Key description" - }, - "fingerprint": { - "type": "string", - "description": "Key fingerprint (SHA1)" - }, - "publicKey": { - "type": "string", - "description": "Public key in DNS format (no prefix/suffix, single line)" - }, - "dnsTxt": { - "$ref": "#/components/schemas/DnsTxt" - }, - "created": { - "type": "string", - "description": "DKIM created datestring", - "format": "date-time" - } - }, - "required": [ - "success", - "id", - "domain", - "selector", - "description", - "fingerprint", - "publicKey", - "dnsTxt", - "created" - ] + "$ref": "#/components/schemas/GetDkimKeyResponse" } } } @@ -11050,7 +7937,7 @@ "DKIM" ], "summary": "Delete a DKIM key", - "operationId": "deletedkimdkim", + "operationId": "deleteDkimKey", "parameters": [ { "name": "dkim", @@ -11086,17 +7973,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -11110,7 +7987,7 @@ "Certs" ], "summary": "List registered TLS certificates", - "operationId": "cert", + "operationId": "getTLSCertificates", "parameters": [ { "name": "query", @@ -11199,64 +8076,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "query": { - "type": "string", - "description": "Initial query" - }, - "total": { - "type": "number", - "description": "How many results were found", - "example": 541 - }, - "page": { - "type": "number", - "description": "Current page number. Derived from page query argument", - "example": 1 - }, - "previousCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any previous results" - }, - "nextCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any next results" - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetTLSCertResult" - } - } - }, - "required": [ - "success", - "total", - "page", - "previousCursor", - "nextCursor", - "results" - ] + "$ref": "#/components/schemas/GetTLSCertsResponse" } } } @@ -11269,7 +8089,7 @@ ], "summary": "Create or update TLS certificate for server name", "description": "Add a new TLS certificate for a server name or update existing one. You can add a single certificate for each server name but SAN names are supported as well. For example you can add a certificate for \"mydomain.com\" that includes \"*.mydomain.com\" in SAN and the same certificate would be used for requests that do not have it's own server name registered but match the SAN value.\n> NB! you must ensure yourself that the `servername` value is actually listed in certificate's common name or SAN as WildDuck is going to use this certificate regardless.", - "operationId": "postcerts", + "operationId": "updateTLSCertificate", "requestBody": { "content": { "application/json": { @@ -11327,61 +8147,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the certificate", - "example": "609d201236d1d936948f23b1" - }, - "servername": { - "type": "string", - "description": "The server name this certificate applies to", - "example": "imap.example.com" - }, - "description": { - "type": "string", - "description": "Key description", - "example": "Some notes about this certificate" - }, - "fingerprint": { - "type": "string", - "description": "Key fingerprint (SHA1)", - "example": "59:8b:ed:11:5b:4f:ce:b4:e5:1a:2f:35:b1:6f:7d:93:40:c8:2f:9c:38:3b:cd:f4:04:92:a1:0e:17:2c:3f:f3" - }, - "expires": { - "type": "string", - "description": "Certificate expiration time", - "format": "date-time", - "example": "2024-06-26T21:55:55.000Z" - }, - "altNames": { - "type": "array", - "items": { - "type": "string" - }, - "description": "SAN servernames listed in the certificate" - }, - "acme": { - "type": "boolean", - "description": "If true then private key and certificate are managed automatically by ACME" - } - }, - "required": [ - "success", - "id", - "servername", - "description", - "fingerprint", - "expires", - "altNames", - "acme" - ] + "$ref": "#/components/schemas/UpdateTLSCertResponse" } } } @@ -11395,7 +8161,7 @@ "Certs" ], "summary": "Resolve ID for a server name", - "operationId": "getcertsresolveservername", + "operationId": "resolveTLSCertificate", "parameters": [ { "name": "servername", @@ -11432,23 +8198,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "Unique ID of the cert (24 byte hex)", - "example": "609d201236d1d936948f23b1" - } - }, - "required": [ - "success", - "id" - ] + "$ref": "#/components/schemas/ResolveIdResponse" } } } @@ -11462,7 +8212,7 @@ "Certs" ], "summary": "Request TLS certificate information", - "operationId": "getcertscert", + "operationId": "getTLSCertificate", "parameters": [ { "name": "cert", @@ -11499,77 +8249,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the certificate", - "example": "609d201236d1d936948f23b1" - }, - "servername": { - "type": "string", - "description": "The server name this certificate applies to", - "example": "imap.example.com" - }, - "description": { - "type": "string", - "description": "Key description", - "example": "Some notes about this certificate" - }, - "fingerprint": { - "type": "string", - "description": "Key fingerprint (SHA1)", - "example": "59:8b:ed:11:5b:4f:ce:b4:e5:1a:2f:35:b1:6f:7d:93:40:c8:2f:9c:38:3b:cd:f4:04:92:a1:0e:17:2c:3f:f3" - }, - "expires": { - "type": "string", - "description": "Certificate expiration time", - "format": "date-time", - "example": "2024-06-26T21:55:55.000Z" - }, - "created": { - "type": "string", - "description": "Created datestring", - "format": "date-time", - "example": "2024-05-13T20:06:46.179Z" - }, - "autogenerated": { - "type": "boolean", - "description": "Was the certificate automatically generated on SNI request" - }, - "altNames": { - "type": "array", - "items": { - "type": "string" - }, - "description": "SAN servernames listed in the certificate" - }, - "acme": { - "type": "boolean", - "description": "If true then private key and certificate are managed automatically by ACME" - }, - "hasCert": { - "type": "boolean", - "description": "True if certificate actually has the certificate or private key" - } - }, - "required": [ - "success", - "id", - "servername", - "description", - "fingerprint", - "expires", - "created", - "altNames", - "acme", - "hasCert" - ] + "$ref": "#/components/schemas/GetTLSCertResponse" } } } @@ -11581,7 +8261,7 @@ "Certs" ], "summary": "Delete a TLS certificate", - "operationId": "deletecertscert", + "operationId": "deleteTLSCert", "parameters": [ { "name": "cert", @@ -11618,17 +8298,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -11642,7 +8312,7 @@ "Webhooks" ], "summary": "List registered Webhooks", - "operationId": "webhooks", + "operationId": "getWebhooks", "parameters": [ { "name": "type", @@ -11727,61 +8397,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "total": { - "type": "number", - "description": "How many results were found", - "example": 541 - }, - "page": { - "type": "number", - "description": "Current page number. Derived from page query argument", - "example": 1 - }, - "previousCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any previous results" - }, - "nextCursor": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Either a cursor string or false if there are not any next results" - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetWebhooksResult" - }, - "description": "Webhook listing" - } - }, - "required": [ - "success", - "total", - "page", - "previousCursor", - "nextCursor", - "results" - ] + "$ref": "#/components/schemas/GetWebhooksResponse" } } } @@ -11793,7 +8409,7 @@ "Webhooks" ], "summary": "Create new Webhook", - "operationId": "postwebhooks", + "operationId": "createWebhook", "requestBody": { "content": { "application/json": { @@ -11840,22 +8456,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "id": { - "type": "string", - "description": "ID of the Webhook" - } - }, - "required": [ - "success", - "id" - ] + "$ref": "#/components/schemas/CreateWebhookResponse" } } } @@ -11869,7 +8470,7 @@ "Webhooks" ], "summary": "Delete a webhook", - "operationId": "deletewebhookswebhook", + "operationId": "deleteWebhook", "parameters": [ { "name": "webhook", @@ -11905,17 +8506,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -11929,7 +8520,7 @@ "Settings" ], "summary": "List registered Settings", - "operationId": "settings", + "operationId": "getSettings", "parameters": [ { "name": "filter", @@ -11965,29 +8556,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "filter": { - "type": "string", - "description": "Partial match if requested" - }, - "settings": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetSettingsResult" - }, - "description": "Setting listing" - } - }, - "required": [ - "success", - "settings" - ] + "$ref": "#/components/schemas/GetSettingsResponse" } } } @@ -12002,7 +8571,7 @@ ], "summary": "Create or Update Setting", "description": "Create a new or update an existing setting", - "operationId": "postsettingskey", + "operationId": "createSetting", "requestBody": { "content": { "application/json": { @@ -12048,22 +8617,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "key": { - "type": "string", - "description": "Key of the Setting" - } - }, - "required": [ - "success", - "key" - ] + "$ref": "#/components/schemas/CreateSettingResponse" } } } @@ -12075,7 +8629,7 @@ "Settings" ], "summary": "Get Setting value", - "operationId": "getsettingskey", + "operationId": "getSetting", "parameters": [ { "name": "key", @@ -12111,40 +8665,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - }, - "key": { - "type": "string", - "description": "Key of the Setting" - }, - "value": { - "oneOf": [ - { - "type": "string", - "description": "Setting value" - }, - { - "type": "number", - "description": "Setting value" - } - ], - "description": "Setting value" - }, - "error": { - "type": "string", - "description": "Error if present", - "example": "Key was not found" - } - }, - "required": [ - "success", - "key" - ] + "$ref": "#/components/schemas/GetSettingResponse" } } } @@ -12159,7 +8680,7 @@ ], "summary": "Check the health of the API", "description": "Check the status of the WildDuck API service, that is if db is connected and readable/writable, same for redis.", - "operationId": "gethealth", + "operationId": "getHealth", "parameters": [], "responses": { "200": { @@ -12167,17 +8688,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "description": "Indicates successful response", - "example": true - } - }, - "required": [ - "success" - ] + "$ref": "#/components/schemas/SuccessResponse" } } } @@ -12330,6 +8841,68 @@ "suspended" ] }, + "GetUsersResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "total": { + "type": "number", + "description": "How many results were found", + "example": 541 + }, + "page": { + "type": "number", + "description": "Current page number. Derived from page query argument", + "example": 1 + }, + "previousCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any previous results" + }, + "nextCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any next results" + }, + "query": { + "type": "string", + "description": "Partial match of username or default email address" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetUsersResult" + }, + "description": "User listing" + } + }, + "required": [ + "success", + "total", + "page", + "previousCursor", + "nextCursor", + "query", + "results" + ] + }, "Mailboxes": { "type": "object", "description": "Optional names for special mailboxes", @@ -12348,6 +8921,43 @@ } } }, + "CreateUserResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "string", + "description": "Example: `507f1f77bcf86cd799439011`\nID of the User" + } + }, + "required": [ + "success", + "id" + ] + }, + "ResolveIdForUsernameResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "string", + "description": "Unique ID (24 byte hex)", + "example": "609d201236d1d936948f23b1" + } + }, + "required": [ + "success", + "id" + ] + }, "KeyInfo": { "type": "object", "description": "Information about public key or false if key is not available", @@ -12587,32 +9197,69 @@ "pop3Download" ] }, - "GetAddressesResult": { + "GetUserResponse": { "type": "object", "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, "id": { "type": "string", - "description": "ID of the Address" + "description": "Users unique ID (24 byte hex)" + }, + "username": { + "type": "string", + "description": "Username of the User" }, "name": { "type": "string", - "description": "Identity name" + "description": "Name of the User" }, "address": { "type": "string", - "description": "E-mail address string" + "description": "Main email address of the User" }, - "user": { - "type": "string", - "description": "User ID this address belongs to if this is a User address" + "retention": { + "type": "number", + "description": "Default retention time (in ms). false if not enabled" }, - "forwarded": { + "enabled2fa": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of enabled 2FA methods" + }, + "autoreply": { "type": "boolean", - "description": "If true then it is a forwarded address" + "description": "Is autoreply enabled or not (start time may still be in the future or end time in the past)" }, - "forwardedDisabled": { + "encryptMessages": { "type": "boolean", - "description": "If true then the forwarded address is disabled" + "description": "If true then received messages are encrypted" + }, + "encryptForwarded": { + "type": "boolean", + "description": "If true then forwarded messages are encrypted" + }, + "pubKey": { + "type": "string", + "description": "Public PGP key for the User that is used for encryption" + }, + "keyInfo": { + "$ref": "#/components/schemas/KeyInfo" + }, + "metaData": { + "type": "object", + "description": "Custom metadata object set for this user", + "format": "any" + }, + "internalData": { + "type": "object", + "description": "Custom internal metadata object set for this user. Not available for user-role tokens", + "properties": {} }, "targets": { "type": "array", @@ -12621,1181 +9268,4304 @@ }, "description": "List of forwarding targets" }, + "spamLevel": { + "type": "number", + "description": "Relative scale for detecting spam. 0 means that everything is spam, 100 means that nothing is spam" + }, + "limits": { + "$ref": "#/components/schemas/UserLimits" + }, "tags": { "type": "array", "items": { "type": "string" }, - "description": "List of tags associated with the Address" + "description": "List of tags associated with the User" }, - "metaData": { - "type": "object", - "description": "Metadata object (if available)", - "properties": {} + "fromWhitelist": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of additional email addresses this user can send mail from. Wildcard is allowed." }, - "internalData": { - "type": "object", - "description": "Internal metadata object (if available), not included for user-role requests", - "properties": {} + "disabledScopes": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "imap", + "pop3", + "smtp" + ] + }, + "description": "Disabled scopes for this user" + }, + "hasPasswordSet": { + "type": "boolean", + "description": "If true then the User has a password set and can authenticate" + }, + "activated": { + "type": "boolean", + "description": "Is the account activated" + }, + "disabled": { + "type": "boolean", + "description": "If true then the user can not authenticate or receive any new mail" + }, + "suspended": { + "type": "boolean", + "description": "If true then the user can not authenticate" } }, "required": [ + "success", "id", + "username", "name", "address", - "user", - "forwarded", - "forwardedDisabled", - "tags" + "retention", + "enabled2fa", + "autoreply", + "encryptMessages", + "encryptForwarded", + "pubKey", + "keyInfo", + "metaData", + "internalData", + "targets", + "spamLevel", + "limits", + "tags", + "disabledScopes", + "hasPasswordSet", + "activated", + "disabled", + "suspended" ] }, - "GetUserAddressesResult": { + "SuccessResponse": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "ID of the Address" + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + } + }, + "required": [ + "success" + ] + }, + "DeleteUserResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true }, - "name": { + "code": { "type": "string", - "description": "Identity name" + "description": "Task code. Should be TaskScheduled", + "example": "TaskScheduled" }, - "address": { + "user": { "type": "string", - "description": "E-mail Address" + "description": "User ID" }, - "main": { - "type": "boolean", - "description": "Indicates if this is the default address for the User" + "addresses": { + "type": "object", + "properties": { + "deleted": { + "type": "number", + "description": "Number of deleted addresses" + } + } }, - "created": { + "deleteAfter": { "type": "string", - "description": "Datestring of the time the address was created", + "description": "Delete after date", "format": "date-time" }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of tags associated with the Address" - }, - "metaData": { - "type": "object", - "description": "Metadata object (if available)", - "properties": {} + "task": { + "type": "string", + "description": "Task ID" + } + }, + "required": [ + "success" + ] + }, + "RecalculateQuotaResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true }, - "internalData": { - "type": "object", - "description": "Internal metadata object (if available), not included for user-role requests", - "properties": {} + "storageUsed": { + "type": "number", + "description": "Calculated quota usage for the user" + }, + "previousStorageUsed": { + "type": "number", + "description": "Previous storage used" } }, "required": [ - "id", - "name", - "address", - "main", - "created", - "tags" + "success", + "storageUsed", + "previousStorageUsed" ] }, - "GetUserAddressesregisterResult": { + "CreateImportResponse": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "ID of the Address" + "entries": { + "type": "number", + "description": "How many database entries were found from the export file" }, - "name": { + "imported": { + "type": "number", + "description": "How many database entries were imported from the export file" + }, + "failed": { + "type": "number", + "description": "How many database entries were not imported due to some error" + }, + "existing": { + "type": "number", + "description": "How many database existing entries were not imported" + } + } + }, + "ResetUserPasswordResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "password": { "type": "string", - "description": "Name from address header" + "description": "Temporary password" }, - "address": { + "validAfter": { "type": "string", - "description": "E-mail Address" + "description": "The date password is valid after", + "format": "date-time" } }, "required": [ - "id", - "address" + "success", + "password" ] }, - "Autoreply": { + "RecoverInfoResponse": { "type": "object", - "description": "Autoreply information", "properties": { - "status": { + "success": { "type": "boolean", - "description": "If true, then autoreply is enabled for this address" + "description": "Indicates successful response", + "example": true }, - "start": { + "user": { "type": "string", - "description": "Either a date string or boolean false to disable start time checks", - "format": "date-time", - "enum": [ - false - ] + "description": "ID of the deleted User" }, - "end": { + "username": { "type": "string", - "description": "Either a date string or boolean false to disable end time checks", - "format": "date-time", - "enum": [ - false - ] + "description": "Username of the User" }, - "name": { - "type": "string", - "description": "Name that is used for the From: header in autoreply message" + "storageUsed": { + "type": "number", + "description": "Calculated quota usage for the user" }, - "subject": { - "type": "string", - "description": "Autoreply subject line" + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of tags associated with the User" }, - "text": { + "deleted": { "type": "string", - "description": "Autoreply plaintext content" + "description": "Datestring of the time the user was deleted", + "format": "date-time" }, - "html": { - "type": "string", - "description": "Autoreply HTML content" - } - } - }, - "AddressLimits": { - "type": "object", - "description": "Account limits and usage", - "properties": { - "forwards": { - "$ref": "#/components/schemas/Forwards" + "recoverableAddresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of email addresses that can be restored" } }, "required": [ - "forwards" + "success", + "user", + "username", + "storageUsed", + "tags", + "deleted", + "recoverableAddresses" ] }, - "AutoreplyInfo": { + "CancelUserDeletionResponse": { "type": "object", - "description": "Autoreply information", "properties": { - "status": { + "success": { "type": "boolean", - "description": "If true, then autoreply is enabled for this address" + "description": "Indicates successful response", + "example": true }, - "name": { + "code": { "type": "string", - "description": "Name that is used for the From: header in autoreply message" + "description": "Task status code" }, - "subject": { + "user": { "type": "string", - "description": "Autoreply subject line" + "description": "User ID" }, - "text": { + "task": { "type": "string", - "description": "Autoreply plaintext content" + "description": "Existing task id" }, - "html": { - "type": "string", - "description": "Autoreply HTML content" + "addresses": { + "type": "object", + "properties": { + "recovered": { + "type": "number", + "description": "Number of recovered addresses" + }, + "main": { + "type": "string", + "description": "Main address" + } + } } }, "required": [ - "status", - "name", - "subject", - "text", - "html" + "success", + "code" ] }, - "Address": { + "GetAddressesResult": { "type": "object", "properties": { + "id": { + "type": "string", + "description": "ID of the Address" + }, "name": { "type": "string", - "description": "Name of the sender/recipient" + "description": "Identity name" }, "address": { "type": "string", - "description": "Address of the sender/recipient" + "description": "E-mail address string" + }, + "user": { + "type": "string", + "description": "User ID this address belongs to if this is a User address" + }, + "forwarded": { + "type": "boolean", + "description": "If true then it is a forwarded address" + }, + "forwardedDisabled": { + "type": "boolean", + "description": "If true then the forwarded address is disabled" + }, + "targets": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of forwarding targets" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of tags associated with the Address" + }, + "metaData": { + "type": "object", + "description": "Metadata object (if available)", + "properties": {} + }, + "internalData": { + "type": "object", + "description": "Internal metadata object (if available), not included for user-role requests", + "properties": {} } }, "required": [ + "id", "name", - "address" + "address", + "user", + "forwarded", + "forwardedDisabled", + "tags" ] }, - "ReferenceWithAttachments": { + "GetAddressesResponse": { "type": "object", "properties": { - "mailbox": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "query": { "type": "string", - "description": "ID of the Mailbox" + "description": "Partial match of an address" }, - "id": { + "total": { "type": "number", - "description": "Message ID" + "description": "How many results were found" }, - "action": { - "type": "string", - "description": "Either reply, replyAll or forward", - "enum": [ - "reply", - "replyAll", - "forward" - ] + "page": { + "type": "number", + "description": "Current page number. Derived from page query argument" }, - "attachments": { + "previousCursor": { "oneOf": [ + { + "type": "string" + }, { "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any previous results" + }, + "nextCursor": { + "oneOf": [ + { + "type": "string" }, { - "type": "array", - "items": { - "type": "string" - } + "type": "boolean" } ], - "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" + "description": "Either a cursor string or false if there are not any next results" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetAddressesResult" + }, + "description": "Address listing" } }, "required": [ - "mailbox", - "id", - "action" + "success", + "query", + "total", + "page", + "previousCursor", + "nextCursor", + "results" ] }, - "Bimi": { + "CreateUserAddressResponse": { "type": "object", - "description": "Marks BIMI verification as passed for a domain. NB! BIMI record and logo files for the domain must be valid.", "properties": { - "domain": { - "type": "string", - "description": "Domain name for the BIMI record. It does not have to be the same as the From address." + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true }, - "selector": { + "id": { "type": "string", - "description": "Optional BIMI selector" + "description": "ID of the address" } }, "required": [ - "domain" + "success", + "id" ] }, - "ContentType": { + "GetUserAddressesResult": { "type": "object", - "description": "Parsed Content-Type header. Usually needed to identify encrypted messages and such", "properties": { - "value": { + "id": { "type": "string", - "description": "MIME type of the message, eg. \"multipart/mixed\"" + "description": "ID of the Address" }, - "params": { - "type": "object", - "description": "An object with Content-Type params as key-value pairs", - "properties": {} - } - }, - "required": [ - "value", - "params" - ] - }, - "GetMessagesResult": { - "type": "object", - "properties": { - "id": { - "type": "number", - "description": "ID of the Message" - }, - "mailbox": { + "name": { "type": "string", - "description": "ID of the Mailbox" + "description": "Identity name" }, - "thread": { + "address": { "type": "string", - "description": "ID of the Thread" + "description": "E-mail Address" }, - "threadMessageCount": { - "type": "number", - "description": "Amount of messages in the Thread. Included if threadCounters query argument was true" + "main": { + "type": "boolean", + "description": "Indicates if this is the default address for the User" }, - "from": { - "$ref": "#/components/schemas/Address" + "created": { + "type": "string", + "description": "Datestring of the time the address was created", + "format": "date-time" }, - "to": { + "tags": { "type": "array", "items": { - "$ref": "#/components/schemas/Address" + "type": "string" }, - "description": "Recipients in To: field" + "description": "List of tags associated with the Address" }, - "cc": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Address" - }, - "description": "Recipients in Cc: field" + "metaData": { + "type": "object", + "description": "Metadata object (if available)", + "properties": {} }, - "bcc": { + "internalData": { + "type": "object", + "description": "Internal metadata object (if available), not included for user-role requests", + "properties": {} + } + }, + "required": [ + "id", + "name", + "address", + "main", + "created", + "tags" + ] + }, + "GetUserAddressesResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "results": { "type": "array", "items": { - "$ref": "#/components/schemas/Address" + "$ref": "#/components/schemas/GetUserAddressesResult" }, - "description": "Recipients in Bcc: field. Usually only available for drafts" - }, - "messageId": { - "type": "string", - "description": "Message ID" - }, - "subject": { - "type": "string", - "description": "Message subject" + "description": "Address listing" + } + }, + "required": [ + "success", + "results" + ] + }, + "GetUserAddressResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true }, - "date": { + "id": { "type": "string", - "description": "Date string from header", - "format": "date-time" + "description": "ID of the Address" }, - "idate": { + "name": { "type": "string", - "description": "Date string of receive time", - "format": "date-time" + "description": "Identity name" }, - "intro": { + "address": { "type": "string", - "description": "First 128 bytes of the message" - }, - "attachments": { - "type": "boolean", - "description": "Does the message have attachments" - }, - "size": { - "type": "number", - "description": "Message size in bytes" - }, - "seen": { - "type": "boolean", - "description": "Is this message already seen or not" - }, - "deleted": { - "type": "boolean", - "description": "Does this message have a Deleted flag (should not have as messages are automatically deleted once this flag is set)" - }, - "flagged": { - "type": "boolean", - "description": "Does this message have a Flagged flag" - }, - "draft": { - "type": "boolean", - "description": "is this message a draft" + "description": "E-mail Address" }, - "answered": { + "main": { "type": "boolean", - "description": "Does this message have a Answered flag" + "description": "Indicates if this is the default address for the User" }, - "forwarded": { - "type": "boolean", - "description": "Does this message have a $Forwarded flag" + "created": { + "type": "string", + "description": "Datestring of the time the address was created", + "format": "date-time" }, - "references": { + "tags": { "type": "array", "items": { - "$ref": "#/components/schemas/ReferenceWithAttachments" + "type": "string" }, - "description": "References" - }, - "bimi": { - "$ref": "#/components/schemas/Bimi" - }, - "contentType": { - "$ref": "#/components/schemas/ContentType" - }, - "encrypted": { - "type": "boolean", - "description": "Specifies whether the message is encrypted" + "description": "List of tags associated with the Address" }, "metaData": { "type": "object", - "description": "Custom metadata value. Included if metaData query argument was true", + "description": "Metadata object (if available)", "properties": {} }, - "headers": { + "internalData": { "type": "object", - "description": "Header object keys requested with the includeHeaders argument", + "description": "Internal metadata object (if available), not included for user-role requests", "properties": {} } }, "required": [ + "success", "id", - "mailbox", - "thread", - "to", - "cc", - "bcc", - "messageId", - "subject", - "date", - "intro", - "attachments", - "size", - "seen", - "deleted", - "flagged", - "draft", - "answered", - "forwarded", - "references", - "bimi", - "contentType" + "name", + "address", + "main", + "created", + "tags" ] }, - "AddressOptionalName": { + "GetUserAddressesregisterResult": { "type": "object", - "description": "Address for the From: header", "properties": { + "id": { + "type": "string", + "description": "ID of the Address" + }, "name": { "type": "string", - "description": "Name of the sender" + "description": "Name from address header" }, "address": { "type": "string", - "description": "Address of the sender" + "description": "E-mail Address" } }, "required": [ + "id", "address" ] }, - "Header": { + "GetUserAddressregisterResponse": { "type": "object", "properties": { - "key": { - "type": "string", - "description": "Header key ('X-Mailer')" + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true }, - "value": { - "type": "string", - "description": "Header value ('My Awesome Mailing Service')" + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetUserAddressesregisterResult" + }, + "description": "Address listing" } - } + }, + "required": [ + "success", + "results" + ] }, - "Attachment": { + "Autoreply": { "type": "object", + "description": "Autoreply information", "properties": { - "filename": { - "type": "string", - "description": "Attachment filename" + "status": { + "type": "boolean", + "description": "If true, then autoreply is enabled for this address" }, - "contentType": { + "start": { "type": "string", - "description": "MIME type for the attachment file" + "description": "Either a date string or boolean false to disable start time checks", + "format": "date-time", + "enum": [ + false + ] }, - "encoding": { + "end": { "type": "string", - "description": "Encoding to use to store the attachments" + "description": "Either a date string or boolean false to disable end time checks", + "format": "date-time", + "enum": [ + false + ] }, - "contentTransferEncoding": { + "name": { "type": "string", - "description": "Transfer encoding" + "description": "Name that is used for the From: header in autoreply message" }, - "content": { + "subject": { "type": "string", - "description": "Base64 encoded attachment content" + "description": "Autoreply subject line" }, - "cid": { + "text": { "type": "string", - "description": "Content-ID value if you want to reference to this attachment from HTML formatted message" + "description": "Autoreply plaintext content" }, - "contentDisposition": { + "html": { "type": "string", - "description": "Content Disposition", - "enum": [ - "inline", - "attachment" - ] + "description": "Autoreply HTML content" } - }, - "required": [ - "content" - ] + } }, - "Rcpt": { + "CreateForwardedAddressResponse": { "type": "object", "properties": { - "value": { - "type": "string", - "description": "RCPT TO address as provided by SMTP client" + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true }, - "formatted": { + "id": { "type": "string", - "description": "Normalized RCPT address" + "description": "ID of the Address" } }, "required": [ - "value", - "formatted" + "success", + "id" ] }, - "Envelope": { + "AddressLimits": { "type": "object", - "description": "SMTP envelope (if available)", + "description": "Account limits and usage", "properties": { - "from": { - "type": "string", - "description": "Address from MAIL FROM" - }, - "rcpt": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Rcpt" - }, - "description": "Array of addresses from RCPT TO (should have just one normally)" + "forwards": { + "$ref": "#/components/schemas/Forwards" } }, "required": [ - "from" + "forwards" ] }, - "List": { + "AutoreplyInfo": { "type": "object", - "description": "If set then this message is from a mailing list", + "description": "Autoreply information", "properties": { - "id": { - "type": "string", - "description": "Value from List-ID header" + "status": { + "type": "boolean", + "description": "If true, then autoreply is enabled for this address" }, - "unsubscribe": { - "type": "string", - "description": "Value from List-Unsubscribe header" - } - }, - "required": [ - "id", - "unsubscribe" - ] - }, - "Tls": { - "type": "object", - "description": "TLS information. Value is false if TLS was not used", - "properties": { "name": { - "type": "object", - "description": "Cipher name, eg \"ECDHE-RSA-AES128-GCM-SHA256\"", - "properties": {} + "type": "string", + "description": "Name that is used for the From: header in autoreply message" }, - "version": { - "type": "object", - "description": "TLS version, eg \"TLSv1/SSLv3\"", - "properties": {} - } - }, - "required": [ - "name", - "version" - ] - }, - "Forwarded": { - "type": "object", - "properties": { - "seq": { + "subject": { "type": "string", - "description": "Sequence ID" + "description": "Autoreply subject line" }, - "type": { + "text": { "type": "string", - "description": "Target type" + "description": "Autoreply plaintext content" }, - "value": { + "html": { "type": "string", - "description": "Target address" + "description": "Autoreply HTML content" } }, "required": [ - "seq", - "type", - "value" + "status", + "name", + "subject", + "text", + "html" ] }, - "Message": { + "GetForwardedAddressResponse": { "type": "object", - "description": "Message information", "properties": { - "id": { - "type": "number", - "description": "Message ID in mailbox" + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true }, - "mailbox": { + "id": { "type": "string", - "description": "Mailbox ID the message was stored into" + "description": "ID of the Address" }, - "size": { - "type": "number", - "description": "Size of the RFC822 formatted email" - } - }, - "required": [ - "id", - "mailbox", - "size" - ] - }, - "GetFilesResult": { - "type": "object", - "properties": { - "id": { + "address": { "type": "string", - "description": "File ID" + "description": "E-mail Address" }, - "filename": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Filename. False if none" + "name": { + "type": "string", + "description": "Identity name" }, - "contentType": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ], - "description": "Content-Type of the file. False if none" + "targets": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of forwarding targets" }, - "cid": { - "type": "string", - "description": "Content ID" + "limits": { + "$ref": "#/components/schemas/AddressLimits" }, - "size": { - "type": "number", - "description": "File size" + "autoreply": { + "$ref": "#/components/schemas/AutoreplyInfo" }, "created": { "type": "string", - "description": "Created datestring", + "description": "Datestring of the time the address was created", "format": "date-time" }, - "md5": { - "type": "string", - "description": "md5 hash" + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of tags associated with the Address" + }, + "metaData": { + "type": "object", + "description": "Metadata object (if available)", + "properties": {} + }, + "internalData": { + "type": "object", + "description": "Internal metadata object (if available), not included for user-role requests", + "properties": {} + }, + "forwardedDisabled": { + "type": "boolean", + "description": "Specifies whether forwarding is disabled" } }, "required": [ + "success", "id", - "filename", - "contentType", - "size", + "address", + "name", + "limits", + "autoreply", "created", - "md5" + "tags" ] }, - "GetAllFiltersResult": { + "ResolveAddressResponse": { "type": "object", "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, "id": { "type": "string", - "description": "Filter ID" + "description": "ID of the Address" }, - "user": { + "address": { "type": "string", - "description": "User ID" + "description": "E-mail Address" }, "name": { "type": "string", - "description": "Name for the filter" - }, - "created": { - "type": "string", - "description": "Datestring of the time the filter was created", - "format": "date-time" + "description": "Identity name" }, - "query": { + "targets": { "type": "array", "items": { - "type": "array", - "items": { - "type": "string" - } + "type": "string" }, - "description": "Filter query strings" + "description": "List of forwarding targets if this is a Forwarded address" }, - "action": { + "limits": { + "$ref": "#/components/schemas/AddressLimits" + }, + "autoreply": { + "$ref": "#/components/schemas/AutoreplyInfo" + }, + "tags": { "type": "array", "items": { - "type": "array", - "items": { - "type": "string" - } + "type": "string" }, - "description": "Filter action strings" + "description": "List of tags associated with the Address" }, - "disabled": { - "type": "boolean", - "description": "If true, then this filter is ignored" + "created": { + "type": "string", + "description": "Datestring of the time the address was created", + "format": "date-time" }, "metaData": { "type": "object", - "description": "Custom metadata value. Included if metaData query argument was true", + "description": "Metadata object (if available)", "properties": {} }, - "targets": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of forwarding targets" + "internalData": { + "type": "object", + "description": "Internal metadata object (if available), not included for user-role requests", + "properties": {} } }, "required": [ + "success", "id", - "user", + "address", "name", - "created", - "query", - "action", - "disabled" + "limits", + "autoreply", + "tags", + "created" ] }, - "GetFiltersResult": { + "ResolveDomainAddressesResponse": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "Filter ID" + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true }, - "name": { - "type": "string", + "modifiedAddresses": { + "type": "number", + "description": "Number of modified addresses" + }, + "modifiedUsers": { + "type": "number", + "description": "Number of modified users" + }, + "modifiedDkim": { + "type": "number", + "description": "Number of modified DKIM keys" + }, + "modifiedAliases": { + "type": "number", + "description": "Number of modified Domain Aliases" + } + }, + "required": [ + "success", + "modifiedAddresses", + "modifiedUsers", + "modifiedDkim", + "modifiedAliases" + ] + }, + "GetMailboxesResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "results": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the Mailbox" + }, + "name": { + "type": "string", + "description": "Name for the mailbox (unicode string)" + }, + "path": { + "type": "string", + "description": "Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)" + }, + "specialUse": { + "type": "string", + "description": "Either special use identifier or null. One of Drafts, Junk, Sent or Trash" + }, + "modifyIndex": { + "type": "number", + "description": "Modification sequence number. Incremented on every change in the mailbox." + }, + "subscribed": { + "type": "boolean", + "description": "Mailbox subscription status. IMAP clients may unsubscribe from a folder." + }, + "retention": { + "type": "number", + "description": "Default retention policy for this mailbox (in ms). If set then messages added to this mailbox will be automatically deleted after retention time." + }, + "hidden": { + "type": "boolean", + "description": "Is the folder hidden or not" + }, + "total": { + "type": "number", + "description": "How many messages are stored in this mailbox" + }, + "unseen": { + "type": "number", + "description": "How many unseen messages are stored in this mailbox" + }, + "size": { + "type": "number", + "description": "Total size of mailbox in bytes." + } + }, + "required": [ + "id", + "name", + "path", + "specialUse", + "modifyIndex", + "subscribed", + "hidden", + "total", + "unseen" + ] + }, + "description": "List of user mailboxes" + } + }, + "required": [ + "success", + "results" + ] + }, + "CreateMailboxResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "string", + "description": "ID of the Mailbox" + } + }, + "required": [ + "success", + "id" + ] + }, + "GetMailboxResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "string", + "description": "ID of the Mailbox" + }, + "name": { + "type": "string", + "description": "Name for the mailbox (unicode string)" + }, + "path": { + "type": "string", + "description": "Full path of the mailbox, folders are separated by slashes, ends with the mailbox name (unicode string)" + }, + "specialUse": { + "type": "string", + "description": "Either special use identifier or null. One of Drafts, Junk, Sent or Trash", + "example": "\\Draft" + }, + "modifyIndex": { + "type": "number", + "description": "Modification sequence number. Incremented on every change in the mailbox." + }, + "subscribed": { + "type": "boolean", + "description": "Mailbox subscription status. IMAP clients may unsubscribe from a folder." + }, + "hidden": { + "type": "boolean", + "description": "Is the folder hidden or not" + }, + "total": { + "type": "number", + "description": "How many messages are stored in this mailbox" + }, + "unseen": { + "type": "number", + "description": "How many unseen messages are stored in this mailbox" + } + }, + "required": [ + "success", + "id", + "name", + "path", + "specialUse", + "modifyIndex", + "subscribed", + "hidden", + "total", + "unseen" + ] + }, + "Address": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the sender/recipient" + }, + "address": { + "type": "string", + "description": "Address of the sender/recipient" + } + }, + "required": [ + "name", + "address" + ] + }, + "ReferenceWithAttachments": { + "type": "object", + "properties": { + "mailbox": { + "type": "string", + "description": "ID of the Mailbox" + }, + "id": { + "type": "number", + "description": "Message ID" + }, + "action": { + "type": "string", + "description": "Either reply, replyAll or forward", + "enum": [ + "reply", + "replyAll", + "forward" + ] + }, + "attachments": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ], + "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" + } + }, + "required": [ + "mailbox", + "id", + "action" + ] + }, + "Bimi": { + "type": "object", + "description": "Marks BIMI verification as passed for a domain. NB! BIMI record and logo files for the domain must be valid.", + "properties": { + "domain": { + "type": "string", + "description": "Domain name for the BIMI record. It does not have to be the same as the From address." + }, + "selector": { + "type": "string", + "description": "Optional BIMI selector" + } + }, + "required": [ + "domain" + ] + }, + "ContentType": { + "type": "object", + "description": "Parsed Content-Type header. Usually needed to identify encrypted messages and such", + "properties": { + "value": { + "type": "string", + "description": "MIME type of the message, eg. \"multipart/mixed\"" + }, + "params": { + "type": "object", + "description": "An object with Content-Type params as key-value pairs", + "properties": {} + } + }, + "required": [ + "value", + "params" + ] + }, + "GetMessagesResult": { + "type": "object", + "properties": { + "id": { + "type": "number", + "description": "ID of the Message" + }, + "mailbox": { + "type": "string", + "description": "ID of the Mailbox" + }, + "thread": { + "type": "string", + "description": "ID of the Thread" + }, + "threadMessageCount": { + "type": "number", + "description": "Amount of messages in the Thread. Included if threadCounters query argument was true" + }, + "from": { + "$ref": "#/components/schemas/Address" + }, + "to": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Address" + }, + "description": "Recipients in To: field" + }, + "cc": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Address" + }, + "description": "Recipients in Cc: field" + }, + "bcc": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Address" + }, + "description": "Recipients in Bcc: field. Usually only available for drafts" + }, + "messageId": { + "type": "string", + "description": "Message ID" + }, + "subject": { + "type": "string", + "description": "Message subject" + }, + "date": { + "type": "string", + "description": "Date string from header", + "format": "date-time" + }, + "idate": { + "type": "string", + "description": "Date string of receive time", + "format": "date-time" + }, + "intro": { + "type": "string", + "description": "First 128 bytes of the message" + }, + "attachments": { + "type": "boolean", + "description": "Does the message have attachments" + }, + "size": { + "type": "number", + "description": "Message size in bytes" + }, + "seen": { + "type": "boolean", + "description": "Is this message already seen or not" + }, + "deleted": { + "type": "boolean", + "description": "Does this message have a Deleted flag (should not have as messages are automatically deleted once this flag is set)" + }, + "flagged": { + "type": "boolean", + "description": "Does this message have a Flagged flag" + }, + "draft": { + "type": "boolean", + "description": "is this message a draft" + }, + "answered": { + "type": "boolean", + "description": "Does this message have a Answered flag" + }, + "forwarded": { + "type": "boolean", + "description": "Does this message have a $Forwarded flag" + }, + "references": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReferenceWithAttachments" + }, + "description": "References" + }, + "bimi": { + "$ref": "#/components/schemas/Bimi" + }, + "contentType": { + "$ref": "#/components/schemas/ContentType" + }, + "encrypted": { + "type": "boolean", + "description": "Specifies whether the message is encrypted" + }, + "metaData": { + "type": "object", + "description": "Custom metadata value. Included if metaData query argument was true", + "properties": {} + }, + "headers": { + "type": "object", + "description": "Header object keys requested with the includeHeaders argument", + "properties": {} + } + }, + "required": [ + "id", + "mailbox", + "thread", + "to", + "cc", + "bcc", + "messageId", + "subject", + "date", + "intro", + "attachments", + "size", + "seen", + "deleted", + "flagged", + "draft", + "answered", + "forwarded", + "references", + "bimi", + "contentType" + ] + }, + "GetMessagesResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response" + }, + "total": { + "type": "number", + "description": "How many results were found" + }, + "page": { + "type": "number", + "description": "Current page number. Derived from page query argument" + }, + "previousCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any previous results" + }, + "nextCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any next results" + }, + "specialUse": { + "type": "string", + "description": "Special use. If available" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetMessagesResult" + }, + "description": "Message listing" + } + }, + "required": [ + "success", + "total", + "page", + "previousCursor", + "nextCursor", + "specialUse", + "results" + ] + }, + "UpdateMessageResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "array", + "items": { + "type": "object", + "properties": {} + }, + "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" + }, + "mailbox": { + "type": "string", + "description": "MoveTo mailbox address" + }, + "updated": { + "type": "number", + "description": "If messages were not moved, then indicates the number of updated messages" + } + }, + "required": [ + "success" + ] + }, + "DeleteMessagesInMailboxResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "deleted": { + "type": "number", + "description": "Indicates the count of deleted messages" + }, + "errors": { + "type": "number", + "description": "Indicate the count of errors during the delete" + } + }, + "required": [ + "success", + "deleted", + "errors" + ] + }, + "AddressOptionalName": { + "type": "object", + "description": "Address for the From: header", + "properties": { + "name": { + "type": "string", + "description": "Name of the sender" + }, + "address": { + "type": "string", + "description": "Address of the sender" + } + }, + "required": [ + "address" + ] + }, + "Header": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Header key ('X-Mailer')" + }, + "value": { + "type": "string", + "description": "Header value ('My Awesome Mailing Service')" + } + } + }, + "Attachment": { + "type": "object", + "properties": { + "filename": { + "type": "string", + "description": "Attachment filename" + }, + "contentType": { + "type": "string", + "description": "MIME type for the attachment file" + }, + "encoding": { + "type": "string", + "description": "Encoding to use to store the attachments" + }, + "contentTransferEncoding": { + "type": "string", + "description": "Transfer encoding" + }, + "content": { + "type": "string", + "description": "Base64 encoded attachment content" + }, + "cid": { + "type": "string", + "description": "Content-ID value if you want to reference to this attachment from HTML formatted message" + }, + "contentDisposition": { + "type": "string", + "description": "Content Disposition", + "enum": [ + "inline", + "attachment" + ] + } + }, + "required": [ + "content" + ] + }, + "UploadMessageResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "message": { + "type": "object", + "description": "Message information", + "properties": { + "id": { + "type": "number", + "description": "Message ID in mailbox" + }, + "malbox": { + "type": "string", + "description": "Mailbox ID the message was stored into" + }, + "size": { + "type": "number", + "description": "Size of the RFC822 formatted email" + } + }, + "required": [ + "id", + "malbox", + "size" + ] + }, + "previousDeleted": { + "type": "boolean", + "description": "Set if replacing a previous message was requested" + }, + "previousDeleteError": { + "type": "string", + "description": "Previous delete error message" + } + }, + "required": [ + "success", + "message" + ] + }, + "SearchMessagesResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response" + }, + "query": { + "type": "string" + }, + "total": { + "type": "number" + }, + "page": { + "type": "number" + }, + "previousCursor": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string" + } + ], + "description": "Either a cursor string or false if there are not any previous results" + }, + "nextCursor": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string" + } + ], + "description": "Either a cursor string or false if there are not any next results" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetMessagesResult" + }, + "description": "Message listing" + } + }, + "required": [ + "success", + "query", + "total", + "page", + "previousCursor", + "nextCursor", + "results" + ] + }, + "SearchApplyMessagesResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates if the action succeeded or not" + }, + "scheduled": { + "type": "string", + "description": "ID of the scheduled operation" + }, + "existing": { + "type": "boolean", + "description": "Indicates if the scheduled operation already exists" + } + }, + "required": [ + "success", + "scheduled", + "existing" + ] + }, + "Rcpt": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "RCPT TO address as provided by SMTP client" + }, + "formatted": { + "type": "string", + "description": "Normalized RCPT address" + } + }, + "required": [ + "value", + "formatted" + ] + }, + "Envelope": { + "type": "object", + "description": "SMTP envelope (if available)", + "properties": { + "from": { + "type": "string", + "description": "Address from MAIL FROM" + }, + "rcpt": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Rcpt" + }, + "description": "Array of addresses from RCPT TO (should have just one normally)" + } + }, + "required": [ + "from" + ] + }, + "List": { + "type": "object", + "description": "If set then this message is from a mailing list", + "properties": { + "id": { + "type": "string", + "description": "Value from List-ID header" + }, + "unsubscribe": { + "type": "string", + "description": "Value from List-Unsubscribe header" + } + }, + "required": [ + "id", + "unsubscribe" + ] + }, + "Tls": { + "type": "object", + "description": "TLS information. Value is false if TLS was not used", + "properties": { + "name": { + "type": "object", + "description": "Cipher name, eg \"ECDHE-RSA-AES128-GCM-SHA256\"", + "properties": {} + }, + "version": { + "type": "object", + "description": "TLS version, eg \"TLSv1/SSLv3\"", + "properties": {} + } + }, + "required": [ + "name", + "version" + ] + }, + "GetMessageResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "number", + "description": "Message ID" + }, + "mailbox": { + "type": "string", + "description": "ID of the Mailbox" + }, + "user": { + "type": "string", + "description": "Example: `507f1f77bcf86cd799439011`\nID of the User" + }, + "envelope": { + "$ref": "#/components/schemas/Envelope" + }, + "thread": { + "type": "string", + "description": "ID of the Thread" + }, + "from": { + "$ref": "#/components/schemas/Address" + }, + "replyTo": { + "$ref": "#/components/schemas/Address" + }, + "to": { + "$ref": "#/components/schemas/Address" + }, + "cc": { + "$ref": "#/components/schemas/Address" + }, + "bcc": { + "$ref": "#/components/schemas/Address" + }, + "subject": { + "type": "string", + "description": "Message subject" + }, + "messageId": { + "type": "string", + "description": "Message-ID header" + }, + "date": { + "type": "string", + "description": "Date string from header", + "format": "date-time" + }, + "idate": { + "type": "string", + "description": "Date string of receive time", + "format": "date-time" + }, + "list": { + "$ref": "#/components/schemas/List" + }, + "size": { + "type": "number", + "description": "Message size" + }, + "expires": { + "type": "string", + "description": "Datestring, if set then indicates the time after this message is automatically deleted" + }, + "seen": { + "type": "boolean", + "description": "Does this message have a \\Seen flag" + }, + "deleted": { + "type": "boolean", + "description": "Does this message have a \\Deleted flag" + }, + "flagged": { + "type": "boolean", + "description": "Does this message have a \\Flagged flag" + }, + "draft": { + "type": "boolean", + "description": "Does this message have a \\Draft flag" + }, + "html": { + "type": "array", + "items": { + "type": "string" + }, + "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" + }, + "text": { + "type": "string", + "description": "Plaintext content of the message" + }, + "attachments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Attachment ID" + }, + "hash": { + "type": "string", + "description": "SHA-256 hash of the contents of the attachment" + }, + "filename": { + "type": "string", + "description": "Filename of the attachment" + }, + "contentType": { + "type": "string", + "description": "MIME type" + }, + "disposition": { + "type": "string", + "description": "Attachment disposition" + }, + "transferEncoding": { + "type": "string", + "description": "Which transfer encoding was used (actual content when fetching attachments is not encoded)" + }, + "related": { + "type": "boolean", + "description": "Was this attachment found from a multipart/related node. This usually means that this is an embedded image" + }, + "sizeKb": { + "type": "number", + "description": "Approximate size of the attachment in kilobytes" + } + }, + "required": [ + "id", + "filename", + "contentType", + "disposition", + "transferEncoding", + "related", + "sizeKb" + ] + }, + "description": "Attachments for the message" + }, + "verificationResults": { + "type": "object", + "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.", + "properties": { + "tls": { + "$ref": "#/components/schemas/Tls" + }, + "spf": { + "type": "object", + "description": "Domain name (either MFROM or HELO) of verified SPF or false if no SPF match was found", + "properties": {} + }, + "dkim": { + "type": "object", + "description": "Domain name of verified DKIM signature or false if no valid signature was found", + "properties": {} + } + }, + "required": [ + "tls", + "spf", + "dkim" + ] + }, + "bimi": { + "type": "object", + "description": "BIMI logo info. If logo validation failed in any way, then this property is not set", + "properties": { + "certified": { + "type": "boolean", + "description": "If true, then this logo is from a VMC file" + }, + "url": { + "type": "string", + "description": "URL of the resource the logo was retrieved from" + }, + "image": { + "type": "string", + "description": "Data URL for the SVG image" + }, + "type": { + "type": "string", + "description": "Certificate type (only for VMC files)", + "enum": [ + "VMC", + "CMC" + ] + } + } + }, + "contentType": { + "type": "object", + "description": "Parsed Content-Type header. Usually needed to identify encrypted messages and such", + "properties": { + "value": { + "type": "string", + "description": "MIME type of the message, eg. \"multipart/mixed" + }, + "params": { + "type": "object", + "description": "An object with Content-Type params as key-value pairs", + "properties": {} + } + }, + "required": [ + "value", + "params" + ] + }, + "metaData": { + "type": "object", + "description": "Custom metadata object set for this message", + "properties": {} + }, + "references": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReferenceWithAttachments" + }, + "description": "References" + }, + "files": { + "type": "object", + "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", + "properties": {} + }, + "outbound": { + "type": "array", + "items": { + "type": "object", + "properties": {} + }, + "description": "Outbound queue entries" + }, + "forwardTargets": { + "type": "object", + "description": "Forward targets", + "properties": {} + }, + "reference": { + "type": "object", + "description": "Referenced message info", + "properties": {} + }, + "answered": { + "type": "boolean", + "description": "\\Answered flag value" + }, + "forwarded": { + "type": "boolean", + "description": "$Forwarded flag value" + }, + "encrypted": { + "type": "boolean", + "description": "True if message is encrypted" + } + }, + "required": [ + "success", + "id", + "mailbox", + "user", + "envelope", + "thread", + "from", + "subject", + "messageId", + "date", + "size", + "seen", + "deleted", + "flagged", + "draft", + "contentType", + "references", + "answered", + "forwarded" + ] + }, + "Forwarded": { + "type": "object", + "properties": { + "seq": { + "type": "string", + "description": "Sequence ID" + }, + "type": { + "type": "string", + "description": "Target type" + }, + "value": { + "type": "string", + "description": "Target address" + } + }, + "required": [ + "seq", + "type", + "value" + ] + }, + "ForwardStoredMessageResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "queueId": { + "type": "string", + "description": "Message ID in outbound queue" + }, + "forwarded": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Forwarded" + }, + "description": "Information about forwarding targets" + } + }, + "required": [ + "success" + ] + }, + "Message": { + "type": "object", + "description": "Message information", + "properties": { + "id": { + "type": "number", + "description": "Message ID in mailbox" + }, + "mailbox": { + "type": "string", + "description": "Mailbox ID the message was stored into" + }, + "size": { + "type": "number", + "description": "Size of the RFC822 formatted email" + } + }, + "required": [ + "id", + "mailbox", + "size" + ] + }, + "SubmitStoredMessageResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "queueId": { + "type": "string", + "description": "Message ID in outbound queue" + }, + "message": { + "$ref": "#/components/schemas/Message" + } + }, + "required": [ + "success", + "queueId" + ] + }, + "GetArchivedMessagesResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response" + }, + "total": { + "type": "number", + "description": "How many results were found" + }, + "page": { + "type": "number", + "description": "Current page number. Derived from page query argument" + }, + "previousCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any previous results" + }, + "nextCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any next results" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetMessagesResult" + }, + "description": "Message listing" + } + }, + "required": [ + "success", + "total", + "page", + "previousCursor", + "nextCursor", + "results" + ] + }, + "RestoreMessagesResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response" + }, + "task": { + "type": "string", + "description": "Task ID" + } + }, + "required": [ + "success", + "task" + ] + }, + "RestoreMessageResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response" + }, + "mailbox": { + "type": "string", + "description": "Mailbox ID the message was moved to" + }, + "id": { + "type": "number", + "description": "New ID for the Message" + } + }, + "required": [ + "success", + "mailbox", + "id" + ] + }, + "UploadFileResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "string", + "description": "File ID" + } + }, + "required": [ + "success", + "id" + ] + }, + "GetFilesResult": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "File ID" + }, + "filename": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Filename. False if none" + }, + "contentType": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Content-Type of the file. False if none" + }, + "cid": { + "type": "string", + "description": "Content ID" + }, + "size": { + "type": "number", + "description": "File size" + }, + "created": { + "type": "string", + "description": "Created datestring", + "format": "date-time" + }, + "md5": { + "type": "string", + "description": "md5 hash" + } + }, + "required": [ + "id", + "filename", + "contentType", + "size", + "created", + "md5" + ] + }, + "GetFilesResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "total": { + "type": "number", + "description": "How many results were found", + "example": 541 + }, + "page": { + "type": "number", + "description": "Current page number. Derived from page query argument", + "example": 1 + }, + "previousCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any previous results" + }, + "nextCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any next results" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetFilesResult" + }, + "description": "File listing" + } + }, + "required": [ + "success", + "total", + "page", + "previousCursor", + "nextCursor", + "results" + ] + }, + "GetAllFiltersResult": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Filter ID" + }, + "user": { + "type": "string", + "description": "User ID" + }, + "name": { + "type": "string", + "description": "Name for the filter" + }, + "created": { + "type": "string", + "description": "Datestring of the time the filter was created", + "format": "date-time" + }, + "query": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Filter query strings" + }, + "action": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Filter action strings" + }, + "disabled": { + "type": "boolean", + "description": "If true, then this filter is ignored" + }, + "metaData": { + "type": "object", + "description": "Custom metadata value. Included if metaData query argument was true", + "properties": {} + }, + "targets": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of forwarding targets" + } + }, + "required": [ + "id", + "user", + "name", + "created", + "query", + "action", + "disabled" + ] + }, + "GetAllFiltersResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "total": { + "type": "number", + "description": "How many results were found", + "example": 541 + }, + "page": { + "type": "number", + "description": "Current page number. Derived from page query argument." + }, + "previousCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any previous results" + }, + "nextCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any next results" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetAllFiltersResult" + }, + "description": "Address listing" + } + }, + "required": [ + "success", + "total", + "page", + "previousCursor", + "nextCursor", + "results" + ] + }, + "GetFiltersResult": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Filter ID" + }, + "name": { + "type": "string", + "description": "Name for the filter" + }, + "created": { + "type": "string", + "description": "Datestring of the time the filter was created", + "format": "date-time" + }, + "query": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Filter query strings" + }, + "action": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Filter action strings" + }, + "disabled": { + "type": "boolean", + "description": "If true, then this filter is ignored" + }, + "metaData": { + "type": "object", + "description": "Custom metadata value. Included if metaData query argument was true", + "properties": {} + } + }, + "required": [ + "id", + "name", + "created", + "query", + "action", + "disabled" + ] + }, + "GetFiltersResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "limits": { + "type": "object", + "description": "Filter usage limits for the user account", + "properties": { + "allowed": { + "type": "number", + "description": "How many filters are allowed" + }, + "used": { + "type": "number", + "description": "How many filters have been created" + } + } + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetFiltersResult" + }, + "description": "Filter description" + } + }, + "required": [ + "success", + "limits", + "results" + ] + }, + "Query": { + "type": "object", + "description": "Rules that a message must match", + "properties": { + "from": { + "type": "string", + "description": "Partial match for the From: header (case insensitive)" + }, + "to": { + "type": "string", + "description": "Partial match for the To:/Cc: headers (case insensitive)" + }, + "subject": { + "type": "string", + "description": "Partial match for the Subject: header (case insensitive)" + }, + "listId": { + "type": "string", + "description": "Partial match for the List-ID: header (case insensitive)" + }, + "text": { + "type": "string", + "description": "Fulltext search against message text" + }, + "ha": { + "type": "boolean", + "description": "Does a message have to have an attachment or not" + }, + "size": { + "type": "number", + "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" + } + } + }, + "Action": { + "type": "object", + "description": "Action to take with a matching message", + "properties": { + "seen": { + "type": "boolean", + "description": "If true then mark matching messages as Seen" + }, + "flag": { + "type": "boolean", + "description": "If true then mark matching messages as Flagged" + }, + "delete": { + "type": "boolean", + "description": "If true then do not store matching messages" + }, + "spam": { + "type": "boolean", + "description": "If true then store matching messages to Junk Mail folder" + }, + "mailbox": { + "type": "string", + "description": "Mailbox ID to store matching messages to" + }, + "targets": { + "type": "array", + "items": { + "type": "string" + }, + "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" + } + } + }, + "UpdateFilterResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + } + }, + "required": [ + "success" + ] + }, + "GetFilterResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "string", + "description": "Filters unique ID" + }, + "name": { + "type": "string", "description": "Name for the filter" }, "created": { "type": "string", - "description": "Datestring of the time the filter was created", + "description": "Datestring of the time the filter was created", + "format": "date-time" + }, + "query": { + "$ref": "#/components/schemas/Query" + }, + "action": { + "$ref": "#/components/schemas/Action" + }, + "disabled": { + "type": "boolean", + "description": "If true, then this filter is ignored" + }, + "metaData": { + "type": "object", + "description": "Custom metadata value", + "properties": {} + } + }, + "required": [ + "success", + "id", + "name", + "created", + "query", + "action", + "disabled" + ] + }, + "CreateAllowedDomainResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "string", + "description": "ID for the created record" + } + }, + "required": [ + "success", + "id" + ] + }, + "GetAllowedDomainResult": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entry ID" + }, + "domain": { + "type": "string", + "description": "Allowlisted domain name" + }, + "action": { + "type": "string", + "description": "Action: `allow`", + "example": "allow" + } + }, + "required": [ + "id", + "domain", + "action" + ] + }, + "GetAllowedDomainsResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetAllowedDomainResult" + }, + "description": "Domain list" + } + }, + "required": [ + "success", + "results" + ] + }, + "CreateBlockedDomainResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "string", + "description": "ID for the created record" + } + }, + "required": [ + "success", + "id" + ] + }, + "GetBlockedDomainResult": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Entry ID" + }, + "domain": { + "type": "string", + "description": "Blocklisted domain name" + }, + "action": { + "type": "string", + "description": "Action: `block`", + "example": "block" + } + }, + "required": [ + "id", + "domain", + "action" + ] + }, + "GetBlockedDomainsResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetBlockedDomainResult" + }, + "description": "Domain list" + } + }, + "required": [ + "success", + "results" + ] + }, + "DeleteDomainListingResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "deleted": { + "type": "string", + "description": "Deleted domain's unique ID" + } + }, + "required": [ + "success", + "deleted" + ] + }, + "LastUse": { + "type": "object", + "description": "Information about last use", + "properties": { + "time": { + "type": "string", + "description": "Datestring of last use or false if password has not been used", + "format": "date-time" + }, + "event": { + "type": "string", + "description": "Event ID of the security log for the last authentication" + } + }, + "required": [ + "time", + "event" + ] + }, + "GetASPsResult": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the Application Password" + }, + "description": { + "type": "string", + "description": "Description" + }, + "scopes": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "imap", + "pop3", + "smtp", + "*" + ] + }, + "description": "Allowed scopes for the Application Password" + }, + "lastUse": { + "$ref": "#/components/schemas/LastUse" + }, + "created": { + "type": "string", + "description": "Datestring", + "format": "date-time" + }, + "expires": { + "type": "string", + "description": "Application password expires after the given date", + "format": "date-time" + } + }, + "required": [ + "id", + "description", + "scopes", + "lastUse", + "created", + "expires" + ] + }, + "GetASPsResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetASPsResult" + }, + "description": "Event listing" + } + }, + "required": [ + "success", + "results" + ] + }, + "CreateASPResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "string", + "description": "ID of the Application Password" + }, + "password": { + "type": "string", + "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\"" + }, + "mobileconfig": { + "type": "string", + "description": "Base64 encoded mobileconfig file. Generated profile file should be sent to the client with Content-Type value of application/x-apple-aspen-config." + }, + "name": { + "type": "string", + "description": "Account name" + }, + "address": { + "type": "string", + "description": "Account address or the address specified in params of this endpoint" + } + }, + "required": [ + "success", + "id", + "password", + "mobileconfig", + "name", + "address" + ] + }, + "GetASPResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "string", + "description": "ID of the Application Password" + }, + "description": { + "type": "string", + "description": "Description" + }, + "scopes": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "imap", + "pop3", + "smtp", + "*" + ] + }, + "description": "Allowed scopes for the Application Password" + }, + "lastUse": { + "$ref": "#/components/schemas/LastUse" + }, + "created": { + "type": "string", + "description": "Datestring", + "format": "date-time" + }, + "expires": { + "type": "string", + "description": "Application password expires after the given date", + "format": "date-time" + } + }, + "required": [ + "success", + "id", + "description", + "scopes", + "lastUse", + "created", + "expires" + ] + }, + "GenerateTOTPSeedResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "seed": { + "type": "string", + "description": "Generated TOTP seed value" + }, + "qrcode": { + "type": "string", + "description": "Base64 encoded QR code" + } + }, + "required": [ + "success", + "seed", + "qrcode" + ] + }, + "GetWebAuthNResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "credentials": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Credential ID" + }, + "rawId": { + "type": "string", + "description": "Raw ID string of the credential in hex" + }, + "description": { + "type": "string", + "description": "Descriptive name for the authenticator" + }, + "authenticatorAttachment": { + "type": "string", + "description": "Indicates whether authenticators is a part of the OS (\"platform\"), or roaming authenticators (\"cross-platform\")", + "example": "platform" + } + }, + "required": [ + "id", + "rawId", + "description", + "authenticatorAttachment" + ] + }, + "description": "List of credentials" + } + }, + "required": [ + "success", + "credentials" + ] + }, + "DeleteWebAuthNResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "deleted": { + "type": "boolean", + "description": "Specifies whether the given credential has been deleted" + } + }, + "required": [ + "success", + "deleted" + ] + }, + "InitiateWebAuthNRegistrationResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "registrationOptions": { + "type": "object", + "properties": { + "challenge": { + "type": "string", + "description": "Challenge as a hex string" + }, + "user": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Example: `507f1f77bcf86cd799439011`\nID of the User" + }, + "name": { + "type": "string", + "description": "User address or name" + }, + "displayName": { + "type": "string", + "description": "User display name or username" + } + }, + "required": [ + "id", + "name", + "displayName" + ] + }, + "authenticatorSelection": { + "type": "object", + "description": "Data about the authenticator", + "properties": { + "authenticatorAttachment": { + "type": "string", + "description": "\"platform\" or \"cross-platform\"" + } + }, + "required": [ + "authenticatorAttachment" + ] + }, + "rp": { + "type": "object", + "description": "Relaying party data", + "properties": { + "name": { + "type": "string", + "description": "Rp name" + }, + "id": { + "type": "string", + "description": "Rp ID. Domain" + }, + "icon": { + "type": "string", + "description": "Rp icon. data/image string in base64 format" + } + }, + "required": [ + "name", + "id" + ] + }, + "excludeCredentials": { + "type": "array", + "items": { + "type": "object", + "properties": { + "rawId": { + "type": "string", + "description": "Raw ID of the credential as hex string" + }, + "type": { + "type": "string", + "description": "Type of the credential" + }, + "transports": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Credential transports. If authenticatorAttachment is \"platform\" then [\"internal\"] otherwise [\"usb\", \"nfc\", \"ble\"]" + } + }, + "required": [ + "rawId", + "type", + "transports" + ] + }, + "description": "List of credentials to exclude" + } + }, + "required": [ + "challenge", + "authenticatorSelection", + "rp" + ] + } + }, + "required": [ + "success" + ] + }, + "AttestateWebAuthNRegistrationResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "string", + "description": "Credential ID" + }, + "rawId": { + "type": "string", + "description": "Credential RawID as a hex string" + }, + "description": { + "type": "string", + "description": "Description for the authenticator" + }, + "authenticatorAttachment": { + "type": "string", + "description": "Specifies whether authenticator is \"platform\" or \"cross-platform\"" + } + }, + "required": [ + "success", + "id", + "rawId", + "description", + "authenticatorAttachment" + ] + }, + "AuthenticateWebAuthNResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "authenticationOptions": { + "type": "object", + "description": "PublicKeyCredentialRequestOptions object", + "properties": { + "challenge": { + "type": "string", + "description": "Challenge as hex string" + }, + "allowCredentials": { + "type": "array", + "items": { + "type": "object", + "properties": { + "rawId": { + "type": "string", + "description": "RawId of the credential as hex string" + }, + "type": { + "type": "string", + "description": "Credential type" + } + }, + "required": [ + "rawId", + "type" + ] + }, + "description": "Allowed credential(s) based on the request" + }, + "rpId": { + "type": "string", + "description": "Relaying Party ID. Domain" + }, + "rawChallenge": { + "type": "string", + "description": "Raw challenge bytes. ArrayBuffer" + }, + "attestation": { + "type": "string", + "description": "Attestation string. `direct`/`indirect`/`none`" + }, + "extensions": { + "type": "object", + "description": "Any credential extensions", + "properties": {} + }, + "userVerification": { + "type": "string", + "description": "User verification type. `required`/`preferred`/`discouraged`" + }, + "timeout": { + "type": "number", + "description": "Timeout in milliseconds (ms)" + } + }, + "required": [ + "challenge", + "allowCredentials" + ] + } + }, + "required": [ + "success", + "authenticationOptions" + ] + }, + "AssertWebAuthNResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "response": { + "type": "object", + "description": "Auth data", + "properties": { + "authenticated": { + "type": "boolean", + "description": "Authentication status" + }, + "credential": { + "type": "string", + "description": "WebAuthN credential ID" + } + }, + "required": [ + "authenticated", + "credential" + ] + }, + "token": { + "type": "string", + "description": "User auth token" + } + }, + "required": [ + "success", + "response" + ] + }, + "PreAuthCheckResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "string", + "description": "Example: `507f1f77bcf86cd799439011`\nID of the User" + }, + "username": { + "type": "string", + "description": "Username of authenticated User" + }, + "address": { + "type": "string", + "description": "Default email address of authenticated User" + }, + "scope": { + "type": "string", + "description": "The scope this authentication is valid for" + }, + "require2fa": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of enabled 2FA mechanisms" + } + }, + "required": [ + "success", + "id", + "username", + "address", + "scope", + "require2fa" + ] + }, + "AuthenticateResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "string", + "description": "Example: `507f1f77bcf86cd799439011`\nID of the User" + }, + "username": { + "type": "string", + "description": "Username of authenticated User" + }, + "address": { + "type": "string", + "description": "Default email address of authenticated User" + }, + "scope": { + "type": "string", + "description": "The scope this authentication is valid for" + }, + "require2fa": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of enabled 2FA mechanisms" + }, + "requirePasswordChange": { + "type": "boolean", + "description": "Indicates if account hassword has been reset and should be replaced" + }, + "token": { + "type": "string", + "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." + } + }, + "required": [ + "success", + "id", + "username", + "address", + "scope", + "require2fa", + "requirePasswordChange" + ] + }, + "GetAuthlogResult": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the event" + }, + "action": { + "type": "string", + "description": "Action identifier" + }, + "result": { + "type": "string", + "description": "Did the action succeed" + }, + "sess": { + "type": "string", + "description": "Session identifier for the logs" + }, + "ip": { + "type": "string", + "description": "IP address for the logs " + }, + "created": { + "type": "string", + "description": "Datestring of the Event time", + "format": "date-time" + }, + "protocol": { + "type": "string", + "description": "Protocol that the authentication was made from" + }, + "requiredScope": { + "type": "string", + "description": "Scope of the auth" + }, + "last": { + "type": "string", + "description": "Date of the last update of data", + "format": "date-time" + }, + "events": { + "type": "number", + "description": "Number of times same auth log has occurred" + }, + "source": { + "type": "string", + "description": "Source of auth. Example: `master` if password auth was used" + }, + "expires": { + "type": "string", + "description": "After this date the given auth log document will not be updated and instead a new one will be created", + "format": "date-time" + } + }, + "required": [ + "id", + "action", + "result", + "created", + "last", + "events", + "expires" + ] + }, + "GetAuthlogResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "action": { + "type": "string", + "description": "Limit listing only to values with specific action value" + }, + "total": { + "type": "number", + "description": "How many results were found" + }, + "page": { + "type": "number", + "description": "Current page number. Derived from page query argument" + }, + "previousCursor": { + "type": "string", + "description": "Cursor value for previous page, retrieved from previousCursor response value", + "example": "TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR" + }, + "nextCursor": { + "type": "string", + "description": "Cursor value for next page, retrieved from nextCursor response value", + "example": "eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetAuthlogResult" + } + } + }, + "required": [ + "success", + "action", + "total", + "page", + "results" + ] + }, + "GetAuthlogEventResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the event" + }, + "action": { + "type": "string", + "description": "Action identifier" + }, + "result": { + "type": "string", + "description": "Did the action succeed" + }, + "sess": { + "type": "string", + "description": "Session identifier for the logs" + }, + "ip": { + "type": "string", + "description": "IP address for the logs " + }, + "created": { + "type": "string", + "description": "Datestring of the Event time", + "format": "date-time" + }, + "protocol": { + "type": "string", + "description": "Protocol that the authentication was made from" + }, + "requiredScope": { + "type": "string", + "description": "Scope of the auth" + }, + "last": { + "type": "string", + "description": "Date of the last update of Event", + "format": "date-time" + }, + "events": { + "type": "number", + "description": "Number of times same auth Event has occurred" + }, + "source": { + "type": "string", + "description": "Source of auth. Example: `master` if password auth was used" + }, + "expires": { + "type": "string", + "description": "After this date the given auth Event will not be updated and instead a new one will be created", + "format": "date-time" + } + }, + "required": [ + "id", + "action", + "result", + "created", + "last", + "events", + "expires" + ] + }, + "UpdateAutoreplyResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "string", + "description": "Autoreply ID" + } + }, + "required": [ + "success", + "id" + ] + }, + "GetAutoreplyResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "status": { + "type": "boolean", + "description": "Is the autoreply enabled (true) or not (false)" + }, + "name": { + "type": "string", + "description": "Name that is used for the From: header in autoreply message", + "enum": [ + "" + ] + }, + "subject": { + "type": "string", + "description": "Subject line for the autoreply. If empty then uses subject of the original message", + "enum": [ + "" + ] + }, + "text": { + "type": "string", + "description": "Plaintext formatted content of the autoreply message", + "enum": [ + "" + ] + }, + "html": { + "type": "string", + "description": "HTML formatted content of the autoreply message", + "enum": [ + "" + ] + }, + "start": { + "type": "string", + "description": "Datestring of the start of the autoreply or boolean false to disable start checks", + "format": "date-time", + "enum": [ + false + ] + }, + "end": { + "type": "string", + "description": "Datestring of the end of the autoreply or boolean false to disable end checks", + "format": "date-time", + "enum": [ + false + ] + }, + "created": { + "type": "string", + "description": "Datestring of when the Autoreply was created", "format": "date-time" + } + }, + "required": [ + "success", + "created" + ] + }, + "Reference": { + "type": "object", + "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", + "properties": { + "mailbox": { + "type": "string", + "description": "ID of the Mailbox" }, - "query": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": "Filter query strings" + "id": { + "type": "number", + "description": "Message ID" }, "action": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": "Filter action strings" + "type": "string", + "description": "Either reply, replyAll or forward", + "enum": [ + "reply", + "replyAll", + "forward" + ] + } + }, + "required": [ + "mailbox", + "id", + "action" + ] + }, + "MessageWithQueueId": { + "type": "object", + "description": "Information about submitted Message", + "properties": { + "mailbox": { + "type": "string", + "description": "Mailbox ID the message was stored to" }, - "disabled": { - "type": "boolean", - "description": "If true, then this filter is ignored" + "id": { + "type": "number", + "description": "Message ID in the Mailbox" }, - "metaData": { - "type": "object", - "description": "Custom metadata value. Included if metaData query argument was true", - "properties": {} + "queueId": { + "type": "string", + "description": "Queue ID in MTA" } }, "required": [ + "mailbox", "id", - "name", - "created", - "query", - "action", - "disabled" + "queueId" ] }, - "Query": { + "SubmitMessageResponse": { "type": "object", - "description": "Rules that a message must match", "properties": { - "from": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "message": { + "$ref": "#/components/schemas/MessageWithQueueId" + } + }, + "required": [ + "success", + "message" + ] + }, + "CreateAuditResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { "type": "string", - "description": "Partial match for the From: header (case insensitive)" + "description": "ID for the created Audit" + } + }, + "required": [ + "success", + "id" + ] + }, + "GetAuditResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true }, - "to": { + "id": { "type": "string", - "description": "Partial match for the To:/Cc: headers (case insensitive)" + "description": "ID of the Audit" }, - "subject": { + "user": { "type": "string", - "description": "Partial match for the Subject: header (case insensitive)" + "description": "Example: `507f1f77bcf86cd799439011`\nID of the User" }, - "listId": { + "start": { "type": "string", - "description": "Partial match for the List-ID: header (case insensitive)" + "description": "Start time as ISO date", + "format": "date-time", + "enum": [ + false + ] }, - "text": { + "end": { "type": "string", - "description": "Fulltext search against message text" + "description": "End time as ISO date", + "format": "date-time", + "enum": [ + false + ] }, - "ha": { - "type": "boolean", - "description": "Does a message have to have an attachment or not" + "expires": { + "type": "string", + "description": "Expiration date. Audit data is deleted after this date", + "format": "date-time" }, - "size": { - "type": "number", - "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" + "import": { + "type": "object", + "description": "Audit import data", + "properties": { + "status": { + "type": "string", + "description": "Status of the audit" + }, + "failed": { + "type": "number", + "description": "How many messages failed" + }, + "copied": { + "type": "number", + "description": "How many messages copied" + } + }, + "required": [ + "status", + "failed", + "copied" + ] } - } + }, + "required": [ + "success", + "id", + "user", + "expires", + "import" + ] }, - "Action": { + "GetDomainAliasesResult": { "type": "object", - "description": "Action to take with a matching message", "properties": { - "seen": { - "type": "boolean", - "description": "If true then mark matching messages as Seen" + "id": { + "type": "string", + "description": "ID of the Domain Alias" }, - "flag": { - "type": "boolean", - "description": "If true then mark matching messages as Flagged" + "alias": { + "type": "string", + "description": "Domain Alias" }, - "delete": { + "domain": { + "type": "string", + "description": "The domain this alias applies to" + } + }, + "required": [ + "id", + "alias", + "domain" + ] + }, + "GetDomainAliasesResponse": { + "type": "object", + "properties": { + "success": { "type": "boolean", - "description": "If true then do not store matching messages" + "description": "Indicates successful response", + "example": true }, - "spam": { - "type": "boolean", - "description": "If true then store matching messages to Junk Mail folder" + "total": { + "type": "number", + "description": "How many results were found", + "example": 541 }, - "mailbox": { - "type": "string", - "description": "Mailbox ID to store matching messages to" + "page": { + "type": "number", + "description": "Current page number. Derived from page query argument", + "example": 1 }, - "targets": { + "previousCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any previous results" + }, + "nextCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any next results" + }, + "results": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/GetDomainAliasesResult" }, - "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" + "description": "Aliases listing" } - } + }, + "required": [ + "success", + "total", + "page", + "previousCursor", + "nextCursor", + "results" + ] }, - "GetAllowedDomainResult": { + "GetDomainAliasResponse": { "type": "object", "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, "id": { "type": "string", - "description": "Entry ID" + "description": "ID of the Alias" + }, + "alias": { + "type": "string", + "description": "Alias domain" }, "domain": { "type": "string", - "description": "Allowlisted domain name" + "description": "Alias target" }, - "action": { + "created": { "type": "string", - "description": "Action: `allow`", - "example": "allow" + "description": "Datestring of the time the alias was created", + "format": "date-time" } }, "required": [ + "success", "id", + "alias", "domain", - "action" + "created" ] }, - "GetBlockedDomainResult": { + "GetDkimKeysResult": { "type": "object", "properties": { "id": { "type": "string", - "description": "Entry ID" + "description": "ID of the DKIM" }, "domain": { "type": "string", - "description": "Blocklisted domain name" + "description": "The domain this DKIM key applies to" }, - "action": { + "selector": { "type": "string", - "description": "Action: `block`", - "example": "block" + "description": "DKIM selector" + }, + "description": { + "type": "string", + "description": "Key description" + }, + "fingerprint": { + "type": "string", + "description": "Key fingerprint (SHA1)" + }, + "created": { + "type": "string", + "description": "DKIM created datestring", + "format": "date-time" } }, "required": [ "id", "domain", - "action" + "selector", + "description", + "fingerprint", + "created" ] }, - "LastUse": { + "GetDkimKeysResponse": { "type": "object", - "description": "Information about last use", "properties": { - "time": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "total": { + "type": "number", + "description": "How many results were found", + "example": 541 + }, + "page": { + "type": "number", + "description": "Current page number. Derived from page query argument", + "example": 1 + }, + "previousCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any previous results" + }, + "nextCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any next results" + }, + "query": { "type": "string", - "description": "Datestring of last use or false if password has not been used", - "format": "date-time" + "description": "Query string. Partial match of a Domain name" }, - "event": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetDkimKeysResult" + }, + "description": "DKIM listing" + } + }, + "required": [ + "success", + "total", + "page", + "previousCursor", + "nextCursor", + "query", + "results" + ] + }, + "DnsTxt": { + "type": "object", + "description": "Value for DNS TXT entry", + "properties": { + "name": { "type": "string", - "description": "Event ID of the security log for the last authentication" + "description": "Is the domain name of TXT" + }, + "value": { + "type": "string", + "description": "Is the value of TXT" } }, "required": [ - "time", - "event" + "name", + "value" ] }, - "GetASPsResult": { + "UpdateDkimKeyResponse": { "type": "object", "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, "id": { "type": "string", - "description": "ID of the Application Password" + "description": "ID of the DKIM" }, - "description": { + "domain": { "type": "string", - "description": "Description" + "description": "The domain this DKIM key applies to" }, - "scopes": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "imap", - "pop3", - "smtp", - "*" - ] - }, - "description": "Allowed scopes for the Application Password" + "selector": { + "type": "string", + "description": "DKIM selector" }, - "lastUse": { - "$ref": "#/components/schemas/LastUse" + "description": { + "type": "string", + "description": "Key description" }, - "created": { + "fingerprint": { "type": "string", - "description": "Datestring", - "format": "date-time" + "description": "Key fingerprint (SHA1)" }, - "expires": { + "publicKey": { "type": "string", - "description": "Application password expires after the given date", - "format": "date-time" + "description": "Public key in DNS format (no prefix/suffix, single line)" + }, + "dnsTxt": { + "$ref": "#/components/schemas/DnsTxt" } }, "required": [ + "success", "id", + "domain", + "selector", "description", - "scopes", - "lastUse", - "created", - "expires" + "fingerprint", + "publicKey", + "dnsTxt" ] }, - "GetAuthlogResult": { + "ResolveIdResponse": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "ID of the event" - }, - "action": { - "type": "string", - "description": "Action identifier" + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true }, - "result": { + "id": { "type": "string", - "description": "Did the action succeed" + "description": "Unique ID of the cert (24 byte hex)", + "example": "609d201236d1d936948f23b1" + } + }, + "required": [ + "success", + "id" + ] + }, + "GetDkimKeyResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true }, - "sess": { + "id": { "type": "string", - "description": "Session identifier for the logs" + "description": "ID of the DKIM" }, - "ip": { + "domain": { "type": "string", - "description": "IP address for the logs " + "description": "The domain this DKIM key applies to" }, - "created": { + "selector": { "type": "string", - "description": "Datestring of the Event time", - "format": "date-time" + "description": "DKIM selector" }, - "protocol": { + "description": { "type": "string", - "description": "Protocol that the authentication was made from" + "description": "Key description" }, - "requiredScope": { + "fingerprint": { "type": "string", - "description": "Scope of the auth" + "description": "Key fingerprint (SHA1)" }, - "last": { + "publicKey": { "type": "string", - "description": "Date of the last update of data", - "format": "date-time" - }, - "events": { - "type": "number", - "description": "Number of times same auth log has occurred" + "description": "Public key in DNS format (no prefix/suffix, single line)" }, - "source": { - "type": "string", - "description": "Source of auth. Example: `master` if password auth was used" + "dnsTxt": { + "$ref": "#/components/schemas/DnsTxt" }, - "expires": { + "created": { "type": "string", - "description": "After this date the given auth log document will not be updated and instead a new one will be created", + "description": "DKIM created datestring", "format": "date-time" } }, "required": [ + "success", "id", - "action", - "result", - "created", - "last", - "events", - "expires" + "domain", + "selector", + "description", + "fingerprint", + "publicKey", + "dnsTxt", + "created" ] }, - "Reference": { + "GetTLSCertResult": { "type": "object", - "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", + "description": "Certificate listing", "properties": { - "mailbox": { + "id": { "type": "string", - "description": "ID of the Mailbox" + "description": "ID of the certificate", + "example": "609d201236d1d936948f23b1" }, - "id": { - "type": "number", - "description": "Message ID" + "servername": { + "type": "string", + "description": "The server name this certificate applies to", + "example": "imap.example.com" }, - "action": { + "acme": { + "type": "boolean", + "description": "If true then private key and certificate are managed automatically by ACME" + }, + "description": { "type": "string", - "description": "Either reply, replyAll or forward", - "enum": [ - "reply", - "replyAll", - "forward" - ] - } - }, - "required": [ - "mailbox", - "id", - "action" - ] - }, - "MessageWithQueueId": { - "type": "object", - "description": "Information about submitted Message", - "properties": { - "mailbox": { + "description": "Key description", + "example": "Some notes about this certificate" + }, + "fingerprint": { + "type": "string", + "description": "Key fingerprint (SHA1)", + "example": "59:8b:ed:11:5b:4f:ce:b4:e5:1a:2f:35:b1:6f:7d:93:40:c8:2f:9c:38:3b:cd:f4:04:92:a1:0e:17:2c:3f:f3" + }, + "created": { + "type": "string", + "description": "Datestring", + "format": "date-time", + "example": "2024-03-13T20:06:46.179Z" + }, + "expires": { "type": "string", - "description": "Mailbox ID the message was stored to" + "description": "Certificate expiration time", + "format": "date-time", + "example": "2024-04-26T21:55:55.000Z" }, - "id": { - "type": "number", - "description": "Message ID in the Mailbox" + "autogenerated": { + "type": "boolean", + "description": "Was the certificate automatically generated on SNI request" }, - "queueId": { - "type": "string", - "description": "Queue ID in MTA" + "altNames": { + "type": "array", + "items": { + "type": "string" + }, + "description": "SAN servernames listed in the certificate" } }, "required": [ - "mailbox", "id", - "queueId" + "servername", + "acme", + "description", + "fingerprint", + "created", + "expires", + "altNames" ] }, - "GetDomainAliasesResult": { + "GetTLSCertsResponse": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "ID of the Domain Alias" + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true }, - "alias": { + "query": { "type": "string", - "description": "Domain Alias" + "description": "Initial query" }, - "domain": { - "type": "string", - "description": "The domain this alias applies to" + "total": { + "type": "number", + "description": "How many results were found", + "example": 541 + }, + "page": { + "type": "number", + "description": "Current page number. Derived from page query argument", + "example": 1 + }, + "previousCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any previous results" + }, + "nextCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any next results" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetTLSCertResult" + } } }, "required": [ - "id", - "alias", - "domain" + "success", + "total", + "page", + "previousCursor", + "nextCursor", + "results" ] }, - "GetDkimKeysResult": { + "UpdateTLSCertResponse": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "ID of the DKIM" + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true }, - "domain": { + "id": { "type": "string", - "description": "The domain this DKIM key applies to" + "description": "ID of the certificate", + "example": "609d201236d1d936948f23b1" }, - "selector": { + "servername": { "type": "string", - "description": "DKIM selector" + "description": "The server name this certificate applies to", + "example": "imap.example.com" }, "description": { "type": "string", - "description": "Key description" + "description": "Key description", + "example": "Some notes about this certificate" }, "fingerprint": { "type": "string", - "description": "Key fingerprint (SHA1)" + "description": "Key fingerprint (SHA1)", + "example": "59:8b:ed:11:5b:4f:ce:b4:e5:1a:2f:35:b1:6f:7d:93:40:c8:2f:9c:38:3b:cd:f4:04:92:a1:0e:17:2c:3f:f3" }, - "created": { + "expires": { "type": "string", - "description": "DKIM created datestring", - "format": "date-time" + "description": "Certificate expiration time", + "format": "date-time", + "example": "2024-06-26T21:55:55.000Z" + }, + "altNames": { + "type": "array", + "items": { + "type": "string" + }, + "description": "SAN servernames listed in the certificate" + }, + "acme": { + "type": "boolean", + "description": "If true then private key and certificate are managed automatically by ACME" } }, "required": [ + "success", "id", - "domain", - "selector", + "servername", "description", "fingerprint", - "created" + "expires", + "altNames", + "acme" ] }, - "DnsTxt": { + "GetTLSCertResponse": { "type": "object", - "description": "Value for DNS TXT entry", "properties": { - "name": { - "type": "string", - "description": "Is the domain name of TXT" + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true }, - "value": { - "type": "string", - "description": "Is the value of TXT" - } - }, - "required": [ - "name", - "value" - ] - }, - "GetTLSCertResult": { - "type": "object", - "description": "Certificate listing", - "properties": { "id": { "type": "string", "description": "ID of the certificate", @@ -13806,10 +13576,6 @@ "description": "The server name this certificate applies to", "example": "imap.example.com" }, - "acme": { - "type": "boolean", - "description": "If true then private key and certificate are managed automatically by ACME" - }, "description": { "type": "string", "description": "Key description", @@ -13820,17 +13586,17 @@ "description": "Key fingerprint (SHA1)", "example": "59:8b:ed:11:5b:4f:ce:b4:e5:1a:2f:35:b1:6f:7d:93:40:c8:2f:9c:38:3b:cd:f4:04:92:a1:0e:17:2c:3f:f3" }, - "created": { + "expires": { "type": "string", - "description": "Datestring", + "description": "Certificate expiration time", "format": "date-time", - "example": "2024-03-13T20:06:46.179Z" + "example": "2024-06-26T21:55:55.000Z" }, - "expires": { + "created": { "type": "string", - "description": "Certificate expiration time", + "description": "Created datestring", "format": "date-time", - "example": "2024-04-26T21:55:55.000Z" + "example": "2024-05-13T20:06:46.179Z" }, "autogenerated": { "type": "boolean", @@ -13842,17 +13608,27 @@ "type": "string" }, "description": "SAN servernames listed in the certificate" + }, + "acme": { + "type": "boolean", + "description": "If true then private key and certificate are managed automatically by ACME" + }, + "hasCert": { + "type": "boolean", + "description": "True if certificate actually has the certificate or private key" } }, "required": [ + "success", "id", "servername", - "acme", "description", "fingerprint", - "created", "expires", - "altNames" + "created", + "altNames", + "acme", + "hasCert" ] }, "GetWebhooksResult": { @@ -13885,6 +13661,81 @@ "url" ] }, + "GetWebhooksResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "total": { + "type": "number", + "description": "How many results were found", + "example": 541 + }, + "page": { + "type": "number", + "description": "Current page number. Derived from page query argument", + "example": 1 + }, + "previousCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any previous results" + }, + "nextCursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Either a cursor string or false if there are not any next results" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetWebhooksResult" + }, + "description": "Webhook listing" + } + }, + "required": [ + "success", + "total", + "page", + "previousCursor", + "nextCursor", + "results" + ] + }, + "CreateWebhookResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "id": { + "type": "string", + "description": "ID of the Webhook" + } + }, + "required": [ + "success", + "id" + ] + }, "GetSettingsResult": { "type": "object", "properties": { @@ -13930,6 +13781,85 @@ "type", "custom" ] + }, + "GetSettingsResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "filter": { + "type": "string", + "description": "Partial match if requested" + }, + "settings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetSettingsResult" + }, + "description": "Setting listing" + } + }, + "required": [ + "success", + "settings" + ] + }, + "CreateSettingResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "key": { + "type": "string", + "description": "Key of the Setting" + } + }, + "required": [ + "success", + "key" + ] + }, + "GetSettingResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Indicates successful response", + "example": true + }, + "key": { + "type": "string", + "description": "Key of the Setting" + }, + "value": { + "oneOf": [ + { + "type": "string", + "description": "Setting value" + }, + { + "type": "number", + "description": "Setting value" + } + ], + "description": "Setting value" + }, + "error": { + "type": "string", + "description": "Error if present", + "example": "Key was not found" + } + }, + "required": [ + "success", + "key" + ] } }, "securitySchemes": { diff --git a/lib/api/2fa/custom.js b/lib/api/2fa/custom.js index a9c13a4e..7f363e06 100644 --- a/lib/api/2fa/custom.js +++ b/lib/api/2fa/custom.js @@ -17,6 +17,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/2fa/custom', tags: ['TwoFactorAuth'], summary: 'Enable custom 2FA for a user', + name: 'enableCustom2FA', description: 'This method disables account password for IMAP/POP3/SMTP', validationObjs: { requestBody: { @@ -25,7 +26,7 @@ module.exports = (db, server, userHandler) => { }, queryParams: {}, pathParams: { user: userId }, - response: { 200: { description: 'Success', model: Joi.object({ success: successRes }) } } + response: { 200: { description: 'Success', model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') } } } }, tools.responseWrapper(async (req, res) => { @@ -74,6 +75,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/2fa/custom', tags: ['TwoFactorAuth'], summary: 'Disable custom 2FA for a user', + name: 'disableCustom2FA', description: 'This method disables custom 2FA. If it was the only 2FA set up, then account password for IMAP/POP3/SMTP gets enabled again', validationObjs: { requestBody: {}, @@ -82,7 +84,7 @@ module.exports = (db, server, userHandler) => { ip: sessIPSchema }, pathParams: { user: userId }, - response: { 200: { description: 'Success', model: Joi.object({ success: successRes }) } } + response: { 200: { description: 'Success', model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') } } } }, tools.responseWrapper(async (req, res) => { diff --git a/lib/api/2fa/totp.js b/lib/api/2fa/totp.js index 38a2ee5f..f18091bf 100644 --- a/lib/api/2fa/totp.js +++ b/lib/api/2fa/totp.js @@ -16,6 +16,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/2fa/totp/setup', tags: ['TwoFactorAuth'], summary: 'Generate TOTP seed', + name: 'generateTOTPSeed', description: 'This method generates TOTP seed and QR code for 2FA. User needs to verify the seed value using 2fa/totp/enable endpoint', validationObjs: { requestBody: { @@ -33,7 +34,7 @@ module.exports = (db, server, userHandler) => { success: successRes, seed: Joi.string().required().description('Generated TOTP seed value'), qrcode: Joi.string().required().description('Base64 encoded QR code') - }) + }).$_setFlag('objectName', 'GenerateTOTPSeedResponse') } } } @@ -86,6 +87,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/2fa/totp/enable', tags: ['TwoFactorAuth'], summary: 'Enable TOTP seed', + name: 'enableTOTPSeed', description: 'This method enables TOTP for a user by verifying the seed value generated from 2fa/totp/setup', validationObjs: { requestBody: { @@ -95,7 +97,7 @@ module.exports = (db, server, userHandler) => { }, queryParams: {}, pathParams: { user: userId }, - response: { 200: { description: 'Success', model: Joi.object({ success: successRes }) } } + response: { 200: { description: 'Success', model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') } } } }, tools.responseWrapper(async (req, res) => { @@ -161,12 +163,13 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/2fa/totp', tags: ['TwoFactorAuth'], summary: 'Disable TOTP auth', + name: 'disableTOTPAuth', description: 'This method disables TOTP for a user. Does not affect other 2FA mechanisms a user might have set up', validationObjs: { requestBody: {}, queryParams: { sess: sessSchema, ip: sessIPSchema }, pathParams: { user: userId }, - response: { 200: { description: 'Success', model: Joi.object({ success: successRes }) } } + response: { 200: { description: 'Success', model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') } } } }, tools.responseWrapper(async (req, res) => { @@ -215,6 +218,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/2fa/totp/check', tags: ['TwoFactorAuth'], summary: 'Validate TOTP Token', + name: 'validateTOTPToken', description: 'This method checks if a TOTP token provided by a User is valid for authentication', validationObjs: { requestBody: { @@ -224,7 +228,7 @@ module.exports = (db, server, userHandler) => { }, queryParams: {}, pathParams: { user: userId }, - response: { 200: { description: 'Success', model: Joi.object({ success: successRes }) } } + response: { 200: { description: 'Success', model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') } } } }, tools.responseWrapper(async (req, res) => { @@ -281,6 +285,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/2fa', tags: ['TwoFactorAuth'], summary: 'Disable 2FA', + name: 'disable2FA', description: 'This method disables all 2FA mechanisms a user might have set up', validationObjs: { requestBody: {}, @@ -289,7 +294,7 @@ module.exports = (db, server, userHandler) => { ip: sessIPSchema }, pathParams: { user: userId }, - response: { 200: { description: 'Success', model: Joi.object({ success: successRes }) } } + response: { 200: { description: 'Success', model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') } } } }, tools.responseWrapper(async (req, res) => { diff --git a/lib/api/2fa/webauthn.js b/lib/api/2fa/webauthn.js index 9cbbac1c..34e8b8c5 100644 --- a/lib/api/2fa/webauthn.js +++ b/lib/api/2fa/webauthn.js @@ -14,6 +14,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/2fa/webauthn/credentials', tags: ['TwoFactorAuth'], summary: 'Get WebAuthN credentials for a user', + name: 'getWebAuthN', description: 'This method returns the list of WebAuthN credentials for a given user', validationObjs: { requestBody: {}, @@ -43,7 +44,7 @@ module.exports = (db, server, userHandler) => { ) .required() .description('List of credentials') - }) + }).$_setFlag('objectName', 'GetWebAuthNResponse') } } } @@ -115,6 +116,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/2fa/webauthn/credentials/:credential', tags: ['TwoFactorAuth'], summary: 'Remove WebAuthN authenticator', + name: 'deleteWebAuthN', description: 'This method deletes the given WebAuthN authenticator for given user.', validationObjs: { requestBody: {}, @@ -132,7 +134,7 @@ module.exports = (db, server, userHandler) => { model: Joi.object({ success: successRes, deleted: booleanSchema.required().description('Specifies whether the given credential has been deleted') - }) + }).$_setFlag('objectName', 'DeleteWebAuthNResponse') } } } @@ -187,6 +189,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/2fa/webauthn/registration-challenge', tags: ['TwoFactorAuth'], summary: 'Get the WebAuthN registration challenge', + name: 'initiateWebAuthNRegistration', description: 'This method initiates the WebAuthN authenticator registration challenge', validationObjs: { requestBody: { @@ -247,7 +250,7 @@ module.exports = (db, server, userHandler) => { ) .description('List of credentials to exclude') }) - }) + }).$_setFlag('objectName', 'InitiateWebAuthNRegistrationResponse') } } } @@ -299,6 +302,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/2fa/webauthn/registration-attestation', tags: ['TwoFactorAuth'], summary: 'Attestate WebAuthN authenticator', + name: 'attestateWebAuthNRegistration', description: 'Attestation is used to verify the authenticity of the authenticator and provide assurances about its features.', validationObjs: { requestBody: { @@ -333,7 +337,7 @@ module.exports = (db, server, userHandler) => { rawId: Joi.string().hex().required().description('Credential RawID as a hex string'), description: Joi.string().required().description('Description for the authenticator'), authenticatorAttachment: Joi.string().required().description('Specifies whether authenticator is "platform" or "cross-platform"') - }) + }).$_setFlag('objectName', 'AttestateWebAuthNRegistrationResponse') } } } @@ -387,6 +391,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/2fa/webauthn/authentication-challenge', tags: ['TwoFactorAuth'], summary: 'Begin WebAuthN authentication challenge', + name: 'authenticateWebAuthN', description: 'This method retrieves the WebAuthN PublicKeyCredentialRequestOptions object to use it for authentication', validationObjs: { requestBody: { @@ -431,7 +436,7 @@ module.exports = (db, server, userHandler) => { }) .required() .description('PublicKeyCredentialRequestOptions object') - }) + }).$_setFlag('objectName', 'AuthenticateWebAuthNResponse') } } } @@ -483,6 +488,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/2fa/webauthn/authentication-assertion', tags: ['TwoFactorAuth'], summary: 'WebAuthN authentication Assertion', + name: 'assertWebAuthN', description: 'Assert WebAuthN authentication request and actually authenticate the user', validationObjs: { requestBody: { @@ -529,7 +535,7 @@ module.exports = (db, server, userHandler) => { .required() .description('Auth data'), token: Joi.string().description('User auth token') - }) + }).$_setFlag('objectName', 'AssertWebAuthNResponse') } } } diff --git a/lib/api/addresses.js b/lib/api/addresses.js index 7a17bf8a..73091f85 100644 --- a/lib/api/addresses.js +++ b/lib/api/addresses.js @@ -33,9 +33,9 @@ const { Autoreply } = require('../schemas/request/addresses-schemas'); module.exports = (db, server, userHandler, settingsHandler) => { server.get( { - name: 'addresses', path: '/addresses', summary: 'List registered Addresses', + name: 'getAddresses', tags: ['Addresses'], validationObjs: { requestBody: {}, @@ -75,7 +75,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { .required() .description('Either a cursor string or false if there are not any next results'), results: Joi.array().items(GetAddressesResult).required().description('Address listing') - }) + }).$_setFlag('objectName', 'GetAddressesResponse') } } } @@ -274,6 +274,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user/addresses', summary: 'Create new Address', + name: 'createUserAddress', 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)', tags: ['Addresses'], @@ -309,7 +310,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { model: Joi.object({ success: successRes, id: Joi.string().required().description('ID of the address') - }) + }).$_setFlag('objectName', 'CreateUserAddressResponse') } } } @@ -582,6 +583,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user/addresses', summary: 'List registered Addresses for a User', + name: 'getUserAddresses', tags: ['Addresses'], validationObjs: { requestBody: {}, @@ -600,7 +602,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { model: Joi.object({ success: successRes, results: Joi.array().items(GetUserAddressesResult).required().description('Address listing') - }) + }).$_setFlag('objectName', 'GetUserAddressesResponse') } } } @@ -727,6 +729,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user/addresses/:address', summary: 'Request Addresses information', + name: 'getUserAddress', tags: ['Addresses'], validationObjs: { requestBody: {}, @@ -751,7 +754,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { tags: Joi.array().items(Joi.string()).required().description('List of tags associated with the Address'), metaData: Joi.object({}).description('Metadata object (if available)'), internalData: Joi.object({}).description('Internal metadata object (if available), not included for user-role requests') - }) + }).$_setFlag('objectName', 'GetUserAddressResponse') } } } @@ -870,6 +873,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user/addresses/:id', summary: 'Update Address information', + name: 'updateUserAddress', tags: ['Addresses'], validationObjs: { requestBody: { @@ -902,7 +906,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { description: 'Success', model: Joi.object({ success: successRes - }) + }).$_setFlag('objectName', 'SuccessResponse') } } } @@ -1130,6 +1134,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { server.del( { path: '/users/:user/addresses/:address', + name: 'deleteUserAddress', summary: 'Delete an Address', tags: ['Addresses'], validationObjs: { @@ -1147,7 +1152,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { description: 'Success', model: Joi.object({ success: successRes - }) + }).$_setFlag('objectName', 'SuccessResponse') } } } @@ -1278,6 +1283,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user/addressregister', summary: 'List addresses from communication register', + name: 'getUserAddressregister', tags: ['Addresses'], validationObjs: { requestBody: {}, @@ -1296,7 +1302,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { model: Joi.object({ success: successRes, results: Joi.array().items(GetUserAddressesregisterResult).required().description('Address listing') - }) + }).$_setFlag('objectName', 'GetUserAddressregisterResponse') } } } @@ -1445,6 +1451,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/addresses/forwarded', summary: 'Create new forwarded Address', + name: 'createForwardedAddress', 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)', tags: ['Addresses'], @@ -1487,7 +1494,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { response: { 200: { description: 'Success', - model: Joi.object({ success: successRes, id: addressId }) + model: Joi.object({ success: successRes, id: addressId }).$_setFlag('objectName', 'CreateForwardedAddressResponse') } } } @@ -1748,6 +1755,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/addresses/forwarded/:id', summary: 'Update forwarded Address information', + name: 'updateForwardedAddress', tags: ['Addresses'], validationObjs: { requestBody: { @@ -1785,7 +1793,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { response: { 200: { description: 'Success', - model: Joi.object({ success: successRes }) + model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') } } } @@ -2046,6 +2054,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/addresses/forwarded/:address', summary: 'Delete a forwarded Address', + name: 'deleteForwardedAddress', tags: ['Addresses'], validationObjs: { requestBody: {}, @@ -2057,7 +2066,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { response: { 200: { description: 'Success', - model: Joi.object({ success: successRes }) + model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') } } } @@ -2145,6 +2154,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/addresses/forwarded/:address', summary: 'Request forwarded Addresses information', + name: 'getForwardedAddress', tags: ['Addresses'], validationObjs: { requestBody: {}, @@ -2166,7 +2176,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { metaData: Joi.object({}).description('Metadata object (if available)'), internalData: Joi.object({}).description('Internal metadata object (if available), not included for user-role requests'), forwardedDisabled: booleanSchema.description('Specifies whether forwarding is disabled') - }) + }).$_setFlag('objectName', 'GetForwardedAddressResponse') } } } @@ -2276,6 +2286,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/addresses/resolve/:address', summary: 'Get Address info', + name: 'resolveAddress', tags: ['Addresses'], validationObjs: { requestBody: {}, @@ -2302,7 +2313,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { created: Joi.date().required().description('Datestring of the time the address was created'), metaData: Joi.object({}).description('Metadata object (if available)'), internalData: Joi.object({}).description('Internal metadata object (if available), not included for user-role requests') - }) + }).$_setFlag('objectName', 'ResolveAddressResponse') } } } @@ -2438,6 +2449,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/addresses/renameDomain', summary: 'Rename domain in addresses', + name: 'renameDomain', description: 'Renames domain names for addresses, DKIM keys and Domain Aliases', tags: ['Addresses'], validationObjs: { @@ -2458,7 +2470,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { modifiedUsers: Joi.number().required().description('Number of modified users'), modifiedDkim: Joi.number().required().description('Number of modified DKIM keys'), modifiedAliases: Joi.number().required().description('Number of modified Domain Aliases') - }) + }).$_setFlag('objectName', 'ResolveDomainAddressesResponse') } } } diff --git a/lib/api/asps.js b/lib/api/asps.js index 4dbd067e..2a417906 100644 --- a/lib/api/asps.js +++ b/lib/api/asps.js @@ -22,6 +22,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/asps', tags: ['ApplicationPasswords'], summary: 'List Application Passwords', + name: 'getASPs', validationObjs: { requestBody: {}, queryParams: { @@ -61,7 +62,7 @@ module.exports = (db, server, userHandler) => { ) .required() .description('Event listing') - }) + }).$_setFlag('objectName', 'GetASPsResponse') } } } @@ -184,6 +185,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/asps/:asp', tags: ['ApplicationPasswords'], summary: 'Request ASP information', + name: 'getASP', validationObjs: { requestBody: {}, queryParams: { @@ -215,7 +217,7 @@ module.exports = (db, server, userHandler) => { .description('Information about last use'), created: Joi.date().required().description('Datestring'), expires: Joi.date().required().description('Application password expires after the given date') - }) + }).$_setFlag('objectName', 'GetASPResponse') } } } @@ -298,6 +300,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/asps', tags: ['ApplicationPasswords'], summary: 'Create new Application Password', + name: 'createASP', validationObjs: { requestBody: { description: Joi.string().trim().max(255).required().description('Description for the Application Password entry'), @@ -348,7 +351,7 @@ module.exports = (db, server, userHandler) => { ), name: Joi.string().required().description('Account name'), address: Joi.string().required().description('Account address or the address specified in params of this endpoint') - }) + }).$_setFlag('objectName', 'CreateASPResponse') } } } @@ -572,6 +575,7 @@ module.exports = (db, server, userHandler) => { path: '/users/:user/asps/:asp', tags: ['ApplicationPasswords'], summary: 'Delete an Application Password', + name: 'deleteASP', validationObjs: { requestBody: {}, queryParams: { @@ -579,7 +583,7 @@ module.exports = (db, server, userHandler) => { ip: sessIPSchema }, pathParams: { user: userId, asp: Joi.string().hex().lowercase().length(24).required().description('ID of the Application Password') }, - response: { 200: { description: 'Success', model: Joi.object({ success: successRes }) } } + response: { 200: { description: 'Success', model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') } } } }, tools.responseWrapper(async (req, res) => { diff --git a/lib/api/audit.js b/lib/api/audit.js index d539d9f2..36a5764c 100644 --- a/lib/api/audit.js +++ b/lib/api/audit.js @@ -16,6 +16,7 @@ module.exports = (db, server, auditHandler) => { path: '/audit', tags: ['Audit'], summary: 'Create new audit', + name: 'createAudit', description: 'Initiates a message audit', validationObjs: { requestBody: { @@ -31,7 +32,10 @@ module.exports = (db, server, auditHandler) => { response: { 200: { description: 'Success', - model: Joi.object({ success: successRes, id: Joi.string().required().description('ID for the created Audit') }) + model: Joi.object({ + success: successRes, + id: Joi.string().required().description('ID for the created Audit') + }).$_setFlag('objectName', 'CreateAuditResponse') } } } @@ -88,6 +92,7 @@ module.exports = (db, server, auditHandler) => { path: '/audit/:audit', tags: ['Audit'], summary: 'Request Audit Info', + name: 'getAudit', description: 'This method returns information about stored audit', validationObjs: { requestBody: {}, @@ -112,7 +117,7 @@ module.exports = (db, server, auditHandler) => { }) .required() .description('Audit import data') - }) + }).$_setFlag('objectName', 'GetAuditResponse') } } } @@ -171,6 +176,7 @@ module.exports = (db, server, auditHandler) => { { path: '/audit/:audit/export.mbox', tags: ['Audit'], + name: 'getAuditEmails', summary: 'Export Audited Emails', description: 'This method returns a mailbox file that contains all audited emails', validationObjs: { diff --git a/lib/api/auth.js b/lib/api/auth.js index 872898fd..245c8a85 100644 --- a/lib/api/auth.js +++ b/lib/api/auth.js @@ -14,6 +14,7 @@ module.exports = (db, server, userHandler) => { { path: '/preauth', summary: 'Pre-auth check', + name: 'preauth', description: 'Check if an username exists and can be used for authentication', tags: ['Authentication'], validationObjs: { @@ -40,7 +41,7 @@ module.exports = (db, server, userHandler) => { address: Joi.string().required().description('Default email address of authenticated User'), scope: Joi.string().required().description('The scope this authentication is valid for'), require2fa: Joi.array().items(Joi.string()).required().description('List of enabled 2FA mechanisms') - }) + }).$_setFlag('objectName', 'PreAuthCheckResponse') } } } @@ -124,6 +125,7 @@ module.exports = (db, server, userHandler) => { { path: '/authenticate', summary: 'Authenticate a User', + name: 'authenticate', tags: ['Authentication'], validationObjs: { requestBody: { @@ -167,7 +169,7 @@ module.exports = (db, server, userHandler) => { token: Joi.string().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.' ) - }) + }).$_setFlag('objectName', 'AuthenticateResponse') } } } @@ -278,6 +280,7 @@ module.exports = (db, server, userHandler) => { { path: '/authenticate', summary: 'Invalidate authentication token', + name: 'invalidateAccessToken', description: 'This method invalidates currently used authentication token. If token is not provided then nothing happens', tags: ['Authentication'], validationObjs: { @@ -287,7 +290,7 @@ module.exports = (db, server, userHandler) => { response: { 200: { description: 'Success', - model: Joi.object({ success: successRes }) + model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') } } } @@ -312,7 +315,7 @@ module.exports = (db, server, userHandler) => { server.get( { - name: 'authlog', + name: 'getAuthlog', path: '/users/:user/authlog', summary: 'List authentication Events', tags: ['Authentication'], @@ -362,7 +365,7 @@ module.exports = (db, server, userHandler) => { }).$_setFlag('objectName', 'GetAuthlogResult') ) .required() - }) + }).$_setFlag('objectName', 'GetAuthlogResponse') } } } @@ -499,6 +502,7 @@ module.exports = (db, server, userHandler) => { server.get( { path: '/users/:user/authlog/:event', + name: 'getAuthlogEvent', summary: 'Request Event information', tags: ['Authentication'], validationObjs: { @@ -529,7 +533,7 @@ module.exports = (db, server, userHandler) => { expires: Joi.date() .required() .description('After this date the given auth Event will not be updated and instead a new one will be created') - }) + }).$_setFlag('objectName', 'GetAuthlogEventResponse') } } } diff --git a/lib/api/autoreply.js b/lib/api/autoreply.js index f691c58e..14bafdeb 100644 --- a/lib/api/autoreply.js +++ b/lib/api/autoreply.js @@ -15,6 +15,7 @@ module.exports = (db, server) => { path: '/users/:user/autoreply', tags: ['Autoreplies'], summary: 'Update Autoreply information', + name: 'updateAutoreply', validationObjs: { requestBody: { status: booleanSchema.description('Is the autoreply enabled (true) or not (false)'), @@ -49,7 +50,7 @@ module.exports = (db, server) => { model: Joi.object({ success: successRes, id: Joi.string().required().description('Autoreply ID') - }) + }).$_setFlag('objectName', 'UpdateAutoreplyResponse') } } } @@ -150,6 +151,7 @@ module.exports = (db, server) => { path: '/users/:user/autoreply', tags: ['Autoreplies'], summary: 'Request Autoreply information', + name: 'getAutoreply', validationObjs: { requestBody: {}, queryParams: { @@ -185,7 +187,7 @@ module.exports = (db, server) => { .description('Datestring of the start of the autoreply or boolean false to disable start checks'), end: Joi.date().empty('').allow(false).description('Datestring of the end of the autoreply or boolean false to disable end checks'), created: Joi.date().required().description('Datestring of when the Autoreply was created') - }) + }).$_setFlag('objectName', 'GetAutoreplyResponse') } } } @@ -246,6 +248,7 @@ module.exports = (db, server) => { path: '/users/:user/autoreply', tags: ['Autoreplies'], summary: 'Delete Autoreply information', + name: 'deleteAutoreply', validationObjs: { requestBody: {}, queryParams: { @@ -255,7 +258,7 @@ module.exports = (db, server) => { pathParams: { user: userId }, - response: { 200: { description: 'Success', model: Joi.object({ success: successRes }) } } + response: { 200: { description: 'Success', model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') } } } }, tools.responseWrapper(async (req, res) => { diff --git a/lib/api/certs.js b/lib/api/certs.js index 28fb176d..8130deeb 100644 --- a/lib/api/certs.js +++ b/lib/api/certs.js @@ -37,7 +37,7 @@ module.exports = (db, server) => { server.get( { - name: 'cert', + name: 'getTLSCertificates', path: '/certs', summary: 'List registered TLS certificates', tags: ['Certs'], @@ -94,7 +94,7 @@ module.exports = (db, server) => { .$_setFlag('objectName', 'GetTLSCertResult') ) .required() - }) + }).$_setFlag('objectName', 'GetTLSCertsResponse') } } } @@ -221,6 +221,7 @@ module.exports = (db, server) => { { path: '/certs/resolve/:servername', summary: 'Resolve ID for a server name', + name: 'resolveTLSCertificate', tags: ['Certs'], validationObjs: { requestBody: {}, @@ -237,7 +238,7 @@ module.exports = (db, server) => { model: Joi.object({ success: successRes, id: Joi.string().required().description('Unique ID of the cert (24 byte hex)').example('609d201236d1d936948f23b1') - }) + }).$_setFlag('objectName', 'ResolveIdResponse') } } } @@ -311,6 +312,7 @@ module.exports = (db, server) => { path: '/certs', summary: 'Create or update TLS certificate for server name', tags: ['Certs'], + name: 'updateTLSCertificate', description: 'Add a new TLS certificate for a server name or update existing one. You can add a single certificate for each server name but SAN names are supported as well. For example you can add a certificate for "mydomain.com" that includes "*.mydomain.com" in SAN and the same certificate would be used for requests that do not have it\'s own server name registered but match the SAN value.\n> NB! you must ensure yourself that the `servername` value is actually listed in certificate\'s common name or SAN as WildDuck is going to use this certificate regardless.', validationObjs: { @@ -386,7 +388,7 @@ module.exports = (db, server) => { .description('SAN servernames listed in the certificate') .example(['example.com', 'www.example.com']), acme: booleanSchema.required().description('If true then private key and certificate are managed automatically by ACME') - }) + }).$_setFlag('objectName', 'UpdateTLSCertResponse') } } } @@ -457,6 +459,7 @@ module.exports = (db, server) => { { path: '/certs/:cert', summary: 'Request TLS certificate information', + name: 'getTLSCertificate', tags: ['Certs'], validationObjs: { requestBody: {}, @@ -489,7 +492,7 @@ module.exports = (db, server) => { .example(['example.com', 'www.example.com']), acme: booleanSchema.required().description('If true then private key and certificate are managed automatically by ACME'), hasCert: booleanSchema.required().description('True if certificate actually has the certificate or private key') - }) + }).$_setFlag('objectName', 'GetTLSCertResponse') } } } @@ -559,6 +562,7 @@ module.exports = (db, server) => { { path: '/certs/:cert', summary: 'Delete a TLS certificate', + name: 'deleteTLSCert', tags: ['Certs'], validationObjs: { requestBody: {}, @@ -574,7 +578,7 @@ module.exports = (db, server) => { description: 'Success', model: Joi.object({ success: successRes - }) + }).$_setFlag('objectName', 'SuccessResponse') } } } diff --git a/lib/api/dkim.js b/lib/api/dkim.js index 4dbf9fa2..0d019ff9 100644 --- a/lib/api/dkim.js +++ b/lib/api/dkim.js @@ -20,7 +20,7 @@ module.exports = (db, server) => { server.get( { - name: 'dkim', + name: 'getDkimKeys', path: '/dkim', tags: ['DKIM'], summary: 'List registered DKIM keys', @@ -61,7 +61,7 @@ module.exports = (db, server) => { .required() ) .description('DKIM listing') - }) + }).$_setFlag('objectName', 'GetDkimKeysResponse') } } } @@ -165,6 +165,7 @@ module.exports = (db, server) => { { path: '/dkim/resolve/:domain', tags: ['DKIM'], + name: 'resolveDkim', summary: 'Resolve ID for a DKIM domain', validationObjs: { requestBody: {}, @@ -185,7 +186,7 @@ module.exports = (db, server) => { model: Joi.object({ success: successRes, id: Joi.string().required().description('DKIM unique ID (24 byte hex)').example('609d201236d1d936948f23b1') - }) + }).$_setFlag('objectName', 'ResolveIdResponse') } } } @@ -259,6 +260,7 @@ module.exports = (db, server) => { path: '/dkim', tags: ['DKIM'], summary: 'Create or update DKIM key for domain', + name: 'updateDkimKey', description: 'Add a new DKIM key for a Domain or update existing one. There can be single DKIM key registered for each domain name.', validationObjs: { requestBody: { @@ -315,7 +317,7 @@ module.exports = (db, server) => { .required() .description('Value for DNS TXT entry') .$_setFlag('objectName', 'DnsTxt') - }) + }).$_setFlag('objectName', 'UpdateDkimKeyResponse') } } } @@ -373,6 +375,7 @@ module.exports = (db, server) => { path: '/dkim/:dkim', tags: ['DKIM'], summary: 'Request DKIM information', + name: 'getDkimKey', validationObjs: { requestBody: {}, queryParams: { @@ -401,7 +404,7 @@ module.exports = (db, server) => { .description('Value for DNS TXT entry') .$_setFlag('objectName', 'DnsTxt'), created: Joi.date().required().description('DKIM created datestring') - }) + }).$_setFlag('objectName', 'GetDkimKeyResponse') } } } @@ -460,6 +463,7 @@ module.exports = (db, server) => { path: '/dkim/:dkim', tags: ['DKIM'], summary: 'Delete a DKIM key', + name: 'deleteDkimKey', validationObjs: { requestBody: {}, queryParams: { @@ -469,7 +473,7 @@ module.exports = (db, server) => { pathParams: { dkim: Joi.string().hex().lowercase().length(24).required().description('ID of the DKIM') }, - response: { 200: { description: 'Success', model: Joi.object({ success: successRes }) } } + response: { 200: { description: 'Success', model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') } } } }, tools.responseWrapper(async (req, res) => { diff --git a/lib/api/domainaccess.js b/lib/api/domainaccess.js index 52aa9803..8ef8b807 100644 --- a/lib/api/domainaccess.js +++ b/lib/api/domainaccess.js @@ -13,6 +13,7 @@ module.exports = (db, server) => { path: '/domainaccess/:tag/allow', tags: ['DomainAccess'], summary: 'Add domain to allowlist', + name: 'createAllowedDomain', description: 'If an email is sent from a domain that is listed in the allowlist then it is never marked as spam. Lists apply for tagged users.', validationObjs: { requestBody: { @@ -34,7 +35,7 @@ module.exports = (db, server) => { model: Joi.object({ success: successRes, id: Joi.string().required().description('ID for the created record') - }) + }).$_setFlag('objectName', 'CreateAllowedDomainResponse') } } } @@ -116,6 +117,7 @@ module.exports = (db, server) => { path: '/domainaccess/:tag/block', tags: ['DomainAccess'], summary: 'Add domain to blocklist', + name: 'createBlockedDomain', description: 'If an email is sent from a domain that is listed in the blocklist then it is always marked as spam. Lists apply for tagged users.', validationObjs: { requestBody: { @@ -137,7 +139,7 @@ module.exports = (db, server) => { model: Joi.object({ success: successRes, id: Joi.string().required().description('ID for the created record') - }) + }).$_setFlag('objectName', 'CreateBlockedDomainResponse') } } } @@ -219,6 +221,7 @@ module.exports = (db, server) => { path: '/domainaccess/:tag/allow', tags: ['DomainAccess'], summary: 'List allowlisted domains', + name: 'getAllowedDomains', validationObjs: { requestBody: {}, queryParams: { @@ -245,7 +248,7 @@ module.exports = (db, server) => { ) .description('Domain list') .required() - }) + }).$_setFlag('objectName', 'GetAllowedDomainsResponse') } } } @@ -322,6 +325,7 @@ module.exports = (db, server) => { path: '/domainaccess/:tag/block', tags: ['DomainAccess'], summary: 'List blocklisted domains', + name: 'getBlockedDomains', validationObjs: { requestBody: {}, queryParams: { @@ -348,7 +352,7 @@ module.exports = (db, server) => { ) .description('Domain list') .required() - }) + }).$_setFlag('objectName', 'GetBlockedDomainsResponse') } } } @@ -425,6 +429,7 @@ module.exports = (db, server) => { path: '/domainaccess/:domain', tags: ['DomainAccess'], summary: 'Delete a Domain from listing', + name: 'deleteDomainListing', validationObjs: { requestBody: {}, queryParams: { @@ -440,7 +445,7 @@ module.exports = (db, server) => { model: Joi.object({ success: successRes, deleted: Joi.string().required().description("Deleted domain's unique ID") - }) + }).$_setFlag('objectName', 'DeleteDomainListingResponse') } } } diff --git a/lib/api/domainaliases.js b/lib/api/domainaliases.js index 05d8bc3e..a6445beb 100644 --- a/lib/api/domainaliases.js +++ b/lib/api/domainaliases.js @@ -12,7 +12,7 @@ const { successRes, totalRes, pageRes, previousCursorRes, nextCursorRes } = requ module.exports = (db, server) => { server.get( { - name: 'domainaliases', + name: 'getDomainAliases', path: '/domainaliases', tags: ['DomainAliases'], summary: 'List registered Domain Aliases', @@ -47,7 +47,7 @@ module.exports = (db, server) => { ) .required() .description('Aliases listing') - }) + }).$_setFlag('objectName', 'GetDomainAliasesResponse') } } } @@ -170,6 +170,7 @@ module.exports = (db, server) => { path: '/domainaliases', tags: ['DomainAliases'], summary: 'Create new Domain Alias', + name: 'createDomainAlias', description: 'Add a new Alias for a Domain. This allows to accept mail on username@domain and username@alias', validationObjs: { requestBody: { @@ -191,7 +192,10 @@ module.exports = (db, server) => { response: { 200: { description: 'Success', - model: Joi.object({ success: successRes, id: Joi.string().required().description('ID of the Domain Alias') }) + model: Joi.object({ + success: successRes, + id: Joi.string().required().description('ID of the Domain Alias').$_setFlag('objectName', 'CreateDomainAliasResponse') + }) } } } @@ -292,6 +296,7 @@ module.exports = (db, server) => { path: '/domainaliases/resolve/:alias', tags: ['DomainAliases'], summary: 'Resolve ID for a domain alias', + name: 'resolveDomainAlias', validationObjs: { requestBody: {}, pathParams: { @@ -308,7 +313,10 @@ module.exports = (db, server) => { response: { 200: { description: 'Success', - model: Joi.object({ success: successRes, id: Joi.string().required().description('Unique ID (24 byte hex)') }) + model: Joi.object({ + success: successRes, + id: Joi.string().required().description('Unique ID (24 byte hex)').$_setFlag('objectName', 'ResolveDomainAliasIdResponse') + }) } } } @@ -381,6 +389,7 @@ module.exports = (db, server) => { path: '/domainaliases/:alias', tags: ['DomainAliases'], summary: 'Request Alias information', + name: 'getDomainAlias', validationObjs: { requestBody: {}, queryParams: { @@ -399,7 +408,7 @@ module.exports = (db, server) => { alias: Joi.string().required().description('Alias domain'), domain: Joi.string().required().description('Alias target'), created: Joi.date().required().description('Datestring of the time the alias was created') - }) + }).$_setFlag('objectName', 'GetDomainAliasResponse') } } } @@ -470,6 +479,7 @@ module.exports = (db, server) => { path: '/domainaliases/:alias', tags: ['DomainAliases'], summary: 'Delete an Alias', + name: 'deleteDomainAlias', validationObjs: { requestBody: {}, pathParams: { alias: Joi.string().hex().lowercase().length(24).required().description('ID of the Alias') }, @@ -477,7 +487,7 @@ module.exports = (db, server) => { sess: sessSchema, ip: sessIPSchema }, - response: { 200: { description: 'Success', model: Joi.object({ success: successRes }) } } + response: { 200: { description: 'Success', model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') } } } }, tools.responseWrapper(async (req, res) => { diff --git a/lib/api/filters.js b/lib/api/filters.js index 662361c8..58e11f7f 100644 --- a/lib/api/filters.js +++ b/lib/api/filters.js @@ -17,7 +17,7 @@ const { userId, filterId } = require('../schemas/request/general-schemas'); module.exports = (db, server, userHandler, settingsHandler) => { server.get( { - name: 'filters', + name: 'getAllFilters', path: '/filters', summary: 'List all Filters', tags: ['Filters'], @@ -44,7 +44,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { previousCursor: previousCursorRes, nextCursor: nextCursorRes, results: Joi.array().items(GetAllFiltersResult).required().description('Address listing') - }) + }).$_setFlag('objectName', 'GetAllFiltersResponse') } } } @@ -207,6 +207,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user/filters', summary: 'List Filters for a User', + name: 'getFilters', tags: ['Filters'], validationObjs: { requestBody: {}, @@ -230,7 +231,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { .required() .description('Filter usage limits for the user account'), results: Joi.array().items(GetFiltersResult).required().description('Filter description') - }) + }).$_setFlag('objectName', 'GetFiltersResponse') } } } @@ -382,6 +383,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user/filters/:filter', summary: 'Request Filter information', + name: 'getFilter', tags: ['Filters'], validationObjs: { requestBody: {}, @@ -405,7 +407,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { action: FilterAction.required(), disabled: booleanSchema.required().description('If true, then this filter is ignored'), metaData: Joi.object().description('Custom metadata value') - }) + }).$_setFlag('objectName', 'GetFilterResponse') } } } @@ -539,6 +541,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user/filters/:filter', summary: 'Delete a Filter', + name: 'deleteFilter', tags: ['Filters'], validationObjs: { requestBody: {}, @@ -555,7 +558,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { description: 'Success', model: Joi.object({ success: successRes - }) + }).$_setFlag('objectName', 'SuccessResponse') } } } @@ -634,6 +637,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user/filters', summary: 'Create a new Filter', + name: 'createFilter', tags: ['Filters'], validationObjs: { requestBody: { @@ -659,7 +663,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { model: Joi.object({ success: successRes, id: Joi.string().required().description('ID for the created filter') - }) + }).$_setFlag('objectName', 'UpdateFilterResponse') } } } @@ -933,6 +937,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user/filters/:filter', summary: 'Update Filter information', + name: 'updateFilter', tags: ['Filters'], validationObjs: { requestBody: { @@ -958,7 +963,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { description: 'Success', model: Joi.object({ success: successRes - }) + }).$_setFlag('objectName', 'UpdateFilterResponse') } } } diff --git a/lib/api/health.js b/lib/api/health.js index 2b04b8e6..68ae3e5b 100644 --- a/lib/api/health.js +++ b/lib/api/health.js @@ -11,6 +11,7 @@ module.exports = (db, server, loggelf) => { summary: 'Check the health of the API', description: 'Check the status of the WildDuck API service, that is if db is connected and readable/writable, same for redis.', tags: ['Health'], + name: 'getHealth', validationObjs: { requestBody: {}, queryParams: {}, @@ -18,11 +19,14 @@ module.exports = (db, server, loggelf) => { response: { 200: { description: 'Success', - model: Joi.object({ success: successRes }) + model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') }, 500: { description: 'Failed', - model: Joi.object({ success: successRes, message: Joi.string().required().description('Error message specifying what went wrong') }) + model: Joi.object({ + success: successRes, + message: Joi.string().required().description('Error message specifying what went wrong').$_setFlag('objectName', 'ErrorResponse') + }) } } } diff --git a/lib/api/mailboxes.js b/lib/api/mailboxes.js index 327c37c5..7dcdef9b 100644 --- a/lib/api/mailboxes.js +++ b/lib/api/mailboxes.js @@ -23,6 +23,7 @@ module.exports = (db, server, mailboxHandler) => { path: '/users/:user/mailboxes', tags: ['Mailboxes'], summary: 'List Mailboxes for a User', + name: 'getMailboxes', validationObjs: { requestBody: {}, pathParams: { @@ -49,7 +50,7 @@ module.exports = (db, server, mailboxHandler) => { model: Joi.object({ success: successRes, results: Joi.array().items(GetMailboxesResult).description('List of user mailboxes').required() - }) + }).$_setFlag('objectName', 'GetMailboxesResponse') } } } @@ -277,6 +278,7 @@ module.exports = (db, server, mailboxHandler) => { { path: '/users/:user/mailboxes', summary: 'Create new Mailbox', + name: 'createMailbox', validationObjs: { pathParams: { user: userId }, requestBody: { @@ -300,7 +302,7 @@ module.exports = (db, server, mailboxHandler) => { model: Joi.object({ success: successRes, id: mailboxId - }) + }).$_setFlag('objectName', 'CreateMailboxResponse') } } }, @@ -368,6 +370,7 @@ module.exports = (db, server, mailboxHandler) => { { path: '/users/:user/mailboxes/:mailbox', summary: 'Request Mailbox information', + name: 'getMailbox', tags: ['Mailboxes'], validationObjs: { requestBody: {}, @@ -401,7 +404,7 @@ module.exports = (db, server, mailboxHandler) => { hidden: booleanSchema.required().description('Is the folder hidden or not'), total: Joi.number().required().description('How many messages are stored in this mailbox'), unseen: Joi.number().required().description('How many unseen messages are stored in this mailbox') - }) + }).$_setFlag('objectName', 'GetMailboxResponse') } } } @@ -537,6 +540,7 @@ module.exports = (db, server, mailboxHandler) => { { path: '/users/:user/mailboxes/:mailbox', summary: 'Update Mailbox information', + name: 'updateMailbox', tags: ['Mailboxes'], validationObjs: { requestBody: { @@ -563,7 +567,7 @@ module.exports = (db, server, mailboxHandler) => { description: 'Success', model: Joi.object({ success: successRes - }) + }).$_setFlag('objectName', 'SuccessResponse') } } } @@ -631,6 +635,7 @@ module.exports = (db, server, mailboxHandler) => { { path: '/users/:user/mailboxes/:mailbox', summary: 'Delete a Mailbox', + name: 'deleteMailbox', tags: ['Mailboxes'], validationObjs: { pathParams: { user: userId, mailbox: mailboxId }, @@ -640,7 +645,7 @@ module.exports = (db, server, mailboxHandler) => { description: 'Success', model: Joi.object({ success: successRes - }) + }).$_setFlag('objectName', 'SuccessResponse') } } } diff --git a/lib/api/messages.js b/lib/api/messages.js index d7bd495e..fbda7631 100644 --- a/lib/api/messages.js +++ b/lib/api/messages.js @@ -330,9 +330,9 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti server.get( { - name: 'messages', path: '/users/:user/mailboxes/:mailbox/messages', summary: 'List messages in a Mailbox', + name: 'getMessages', description: 'Lists all messages in a mailbox', validationObjs: { requestBody: {}, @@ -421,7 +421,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti ) .required() .description('Message listing') - }) + }).$_setFlag('objectName', 'GetMessagesResponse') } } }, @@ -655,7 +655,6 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti server.get( { - name: 'search', path: '/users/:user/search', validationObjs: { queryParams: { @@ -747,13 +746,14 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti ) .required() .description('Message listing') - }) + }).$_setFlag('objectName', 'SearchMessagesResponse') } } }, summary: 'Search for messages', description: 'This method allows searching for matching messages.', - tags: ['Messages'] + tags: ['Messages'], + name: 'searchMessages' }, tools.responseWrapper(async (req, res) => { res.charSet('utf-8'); @@ -925,7 +925,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti server.post( { - name: 'searchApply', + name: 'searchApplyMessages', path: '/users/:user/search', summary: 'Search and update messages', description: @@ -957,7 +957,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti success: booleanSchema.required().description('Indicates if the action succeeded or not'), scheduled: Joi.string().required().description('ID of the scheduled operation'), existing: booleanSchema.required().description('Indicates if the scheduled operation already exists') - }) + }).$_setFlag('objectName', 'SearchApplyMessagesResponse') } } } @@ -1022,7 +1022,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti server.get( { - name: 'message', + name: 'getMessage', path: '/users/:user/mailboxes/:mailbox/messages/:message', summary: 'Request Message information', validationObjs: { @@ -1133,7 +1133,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti answered: booleanSchema.required().description('\\Answered flag value'), forwarded: booleanSchema.required().description('$Forwarded flag value'), encrypted: booleanSchema.description('True if message is encrypted') - }) + }).$_setFlag('objectName', 'GetMessageResponse') } } }, @@ -1433,7 +1433,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti server.get( { - name: 'raw', + name: 'getMessageSource', path: '/users/:user/mailboxes/:mailbox/messages/:message/message.eml', summary: 'Get Message source', description: 'This method returns the full RFC822 formatted source of the stored message', @@ -1556,7 +1556,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti server.get( { - name: 'attachment', + name: 'getMessageAttachment', path: '/users/:user/mailboxes/:mailbox/messages/:message/attachments/:attachment', summary: 'Download Attachment', description: 'This method returns attachment file contents in binary form', @@ -1731,6 +1731,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti path: '/users/:user/mailboxes/:mailbox/messages/:message', tags: ['Messages'], summary: 'Update message information with path param', + name: 'updateMessagePathParams', description: 'This method updates message flags and also allows to move messages to a different mailbox', validationObjs: { requestBody: { @@ -1771,7 +1772,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti ), mailbox: Joi.string().description('MoveTo mailbox address'), updated: Joi.number().description('If messages were not moved, then indicates the number of updated messages') - }) + }).$_setFlag('objectName', 'UpdateMessageResponse') } } } @@ -1783,6 +1784,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti path: '/users/:user/mailboxes/:mailbox/messages', tags: ['Messages'], summary: 'Update Message information', + name: 'updateMessage', description: 'This method updates message flags and also allows to move messages to a different mailbox', validationObjs: { requestBody: { @@ -1823,7 +1825,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti ), mailbox: Joi.string().description('MoveTo mailbox address'), updated: Joi.number().description('If messages were not moved, then indicates the number of updated messages') - }) + }).$_setFlag('objectName', 'UpdateMessageResponse') } } } @@ -1835,6 +1837,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti { path: '/users/:user/mailboxes/:mailbox/messages/:message', tags: ['Messages'], + name: 'deleteMessage', summary: 'Delete a Message', validationObjs: { requestBody: {}, @@ -1847,7 +1850,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti mailbox: mailboxId, message: messageId }, - response: { 200: { description: 'Success', model: Joi.object({ success: successRes }) } } + response: { 200: { description: 'Success', model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') } } } }, tools.responseWrapper(async (req, res) => { @@ -1930,6 +1933,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti path: '/users/:user/mailboxes/:mailbox/messages', tags: ['Messages'], summary: 'Delete all Messages from a Mailbox', + name: 'deleteMessagesInMailbox', validationObjs: { requestBody: {}, queryParams: { @@ -1950,7 +1954,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti success: successRes, deleted: Joi.number().required().description('Indicates the count of deleted messages'), errors: Joi.number().required().description('Indicate the count of errors during the delete') - }) + }).$_setFlag('objectName', 'DeleteMessagesInMailboxResponse') } } } @@ -2069,6 +2073,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti { path: '/users/:user/mailboxes/:mailbox/messages', summary: 'Upload Message', + name: 'uploadMessage', 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 structured data fields, then do not use the raw property.', validationObjs: { @@ -2164,7 +2169,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti .description('Message information'), previousDeleted: booleanSchema.description('Set if replacing a previous message was requested'), previousDeleteError: Joi.string().description('Previous delete error message') - }) + }).$_setFlag('objectName', 'UploadMessageResponse') } } }, @@ -2557,11 +2562,12 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti }).$_setFlag('objectName', 'Forwarded') ) .description('Information about forwarding targets') - }) + }).$_setFlag('objectName', 'ForwardStoredMessageResponse') } } }, summary: 'Forward stored Message', + name: 'forwardStoredMessage', 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 a user had forwarding turned on but the message was not delivered so you can try again. Forwarding does not modify the original message.', tags: ['Messages'] @@ -2762,11 +2768,12 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti }) .description('Message information') .$_setFlag('objectName', 'Message') - }) + }).$_setFlag('objectName', 'SubmitStoredMessageResponse') } } }, summary: 'Submit Draft for delivery', + name: 'submitStoredMessage', description: 'This method allows to submit a draft message for delivery. Draft is moved to Sent mail folder.', tags: ['Messages'] }, @@ -3122,6 +3129,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti path: '/users/:user/outbound/:queueId', tags: ['Messages'], summary: 'Delete an Outbound Message', + name: 'deleteOutboundMessage', description: 'You can delete outbound emails that are still in queue. Queue ID can be found from the `outbound` property of a stored email.', validationObjs: { requestBody: {}, @@ -3138,7 +3146,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti description: 'Success', model: Joi.object({ success: successRes - }) + }).$_setFlag('objectName', 'SuccessResponse') } } } @@ -3186,7 +3194,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti server.get( { - name: 'archived', + name: 'getArchivedMessages', path: '/users/:user/archived/messages', summary: 'List archived messages', description: 'Archive contains all recently deleted messages besides Drafts etc.', @@ -3273,7 +3281,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti ) .required() .description('Message listing') - }) + }).$_setFlag('objectName', 'GetArchivedMessagesResponse') } } }, @@ -3414,7 +3422,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti server.post( { - name: 'create_restore_task', + name: 'restoreMessages', path: '/users/:user/archived/restore', tags: ['Archive'], summary: 'Restore archived messages', @@ -3437,7 +3445,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti model: Joi.object({ success: booleanSchema.required().description('Indicates successful response'), task: Joi.string().required().description('Task ID') - }) + }).$_setFlag('objectName', 'RestoreMessagesResponse') } } } @@ -3526,7 +3534,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti server.post( { - name: 'archived_restore', + name: 'restoreMessage', path: '/users/:user/archived/messages/:message/restore', summary: 'Restore archived messages', description: @@ -3550,7 +3558,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti success: booleanSchema.required().description('Indicates successful response'), mailbox: Joi.string().required().description('Mailbox ID the message was moved to'), id: Joi.number().required().description('New ID for the Message') - }) + }).$_setFlag('objectName', 'RestoreMessageResponse') } } } diff --git a/lib/api/settings.js b/lib/api/settings.js index 0ad82b63..a0d1e756 100644 --- a/lib/api/settings.js +++ b/lib/api/settings.js @@ -11,7 +11,7 @@ const { successRes } = require('../schemas/response/general-schemas'); module.exports = (db, server, settingsHandler) => { server.get( { - name: 'settings', + name: 'getSettings', path: '/settings', tags: ['Settings'], summary: 'List registered Settings', @@ -47,7 +47,7 @@ module.exports = (db, server, settingsHandler) => { ) .description('Setting listing') .required() - }) + }).$_setFlag('objectName', 'GetSettingsResponse') } } } @@ -100,6 +100,7 @@ module.exports = (db, server, settingsHandler) => { tags: ['Settings'], summary: 'Create or Update Setting', description: 'Create a new or update an existing setting', + name: 'createSetting', validationObjs: { requestBody: { value: Joi.any() @@ -128,7 +129,7 @@ module.exports = (db, server, settingsHandler) => { model: Joi.object({ success: successRes, key: Joi.string().required().description('Key of the Setting') - }) + }).$_setFlag('objectName', 'CreateSettingResponse') } } } @@ -190,6 +191,7 @@ module.exports = (db, server, settingsHandler) => { path: '/settings/:key', tags: ['Settings'], summary: 'Get Setting value', + name: 'getSetting', validationObjs: { requestBody: {}, queryParams: { @@ -209,7 +211,7 @@ module.exports = (db, server, settingsHandler) => { .try(Joi.string().description('Setting value'), Joi.number().description('Setting value')) .description('Setting value'), error: Joi.string().description('Error if present').example('Key was not found') - }) + }).$_setFlag('objectName', 'GetSettingResponse') } } } diff --git a/lib/api/storage.js b/lib/api/storage.js index 32d7e76c..de457e06 100644 --- a/lib/api/storage.js +++ b/lib/api/storage.js @@ -16,6 +16,7 @@ module.exports = (db, server, storageHandler) => { path: '/users/:user/storage', tags: ['Storage'], summary: 'Upload file', + name: 'uploadFile', description: 'This method allows to upload an attachment to be linked from a draft', validationObjs: { requestBody: { @@ -44,7 +45,7 @@ module.exports = (db, server, storageHandler) => { model: Joi.object({ success: successRes, id: Joi.string().required().description('File ID') - }) + }).$_setFlag('objectName', 'UploadFileResponse') } } } @@ -128,6 +129,7 @@ module.exports = (db, server, storageHandler) => { path: '/users/:user/storage', tags: ['Storage'], summary: 'List stored files', + name: 'getFiles', validationObjs: { requestBody: {}, queryParams: { @@ -173,7 +175,7 @@ module.exports = (db, server, storageHandler) => { ) .required() .description('File listing') - }) + }).$_setFlag('objectName', 'GetFilesResponse') } } } @@ -313,6 +315,7 @@ module.exports = (db, server, storageHandler) => { path: '/users/:user/storage/:file', tags: ['Storage'], summary: 'Delete a File', + name: 'deleteFile', validationObjs: { requestBody: {}, queryParams: { @@ -328,7 +331,7 @@ module.exports = (db, server, storageHandler) => { description: 'Success', model: Joi.object({ success: successRes - }) + }).$_setFlag('objectName', 'SuccessResponse') } } } @@ -378,8 +381,8 @@ module.exports = (db, server, storageHandler) => { server.get( { - name: 'storagefile', path: '/users/:user/storage/:file', + name: 'getFile', tags: ['Storage'], summary: 'Download File', description: 'This method returns stored file contents in binary form', diff --git a/lib/api/submit.js b/lib/api/submit.js index 4defc0a6..92f92c57 100644 --- a/lib/api/submit.js +++ b/lib/api/submit.js @@ -624,7 +624,7 @@ module.exports = (db, server, messageHandler, userHandler, settingsHandler) => { server.post( { - name: 'send', + name: 'submitMessage', path: '/users/:user/submit', tags: ['Submission'], summary: 'Submit a Message for Delivery', @@ -729,7 +729,7 @@ module.exports = (db, server, messageHandler, userHandler, settingsHandler) => { .required() .description('Information about submitted Message') .$_setFlag('objectName', 'MessageWithQueueId') - }) + }).$_setFlag('objectName', 'SubmitMessageResponse') } } } diff --git a/lib/api/updates.js b/lib/api/updates.js index 6aef39e8..6abd66c7 100644 --- a/lib/api/updates.js +++ b/lib/api/updates.js @@ -15,6 +15,7 @@ module.exports = (db, server, notifier) => { path: '/users/:user/updates', tags: ['Users'], summary: 'Open change stream', + name: 'getUpdates', 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', validationObjs: { diff --git a/lib/api/users.js b/lib/api/users.js index a1bb5f4b..3a27de16 100644 --- a/lib/api/users.js +++ b/lib/api/users.js @@ -37,7 +37,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { server.get( { - name: 'users', + name: 'getUsers', path: '/users', summary: 'List registered Users', tags: ['Users'], @@ -73,7 +73,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { nextCursor: nextCursorRes, query: Joi.string().required().description('Partial match of username or default email address'), results: Joi.array().items(GetUsersResult).required().description('User listing') - }) + }).$_setFlag('objectName', 'GetUsersResponse') } } } @@ -302,6 +302,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users', summary: 'Create new user', + name: 'createUser', tags: ['Users'], validationObjs: { requestBody: { @@ -445,7 +446,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { model: Joi.object({ success: successRes, id: userId - }) + }).$_setFlag('objectName', 'CreateUserResponse') } } } @@ -649,6 +650,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/resolve/:username', summary: 'Resolve ID for a username', + name: 'resolveUser', tags: ['Users'], validationObjs: { requestBody: {}, @@ -669,7 +671,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { model: Joi.object({ success: successRes.example(true), id: userId.description('Unique ID (24 byte hex)').example('609d201236d1d936948f23b1') - }) + }).$_setFlag('objectName', 'ResolveIdForUsernameResponse') } } } @@ -753,6 +755,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user', summary: 'Request User information', + name: 'getUser', tags: ['Users'], validationObjs: { requestBody: {}, @@ -893,7 +896,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { activated: booleanSchema.required().description('Is the account activated'), disabled: booleanSchema.required().description('If true then the user can not authenticate or receive any new mail'), suspended: booleanSchema.required().description('If true then the user can not authenticate') - }) + }).$_setFlag('objectName', 'GetUserResponse') } } } @@ -1148,6 +1151,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user', summary: 'Update User information', + name: 'updateUser', tags: ['Users'], validationObjs: { requestBody: { @@ -1262,7 +1266,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { description: 'Success', model: Joi.object({ success: successRes - }) + }).$_setFlag('objectName', 'SuccessResponse') } } } @@ -1476,6 +1480,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user/logout', summary: 'Log out User', + name: 'logoutUser', tags: ['Users'], validationObjs: { requestBody: { @@ -1492,7 +1497,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { description: 'Success', model: Joi.object({ success: successRes - }) + }).$_setFlag('objectName', 'SuccessResponse') } } } @@ -1552,6 +1557,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { 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.', summary: 'Recalculate User quota', + name: 'recalculateQuota', tags: ['Users'], validationObjs: { requestBody: { @@ -1569,7 +1575,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { success: successRes, storageUsed: Joi.number().description('Calculated quota usage for the user').required(), previousStorageUsed: Joi.number().description('Previous storage used').required() - }) + }).$_setFlag('objectName', 'RecalculateQuotaResponse') } } } @@ -1732,6 +1738,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { 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.', summary: 'Recalculate Quota for all Users', + name: 'recalculateQuotaAllUsers', tags: ['Users'], validationObjs: { requestBody: { @@ -1743,7 +1750,10 @@ module.exports = (db, server, userHandler, settingsHandler) => { response: { 200: { description: 'Success', - model: Joi.object({ success: successRes, task: Joi.string().required().description('Task ID') }) + model: Joi.object({ + success: successRes, + task: Joi.string().required().description('Task ID').$_setFlag('objectName', 'RecalculateQuotaAllUsersResponse') + }) } } } @@ -1799,6 +1809,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { path: '/data/export', tags: ['Export'], summary: 'Export data', + name: 'createExport', description: 'Export data for matching users. Export dump does not include emails, only account structure (user data, password hashes, mailboxes, filters, etc.). A special "export"-role access token is required for exporting and importing.', validationObjs: { @@ -1945,6 +1956,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/data/import', summary: 'Import user data', + name: 'createImport', description: 'Import data from an export dump. If a database entry already exists, it is not modified. A special "export"-role access token is required for exporting and importing.', tags: ['Export'], @@ -1961,7 +1973,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { imported: Joi.number().description('How many database entries were imported from the export file'), failed: Joi.number().description('How many database entries were not imported due to some error'), existing: Joi.number().description('How many database existing entries were not imported') - }) + }).$_setFlag('objectName', 'CreateImportResponse') } } } @@ -2138,6 +2150,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user/password/reset', summary: 'Reset password for a User', + name: 'resetUserPassword', description: 'This method generates a new temporary password for a User. Additionally it removes all two-factor authentication settings', tags: ['Users'], validationObjs: { @@ -2157,7 +2170,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { success: successRes, password: Joi.string().required().description('Temporary password'), validAfter: Joi.date().empty('').description('The date password is valid after') - }) + }).$_setFlag('objectName', 'ResetUserPasswordResponse') } } } @@ -2215,6 +2228,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user', summary: 'Delete a User', + name: 'deleteUser', description: 'This method deletes user and address entries from DB and schedules a background task to delete messages. You can call this method several times even if the user has already been deleted, in case there are still some pending messages.', tags: ['Users'], @@ -2246,7 +2260,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { }), deleteAfter: Joi.date().description('Delete after date'), task: Joi.string().description('Task ID') - }) + }).$_setFlag('objectName', 'DeleteUserResponse') } } } @@ -2308,6 +2322,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user/restore', summary: 'Return recovery info for a deleted user', + name: 'restoreUserInfo', tags: ['Users'], validationObjs: { requestBody: {}, @@ -2329,7 +2344,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { tags: Joi.array().items(Joi.string()).description('List of tags associated with the User').required(), deleted: Joi.date().description('Datestring of the time the user was deleted').required(), recoverableAddresses: Joi.array().items(Joi.string()).description('List of email addresses that can be restored').required() - }) + }).$_setFlag('objectName', 'RecoverInfoResponse') } } } @@ -2394,6 +2409,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { { path: '/users/:user/restore', summary: 'Cancel user deletion task', + name: 'cancelUserDelete', description: 'Use this endpoint to cancel a timed deletion task scheduled by DELETE /user/{id}. If user data is not yet deleted then the account is fully recovered, except any email addresses that might have been already recycled', tags: ['Users'], @@ -2418,7 +2434,7 @@ module.exports = (db, server, userHandler, settingsHandler) => { recovered: Joi.number().description('Number of recovered addresses'), main: Joi.string().description('Main address') }) - }) + }).$_setFlag('objectName', 'CancelUserDeletionResponse') } } } diff --git a/lib/api/webhooks.js b/lib/api/webhooks.js index 89e893aa..7bcfe661 100644 --- a/lib/api/webhooks.js +++ b/lib/api/webhooks.js @@ -11,7 +11,7 @@ const { successRes, totalRes, pageRes, previousCursorRes, nextCursorRes } = requ module.exports = (db, server) => { server.get( { - name: 'webhooks', + name: 'getWebhooks', path: '/webhooks', tags: ['Webhooks'], summary: 'List registered Webhooks', @@ -52,7 +52,7 @@ module.exports = (db, server) => { ) .required() .description('Webhook listing') - }) + }).$_setFlag('objectName', 'GetWebhooksResponse') } } } @@ -185,6 +185,7 @@ module.exports = (db, server) => { path: '/webhooks', tags: ['Webhooks'], summary: 'Create new Webhook', + name: 'createWebhook', validationObjs: { requestBody: { type: Joi.array() @@ -207,7 +208,7 @@ module.exports = (db, server) => { model: Joi.object({ success: successRes, id: Joi.string().required().description('ID of the Webhook') - }) + }).$_setFlag('objectName', 'CreateWebhookResponse') } } } @@ -316,6 +317,7 @@ module.exports = (db, server) => { path: '/webhooks/:webhook', tags: ['Webhooks'], summary: 'Delete a webhook', + name: 'deleteWebhook', validationObjs: { requestBody: {}, queryParams: { @@ -326,7 +328,7 @@ module.exports = (db, server) => { response: { 200: { description: 'Success', - model: Joi.object({ success: successRes }) + model: Joi.object({ success: successRes }).$_setFlag('objectName', 'SuccessResponse') } } } diff --git a/package-lock.json b/package-lock.json index 5de6ef1f..442addfe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,7 +60,7 @@ "restify-cors-middleware2": "2.2.1", "restify-errors": "8.0.2", "restify-logger": "2.0.1", - "restifyapigenerate": "1.2.2", + "restifyapigenerate": "1.2.3", "search-string": "4.0.0", "seq-index": "1.1.0", "smtp-server": "3.13.6", @@ -8774,9 +8774,9 @@ } }, "node_modules/restifyapigenerate": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/restifyapigenerate/-/restifyapigenerate-1.2.2.tgz", - "integrity": "sha512-FXl85SL03YcW3OSwhizabCZQT8blpZR2JMe5jma9dM1mKtIdTPuay5IEW4DGRkWZpzahTvBEqYj1vwpZM8eAsg==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/restifyapigenerate/-/restifyapigenerate-1.2.3.tgz", + "integrity": "sha512-dNle/T9NY1wiuhlwQKoRrTj6nelEv0WfF/k4pdMgv8PrxP+rtrmUUaa/H4zVxol56+f1xPR8BniTq8S5qRP4jw==", "engines": { "node": ">=16.0.0" } diff --git a/package.json b/package.json index 7795560e..358c557b 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "restify-cors-middleware2": "2.2.1", "restify-errors": "8.0.2", "restify-logger": "2.0.1", - "restifyapigenerate": "1.2.2", + "restifyapigenerate": "1.2.3", "search-string": "4.0.0", "seq-index": "1.1.0", "smtp-server": "3.13.6",