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/uploads

Request

Send multipart/form-data with one field:

FieldTypeDescription
filefilePNG, 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_url instead. Artwork fetched from a URL has no 4.5 MB limit.

Errors

StatusCodeMeaning
400MISSING_FILENo file field in the request
400INVALID_IMAGEThe file isn't a readable image
400UNSUPPORTED_FORMATReadable, but not PNG, JPG or WebP
401MISSING_API_KEYNo Authorization header
401INVALID_API_KEYKey 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.
500UPLOAD_FAILEDStoring the file failed. Retry.