---
title: PATCH /tasks/{task_id}/compose-contents/{content_id}
slug: content-marketing-platform/api/patch-taskstaskidcompose-contentscontentid
docTags: 
createdAt: 2026-10-18T11:50:12.773Z
---

{
  "id": "ZGSdsR5xaf_257cCibsiY",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "https://api.cmp.optimizely.com/v3/tasks/{task_id}/compose-contents/{content_id}",
    "servers": [
      {
        "url": "https://api.cmp.optimizely.com/v3/tasks/{task_id}/compose-contents/{content_id}",
        "description": "v3 version of Optimizely CMP Open API"
      }
    ],
    "name": "PATCH /tasks/{task_id}/compose-contents/{content_id}",
    "description": "<p>Experimental Update the field values of a compose content of a task. The given fields are merged into the existing fields. Field values are checked against the content schema structure; value rules (<code>validations</code>) are not checked on update. Returns 422 if the task is completed or archived.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "task_id",
          "type": "string",
          "example": "645cb61c966d0c591320f636",
          "description": "Unique identifier of the task"
        },
        {
          "kind": "required",
          "name": "content_id",
          "type": "string",
          "example": "db5lh0dh7f0s1otndpp0",
          "description": "Unique identifier of the compose content"
        }
      ],
      "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 a compose content",
          "customType": "TaskComposeContentUpdateRequest",
          "schema": [
            {
              "name": "fields",
              "kind": "required",
              "type": "object",
              "description": "<p>Field values to set. The values are merged into the existing fields: fields that are not in the request keep their values. Each field must exist in the content schema, and each locale code must be active. A <code>null</code> value is not supported and does not clear a field.</p>",
              "complexType": "allOf",
              "complexItems": [
                {
                  "name": "ComposeContentFields",
                  "description": "",
                  "modelRef": "#/components/schemas/ComposeContentFields",
                  "schema": []
                }
              ],
              "schema": []
            }
          ],
          "modelRef": "#/components/schemas/TaskComposeContentUpdateRequest",
          "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 compose content",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "TaskComposeContentResponse",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier of the compose content",
                "example": "db5lh0dh7f0s1otndpp0"
              },
              {
                "name": "content_schema_id",
                "kind": "required",
                "type": "string",
                "description": "Internal identifier of the content schema of the compose content",
                "example": "db5lfu5h7f0s1otndoug"
              },
              {
                "name": "status",
                "kind": "required",
                "type": "string<draft | changed | published | archived | >",
                "nullable": true,
                "description": "Status of the compose content",
                "example": "draft",
                "enum": [
                  "draft",
                  "changed",
                  "published",
                  "archived",
                  "null"
                ]
              },
              {
                "name": "version",
                "kind": "required",
                "type": "integer",
                "description": "Current version number of the compose content",
                "example": 1
              },
              {
                "name": "published_version",
                "kind": "required",
                "type": "integer",
                "nullable": true,
                "description": "<p>Version number that is currently published. <code>null</code> if the content was never published.</p>",
                "example": ""
              },
              {
                "name": "created_at",
                "kind": "required",
                "type": "string<date-time>",
                "description": "<p>Date and time on which the compose content was created, in ISO 8601 UTC format</p>",
                "example": "2026-10-11T09:36:01Z",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "required",
                "type": "string<date-time>",
                "description": "<p>Date and time of the most recent update of the compose content, in ISO 8601 UTC format</p>",
                "example": "2026-10-11T09:36:11Z",
                "format": "date-time"
              },
              {
                "name": "fields",
                "kind": "required",
                "type": "object",
                "description": "<p>Field values of the compose content, keyed by the field <code>api_id</code> of the content schema. Each value is an object keyed by locale code (for example <code>en-US</code>). Fields that are not localized are still keyed by the default locale. The value type depends on the field type in the content schema. Reference and embedded schema fields are returned as links only: <code>{\"meta\": {\"id\": \"...\", \"type\": \"link\", \"link_type\": \"content\"}}</code>.</p>",
                "example": "{\"title\":{\"en-US\":\"Hello from Open API\",\"de\":\"Hallo\"},\"is_featured\":{\"en-US\":true}}",
                "modelRef": "#/components/schemas/ComposeContentFields",
                "customType": "ComposeContentFields",
                "schema": []
              },
              {
                "name": "links",
                "kind": "required",
                "type": "object",
                "description": "Meta links",
                "example": "",
                "schema": [
                  {
                    "name": "self",
                    "kind": "required",
                    "type": "string",
                    "description": "URL of the compose content",
                    "example": "https://api.cmp.optimizely.com/v3/tasks/645cb61c966d0c591320f636/compose-contents/db5lh0dh7f0s1otndpp0"
                  },
                  {
                    "name": "task",
                    "kind": "required",
                    "type": "string",
                    "description": "URL of the task",
                    "example": "https://api.cmp.optimizely.com/v3/tasks/645cb61c966d0c591320f636"
                  },
                  {
                    "name": "content_schema",
                    "kind": "required",
                    "type": "string",
                    "nullable": true,
                    "description": "URL of the content schema",
                    "example": "https://api.cmp.optimizely.com/v3/compose/content-schemas/db5lfu5h7f0s1otndoug"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/TaskComposeContentResponse",
            "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": "1q0rqPm_o6jv2_Gl7sB5W",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PATCH \\\n     --url https://api.cmp.optimizely.com/v3/tasks/{task_id}/compose-contents/{content_id} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"fields\": {}\n     }'"
        },
        {
          "id": "7xkTeF2uyjrzYnhRzjV4X",
          "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   \"fields\": {}\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}/compose-contents/{content_id}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "-za5easkIhEDfiuXZc5k8",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.cmp.optimizely.com/v3/tasks/{task_id}/compose-contents/{content_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   \"fields\": {}\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "U26dGShN8_F0oebKwll0c",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.cmp.optimizely.com/v3/tasks/{task_id}/compose-contents/{content_id}\"\n\npayload = json.dumps({\n   \"fields\": {}\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": "1q0rqPm_o6jv2_Gl7sB5W"
    },
    "results": {
      "languages": [
        {
          "id": "12Kki1H8MX9EEGzfO-8IV",
          "language": "200",
          "code": "// Updated compose content\n{\n  \"id\": \"db5lh0dh7f0s1otndpp0\",\n  \"content_schema_id\": \"db5lfu5h7f0s1otndoug\",\n  \"status\": \"draft\",\n  \"version\": 1,\n  \"published_version\": 0,\n  \"created_at\": \"2026-10-11T09:36:01Z\",\n  \"updated_at\": \"2026-10-11T09:36:11Z\",\n  \"fields\": {},\n  \"links\": {\n    \"self\": \"https://api.cmp.optimizely.com/v3/tasks/645cb61c966d0c591320f636/compose-contents/db5lh0dh7f0s1otndpp0\",\n    \"task\": \"https://api.cmp.optimizely.com/v3/tasks/645cb61c966d0c591320f636\",\n    \"content_schema\": \"https://api.cmp.optimizely.com/v3/compose/content-schemas/db5lfu5h7f0s1otndoug\"\n  }\n}"
        },
        {
          "id": "OWo0gLRbboNQz7AcP6lmh",
          "language": "400",
          "code": "// Client error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "IU2n67yCIG5kQjdnPiiK7",
          "language": "401",
          "code": "// Authorization error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "N7ClT5S7J5gAg8yErlEN9",
          "language": "403",
          "code": "// Permission error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "4XI6WtGjBYskEO5G_yXy3",
          "language": "404",
          "code": "// Not found error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "TT30UpKA66G2jPf8mT3TM",
          "language": "422",
          "code": "// Unprocessable entity error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "12Kki1H8MX9EEGzfO-8IV"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}