Create a New Folder

Purpose

This API is for adding a new folder to a specific account.

OAuth Scope

Use the scope

ZohoMail.folders.ALL (or) ZohoMail.folders.CREATE

to generate the Authtoken.

ALL - Full access to folders.

CREATE - Create a folder.

Request URL

Method: POST

https://mail.zoho.com/api/accounts/{accountId}/folders

Path Parameters

  • accountId* long
    • This key is used to identify the account in which a new folder is created. It is generated during account addition.
    • This parameter can be fetched from Get all accounts API.

Request Body(JSON Object)

  • folderName* string
    • This parameter specifies the unique name of the folder to be created in the particular account. 
    • The folder name should contain alphabets/ letters and should not contain any special characters.
  • parentFolderId long
    • This parameter refers to the folder ID of the parent folder under which the new folder is created.
  • parentFolderPath string
    • This parameter refers to the path of the parent folder under which the new folder is created.

 

* - Mandatory parameter

Response Codes

Refer here for the response codes and their meaning.

Sample Request

Copiedcurl "https://mail.zoho.com/api/accounts/N****C0CM/folders" \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken *****" \
-d '{
    "parentFolderId": 2560636000000076001,
   "folderName": "new"
}'

Sample Response

Copied{
    "status": {
        "code": 201,
        "description": "Created"
    },
    "data": {
        "path": "/new",
        "previousFolderId": "2560636000000076001",
        "isArchived": 0,
        "folderName": "new",
        "imapAccess": true,
        "folderType": "Inbox",
        "URI": "https://mail.zoho.com/api/accounts/N****C0CM/folders/2560636000000076007",
        "folderId": "2560636000000076007"
    }
}