Skip to content
Mockly

Mockly API

Exports

Status polling and file downloads for previously submitted renders.

GET /api/v1/exports/:id

Get the status of a render. Useful for polling video renders, or refreshing an expired download URL on a completed image render.

curl https://www.getmockly.com/api/v1/exports/abc-123-... \
  -H "Authorization: Bearer mk_live_..."

While rendering:

{
  "id": "abc-123-...",
  "status": "rendering",
  "renderKind": "video",
  "progress": 0.42
}

progress is a float between 0 and 1 (only present for video renders).

When complete:

{
  "id": "abc-123-...",
  "status": "completed",
  "renderKind": "video",
  "downloadUrl": "https://...",
  "sizeBytes": 1234567
}

On failure:

{
  "id": "abc-123-...",
  "status": "failed",
  "renderKind": "video",
  "error": "Render timed out after 600 seconds"
}

Only renders submitted via the API for your own user are visible. Renders made via the browser editor are not exposed through this endpoint, even if you own them. Looking up an export ID you didn't create returns 404 not_found.

GET /api/v1/exports/:id/download

Stream the rendered file directly from Mockly. Useful when:

  • The upstream downloadUrl (signed S3 URL) has expired.
  • You want a stable URL gated behind your Bearer auth.
  • You want a guaranteed content-disposition: attachment for browser downloads.
curl -L https://www.getmockly.com/api/v1/exports/abc-123-.../download \
  -H "Authorization: Bearer mk_live_..." \
  -o mockup.png

The response is the binary file with appropriate content-type (image/png, video/mp4, or video/webm) and content-disposition: attachment; filename="...". Cache headers are private, max-age=60.

For chat image renders, this endpoint also auto-crops trailing transparent pixels at the bottom — matching the behavior of the editor's export. The sizeBytes you got back from the render endpoint is the un-cropped Lambda size; the actual downloaded file may be slightly smaller.

URL expiry

The downloadUrl returned by /chat/render and /exports/:id for image renders is a signed S3 URL that expires after a short window (~15 minutes). For long-running consumers, prefer one of:

  • Download immediately after receiving the response (most common pattern).
  • Use GET /exports/:id/download for a stable URL behind your auth — no expiry.
  • Re-fetch GET /exports/:id to get a fresh signed URL.

Video renders return a different kind of URL (a Remotion Lambda output URL with longer-lived signing); the download endpoint is still recommended for production use.