Create a Folder

Purpose 

This API is used to create a new folder in the mailbox.

OAuth Scope

Use the scope

MailApps.folders.ALL (or) MailApps.folders.CREATE

ALL - Full access to folders.

CREATE - Create a new folder.

To generate Authtoken, refer here.

Request URL

Method: POST

https://mail360.zoho.com/api/accounts/{account_key}/folders

Path Parameters

  • account_key* string
    • This key is used to identify the mailbox. 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 name of the new folder created.
  • parentFolderId long
    • This parameter refers to the ID of the parent folder under which the new folder will be created.

 

* - Mandatory parameter.

Sample Request

Copiedcurl "https://mail360.zoho.com/api/accounts/N7A****0CM/folders" \
     -X POST \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -H "Authorization: Zoho-oauthtoken ****" \
     -d '{
         "folderName": "Label_create_4",
         "parentFolderId": "27684000000021001",
         "parentFolderPath": "/INBOX/Label_create_4"
     }'

Sample Response

Copied{
   "status": {
       "code": 201,
       "description": "Created"
   },
   "data": {
       "path": "/INBOX/Label_create_4",
       "folderName": "Label_create_4",
       "folderType": "Inbox",
       "folderId": "27684000000021001"
   }
}