POST /tasks/{id}/assets
1 min
POST
https://api.cmp.optimizely.com/v3/tasks/{id}/assets
idstringUnique identifier of the task
acceptstringGenerated from available response content types
bodyobject<p>Payload to add an asset. There are two mechanisms for adding assets to a task:</p>
<ul>
<li><code>direct_upload</code> - An asset that has been uploaded using the <a href="https://docs.developers.optimizely.com/content-marketing-platform/docs/upload-assets" target="_blank">Upload assets</a> endpoint.</li>
<li><code>fork_from_library</code> - This will fork an existing asset from the library to the task.
The <code>type</code> field is optional, and will default to <code>direct_upload</code> if not provided.
Note: Renditions is currently not supported for library assets.</li>
</ul>
201Created asset
400Client error
401Authorization error
403Permission error
404Not found error
422Unprocessable entity error
curl --request POST \
--url https://api.cmp.optimizely.com/v3/tasks/{id}/assets \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"key": "",
"title": "sample_image.png"
}'