Create Label

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 creating a label.

Endpoints

OAuth Scope

WorkDrive.labels.CREATECopied!

Request Example

cURL
cURL
Deluge
Copied!
curl --request POST \
  --url https://www.zohoapis.com/workdrive/api/v1/labels \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: application/vnd.api+json' \
  --data '{"data":{"attributes":{"color":"FBE983","user_id":"5nek5a28a8c9201f64a07b7196524264ed528-181767000000047009","name":"Product Design"},"type":"labels"}}'

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).

user_idstring(Required)

A unique ID of the team member that is created when a member is added in a team.

namestring(Required)

Name of the label

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": "FBE983",
        "user_id": "5nek5a28a8c9201f64a07b7196524264ed528-181767000000047009",
        "name": "Product Design"
      },
      "type": "labels"
    }
  }
                
Show full

Response Example

L003

L003

L002

L001

L005

L004

L006

L006

F000

201
201
400
500
Copied!
  {
    "data": {
      "id": "5nek5a28a8c9201f64a07b7196524264ed528-181767000000449001",
      "type": "labels",
      "attributes": {
        "color": "FBE983",
        "name": "Product Design",
        "index": 4,
        "team_id": "5nek5a28a8c9201f64a07b7196524264ed528",
        "type": 1,
        "label_id": "181767000000449001"
      },
      "relationships": {
        "files": {
          "links": {
            "self": "https://www.zohoapis.com/workdrive/api/v1/labels/5nek5a28a8c9201f64a07b7196524264ed528-181767000000449001/relationships/files",
            "related": "https://www.zohoapis.com/workdrive/api/v1/labels/5nek5a28a8c9201f64a07b7196524264ed528-181767000000449001/files"
          }
        }
      },
      "links": {
        "self": "https://www.zohoapis.com/workdrive/api/v1/labels/5nek5a28a8c9201f64a07b7196524264ed528-181767000000449001"
      }
    }
  }
                
  {
    "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": "L005",
        "title": "Maximum label limit reached"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "L004",
        "title": "Label with this name already exists"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "L006",
        "title": "Failed to create label"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "F000",
        "title": "General Exception"
      }
    ]
  }
                
Show full