Change Label Color

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

This API helps in changing the label color.

Endpoints

OAuth Scope

WorkDrive.labels.UPDATECopied!

Request Example

cURL
cURL
Deluge
Copied!
curl --request PATCH \
  --url https://www.zohoapis.com/workdrive/api/v1/labels/{label_id} \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: application/vnd.api+json' \
  --data '{"data":{"attributes":{"color":"14A765"},"type":"labels"}}'

Path Parameters

label_idstring(Required)

The unique ID of a label

Request Body

application/vnd.api+json
dataJSON Object(Required)
Hide Sub-Attributes
attributesJSON Object(Required)
Hide Sub-Attributes
colorstring(Required)

Color to represent the label. It refers to the 6-digit color code.

You can use any color code; however, only limited colors are available in the web app user interface.

typestring(Required)

The JSON:API resource type. Always "labels".

Allowed Values :
Show Values
labelsCopied!
Copied!Copy all as JSON Array

Body Parameters

Copied!
  {
    "data": {
      "attributes": {
        "color": "14A765"
      },
      "type": "labels"
    }
  }
                
Show full

Response Example

L003

L003

L002

L001

L007

L004

L008

F000

200
200
400
500
Copied!
  {
    "data": {
      "id": "5nek5a28a8c9201f64a07b7196524264ed528-181767000000449002",
      "type": "labels",
      "attributes": {
        "color": "14A765",
        "name": "Training materials",
        "index": 5,
        "team_id": "5nek5a28a8c9201f64a07b7196524264ed528",
        "type": 1,
        "label_id": "181767000000449002"
      },
      "relationships": {
        "files": {
          "links": {
            "self": "https://www.zohoapis.com/workdrive/api/v1/labels/5nek5a28a8c9201f64a07b7196524264ed528-181767000000449002/relationships/files",
            "related": "https://www.zohoapis.com/workdrive/api/v1/labels/5nek5a28a8c9201f64a07b7196524264ed528-181767000000449002/files"
          }
        }
      },
      "links": {
        "self": "https://www.zohoapis.com/workdrive/api/v1/labels/5nek5a28a8c9201f64a07b7196524264ed528-181767000000449002"
      }
    }
  }
                
  {
    "errors": [
      {
        "id": "L003",
        "title": "Label color should not be empty"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "L002",
        "title": "Label name should not exceed 25 characters"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "L001",
        "title": "Label name should not be empty"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "L007",
        "title": "Failed to rename label"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "L004",
        "title": "Label with this name already exists"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "L008",
        "title": "Failed to change label color"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "F000",
        "title": "General Exception"
      }
    ]
  }
                
Show full