{ "openapi": "3.1.0", "info": { "description": "This is a Zoho Mail API OpenAPI 3.0 specification", "title": "Zoho Mail API", "version": "1.0.0" }, "tags": [ { "name": "folders", "description": "The Folder APIs help you to get and update information about the Folder details of a particular user account.", "externalDocs": { "description": "Find out more", "url": "https://www.zoho.com/mail/help/api/folders-api.html" } } ], "paths": { "/api/accounts/{accountId}/folders": { "post": { "tags": [ "folders" ], "x-mcp-group": [ "Folders" ], "summary": "Create a New Folder", "description": "Adds a new folder to a specific account.", "operationId": "createFolder", "parameters": [ { "name": "accountId", "in": "path", "required": true, "description": "The ID of the account where the folder will be created.", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "folderName" ], "properties": { "folderName": { "type": "string", "description": "The name of the folder to be created.", "example": "newFolder" }, "parentFolderId": { "type": "string", "description": "The ID of the parent folder under which the new folder is created.", "example": "2560636000000076001" }, "parentFolderPath": { "type": "string", "description": "The path of the parent folder under which the new folder is created.", "example": "/Inbox" } } } } } }, "responses": { "201": { "description": "Folder successfully created.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FolderResponse" } } } }, "400": { "description": "Invalid input passed" }, "404": { "description": "Page not found" }, "500": { "description": "Internal Error" } }, "security": [ { "iam-oauth2-schema": [ "ZohoMail.folders.ALL", "ZohoMail.folders.CREATE" ] } ] }, "get": { "tags": [ "folders" ], "x-mcp-group": [ "Folders" ], "summary": "Get all folders of the account", "description": "This API is used to list all the folders within the specified account.", "operationId": "getAllFolders", "parameters": [ { "name": "accountId", "in": "path", "required": true, "description": "The ID of the account where the folder will be listed.", "schema": { "type": "string" } }, { "name": "fields", "in": "query", "required": true, "description": "Comma-separated list of fields to include in the response. Allowed values: folderId, folderName, folderType, path, previousFolderId, isArchived, imapAccess, URI. Default: fields=folderId,folderName", "schema": { "type": "string", "default": "folderId,folderName" } } ], "responses": { "200": { "description": "Fetched all folders successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FoldersResponse" } } } }, "400": { "description": "Invalid input passed" }, "404": { "description": "Page not found" }, "500": { "description": "Internal Error" } }, "security": [ { "iam-oauth2-schema": [ "ZohoMail.folders.ALL", "ZohoMail.folders.READ" ] } ] } }, "/api/accounts/{accountId}/folders/{folderId}": { "get": { "tags": [ "folders" ], "x-mcp-group": [ "Folders" ], "summary": "Get a specific folder of the account", "description": "This API is used to retrieve a specific folder in a specific account, using the account ID and the folder ID.", "operationId": "getFolder", "parameters": [ { "name": "accountId", "in": "path", "required": true, "description": "The ID of the account where the folder will be listed.", "schema": { "type": "string" } }, { "name": "folderId", "in": "path", "required": true, "description": "This key is used to identify the folder to be fetched.", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Fetched folder successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FolderResponse" } } } }, "400": { "description": "Invalid input passed" }, "404": { "description": "Page not found" }, "500": { "description": "Internal Error" } }, "security": [ { "iam-oauth2-schema": [ "ZohoMail.folders.ALL", "ZohoMail.folders.READ" ] } ] }, "delete": { "tags": [ "folders" ], "x-mcp-group": [ "Folders" ], "summary": "Delete a folder", "description": "This API is used to delete a specific folder in a specific account, using the account ID and the folder ID.", "operationId": "deleteFolder", "parameters": [ { "name": "accountId", "in": "path", "required": true, "description": "This key is used to identify the account from which the folders have to be fetched. It is generated during account addition.", "schema": { "type": "string" } }, { "name": "folderId", "in": "path", "required": true, "description": "This key is used to identify the folder to be fetched.", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Deleted folder successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoDataResponse" } } } }, "400": { "description": "Invalid input passed" }, "404": { "description": "Page not found" }, "500": { "description": "Internal Error" } }, "security": [ { "iam-oauth2-schema": [ "ZohoMail.folders.ALL", "ZohoMail.folders.DELETE" ] } ] } }, "/api/accounts/{accountId}/folders/{folderIdToMove}": { "put": { "tags": [ "folders" ], "x-mcp-group": [ "Folders" ], "summary": "Move a folder", "description": "This API serves the purpose of move folders.", "operationId": "moveFolder", "parameters": [ { "name": "accountId", "in": "path", "required": true, "description": "This key is used to identify the account from which the folders have to be fetched. It is generated during account addition.", "schema": { "type": "string" } }, { "name": "folderIdToMove", "in": "path", "required": true, "description": "This key is used to identify the folder to be fetched.", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FolderMovePayload" } } } }, "responses": { "200": { "description": "Updated folder successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoDataResponse" } } } }, "400": { "description": "Invalid input passed" }, "404": { "description": "Page not found" }, "500": { "description": "Internal Error" } }, "security": [ { "iam-oauth2-schema": [ "ZohoMail.folders.ALL", "ZohoMail.folders.UPDATE" ] } ] } }, "/api/accounts/{accountId}/folders/{folderIdToRename}": { "put": { "tags": [ "folders" ], "x-mcp-group": [ "Folders" ], "summary": "Rename a folder", "description": "This API serves the purpose of rename folders.", "operationId": "renameFolder", "parameters": [ { "name": "accountId", "in": "path", "required": true, "description": "This key is used to identify the account from which the folders have to be fetched. It is generated during account addition.", "schema": { "type": "string" } }, { "name": "folderIdToRename", "in": "path", "required": true, "description": "This key is used to identify the folder to be fetched.", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FolderRenamePayload" } } } }, "responses": { "200": { "description": "Updated folder successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoDataResponse" } } } }, "400": { "description": "Invalid input passed" }, "404": { "description": "Page not found" }, "500": { "description": "Internal Error" } }, "security": [ { "iam-oauth2-schema": [ "ZohoMail.folders.ALL", "ZohoMail.folders.UPDATE" ] } ] } }, "/api/accounts/{accountId}/folders/{folderIdToEnableImapView}": { "put": { "tags": [ "folders" ], "x-mcp-group": [ "Folders" ], "summary": "Enable imap view in folder", "description": "This API serves the purpose of enabling imap view for folders.", "operationId": "enableFolderImapView", "parameters": [ { "name": "accountId", "in": "path", "required": true, "description": "This key is used to identify the account from which the folders have to be fetched. It is generated during account addition.", "schema": { "type": "string" } }, { "name": "folderIdToEnableImapView", "in": "path", "required": true, "description": "This key is used to identify the folder to be fetched.", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FolderEnableIMAPViewPayload" } } } }, "responses": { "200": { "description": "Updated folder successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoDataResponse" } } } }, "400": { "description": "Invalid input passed" }, "404": { "description": "Page not found" }, "500": { "description": "Internal Error" } }, "security": [ { "iam-oauth2-schema": [ "ZohoMail.folders.ALL", "ZohoMail.folders.UPDATE" ] } ] } }, "/api/accounts/{accountId}/folders/{folderIdToDisableImapView}": { "put": { "tags": [ "folders" ], "x-mcp-group": [ "Folders" ], "summary": "Disable imap view in folder", "description": "This API serves the purpose of disabling imap view for folders.", "operationId": "disableImapFolderView", "parameters": [ { "name": "accountId", "in": "path", "required": true, "description": "This key is used to identify the account from which the folders have to be fetched. It is generated during account addition.", "schema": { "type": "string" } }, { "name": "folderIdToDisableImapView", "in": "path", "required": true, "description": "This key is used to identify the folder to be fetched.", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FolderDisableIMAPViewPayload" } } } }, "responses": { "200": { "description": "Updated folder successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoDataResponse" } } } }, "400": { "description": "Invalid input passed" }, "404": { "description": "Page not found" }, "500": { "description": "Internal Error" } }, "security": [ { "iam-oauth2-schema": [ "ZohoMail.folders.ALL", "ZohoMail.folders.UPDATE" ] } ] } }, "/api/accounts/{accountId}/folders/{folderIdToRead}": { "put": { "tags": [ "folders" ], "x-mcp-group": [ "Folders" ], "summary": "To mark as read a folder", "description": "This API serves the purpose of marking a folder as read.", "operationId": "readFolder", "parameters": [ { "name": "accountId", "in": "path", "required": true, "description": "This key is used to identify the account from which the folders have to be fetched. It is generated during account addition.", "schema": { "type": "string" } }, { "name": "folderIdToRead", "in": "path", "required": true, "description": "This key is used to identify the folder to be fetched.", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FolderReadPayload" } } } }, "responses": { "200": { "description": "Updated folder successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoDataResponse" } } } }, "400": { "description": "Invalid input passed" }, "404": { "description": "Page not found" }, "500": { "description": "Internal Error" } }, "security": [ { "iam-oauth2-schema": [ "ZohoMail.folders.ALL", "ZohoMail.folders.UPDATE" ] } ] } }, "/api/accounts/{accountId}/folders/{folderIdToEmpty}": { "put": { "tags": [ "folders" ], "x-mcp-group": [ "Folders" ], "summary": "To empty folder", "description": "This API serves the purpose of emptying a folder.", "operationId": "emptyFolder", "parameters": [ { "name": "accountId", "in": "path", "required": true, "description": "This key is used to identify the account from which the folders have to be fetched. It is generated during account addition.", "schema": { "type": "string" } }, { "name": "folderIdToEmpty", "in": "path", "required": true, "description": "This key is used to identify the folder to be fetched.", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FolderEmptyPayload" } } } }, "responses": { "200": { "description": "Updated folder successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoDataResponse" } } } }, "400": { "description": "Invalid input passed" }, "404": { "description": "Page not found" }, "500": { "description": "Internal Error" } }, "security": [ { "iam-oauth2-schema": [ "ZohoMail.folders.ALL", "ZohoMail.folders.UPDATE" ] } ] } } }, "components": { "schemas": { "Status": { "type": "object", "properties": { "code": { "type": "integer", "examples": [ 200 ] }, "description": { "type": "string", "examples": [ "success" ] } } }, "NoDataResponse": { "type": "object", "properties": { "status": { "$ref": "#/components/schemas/Status" } } }, "FolderResponse": { "type": "object", "properties": { "status": { "$ref": "#/components/schemas/Status" }, "data": { "$ref": "#/components/schemas/Folder" } } }, "FoldersResponse": { "type": "object", "properties": { "status": { "$ref": "#/components/schemas/Status" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/Folder" } } } }, "Folder": { "type": "object", "properties": { "path": { "type": "string", "example": "/new" }, "previousFolderId": { "type": "string", "example": "2560636000000076001" }, "isArchived": { "type": "integer", "example": 0 }, "folderName": { "type": "string", "example": "new" }, "imapAccess": { "type": "boolean", "example": true }, "folderType": { "type": "string", "example": "Inbox" }, "URI": { "type": "string", "example": "https://mail.zoho.com/api/accounts/N****C0CM/folders/2560636000000076007" }, "folderId": { "type": "string", "example": "2560636000000076007" } } }, "FolderMovePayload": { "type": "object", "required": [ "mode" ], "properties": { "mode": { "type": "string", "enum": [ "move" ], "default": "move", "description": "This parameter specifies the type of operation that is to be performed. The value should be 'move'" }, "parentFolderId": { "type": "string", "description": "This parameter refers to the folder ID of the destination parent folder where the folder should be moved.", "example": "2560636000000076001" }, "previousFolderId": { "type": "string", "description": "This parameter refers to the folder ID of a specific folder under the destination parent folder. This determines the exact position where the folder should be placed.", "example": "2560636000000076001" } } }, "FolderRenamePayload": { "type": "object", "required": [ "mode" ], "properties": { "mode": { "type": "string", "enum": [ "rename" ], "default": "rename", "description": "This parameter specifies the type of operation that is to be performed. The value should be 'rename'" }, "folderName": { "type": "string", "description": "This parameter refers to the new name of the folder." } } }, "FolderEnableIMAPViewPayload": { "type": "object", "required": [ "mode" ], "properties": { "mode": { "type": "string", "enum": [ "setViewableInIMAP" ], "default": "setViewableInIMAP", "description": "This parameter specifies the type of operation that is to be performed. The value should be 'setViewableInIMAP'" } } }, "FolderDisableIMAPViewPayload": { "type": "object", "required": [ "mode" ], "properties": { "mode": { "type": "string", "enum": [ "removeViewableInIMAP" ], "default": "removeViewableInIMAP", "description": "This parameter specifies the type of operation that is to be performed. The value should be 'removeViewableInIMAP'" } } }, "FolderReadPayload": { "type": "object", "required": [ "mode" ], "properties": { "mode": { "type": "string", "enum": [ "markAsRead" ], "default": "markAsRead", "description": "This parameter specifies the type of operation that is to be performed. The value should be 'markAsRead'" } } }, "FolderEmptyPayload": { "type": "object", "required": [ "mode" ], "properties": { "mode": { "type": "string", "enum": [ "emptyFolder" ], "default": "emptyFolder", "description": "This parameter specifies the type of operation that is to be performed. The value should be 'emptyFolder'" } } } }, "securitySchemes": { "iam-oauth2-schema": { "type": "oauth2", "flows": { "authorizationCode": { "authorizationUrl": "https://accounts.zoho.com/oauth/v2/auth", "tokenUrl": "https://accounts.zoho.com/oauth/v2/token", "scopes": { "ZohoMail.folders.ALL": "Full access to folders.", "ZohoMail.folders.CREATE": "Create access to folder.", "ZohoMail.folders.READ": "Read access to folder", "ZohoMail.folders.UPDATE": "Update access to folder", "ZohoMail.folders.DELETE": "Update access to folder" } } } } } } }