Create Custom Field

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 custom field within a data template.

A 'custom_field_id' is created when a new custom field is created within a data template.

Endpoints

OAuth Scope

WorkDrive.datatemplates.CREATECopied!

Request Example

cURL
cURL
Deluge
Copied!
curl --request POST \
  --url https://www.zohoapis.com/workdrive/api/v1/datatemplates/{data_template_id}/customfields \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: application/vnd.api+json' \
  --data '{"data":{"attributes":{"display_name":"Role","type":"dropdown","field_properties":{"description":"Role of the candidate","is_mandatory":true,"default_value":""},"choices":[{"key":"Developer"},{"key":"Designers"},{"key":"Marketer"}]},"type":"customfields"}}'

Path Parameters

data_template_idstring(Required)

A unique ID of the data template.

Request Body

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

A name for the custom field.

typestring(Required)

This represents the data type of the custom field.
Refer to this table for all supported custom field data types.

field_propertiesJSON Object(Optional)

This represents the variables used for different data types.
Refer to this table for all supported custom field data types with supported field properties.

Show Sub-Attributes
descriptionstring(Optional)

Description for the custom field.

is_mandatoryboolean(Optional)

Set true to make this custom field mandatory.

default_valuestring(Optional)

Default value to prefill for the custom field.

choicesJSON Array(Optional)

This represents the list of choices for choice type custom fields (dropdown, radio, checkbox).


Eg. [{key:"choice1"},{key:"choice2"}]

Show Sub-Attributes
keystring(Optional)

Display value for this choice item.

typestring(Required)

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

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

Body Parameters

Copied!
  {
    "data": {
      "attributes": {
        "display_name": "Role",
        "type": "dropdown",
        "field_properties": {
          "description": "Role of the candidate",
          "is_mandatory": true,
          "default_value": ""
        },
        "choices": [
          {
            "key": "Developer"
          },
          {
            "key": "Designers"
          },
          {
            "key": "Marketer"
          }
        ]
      },
      "type": "customfields"
    }
  }
                
Show full

Response Example

CF003

CF003

CF037

F000

CF080

CF081

CF082

CF083

CF053

CF077

CF001

CF078

CF067

CF079

201
201
500
Copied!
  {
    "data": {
      "id": "nrkroc4c5f3259e2a410da17c3915ea990dde-MjQwMDAwMDA1ODEwMDEtMjQwMDAwMDA1ODIwMDI",
      "type": "customfields",
      "attributes": {
        "data_template_id": "nrkroc4c5f3259e2a410da17c3915ea990dde-24000000581001",
        "column_name": "CF61",
        "index": 1,
        "display_name": "Role",
        "type": "dropdown",
        "field_properties": {
          "description": "Role of the candidate",
          "is_mandatory": true,
          "default_value": ""
        },
        "choices": [
          {
            "key": "Developer"
          },
          {
            "key": "Designers"
          },
          {
            "key": "Marketer"
          }
        ]
      },
      "links": {
        "self": "https://www.zohoapis.com/workdrive/api/v1/customfields/nrkroc4c5f3259e2a410da17c3915ea990dde-MjQwMDAwMDA1ODEwMDEtMjQwMDAwMDA1ODIwMDI"
      }
    }
  }
                
  {
    "errors": [
      {
        "id": "CF003",
        "title": "Custom field cannot be created without a name or type"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF037",
        "title": "This template is not enabled"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "F000",
        "title": "General Exception"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF080",
        "title": "Maximum dropdown/radio limit reached for this data template"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF081",
        "title": "Maximum checkbox options limit reached for this data template"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF082",
        "title": "Date value cannot be in the past"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF083",
        "title": "Date value cannot be in the future"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF053",
        "title": "Invalid dataTemplate"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF077",
        "title": "Maximum custom field limit reached for this data template"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF001",
        "title": "Custom fields cannot be created.Please pass valid data-template id"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF078",
        "title": "Maximum multi-line field limit reached for this data template"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF067",
        "title": "Custom Fields position exceeds the limit"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "CF079",
        "title": "Maximum choice field (checkbox) limit reached for this data template"
      }
    ]
  }
                
Show full