Upload Artwork
The generate endpoint needs your artwork as a public URL (artwork_url) or as a file in the same request (artwork, multipart). If your artwork isn't online yet, upload it here once and pass the returned url to as many generate requests as you like. Uploading is free.
Endpoint
POST /api/v1/uploadsRequest
Send multipart/form-data with one field:
| Field | Type | Description |
|---|---|---|
file | file | PNG, JPG or WebP. The whole request must be under 4.5 MB. |
curl -X POST https://www.mockupanda.com/api/v1/uploads \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@artwork.png"Response
{
"url": "https://mockups.example-cdn.com/uploads/7d0c.../3f9b2c1e-5a4d-4e8f-9b6a-1c2d3e4f5a6b.png",
"content_type": "image/png",
"size_bytes": 1843201,
"width": 3000,
"height": 4500
}Good to know
- The link is public but unguessable: anyone with the URL can open the file, so treat it like the artwork itself.
- Uploads are deleted after 7 days. Upload again for later jobs, or host the artwork yourself.
- Files are checked: anything that isn't a readable PNG, JPG or WebP is refused, so a bad file fails here, for free, rather than at generate time.
- Larger files: if your artwork is over 4.5 MB, host it anywhere public (your store, a CDN, cloud storage) and pass that URL as
artwork_urlinstead. Artwork fetched from a URL has no 4.5 MB limit.
Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | MISSING_FILE | No file field in the request |
| 400 | INVALID_IMAGE | The file isn't a readable image |
| 400 | UNSUPPORTED_FORMAT | Readable, but not PNG, JPG or WebP |
| 401 | MISSING_API_KEY | No Authorization header |
| 401 | INVALID_API_KEY | Key is wrong or revoked |
| 413 | - | Request over 4.5 MB. Refused by our hosting before it reaches the API, so the body is not the usual JSON error. |
| 500 | UPLOAD_FAILED | Storing the file failed. Retry. |