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

{
  "id": "4boscdnssNS63H7fDmRah",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.cmp.optimizely.com/v3/tasks/{task_id}/assets/{asset_id}/comments",
    "servers": [
      {
        "url": "https://api.cmp.optimizely.com/v3/tasks/{task_id}/assets/{asset_id}/comments",
        "description": "v3 version of Optimizely CMP Open API"
      }
    ],
    "name": "POST /tasks/{task_id}/assets/{asset_id}/comments",
    "description": "<p>Add a comment to the latest version of a task asset. Supports adding comments to only <strong>images</strong>, <strong>videos</strong> and <strong>raw files</strong> type assets.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "task_id",
          "type": "string",
          "example": "7d7f910551b00a722e0418830cee6612",
          "description": "Unique identifier of the task"
        },
        {
          "kind": "required",
          "name": "asset_id",
          "type": "string",
          "example": "897f910551b00a722e0418830cee6612",
          "description": "Unique identifier of the asset"
        }
      ],
      "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 comment",
          "customType": "CommentCreateRequest",
          "schema": [
            {
              "name": "value",
              "kind": "required",
              "type": "string",
              "description": "<p>Content of the comment. Markdown is supported. To mention a user belonging to the organization, use the <code>@[name](openapi-user-link)</code> format.</p>",
              "example": "Comment mentioning @[Organization User](https://api.cmp.optimizely.com/v3/users/5fe38aeb574b52a62a089238)",
              "minLength": 1
            },
            {
              "name": "attachments",
              "kind": "optional",
              "type": "array",
              "description": "List of comment attachments.",
              "modelRef": "#/components/schemas/AttachmentRequest",
              "customType": "AttachmentRequest[]",
              "schema": [
                {
                  "name": "key",
                  "kind": "required",
                  "type": "string",
                  "description": "<p>Unique identifier of the file upload session. This is the <code>upload_meta_fields.key</code> field retrieved from the <code>/v3/upload-url</code> endpoint.</p>",
                  "example": "ce8995aea58b11ea8cd90242ac120005",
                  "minLength": 1,
                  "maxLength": 100
                },
                {
                  "name": "name",
                  "kind": "required",
                  "type": "string",
                  "description": "Filename of the attachment",
                  "example": "sample_image.png",
                  "minLength": 1
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/CommentCreateRequest",
          "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 comment",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "TaskAssetCommentResponse",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier of the comment",
                "example": "5fe38c39574b52a62a089239"
              },
              {
                "name": "value",
                "kind": "required",
                "type": "string",
                "description": "Content of the comment",
                "example": "Well done!"
              },
              {
                "name": "is_resolved",
                "kind": "required",
                "type": "boolean",
                "description": "Determines if the comment is resolved in Optimizely CMP",
                "example": false
              },
              {
                "name": "created_at",
                "kind": "required",
                "type": "string<date-time>",
                "description": "<p>Creation date and time of the comment, in ISO 8601 UTC format (2020-02-10T10:40</p><div></div>)<p></p>",
                "example": "2020-10-06T13:15:30Z",
                "format": "date-time"
              },
              {
                "name": "modified_at",
                "kind": "required",
                "type": "string<date-time>",
                "description": "<p>Last modification date and time of the comment, in ISO 8601 UTC format (2020-02-10T10:40</p><div></div>)<p></p>",
                "example": "2020-10-06T14:15:30Z",
                "format": "date-time"
              },
              {
                "name": "attachments",
                "kind": "required",
                "type": "array",
                "description": "List of attachments of the comment",
                "modelRef": "#/components/schemas/AttachmentResponse",
                "customType": "AttachmentResponse[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string",
                    "description": "Unique identifier for the attachment",
                    "example": "5a7f910511b0a72230ce6631"
                  },
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "Filename of the attachment",
                    "example": "sample_image.png"
                  },
                  {
                    "name": "url",
                    "kind": "required",
                    "type": "string",
                    "description": "Download URL of the attachment",
                    "example": "https://files.cmp.optimizely.com/download/2115bfe4450c11ebaae8000c291b51d4"
                  }
                ]
              },
              {
                "name": "links",
                "kind": "required",
                "type": "object",
                "description": "Meta links",
                "example": "",
                "schema": [
                  {
                    "name": "task",
                    "kind": "required",
                    "type": "string",
                    "description": "URL of the task",
                    "example": "https://api.cmp.optimizely.com/v3/tasks/5d7f910551b00a722e0418830cee5534"
                  },
                  {
                    "name": "asset",
                    "kind": "required",
                    "type": "string",
                    "description": "URL of the asset",
                    "example": "https://api.cmp.optimizely.com/v3/tasks/5d7f910551b00a722e0418830cee5534/images/6d7f910551b00a722e0418830cee5564"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/TaskAssetCommentResponse",
            "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": "1dPtZDjClENUC_aXZW23_",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.cmp.optimizely.com/v3/tasks/{task_id}/assets/{asset_id}/comments \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data-raw '{\n     \"value\": \"Comment mentioning @[Organization User](https://api.cmp.optimizely.com/v3/users/5fe38aeb574b52a62a089238)\",\n     \"attachments\": [\n     {\n     \"key\": \"ce8995aea58b11ea8cd90242ac120005\",\n     \"name\": \"sample_image.png\"\n     }\n     ]\n     }'"
        },
        {
          "id": "qjysRMT41qGTIWFwUiYeI",
          "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   \"value\": \"Comment mentioning @[Organization User](https://api.cmp.optimizely.com/v3/users/5fe38aeb574b52a62a089238)\",\n   \"attachments\": [\n      {\n         \"key\": \"ce8995aea58b11ea8cd90242ac120005\",\n         \"name\": \"sample_image.png\"\n      }\n   ]\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}/assets/{asset_id}/comments\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "-NYBBPUBTUZNrVFMO2tol",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.cmp.optimizely.com/v3/tasks/{task_id}/assets/{asset_id}/comments\")\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   \"value\": \"Comment mentioning @[Organization User](https://api.cmp.optimizely.com/v3/users/5fe38aeb574b52a62a089238)\",\n   \"attachments\": [\n      {\n         \"key\": \"ce8995aea58b11ea8cd90242ac120005\",\n         \"name\": \"sample_image.png\"\n      }\n   ]\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "haMak7iQN-x296sI0vbLF",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.cmp.optimizely.com/v3/tasks/{task_id}/assets/{asset_id}/comments\"\n\npayload = json.dumps({\n   \"value\": \"Comment mentioning @[Organization User](https://api.cmp.optimizely.com/v3/users/5fe38aeb574b52a62a089238)\",\n   \"attachments\": [\n      {\n         \"key\": \"ce8995aea58b11ea8cd90242ac120005\",\n         \"name\": \"sample_image.png\"\n      }\n   ]\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": "1dPtZDjClENUC_aXZW23_"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-201",
          "language": "201",
          "code": "// Added comment\n{\n  \"id\": \"5fe38c39574b52a62a089239\",\n  \"value\": \"Well done!\",\n  \"is_resolved\": false,\n  \"created_at\": \"2020-10-06T13:15:30Z\",\n  \"modified_at\": \"2020-10-06T14:15:30Z\",\n  \"attachments\": [\n    {\n      \"id\": \"5a7f910511b0a72230ce6631\",\n      \"name\": \"sample_image.png\",\n      \"url\": \"https://files.cmp.optimizely.com/download/2115bfe4450c11ebaae8000c291b51d4\"\n    }\n  ],\n  \"links\": {\n    \"task\": \"https://api.cmp.optimizely.com/v3/tasks/5d7f910551b00a722e0418830cee5534\",\n    \"asset\": \"https://api.cmp.optimizely.com/v3/tasks/5d7f910551b00a722e0418830cee5534/images/6d7f910551b00a722e0418830cee5564\"\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-201"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}