Create a Label

Purpose 

This API is used to create a new label within the mailbox.

OAuth Scope

Use the scope

MailApps.tags.ALL (or) MailApps.tags.CREATE

ALL - Full access to labels.

CREATE - Create a new label.

To generate Authtoken, refer here.

Request URL

Method: POST

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

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)

  • displayName* string
    • This parameter specifies the name of the new label created.
  • color string
    • This parameter refers to the color you prefer to associate with the label.
    • The value should be given as a Hex representation of the color.

Sample Request

Copiedcurl "https://mail360.zoho.com/api/accounts/x7k**0s/labels" \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken 802432953.**fac09d8c98b4ac3" \
-d '{
  "displayName" :"Label 1",
  "color":"#FFD700"
}'

Sample Response

Copied{
    "status": {
        "code": 201,
        "description": "Created"
    },
    "data": {
        "labelId": "27684000000021003",
        "displayName": "L1",
        "color": "#FFD700",
        "sequence": 1
    }
}