---
title: POST tasks/{task_id}/fields
slug: content-marketing-platform/api/post-taskstaskidfields
docTags: 
createdAt: 2026-10-01T18:51:26.265Z
---

{
  "id": "AXAXNLLuRKk15V_dDAFdu",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.cmp.optimizely.com/v3/tasks/{task_id}/fields",
    "servers": [
      {
        "url": "https://api.cmp.optimizely.com/v3/tasks/{task_id}/fields",
        "description": "v3 version of Optimizely CMP Open API"
      }
    ],
    "name": "POST tasks/{task_id}/fields",
    "description": "<p>Experimental Add a field to a task.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "task_id",
          "type": "string",
          "example": "5f857f30e1c4a2038d6179e9",
          "description": "Unique identifier of the task"
        }
      ],
      "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 add a field to a task",
          "discriminator": {
            "propertyName": "type",
            "mapping": {
              "checkbox": "#/components/schemas/MultiChoiceTypeObjectField",
              "currency_number": "#/components/schemas/NumberTypeObjectField",
              "date": "#/components/schemas/DateTypeObjectField",
              "dropdown": "#/components/schemas/DropdownTypeObjectField",
              "label": "#/components/schemas/MultiChoiceTypeObjectField",
              "radio_button": "#/components/schemas/RadioButtonTypeObjectField",
              "percentage_number": "#/components/schemas/NumberTypeObjectField",
              "simple_number": "#/components/schemas/NumberTypeObjectField",
              "text": "#/components/schemas/StringTypeObjectField",
              "text_area": "#/components/schemas/StringTypeObjectField",
              "rich_text": "#/components/schemas/StringTypeObjectField",
              "image": "#/components/schemas/AssetTypeObjectField",
              "video": "#/components/schemas/AssetTypeObjectField"
            }
          },
          "customType": "ObjectFieldCreateRequest",
          "schema": [],
          "modelRef": "#/components/schemas/ObjectFieldCreateRequest",
          "complexItems": [
            {
              "name": "object",
              "schema": [
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string",
                  "description": "Type of the field",
                  "example": "checkbox"
                },
                {
                  "name": "values",
                  "kind": "required",
                  "type": "array",
                  "description": "Values for the campaign field",
                  "example": "",
                  "itemType": "undefined",
                  "customType": "undefined[]",
                  "itemExample": "",
                  "itemDefault": ""
                },
                {
                  "name": "id",
                  "kind": "required",
                  "type": "string",
                  "description": "Unique identifier of the field",
                  "example": "41aac313bda1e40b6cde7116fc24a"
                },
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string",
                  "description": "Type of the field",
                  "example": "checkbox"
                },
                {
                  "name": "values",
                  "kind": "required",
                  "type": "array",
                  "description": "Any single string",
                  "example": "",
                  "itemType": "undefined",
                  "customType": "undefined[]",
                  "itemExample": "",
                  "itemDefault": ""
                }
              ],
              "modelRef": "#/components/schemas/StringTypeObjectField",
              "customType": "StringTypeObjectField"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string",
                  "description": "Type of the field",
                  "example": "checkbox"
                },
                {
                  "name": "values",
                  "kind": "required",
                  "type": "array",
                  "description": "Values for the campaign field",
                  "example": "",
                  "itemType": "undefined",
                  "customType": "undefined[]",
                  "itemExample": "",
                  "itemDefault": ""
                },
                {
                  "name": "id",
                  "kind": "required",
                  "type": "string",
                  "description": "Unique identifier of the field",
                  "example": "41aac313bda1e40b6cde7116fc24a"
                },
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string",
                  "description": "Type of the field",
                  "example": "checkbox"
                },
                {
                  "name": "values",
                  "kind": "required",
                  "type": "array",
                  "description": "Array of choice IDs",
                  "example": "",
                  "itemType": "undefined",
                  "customType": "undefined[]",
                  "itemExample": "",
                  "itemDefault": ""
                }
              ],
              "modelRef": "#/components/schemas/MultiChoiceTypeObjectField",
              "customType": "MultiChoiceTypeObjectField"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string",
                  "description": "Type of the field",
                  "example": "checkbox"
                },
                {
                  "name": "values",
                  "kind": "required",
                  "type": "array",
                  "description": "Values for the campaign field",
                  "example": "",
                  "itemType": "undefined",
                  "customType": "undefined[]",
                  "itemExample": "",
                  "itemDefault": ""
                },
                {
                  "name": "id",
                  "kind": "required",
                  "type": "string",
                  "description": "Unique identifier of the field",
                  "example": "41aac313bda1e40b6cde7116fc24a"
                },
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string",
                  "description": "Type of the field",
                  "example": "checkbox"
                },
                {
                  "name": "values",
                  "kind": "required",
                  "type": "array",
                  "description": "",
                  "example": "",
                  "itemType": "undefined",
                  "customType": "undefined[]",
                  "itemExample": "",
                  "itemDefault": ""
                }
              ],
              "modelRef": "#/components/schemas/DropdownTypeObjectField",
              "customType": "DropdownTypeObjectField"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string",
                  "description": "Type of the field",
                  "example": "checkbox"
                },
                {
                  "name": "values",
                  "kind": "required",
                  "type": "array",
                  "description": "Values for the campaign field",
                  "example": "",
                  "itemType": "undefined",
                  "customType": "undefined[]",
                  "itemExample": "",
                  "itemDefault": ""
                },
                {
                  "name": "id",
                  "kind": "required",
                  "type": "string",
                  "description": "Unique identifier of the field",
                  "example": "41aac313bda1e40b6cde7116fc24a"
                },
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string",
                  "description": "Type of the field",
                  "example": "checkbox"
                },
                {
                  "name": "values",
                  "kind": "required",
                  "type": "array",
                  "description": "Accepts a single choice Id.",
                  "example": "",
                  "itemType": "undefined",
                  "customType": "undefined[]",
                  "itemExample": "",
                  "itemDefault": ""
                }
              ],
              "modelRef": "#/components/schemas/RadioButtonTypeObjectField",
              "customType": "RadioButtonTypeObjectField"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string",
                  "description": "Type of the field",
                  "example": "checkbox"
                },
                {
                  "name": "values",
                  "kind": "required",
                  "type": "array",
                  "description": "Values for the campaign field",
                  "example": "",
                  "itemType": "undefined",
                  "customType": "undefined[]",
                  "itemExample": "",
                  "itemDefault": ""
                },
                {
                  "name": "id",
                  "kind": "required",
                  "type": "string",
                  "description": "Unique identifier of the field",
                  "example": "41aac313bda1e40b6cde7116fc24a"
                },
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string",
                  "description": "Type of the field",
                  "example": "checkbox"
                },
                {
                  "name": "values",
                  "kind": "required",
                  "type": "array",
                  "description": "Accepts a single numeric value",
                  "example": "",
                  "itemType": "undefined",
                  "customType": "undefined[]",
                  "itemExample": "",
                  "itemDefault": ""
                }
              ],
              "modelRef": "#/components/schemas/NumberTypeObjectField",
              "customType": "NumberTypeObjectField"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string",
                  "description": "Type of the field",
                  "example": "checkbox"
                },
                {
                  "name": "values",
                  "kind": "required",
                  "type": "array",
                  "description": "Values for the campaign field",
                  "example": "",
                  "itemType": "undefined",
                  "customType": "undefined[]",
                  "itemExample": "",
                  "itemDefault": ""
                },
                {
                  "name": "id",
                  "kind": "required",
                  "type": "string",
                  "description": "Unique identifier of the field",
                  "example": "41aac313bda1e40b6cde7116fc24a"
                },
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string",
                  "description": "Type of the field",
                  "example": "checkbox"
                },
                {
                  "name": "values",
                  "kind": "required",
                  "type": "array",
                  "description": "",
                  "example": "",
                  "itemType": "undefined",
                  "customType": "undefined[]",
                  "itemExample": "",
                  "itemDefault": ""
                }
              ],
              "modelRef": "#/components/schemas/DateTypeObjectField",
              "customType": "DateTypeObjectField"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string",
                  "description": "Type of the field",
                  "example": "checkbox"
                },
                {
                  "name": "values",
                  "kind": "required",
                  "type": "array",
                  "description": "Values for the campaign field",
                  "example": "",
                  "itemType": "undefined",
                  "customType": "undefined[]",
                  "itemExample": "",
                  "itemDefault": ""
                },
                {
                  "name": "id",
                  "kind": "required",
                  "type": "string",
                  "description": "Unique identifier of the field",
                  "example": "41aac313bda1e40b6cde7116fc24a"
                },
                {
                  "name": "type",
                  "kind": "required",
                  "type": "string",
                  "description": "Type of the field",
                  "example": "checkbox"
                },
                {
                  "name": "values",
                  "kind": "required",
                  "type": "array",
                  "description": "Payload for fields with attachments",
                  "example": "",
                  "itemType": "undefined",
                  "customType": "undefined[]",
                  "itemExample": "",
                  "itemDefault": ""
                }
              ],
              "modelRef": "#/components/schemas/AssetTypeObjectField",
              "customType": "AssetTypeObjectField"
            }
          ],
          "complexType": "oneOf",
          "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": "201",
        "description": "Added field to a task.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "discriminator": {
              "propertyName": "type",
              "mapping": {
                "checkbox": "#/components/schemas/FieldTypeCheckbox",
                "currency_number": "#/components/schemas/FieldTypeCurrencyNumber",
                "date": "#/components/schemas/FieldTypeCommon",
                "dropdown": "#/components/schemas/FieldTypeDropdown",
                "image": "#/components/schemas/FieldTypeCommon",
                "label": "#/components/schemas/FieldTypeLabel",
                "percentage_number": "#/components/schemas/FieldTypePercentageNumber",
                "radio_button": "#/components/schemas/FieldTypeRadio",
                "rich_text": "#/components/schemas/FieldTypeCommon",
                "simple_number": "#/components/schemas/FieldTypeSimpleNumber",
                "text": "#/components/schemas/FieldTypeCommon",
                "text_area": "#/components/schemas/FieldTypeCommon",
                "video": "#/components/schemas/FieldTypeCommon"
              }
            },
            "customType": "ObjectFieldCreateResponse",
            "schema": [],
            "modelRef": "#/components/schemas/ObjectFieldCreateResponse",
            "complexItems": [
              {
                "name": "object",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string",
                    "description": "Identifier of the field",
                    "example": "64be245ec0d79e79fdf1ad84"
                  },
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "Name of the field",
                    "example": "Dropdown 101"
                  },
                  {
                    "name": "values",
                    "kind": "required",
                    "type": "array",
                    "description": "List of selected values or from user input",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string",
                    "description": "Type of the field",
                    "example": "text"
                  }
                ],
                "modelRef": "#/components/schemas/FieldTypeCommon",
                "customType": "FieldTypeCommon"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string",
                    "description": "Identifier of the field",
                    "example": "64be245ec0d79e79fdf1ad84"
                  },
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "Name of the field",
                    "example": "Dropdown 101"
                  },
                  {
                    "name": "values",
                    "kind": "required",
                    "type": "array",
                    "description": "List of selected values or from user input",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string",
                    "description": "Type of the field",
                    "example": "text"
                  },
                  {
                    "name": "is_multi_select",
                    "kind": "required",
                    "type": "boolean",
                    "description": "Select multiple values from the label"
                  },
                  {
                    "name": "choices",
                    "kind": "required",
                    "type": "array",
                    "description": "Choices of the label",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "id",
                        "kind": "required",
                        "type": "string",
                        "description": "Identifier of the choice",
                        "example": "6ceee2f4fa3411ecb37802420ac8001b"
                      },
                      {
                        "name": "name",
                        "kind": "required",
                        "type": "string",
                        "description": "Name of the choice",
                        "example": "Label 1 Choice 1"
                      }
                    ]
                  }
                ],
                "modelRef": "#/components/schemas/FieldTypeLabel",
                "customType": "FieldTypeLabel"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string",
                    "description": "Identifier of the field",
                    "example": "64be245ec0d79e79fdf1ad84"
                  },
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "Name of the field",
                    "example": "Dropdown 101"
                  },
                  {
                    "name": "values",
                    "kind": "required",
                    "type": "array",
                    "description": "List of selected values or from user input",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string",
                    "description": "Type of the field",
                    "example": "text"
                  },
                  {
                    "name": "is_multi_select",
                    "kind": "required",
                    "type": "boolean",
                    "description": "Select multiple values from the dropdown"
                  },
                  {
                    "name": "choices",
                    "kind": "required",
                    "type": "array",
                    "description": "Choices of the dropdown",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "id",
                        "kind": "required",
                        "type": "string",
                        "description": "Identifier of the choice",
                        "example": "6ceee2f4fa3411ecb37802420ac8001b"
                      },
                      {
                        "name": "name",
                        "kind": "required",
                        "type": "string",
                        "description": "Name of the choice",
                        "example": "Dropdown 1 Choice 1"
                      }
                    ]
                  }
                ],
                "modelRef": "#/components/schemas/FieldTypeDropdown",
                "customType": "FieldTypeDropdown"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string",
                    "description": "Identifier of the field",
                    "example": "64be245ec0d79e79fdf1ad84"
                  },
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "Name of the field",
                    "example": "Dropdown 101"
                  },
                  {
                    "name": "values",
                    "kind": "required",
                    "type": "array",
                    "description": "List of selected values or from user input",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string",
                    "description": "Type of the field",
                    "example": "text"
                  },
                  {
                    "name": "choices",
                    "kind": "required",
                    "type": "array",
                    "description": "Choices of the radio button",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "id",
                        "kind": "required",
                        "type": "string",
                        "description": "Identifier of the choice",
                        "example": "6ceee2f4fa3411ecb37802420ac8001b"
                      },
                      {
                        "name": "name",
                        "kind": "required",
                        "type": "string",
                        "description": "Name of the choice",
                        "example": "Radio 1 Choice 1"
                      }
                    ]
                  }
                ],
                "modelRef": "#/components/schemas/FieldTypeRadio",
                "customType": "FieldTypeRadio"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string",
                    "description": "Identifier of the field",
                    "example": "64be245ec0d79e79fdf1ad84"
                  },
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "Name of the field",
                    "example": "Dropdown 101"
                  },
                  {
                    "name": "values",
                    "kind": "required",
                    "type": "array",
                    "description": "List of selected values or from user input",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string",
                    "description": "Type of the field",
                    "example": "text"
                  },
                  {
                    "name": "choices",
                    "kind": "required",
                    "type": "array",
                    "description": "Choices of the checkbox",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "id",
                        "kind": "required",
                        "type": "string",
                        "description": "Identifier of the choice",
                        "example": "6ceee2f4fa3411ecb37802420ac8001b"
                      },
                      {
                        "name": "name",
                        "kind": "required",
                        "type": "string",
                        "description": "Name of the choice",
                        "example": "Checkbox 1 Choice 1"
                      }
                    ]
                  }
                ],
                "modelRef": "#/components/schemas/FieldTypeCheckbox",
                "customType": "FieldTypeCheckbox"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string",
                    "description": "Identifier of the field",
                    "example": "64be245ec0d79e79fdf1ad84"
                  },
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "Name of the field",
                    "example": "Dropdown 101"
                  },
                  {
                    "name": "values",
                    "kind": "required",
                    "type": "array",
                    "description": "List of selected values or from user input",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string",
                    "description": "Type of the field",
                    "example": "text"
                  },
                  {
                    "name": "has_thousand_separator",
                    "kind": "required",
                    "type": "boolean",
                    "description": "Whether the numerical field has a thousand separator",
                    "example": true
                  },
                  {
                    "name": "decimal_places",
                    "kind": "required",
                    "type": "integer",
                    "nullable": true,
                    "description": "Decimal place of the numerical field",
                    "example": 2
                  }
                ],
                "modelRef": "#/components/schemas/FieldTypeSimpleNumber",
                "customType": "FieldTypeSimpleNumber"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string",
                    "description": "Identifier of the field",
                    "example": "64be245ec0d79e79fdf1ad84"
                  },
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "Name of the field",
                    "example": "Dropdown 101"
                  },
                  {
                    "name": "values",
                    "kind": "required",
                    "type": "array",
                    "description": "List of selected values or from user input",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string",
                    "description": "Type of the field",
                    "example": "text"
                  },
                  {
                    "name": "decimal_places",
                    "kind": "required",
                    "type": "integer",
                    "nullable": true,
                    "description": "Decimal place of the numerical field",
                    "example": 2
                  }
                ],
                "modelRef": "#/components/schemas/FieldTypePercentageNumber",
                "customType": "FieldTypePercentageNumber"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string",
                    "description": "Identifier of the field",
                    "example": "64be245ec0d79e79fdf1ad84"
                  },
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "Name of the field",
                    "example": "Dropdown 101"
                  },
                  {
                    "name": "values",
                    "kind": "required",
                    "type": "array",
                    "description": "List of selected values or from user input",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string",
                    "description": "Type of the field",
                    "example": "text"
                  },
                  {
                    "name": "has_thousand_separator",
                    "kind": "required",
                    "type": "boolean",
                    "description": "Whether the numerical field has a thousand separator",
                    "example": true
                  },
                  {
                    "name": "decimal_places",
                    "kind": "required",
                    "type": "integer",
                    "nullable": true,
                    "description": "Decimal place of the numerical field",
                    "example": 2
                  },
                  {
                    "name": "currency_code",
                    "kind": "required",
                    "type": "string",
                    "description": "Currency code of the numerical field",
                    "example": "USD"
                  }
                ],
                "modelRef": "#/components/schemas/FieldTypeCurrencyNumber",
                "customType": "FieldTypeCurrencyNumber"
              }
            ],
            "complexType": "oneOf",
            "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": "DBvzTRPQeRNtiF-sVeqMP",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.cmp.optimizely.com/v3/tasks/{task_id}/fields \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"type\": \"checkbox\",\n     \"values\": [],\n     \"id\": \"41aac313bda1e40b6cde7116fc24a\"\n     }'"
        },
        {
          "id": "SqUkpG1OezNl4n3MHXF4D",
          "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   \"type\": \"checkbox\",\n   \"values\": [],\n   \"id\": \"41aac313bda1e40b6cde7116fc24a\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.cmp.optimizely.com/v3/tasks/{task_id}/fields\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "PHqNX4gScaTnbHAJWv1Ok",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.cmp.optimizely.com/v3/tasks/{task_id}/fields\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"type\": \"checkbox\",\n   \"values\": [],\n   \"id\": \"41aac313bda1e40b6cde7116fc24a\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "WI-wojXJxhpQu8hdiXnF0",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.cmp.optimizely.com/v3/tasks/{task_id}/fields\"\n\npayload = json.dumps({\n   \"type\": \"checkbox\",\n   \"values\": [],\n   \"id\": \"41aac313bda1e40b6cde7116fc24a\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "DBvzTRPQeRNtiF-sVeqMP"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-201",
          "language": "201",
          "code": "// Added field to a task.\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-201"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}