---
title: PATCH /tasks/{task_id}/custom-fields/{custom_field_id}
slug: content-marketing-platform/api/patch-taskstaskidcustom-fieldscustomfieldid
docTags: 
createdAt: 2026-10-01T18:51:26.265Z
---

{
  "id": "612u_-5R1E-ziovkB9IUx",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "https://api.cmp.optimizely.com/v3/tasks/{task_id}/custom-fields/{custom_field_id}",
    "servers": [
      {
        "url": "https://api.cmp.optimizely.com/v3/tasks/{task_id}/custom-fields/{custom_field_id}",
        "description": "v3 version of Optimizely CMP Open API"
      }
    ],
    "name": "PATCH /tasks/{task_id}/custom-fields/{custom_field_id}",
    "description": "<p>Update a custom field of a task.\nYou can update the following types:  <code>text_field</code>, <code>multi_line_text_field</code>, <code>checkboxes</code>, <code>dropdown</code>, <code>multi_select_dropdown</code>, <code>multiple_choice</code>, <code>date_field</code>, <code>rich_text_field</code></p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "task_id",
          "type": "string",
          "example": "5f857f30e1c4a2038d6179e9",
          "description": "Unique identifier of the task"
        },
        {
          "kind": "required",
          "name": "custom_field_id",
          "type": "string",
          "example": "9nu8ue9wf8u9nusd9q",
          "description": "Unique identifier of the custom field"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Payload to update the custom field.\n",
          "customType": "TaskCustomFieldUpdateRequest",
          "schema": [
            {
              "name": "values",
              "kind": "required",
              "type": "array",
              "description": "<p>An array of choice IDs, if the custom field has choices. Otherwise, text values to update the custom field values with. Must contain at least one id/value in the array. For custom fields of type <code>checkboxes</code>, you can provide an array of multiple-choice IDs as values.\nValue for the custom field of type <code>date_field</code> must follow this format: <code>YYYY-MM-DD</code>.</p>",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "1nu8ue9wf8u9nusd9u",
              "itemDefault": ""
            }
          ],
          "modelRef": "#/components/schemas/TaskCustomFieldUpdateRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "OAuth2",
          "name": "OAuth2",
          "kind": "optional",
          "type": "oauth2",
          "oauth2Flows": {
            "clientCredentials": {
              "tokenUrl": "https://accounts.cmp.optimizely.com/o/oauth2/v1/token",
              "scopes": {}
            },
            "authorizationCode": {
              "authorizationUrl": "https://accounts.cmp.optimizely.com/o/oauth2/v1/auth",
              "tokenUrl": "https://accounts.cmp.optimizely.com/o/oauth2/v1/token",
              "scopes": {
                "openid": "Grants the ability to receive a unique identifier for the user.",
                "profile": "Grants access to user profile information.",
                "offline_access": "Grants the ability to refresh access_token using the refresh token even when user is not present (not logged in)."
              }
            }
          },
          "requiredScopes": [
            "openid",
            "profile",
            "offline_access"
          ]
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Updated custom field",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "TaskCustomField",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier for the custom field",
                "example": "9nu8ue9wf8u9nusd9q"
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "Name of the custom field",
                "example": "My Dropdown"
              },
              {
                "name": "type",
                "kind": "required",
                "type": "string<text_field | multi_line_text_field | checkboxes | dropdown | multi_select_dropdown | multiple_choice | date_field | image | video | rich_text_field>",
                "description": "Type of the custom field",
                "example": "dropdown",
                "enum": [
                  "text_field",
                  "multi_line_text_field",
                  "checkboxes",
                  "dropdown",
                  "multi_select_dropdown",
                  "multiple_choice",
                  "date_field",
                  "image",
                  "video",
                  "rich_text_field"
                ]
              },
              {
                "name": "values",
                "kind": "required",
                "type": "array",
                "description": "List of values of the custom field",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string",
                    "nullable": true,
                    "description": "Identifier of the custom field value",
                    "example": "1nu8ue9wf8u9nusd9u"
                  },
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "Name of the custom field value",
                    "example": "Some text"
                  }
                ]
              },
              {
                "name": "links",
                "kind": "required",
                "type": "object",
                "description": "Meta links",
                "example": "",
                "schema": [
                  {
                    "name": "self",
                    "kind": "required",
                    "type": "string",
                    "description": "URL of the custom field",
                    "example": "https://api.cmp.optimizely.com/v3/tasks/5f857f30e1c4a2038d6179e9/custom-fields/9nu8ue9wf8u9nusd9q"
                  },
                  {
                    "name": "choices",
                    "kind": "required",
                    "type": "string",
                    "nullable": true,
                    "description": "URL of the available custom field choices",
                    "example": "https://api.cmp.optimizely.com/v3/tasks/5f857f30e1c4a2038d6179e9/custom-fields/9nu8ue9wf8u9nusd9q/choices"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/TaskCustomField",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Client error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"message\":\"Unsupported arguments: a,b,c\"}",
            "description": "Error payload",
            "customType": "Error",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Message describing the error",
                "example": "Not found"
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "map",
                "description": "Additional information",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Authorization error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"message\":\"Unauthorized\"}",
            "description": "Error payload",
            "customType": "Error",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Message describing the error",
                "example": "Not found"
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "map",
                "description": "Additional information",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "403",
        "description": "Permission error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"message\":\"You do not have the permission to perform this operation\"}",
            "description": "Error payload",
            "customType": "Error",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Message describing the error",
                "example": "Not found"
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "map",
                "description": "Additional information",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Not found error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"message\":\"Resource not found\"}",
            "description": "Error payload",
            "customType": "Error",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Message describing the error",
                "example": "Not found"
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "map",
                "description": "Additional information",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "422",
        "description": "Unprocessable entity error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"message\":\"Resource cannot be processed\"}",
            "description": "Error payload",
            "customType": "Error",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Message describing the error",
                "example": "Not found"
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "map",
                "description": "Additional information",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "mB8eeAE_O2n6BuT74YN-H",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PATCH \\\n     --url https://api.cmp.optimizely.com/v3/tasks/{task_id}/custom-fields/{custom_field_id} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"values\": []\n     }'"
        },
        {
          "id": "g9zu5Et1IqhUBDnGuTuPg",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"values\": []\n});\n\nvar requestOptions = {\n   method: 'PATCH',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.cmp.optimizely.com/v3/tasks/{task_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": "orUCSrGss8CpS9XMNge8d",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.cmp.optimizely.com/v3/tasks/{task_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\"\nrequest.body = JSON.dump({\n   \"values\": []\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "9iPgBCletwFqwS-kySVwo",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.cmp.optimizely.com/v3/tasks/{task_id}/custom-fields/{custom_field_id}\"\n\npayload = json.dumps({\n   \"values\": []\n})\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": "mB8eeAE_O2n6BuT74YN-H"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Updated custom field\n{\n  \"id\": \"9nu8ue9wf8u9nusd9q\",\n  \"name\": \"My Dropdown\",\n  \"type\": \"dropdown\",\n  \"values\": [\n    {\n      \"id\": \"1nu8ue9wf8u9nusd9u\",\n      \"name\": \"Some text\"\n    }\n  ],\n  \"links\": {\n    \"self\": \"https://api.cmp.optimizely.com/v3/tasks/5f857f30e1c4a2038d6179e9/custom-fields/9nu8ue9wf8u9nusd9q\",\n    \"choices\": \"https://api.cmp.optimizely.com/v3/tasks/5f857f30e1c4a2038d6179e9/custom-fields/9nu8ue9wf8u9nusd9q/choices\"\n  }\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Client error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Authorization error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "response-3-403",
          "language": "403",
          "code": "// Permission error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "response-4-404",
          "language": "404",
          "code": "// Not found error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "response-5-422",
          "language": "422",
          "code": "// Unprocessable entity error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}