Learn how to upload images and files to a Wix site's Media Manager using the REST API.
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:
url (wixstatic.com) that works reliably in other APIsThe simplest way to add media is to import it from an external URL. Wix will download and store the file.
| Parameter | Required | Description |
|---|---|---|
url | Yes | The external URL of the file to import |
mimeType | Recommended | MIME type (e.g., image/jpeg, image/png). If omitted, Wix tries to detect it |
displayName | No | Display name in Media Manager. Include extension (e.g., My Image.jpg) |
parentFolderId | No | Folder ID to store the file. Defaults to media-root |
| Field | Description |
|---|---|
id | Media ID |
url | The wixstatic.com URL - use this in other APIs |
operationStatus | PENDING → 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:
Practical approach: Try using the URL immediately. If it fails, poll until operationStatus: "READY".
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:
Example:
If you need to find files without knowing the ID:
| Status | Meaning |
|---|---|
PENDING | Still processing - wait before using |
READY | File is ready to use |
FAILED | Import failed |
Note: Wix automatically generates labels (tags) for images using AI.
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.
The response holds the uploadUrl.
Send the file's raw bytes as the body, with its MIME type and its name:
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.
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:
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.
Problem: The file shows operationStatus: "FAILED" after import.
Causes:
Solution: Use image sources that allow hotlinking:
images.unsplash.com)images.pexels.com)Problem: File stays in PENDING status for a long time.
Solution:
| Step | Action | Result |
|---|---|---|
| 1 | Call Import File API with external URL | Get file id and url with status PENDING |
| 2 | Poll List Files API | Wait for operationStatus: "READY" |
| 3 | Use in other APIs | Use 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