---
title: Upload assets to library or task
slug: content-marketing-platform/docs/upload-assets-to-library-or-task
docTags: 
createdAt: 2026-07-22T20:21:11.854Z
---

Upload assets (images, videos, and raw files) to the library or a task in Optimizely Content Marketing Platform (CMP).

1. Fetch the pre-signed upload URL and its related meta-fields using the [GET /v3/upload-url](docId:-HrgOyuYkUaDaOGLHQdFY) endpoint. The validity time for this URL is 60 minutes.
2. Upload the file and related meta fields through an HTTP POST request to the pre-signed upload URL.
   - The payload must be in `multipart/form-data`.
   - The field name for the file must be `file`.
   - Ensure that the meta fields are in the same order as received.
   - The `file `field must be appended at the end.
     If this URL is accessed multiple times with the same meta-fields, the asset is created by the last successfully uploaded file in the next step.
3. Upon success (204 HTTP response code) from the pre-signed URL, access the POST endpoint for the desired destination (library or task) by passing the `key` that was previously obtained from the `GET /v3/upload-url` endpoint and an arbitrary `title` as the request payload. If this endpoint is accessed multiple times with the same `key`, each access creates an asset for the same uploaded file.

You can also upload large files faster using CMP's [multipart upload feature](docId\:eipsoKa6_-WcUU7ybWYUt).

## POST endpoints

- `POST /v3/assets` – Add asset to library.
- `POST /v3/assets/{asset_id}/versions` – Add version to a library asset.
- `POST /v3/tasks/{id}/assets` – Add asset to a task.
- `POST /v3/tasks/{task_id}/assets/{asset_id}/drafts` – Add draft to a task asset.
- `POST /v3/multipart-uploads` – Create pre-signed URLs for multipart upload of large files.
- `POST /v3/multipart-uploads/{id}/complete` – Initiate completion of a multipart upload after all parts have been uploaded.
