---
title: Update custom field
slug: project-api/update-custom-field
docTags: 
createdAt: 2024-06-10T16:48:55.566Z
---

{
  "id": "WbF4vp8zI1piqaTH5XZcC",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "https://api.catenda.com/v2/projects/{project-id}/custom-fields/{custom-field-id}",
    "servers": [
      {
        "url": "https://api.catenda.com/v2/projects/{project-id}/custom-fields/{custom-field-id}"
      }
    ],
    "name": "Update custom field",
    "description": "Update a custom field.\n\nThis resource is also where you can modify the custom field enumeration items.\n",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "project-id",
          "type": "string",
          "example": "af2d8af0fa54465b89bf26dd3d92cfd0",
          "description": "Catenda project id"
        },
        {
          "kind": "required",
          "name": "custom-field-id",
          "type": "string",
          "description": "Id of the custom field"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "name",
              "kind": "optional",
              "type": "string",
              "description": "The name of the custom field",
              "example": "Custom field 1"
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "description": "Description of the custom field",
              "example": "Custom field description"
            },
            {
              "name": "archived",
              "kind": "optional",
              "type": "boolean",
              "description": "Archived status.",
              "example": false
            },
            {
              "name": "enumerationItemsToAdd",
              "kind": "optional",
              "type": "array",
              "description": "Enumeration items to add to the custom field.",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "string",
                  "description": "The name of the enumeration item.",
                  "example": "Item name"
                },
                {
                  "name": "code",
                  "kind": "optional",
                  "type": "string",
                  "description": "The code of the item, value is unique for a custom field.",
                  "example": ""
                }
              ]
            },
            {
              "name": "enumerationItemsToMove",
              "kind": "optional",
              "type": "array",
              "description": "Enumeration items to reorder in the custom field.",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "string",
                  "description": "A unique identifier for an enumeration item, represented as compacted UUID using 32 hexadecimal characters",
                  "example": "224809076a694255b589d236517a55da"
                },
                {
                  "name": "itemBeforeId",
                  "kind": "optional",
                  "type": "string",
                  "description": "Determines the position this item will sit within the enumeration, provide the id of the enumeration item you want this item to appear immediately after. Set the value to null to place this item at the beginning.",
                  "example": ""
                }
              ]
            },
            {
              "name": "enumerationItemsToDisable",
              "kind": "optional",
              "type": "array",
              "description": "Enumeration items to disable in the custom field.",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "string",
                  "description": "A unique identifier for an enumeration item, represented as compacted UUID using 32 hexadecimal characters",
                  "example": "224809076a694255b589d236517a55da"
                }
              ]
            },
            {
              "name": "enumerationItemsToRestore",
              "kind": "optional",
              "type": "array",
              "description": "Enumeration items to restore in the custom field.",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "string",
                  "description": "A unique identifier for an enumeration item, represented as compacted UUID using 32 hexadecimal characters",
                  "example": "224809076a694255b589d236517a55da"
                }
              ]
            },
            {
              "name": "enumerationItemsToRename",
              "kind": "optional",
              "type": "array",
              "description": "Enumeration items to rename in the custom field.",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "string",
                  "description": "A unique identifier for an enumeration item, represented as compacted UUID using 32 hexadecimal characters",
                  "example": "224809076a694255b589d236517a55da"
                },
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "string",
                  "description": "Name of the enumeration item.",
                  "example": "Item name"
                }
              ]
            },
            {
              "name": "enumerationItemsToUpdateCode",
              "kind": "optional",
              "type": "array",
              "description": "Enumeration items to update with new codes in the custom field.",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "string",
                  "description": "A unique identifier for an enumeration item, represented as compacted UUID using 32 hexadecimal characters",
                  "example": "224809076a694255b589d236517a55da"
                },
                {
                  "name": "code",
                  "kind": "optional",
                  "type": "string",
                  "description": "The code of the item, value is unique for a custom field.",
                  "example": "Item name"
                }
              ]
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "Bearer",
          "name": "Bearer",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Represents a single custom field.",
            "customType": "custom-field",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "description": "Id of the custom field, represented as compacted UUID using 32 hexadecimal characters.",
                "example": "324409076a694255b589d236517a55da"
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "The name of the custom field.",
                "example": "Custom field name"
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "Description of the custom field.",
                "example": "Custom field description"
              },
              {
                "name": "type",
                "kind": "optional",
                "type": "string<text | integer | double | enumeration | date>",
                "description": "Type of the custom field. Valid values are \"text\", \"integer\", \"double\", \"enumeration\" or \"date\".",
                "example": "text"
              },
              {
                "name": "createdAt",
                "kind": "optional",
                "type": "string",
                "description": "The date and time the custom field was created in ISO 8601 format.",
                "example": "2023-03-06T11:52:45.000Z"
              },
              {
                "name": "createdBy",
                "kind": "optional",
                "type": "string",
                "description": "Id of the user that created the custom field.",
                "example": "624809076a694255b989d236517a55da"
              },
              {
                "name": "archived",
                "kind": "optional",
                "type": "boolean",
                "description": "Whether the custom field is archived.",
                "example": false
              },
              {
                "name": "dropdownItems",
                "kind": "optional",
                "type": "array",
                "description": "List of dropdown items for custom fields of type enumeration. Value is null for other custom field types.",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string",
                    "description": "Id of the custom field, represented as compacted UUID using 32 hexadecimal characters.",
                    "example": ""
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "Name of the dropdown item",
                    "example": "Dropdown item 1"
                  },
                  {
                    "name": "code",
                    "kind": "optional",
                    "type": "string",
                    "description": "The code of the enumeration item, value is unique for a custom field.",
                    "example": "Item name"
                  },
                  {
                    "name": "disabled",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "Whether the enumeration item is disabled.",
                    "example": false
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/custom-field",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "JoaegiI2ZAgVRVjKy6uwk",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PATCH \\\n     --url https://api.catenda.com/v2/projects/{project-id}/custom-fields/{custom-field-id} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "3Meuy1CeqNnOcmkD6asud",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'PATCH',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.catenda.com/v2/projects/{project-id}/custom-fields/{custom-field-id}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "06UglJEuD13yr4nPf4Y0o",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.catenda.com/v2/projects/{project-id}/custom-fields/{custom-field-id}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Patch.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "6XCsftm9YbcJ4gpZqCUP6",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.catenda.com/v2/projects/{project-id}/custom-fields/{custom-field-id}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"PATCH\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "JoaegiI2ZAgVRVjKy6uwk"
    },
    "results": {
      "languages": [
        {
          "id": "WsKe2EXURmsT3xZ7sVmgQ",
          "language": "200",
          "code": "// OK\n{\n  \"id\": \"324409076a694255b589d236517a55da\",\n  \"name\": \"Custom field name\",\n  \"description\": \"Custom field description\",\n  \"type\": \"text\",\n  \"createdAt\": \"2023-03-06T11:52:45.000Z\",\n  \"createdBy\": \"624809076a694255b989d236517a55da\",\n  \"archived\": false,\n  \"dropdownItems\": [\n    {\n      \"id\": \"\",\n      \"name\": \"Dropdown item 1\",\n      \"code\": \"Item name\",\n      \"disabled\": false\n    }\n  ]\n}"
        }
      ],
      "selectedLanguageId": "WsKe2EXURmsT3xZ7sVmgQ"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}