---
title: POST /assets
slug: content-marketing-platform/api/post-assets
docTags: 
createdAt: 2026-10-01T18:51:26.265Z
---

{
  "id": "FfUuu7EINh0qIBKpOTxFd",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.cmp.optimizely.com/v3/assets",
    "servers": [
      {
        "url": "https://api.cmp.optimizely.com/v3/assets",
        "description": "v3 version of Optimizely CMP Open API"
      }
    ],
    "name": "POST /assets",
    "description": "<p>Create a new asset. Supports only <code>images</code>, <code>videos</code>, and <code>raw files</code>. See <a href=\"https://docs.developers.optimizely.com/content-marketing-platform/docs/upload-assets\" target=\"_blank\">Upload assets</a> to upload an asset.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "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 create an asset",
          "customType": "LibraryAssetCreateRequest",
          "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>",
              "maxLength": 100
            },
            {
              "name": "title",
              "kind": "required",
              "type": "string",
              "description": "Title of the asset",
              "example": "sample_image.png",
              "minLength": 1,
              "maxLength": 100
            },
            {
              "name": "folder_id",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "ID of the folder where the asset should be added",
              "example": "5d7f910551b00a722e0418830cee6631"
            }
          ],
          "modelRef": "#/components/schemas/LibraryAssetCreateRequest",
          "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": "Created asset",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "AssetResponse",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier for the asset",
                "example": "5d7f910551b00a722e0418830cee6631"
              },
              {
                "name": "title",
                "kind": "required",
                "type": "string",
                "description": "Title of the asset",
                "example": "sample_image.png"
              },
              {
                "name": "type",
                "kind": "required",
                "type": "string<article | image | video | raw_file | structured_content | compose_content>",
                "description": "Type of the asset",
                "example": "image",
                "enum": [
                  "article",
                  "image",
                  "video",
                  "raw_file",
                  "structured_content",
                  "compose_content"
                ]
              },
              {
                "name": "mime_type",
                "kind": "required",
                "type": "string",
                "description": "MIME type of the asset",
                "example": "image/png"
              },
              {
                "name": "file_extension",
                "kind": "required",
                "type": "string",
                "nullable": true,
                "description": "File extension of the asset",
                "example": "png"
              },
              {
                "name": "created_at",
                "kind": "required",
                "type": "string<date-time>",
                "description": "<p>Date and time on which the asset was created, in ISO 8601 UTC format (2020-02-10T10:40</p><div></div>)<p></p>",
                "example": "2019-10-06T13:15:30Z",
                "format": "date-time"
              },
              {
                "name": "modified_at",
                "kind": "required",
                "type": "string<date-time>",
                "description": "<p>Date and time of the most recent modification of the asset, in ISO 8601 UTC format (2020-02-10T10:40</p><div></div>)<p></p>",
                "example": "2019-10-07T13:15:30Z",
                "format": "date-time"
              },
              {
                "name": "folder_id",
                "kind": "required",
                "type": "string",
                "nullable": true,
                "description": "ID of the folder containing the asset in the library",
                "example": "6bb8db20a5b611ebae319b7c541b1a5a"
              },
              {
                "name": "file_location",
                "kind": "required",
                "type": "string",
                "description": "Location of the folder containing the asset in the library",
                "example": "/all assets/important assets"
              },
              {
                "name": "is_archived",
                "kind": "required",
                "type": "boolean",
                "description": "Whether the asset is archived or not",
                "example": false
              },
              {
                "name": "content",
                "kind": "required",
                "type": "object",
                "description": "Content of the asset",
                "modelRef": "#/components/schemas/AssetContent",
                "customType": "AssetContent",
                "schema": [
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string<url | api_url | html_body>",
                    "description": "<p>Type of the content.</p>\n<ul>\n<li>article  – <code>html_body</code></li>\n<li>image, raw_file, video  – <code>url</code></li>\n<li>structured_content  – <code>api_url</code></li>\n<li>compose_content  – <code>api_url</code></li>\n</ul>",
                    "example": "url",
                    "enum": [
                      "url",
                      "api_url",
                      "html_body"
                    ]
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>Content of the asset.  - article – the html body - image, raw_file, video – the download URL - structured_content – api url - compose_content – api url</p>",
                    "example": "http://images.cmp.optimizely.com/Zz0xODQ3NDU3Y2Y2YmYzOTlmNjkyOTgyZDY3Y2I3YWM2OA==S"
                  }
                ]
              },
              {
                "name": "labels",
                "kind": "required",
                "type": "array",
                "description": "Labels associated with the asset",
                "modelRef": "#/components/schemas/ResourceLabelResponse",
                "customType": "ResourceLabelResponse[]",
                "schema": [
                  {
                    "name": "group",
                    "kind": "required",
                    "type": "object",
                    "description": "Label group",
                    "example": "",
                    "schema": [
                      {
                        "name": "id",
                        "kind": "required",
                        "type": "string",
                        "description": "Identifier of the label group",
                        "example": "2467e583a60e23fda2b89db81a453cd2"
                      },
                      {
                        "name": "name",
                        "kind": "required",
                        "type": "string",
                        "description": "Name of the label group",
                        "example": "Content Format"
                      }
                    ]
                  },
                  {
                    "name": "values",
                    "kind": "required",
                    "type": "array",
                    "description": "List of values of the label",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "id",
                        "kind": "required",
                        "type": "string",
                        "description": "Identifier of the label value",
                        "example": "71c378f3fee3d822759d1bdc2aab628c"
                      },
                      {
                        "name": "name",
                        "kind": "required",
                        "type": "string",
                        "description": "Name of the label value",
                        "example": "Photos"
                      }
                    ]
                  }
                ]
              },
              {
                "name": "links",
                "kind": "required",
                "type": "object",
                "description": "Meta links",
                "example": "",
                "schema": [
                  {
                    "name": "self",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>URL of the asset (only GET is supported)</p>",
                    "example": "https://api.cmp.optimizely.com/v3/images/5d7f910551bw0a722e0418830cee6631"
                  }
                ]
              },
              {
                "name": "owner_organization_id",
                "kind": "required",
                "type": "string",
                "nullable": false,
                "description": "ID of the asset's owner organization",
                "example": "5108c3a9becac35915111191"
              },
              {
                "name": "thumbnail_url",
                "kind": "required",
                "type": "string",
                "nullable": true,
                "description": "URL of the asset's thumbnail",
                "example": "https://images1.cmp.optimizely.com/Pz1kYmI9Z2FkYTJtZWI5VGI1WZq4MTZkNTdmGHjM5OGRmYq=="
              }
            ],
            "modelRef": "#/components/schemas/AssetResponse",
            "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
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "Vd5QRiK4SKCIzZWUuoWr8",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.cmp.optimizely.com/v3/assets \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"key\": \"\",\n     \"title\": \"sample_image.png\"\n     }'"
        },
        {
          "id": "OuJbmJlt4jhytV8MK-qQK",
          "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   \"key\": \"\",\n   \"title\": \"sample_image.png\"\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/assets\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "peGUfejmotY_6ZlHTLoGN",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.cmp.optimizely.com/v3/assets\")\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   \"key\": \"\",\n   \"title\": \"sample_image.png\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "K3mAw2DT3h5dTwrzN9eWJ",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.cmp.optimizely.com/v3/assets\"\n\npayload = json.dumps({\n   \"key\": \"\",\n   \"title\": \"sample_image.png\"\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": "Vd5QRiK4SKCIzZWUuoWr8"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-201",
          "language": "201",
          "code": "// Created asset\n{\n  \"id\": \"5d7f910551b00a722e0418830cee6631\",\n  \"title\": \"sample_image.png\",\n  \"type\": \"image\",\n  \"mime_type\": \"image/png\",\n  \"file_extension\": \"png\",\n  \"created_at\": \"2019-10-06T13:15:30Z\",\n  \"modified_at\": \"2019-10-07T13:15:30Z\",\n  \"folder_id\": \"6bb8db20a5b611ebae319b7c541b1a5a\",\n  \"file_location\": \"/all assets/important assets\",\n  \"is_archived\": false,\n  \"content\": {\n    \"type\": \"url\",\n    \"value\": \"http://images.cmp.optimizely.com/Zz0xODQ3NDU3Y2Y2YmYzOTlmNjkyOTgyZDY3Y2I3YWM2OA==S\"\n  },\n  \"labels\": [\n    {\n      \"group\": {\n        \"id\": \"2467e583a60e23fda2b89db81a453cd2\",\n        \"name\": \"Content Format\"\n      },\n      \"values\": [\n        {\n          \"id\": \"71c378f3fee3d822759d1bdc2aab628c\",\n          \"name\": \"Photos\"\n        }\n      ]\n    }\n  ],\n  \"links\": {\n    \"self\": \"https://api.cmp.optimizely.com/v3/images/5d7f910551bw0a722e0418830cee6631\"\n  },\n  \"owner_organization_id\": \"5108c3a9becac35915111191\",\n  \"thumbnail_url\": \"https://images1.cmp.optimizely.com/Pz1kYmI9Z2FkYTJtZWI5VGI1WZq4MTZkNTdmGHjM5OGRmYq==\"\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}"
        }
      ],
      "selectedLanguageId": "response-0-201"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}