API reference
Every route of https://mintrender.com/v1. Send your API key as Authorization: Bearer mr_live_… on each call. This page is made from the OpenAPI file, so it always matches the API.
System
GET /healthz
Health check
Answers
200The API is up
Templates
GET /v1/templates
List templates
Answers
200The workspace's templates, newest first401No API key, or the key is not valid429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
POST /v1/templates
Create a template from a scene
Body
| Field | Type | About |
|---|---|---|
name required | string | |
scene required | Scene |
Answers
201The new template (a draft; publish it to render it)400The request is not valid; `field` names the problem401No API key, or the key is not valid402A plan limit is reached: `no_credits` (no credits left in this period) or `plan_limit` (templates, members or stored files)413Too large429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
POST /v1/templates/generate
Make a draft template from a description (AI). The AI template maker (spec 11.3). The result is a draft that the validator accepts; it is never published by itself. Limits: the plan's AI templates a month, and a daily cap for the whole service.
Body
| Field | Type | About |
|---|---|---|
description required | string | |
size | string | Default: "1200x630". |
name | string |
Answers
201The new draft template400The request is not valid; `field` names the problem401No API key, or the key is not valid402A plan limit is reached: `no_credits` (no credits left in this period) or `plan_limit` (templates, members or stored files)422The request cannot be done; `code` says why (for example an Idempotency-Key used with a different body)429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)502A service we use failed; try again503Not available now: a set-up step is missing, or a daily limit is reached; `code` says which504A service we use took too long; try again
GET /v1/templates/{id}
Get a template, its params and versions
| Parameter | In | Type | About |
|---|---|---|---|
id required | path | string |
Answers
200The template401No API key, or the key is not valid404Not found429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
DELETE /v1/templates/{id}
Delete a template. Signed links and renders of it stop at once (404). Files already made stay until they expire. The template no longer counts toward the plan's limit.
| Parameter | In | Type | About |
|---|---|---|---|
id required | path | string |
Answers
200Deleted401No API key, or the key is not valid404Not found429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
PUT /v1/templates/{id}/draft
Save the draft scene
| Parameter | In | Type | About |
|---|---|---|---|
id required | path | string |
Body
| Field | Type | About |
|---|---|---|
scene required | Scene | |
name | string |
Answers
200The template with the new draft400The request is not valid; `field` names the problem401No API key, or the key is not valid404Not found413Too large429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
POST /v1/templates/{id}/publish
Publish the draft as a new version. Signed links and renders without a `version` use the newest published version.
| Parameter | In | Type | About |
|---|---|---|---|
id required | path | string |
Answers
200The new version400The request is not valid; `field` names the problem401No API key, or the key is not valid404Not found409Conflict429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
POST /v1/templates/{id}/duplicate
Copy a template (its draft)
| Parameter | In | Type | About |
|---|---|---|---|
id required | path | string |
Body
| Field | Type | About |
|---|---|---|
name | string |
Answers
201The copy401No API key, or the key is not valid402A plan limit is reached: `no_credits` (no credits left in this period) or `plan_limit` (templates, members or stored files)404Not found429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
Assets
POST /v1/assets
Upload an image or CSV. Send `multipart/form-data` with a `file` (and an optional `name`), or JSON `{"url": "https://…"}` to fetch it. Images: PNG, JPEG, GIF, WebP, SVG up to 20 MB and 16 megapixels (bigger ones are refused with `image_too_large`; the editor makes them smaller before it uploads them). CSV: UTF-8 up to 5 MB. A workspace stores up to 500 MB of files on Free and 10 GB on paid plans.
Body
| Field | Type | About |
|---|---|---|
url required | string | |
name | string |
Answers
201The stored asset400The request is not valid; `field` names the problem401No API key, or the key is not valid402A plan limit is reached: `no_credits` (no credits left in this period) or `plan_limit` (templates, members or stored files)413Too large429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
GET /v1/assets
List assets
| Parameter | In | Type | About |
|---|---|---|---|
kind | query | "image" | "csv" |
Answers
200Newest first, at most 500401No API key, or the key is not valid429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
GET /v1/assets/{id}/uses
Templates that use an asset. For a confirm step before a delete: the templates whose draft or a saved version uses the asset. A delete is refused (409) while a saved version uses it.
| Parameter | In | Type | About |
|---|---|---|---|
id required | path | string |
Answers
200At most 100401No API key, or the key is not valid404Not found429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
DELETE /v1/assets/{id}
Delete an asset. Refused (409 `in_use`) while a saved version of a template that is not deleted uses it. GET /v1/assets/{id}/uses lists the templates.
| Parameter | In | Type | About |
|---|---|---|---|
id required | path | string |
Answers
200Deleted401No API key, or the key is not valid404Not found409Conflict429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
GET /v1/assets/{id}/file
Download an asset's file. The uploaded file itself, with its own type (a cleaned SVG for SVG uploads).
| Parameter | In | Type | About |
|---|---|---|---|
id required | path | string |
Answers
200The file401No API key, or the key is not valid404Not found429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
Render
POST /v1/render
Render a template. Renders each size as one file. 1 image or 1 PDF page = 1 credit; files that already exist for the same input answer at once (`cached: true`) and cost nothing. `mode: async` (or a PDF over 10 pages, or more than 5 sizes) answers 202 with a job to poll. `?inline=1` (one output) streams the bytes.
| Parameter | In | Type | About |
|---|---|---|---|
inline | query | "0" | "1" | |
idempotency-key | header | string | Send the same key again within 24 hours to get the first answer without a second charge |
Body
| Field | Type | About |
|---|---|---|
template required | string | |
version | integer | Default: the newest published version |
data | object | |
ignore_unknown | boolean | Skip data keys that match no param instead of a 400 |
format | "png" | "jpg" | "webp" | "svg" | "pdf" | Default: "png". |
sizes | list of string | Default: ["main"]. |
scale | number | Default: 1. |
quality | integer | Default: 90. |
mode | "sync" | "async" | Default: "sync". |
webhook_url | string | |
metadata | object | Your own values, returned with the render (at most 4 KB) |
Answers
200The finished render (with ?inline=1: the file itself)202Queued as a job400The request is not valid; `field` names the problem401No API key, or the key is not valid402A plan limit is reached: `no_credits` (no credits left in this period) or `plan_limit` (templates, members or stored files)404Not found409Conflict413Too large422The request cannot be done; `code` says why (for example an Idempotency-Key used with a different body)429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
DELETE /v1/renders/{id}
Cancel a queued job. Only a job that has not started can be canceled; its credits come back.
| Parameter | In | Type | About |
|---|---|---|---|
id required | path | string |
Answers
200The canceled job401No API key, or the key is not valid404Not found409Conflict429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
GET /v1/renders/{id}
Get a render or job
| Parameter | In | Type | About |
|---|---|---|---|
id required | path | string |
Answers
200The render401No API key, or the key is not valid404Not found429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
POST /v1/preview
A free low-res preview with a watermark. Send a `scene` (no key needed; free tools and the docs use this) or, with an API key, a `template`. The answer is the image itself, at most 600 px on its long side. 30 a minute.
Body
| Field | Type | About |
|---|---|---|
template | string | |
scene | Scene | |
data | object | |
size | string | Default: "main". |
format | "png" | "jpg" | "webp" | Default: "png". |
cf-turnstile-response | string |
Answers
200The image400The request is not valid; `field` names the problem401No API key, or the key is not valid403Not allowed404Not found413Too large429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
POST /v1/links
Make a signed link. A link that renders the template when it is opened (spec 7.2). Data values are strings; at most 2,048 characters each.
Body
| Field | Type | About |
|---|---|---|
template required | string | |
size | string | Default: "main". |
format | "png" | "jpg" | "webp" | "svg" | "pdf" | Default: "png". |
data | object | Values are strings in a link Default: {}. |
Answers
200The link400The request is not valid; `field` names the problem401No API key, or the key is not valid404Not found429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)503Not available now: a set-up step is missing, or a daily limit is reached; `code` says which
Bulk
POST /v1/batch
Render many rows. Up to 10,000 rows of data (from `rows`, an uploaded CSV or a CSV link). Credits for every row are reserved at once; failed rows give theirs back. Poll GET /v1/batch/{id}, or give a webhook_url.
Body
| Field | Type | About |
|---|---|---|
template required | string | |
version | integer | |
format | "png" | "jpg" | "webp" | "svg" | "pdf" | Default: "png". |
sizes | list of string | Default: ["main"]. |
scale | number | Default: 1. |
quality | integer | Default: 90. |
rows | list of object | |
csv_asset | string | An uploaded CSV (asset id); the header row gives the param names |
csv_url | string | A public CSV link, for example a Google Sheet published as CSV |
ignore_unknown | boolean | |
zip | boolean | Also build one ZIP of all files Default: false. |
webhook_url | string |
Answers
202Queued400The request is not valid; `field` names the problem401No API key, or the key is not valid402A plan limit is reached: `no_credits` (no credits left in this period) or `plan_limit` (templates, members or stored files)404Not found409Conflict413Too large422The request cannot be done; `code` says why (for example an Idempotency-Key used with a different body)429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
GET /v1/batch/{id}
Get a batch: counts and each row's render
| Parameter | In | Type | About |
|---|---|---|---|
id required | path | string | |
offset | query | integernull | |
limit | query | integer |
Answers
200The batch401No API key, or the key is not valid404Not found429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
GET /v1/batch/{id}/zip
Download a batch's ZIP. The ZIP of a batch sent with `zip: true`, once the batch shows a `zip_url`. 404 while it is not ready, and after it expires with the batch's files (the last of its renders): `zip_url` is then null again.
| Parameter | In | Type | About |
|---|---|---|---|
id required | path | string |
Answers
200The ZIP file401No API key, or the key is not valid404Not found429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
Webhooks
POST /v1/webhooks
Add a webhook. Events are POSTed as JSON with `MR-Signature: t={unix},v1={hex HMAC-SHA256(secret, t + "." + body)}`. The secret is shown only in this answer.
Body
| Field | Type | About |
|---|---|---|
url required | string | |
events | list of "render.succeeded" | "render.failed" | "batch.completed" | Default: ["render.succeeded","render.failed","batch.completed"]. |
Answers
201The webhook and its secret400The request is not valid; `field` names the problem401No API key, or the key is not valid429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
GET /v1/webhooks
List webhooks
Answers
200Webhooks401No API key, or the key is not valid429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
DELETE /v1/webhooks/{id}
Delete a webhook
| Parameter | In | Type | About |
|---|---|---|---|
id required | path | string |
Answers
200Deleted401No API key, or the key is not valid404Not found429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
GET /v1/deliveries
Recent webhook deliveries (every try)
| Parameter | In | Type | About |
|---|---|---|---|
render | query | string | |
limit | query | integer |
Answers
200Newest first401No API key, or the key is not valid429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
POST /v1/deliveries/{id}/resend
Send a delivery again
| Parameter | In | Type | About |
|---|---|---|---|
id required | path | string |
Answers
200The new delivery (tried now; retried like any other)401No API key, or the key is not valid404Not found429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
Account
GET /v1/usage
Credits and renders this period
Answers
200Usage401No API key, or the key is not valid429Too many requests; see Retry-After451The workspace is frozen (`frozen`), or a reviewer workspace has ended (`expired`)
Seen MintRender used for content that breaks our terms? Report it. Questions about the API: support@mintrender.com, with the request id.