RECIPE: Upload Media to Wix Media Manager

Download skillThe skill is a reference md and part of wix-manage skill. You can use the following command to add the full wix-manage skill to your project:
Copy

Learn how to upload images and files to a Wix site's Media Manager using the REST API.


Overview

The Wix Media Manager stores all media files for a site. When you need to use images or files in other Wix APIs, you should first upload them to the Media Manager to get a reliable wixstatic.com URL.

Key Points:

  • Uploaded files are permanently stored on Wix servers
  • You get back a url (wixstatic.com) that works reliably in other APIs
  • External URLs can fail if the source server blocks requests - Media Manager URLs never fail

Method: Import File from External URL

The simplest way to add media is to import it from an external URL. Wix will download and store the file.

API Endpoint

Copy

Request Example

Copy

Request Parameters

ParameterRequiredDescription
urlYesThe external URL of the file to import
mimeTypeRecommendedMIME type (e.g., image/jpeg, image/png). If omitted, Wix tries to detect it
displayNameNoDisplay name in Media Manager. Include extension (e.g., My Image.jpg)
parentFolderIdNoFolder ID to store the file. Defaults to media-root

Response Example

Copy

Key Response Fields

FieldDescription
idMedia ID
urlThe wixstatic.com URL - use this in other APIs
operationStatusPENDING → READY when processed, or FAILED if import failed

Can I Use the URL Immediately?

In most cases, yes. The returned wixstatic.com URL typically works immediately for basic use cases like adding to products or blog posts.

Wait for READY when:

  • You need image dimensions or metadata
  • You're using image transformations (resize, crop)
  • You want guaranteed consistency for critical operations

Practical approach: Try using the URL immediately. If it fails, poll until operationStatus: "READY".


Checking File Status

After importing, the file goes through async processing. For guaranteed consistency, verify operationStatus: "READY" before using the file.

Use this endpoint to check the status of a specific file:

Copy

Example:

Copy

List Recent Files (Alternative)

If you need to find files without knowing the ID:

Copy

Status Values

StatusMeaning
PENDINGStill processing - wait before using
READYFile is ready to use
FAILEDImport failed

Response When Ready

Copy

Note: Wix automatically generates labels (tags) for images using AI.


Alternative: Upload a File That Is Not at a URL

When the file is not at a URL (a file on a device, or a file the user attached), upload the file itself in two steps.

Step 1: Generate Upload URL

Copy

The response holds the uploadUrl.

Step 2: Upload to the Generated URL

Send the file's raw bytes as the body, with its MIME type and its name:

Copy

The response holds the stored file, in the same shape as the import response: use its url.

Note: For files larger than 10MB, use the Resumable Upload URL API instead.

When the File Is Base64 Text

A file often reaches your code as base64 text and not as bytes: an attached file handed over as { path, content, encoding: "base64" }, or a data:image/png;base64,... value the user pasted. That text is not the file. Sent as the body in Step 2, it is stored as a text document, and the upload still answers 200. The Import File API does not take a data: URL either.

Decode the text to bytes, then run the two steps. In an environment that runs one script over several Wix API requests (wix.request stands for an authenticated Wix API request there), it is one call:

Copy

Check what was stored before you use it. An image comes back with mediaType: "IMAGE" and a static.wixstatic.com/media/... URL. A URL that ends in .txt, or a mediaType that is not the kind of file you sent, means the text was uploaded and not the file: do not use that URL and do not report the upload as done. Decode and upload again.


Common Issues

Issue 1: Import Fails (operationStatus: FAILED)

Problem: The file shows operationStatus: "FAILED" after import.

Causes:

  • Source server blocks external requests (e.g., Wikipedia, some CDNs)
  • Source server requires authentication
  • Invalid URL or file not found
  • File type not supported

Solution: Use image sources that allow hotlinking:

  • Unsplash (images.unsplash.com)
  • Pexels (images.pexels.com)
  • Your own hosted images
  • Public cloud storage (S3, GCS with public access)

Issue 2: File Stuck in PENDING

Problem: File stays in PENDING status for a long time.

Solution:

  • Large files take longer to process
  • Check back after a few seconds
  • If still pending after 30+ seconds, the import may have silently failed

Summary

StepActionResult
1Call Import File API with external URLGet file id and url with status PENDING
2Poll List Files APIWait for operationStatus: "READY"
3Use in other APIsUse the url field (wixstatic.com URL)

When the file is not at a URL, step 1 is the two-step upload in Upload a File That Is Not at a URL. If the file is base64 text, decode it to bytes first.

Last updated: 25 November 2026

Did this help?