Get all folders

Purpose

This API is used to list all the folders within the specified account.

OAuth Scope

Use the scope

ZohoMail.folders.ALL (or) ZohoMail.folders.READ

to generate the Authtoken.

ALL - Full access to folders.

READ - Read all folder details.

Request URL

Method: GET

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

Path Parameters

  • accountId* long
    • This key is used to identify the account from which the folders have to be fetched. It is generated during account addition.
    • This parameter can be fetched from Get all accounts API.

 

* - Mandatory parameter

Response Codes

Refer here for the response codes and their meaning.

Sample Request

Copiedcurl "https://mail.zoho.com/api/accounts/9999000***293/folders" \
-X GET \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken ***" \

Sample Response

Copied{
    "status": {
        "code": 200,
        "description": "success"
    },
    "data": [
        {
            "path": "/Inbox",
            "isArchived": 1,
            "folderName": "Inbox",
            "imapAccess": true,
            "folderType": "Inbox",
            "URI": "https://mail.zoho.com/api/accounts/2560636000000008002/folders/2560636000000008014",
            "folderId": "2560636000000008014"
        },
        {
            "path": "/Drafts",
            "previousFolderId": "2560636000000008014",
            "isArchived": 0,
            "folderName": "Drafts",
            "imapAccess": true,
            "folderType": "Drafts",
            "URI": "https://mail.zoho.com/api/accounts/2560636000000008002/folders/2560636000000008016",
            "folderId": "2560636000000008016"
        },
        {
            "path": "/Templates",
            "previousFolderId": "2560636000000008016",
            "isArchived": 0,
            "folderName": "Templates",
            "imapAccess": true,
            "folderType": "Templates",
            "URI": "https://mail.zoho.com/api/accounts/2560636000000008002/folders/2560636000000008018",
            "folderId": "2560636000000008018"
        },
        {
            "path": "/Snoozed",
            "previousFolderId": "2560636000000008018",
            "isArchived": 0,
            "folderName": "Snoozed",
            "imapAccess": true,
            "folderType": "Snoozed",
            "URI": "https://mail.zoho.com/api/accounts/2560636000000008002/folders/2560636000000008020",
            "folderId": "2560636000000008020"
        },
        {
            "path": "/Sent",
            "previousFolderId": "2560636000000008020",
            "isArchived": 0,
            "folderName": "Sent",
            "imapAccess": true,
            "folderType": "Sent",
            "URI": "https://mail.zoho.com/api/accounts/2560636000000008002/folders/2560636000000008022",
            "folderId": "2560636000000008022"
        },
        {
            "path": "/Spam",
            "previousFolderId": "2560636000000008022",
            "isArchived": 0,
            "folderName": "Spam",
            "imapAccess": true,
            "folderType": "Spam",
            "URI": "https://mail.zoho.com/api/accounts/2560636000000008002/folders/2560636000000008024",
            "folderId": "2560636000000008024"
        },
        {
            "path": "/Trash",
            "previousFolderId": "2560636000000008024",
            "isArchived": 0,
            "folderName": "Trash",
            "imapAccess": true,
            "folderType": "Trash",
            "URI": "https://mail.zoho.com/api/accounts/2560636000000008002/folders/2560636000000008026",
            "folderId": "2560636000000008026"
        },
        {
            "path": "/Outbox",
            "previousFolderId": "2560636000000008026",
            "isArchived": 0,
            "folderName": "Outbox",
            "imapAccess": true,
            "folderType": "Outbox",
            "URI": "https://mail.zoho.com/api/accounts/2560636000000008002/folders/2560636000000008028",
            "folderId": "2560636000000008028"
        },
        {
            "path": "/test",
            "previousFolderId": "2560636000000075007",
            "isArchived": 0,
            "folderName": "test",
            "imapAccess": true,
            "folderType": "Inbox",
            "URI": "https://mail.zoho.com/api/accounts/2560636000000008002/folders/2560636000000013018",
            "folderId": "2560636000000013018"
        }
    ]
}