You can't directly upload media files to the Assets folder in Webflow using the API, as Webflow does not currently support file uploads to the Assets panel via API.
However, here’s what you can and can't do when using the Webflow API with respect to media:
If you want to use external media and include it in your Webflow project via API:
A CURL example for creating a CMS item with a reference to a media file:
curl -X POST https://api.webflow.com/collections/{collection_id}/items \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "accept-version: 1.0.0" \ -H "Content-Type: application/json" \ -d '{ "fields": { "name": "Sample Item", "media": "https://your-cdn.com/path/to/image.jpg", "_archived": false, "_draft": false } }'
{collection_id}
, YOUR_API_KEY
, and the URL with your actual values.media
must match the Field API ID of the image/file field in your CMS Collection.Webflow's API does not support direct asset uploads into the Assets folder. To use media via the API, you must host the file externally and reference its URL in a CMS item field using the CMS API.