API REFERENCE
Images
Your library: every conversion of the same image is a version of one image.
GET/v1/images
List images
The caller's library, one entry per image, a page at a time: an image's versions are never cut at a page's edge. Pass a page's nextCursor back as cursor. deleted=true lists Recently deleted (newest deletion first).
Query
filterone ofall,unlocked,not_downloaded,faileddefault allsortone ofnewest,oldest,namedefault newestqstring- A substring of the name, any case.
deletedone oftrue,falselimitinteger, 1 to 100default 60cursorstring- A page's
nextCursor.
Errors
Every refusal carries its code and a requestId. Errors and retries.
GET/v1/images/{id}
Retrieve an image
One image, with every live version newest first.
Path
ididrequired
Errors
| Status | Code | What to do |
|---|---|---|
| 404 | not_ | Check the id. Another account's objects read as not found too. |
Every refusal carries its code and a requestId. Errors and retries.
PATCH/v1/images/{id}
Name an image
The person's name for it, cleaned to a printable label; null or a blank gives back its file's name. Its files download under it.
Path
ididrequired
Body
namestring, or nullrequired- The name, or null to give back the file's.
Errors
| Status | Code | What to do |
|---|---|---|
| 404 | not_ | Check the id. Another account's objects read as not found too. |
Every refusal carries its code and a requestId. Errors and retries.
DELETE/v1/images/{id}
Delete an image
Into Recently deleted, restorable for 30 days (POST /images/{id}/restore); then every version and its files are erased. Converting the same bytes again brings it back. Its unlock, if paid, is never lost.
Path
ididrequired
Errors
| Status | Code | What to do |
|---|---|---|
| 404 | not_ | Check the id. Another account's objects read as not found too. |
| 409 | conversion_ | Wait for it to finish, then try again. |
Every refusal carries its code and a requestId. Errors and retries.
POST/v1/images/{id}/restore
Restore an image
Back from Recently deleted, every version with it.
Path
ididrequired
Errors
| Status | Code | What to do |
|---|---|---|
| 404 | not_ | Check the id. Another account's objects read as not found too. |
Every refusal carries its code and a requestId. Errors and retries.
POST/v1/images/{id}/erase
Erase an image now
Before its 30 days: its versions are erased and their files deleted; it cannot be restored after. Only from Recently deleted: an image in the library is 409 not_deleted (delete it first).
Path
ididrequired
Errors
| Status | Code | What to do |
|---|---|---|
| 404 | not_ | Check the id. Another account's objects read as not found too. |
| 409 | not_ | Delete it first, or leave it. |
Every refusal carries its code and a requestId. Errors and retries.
POST/v1/images/{id}/conversions
Convert an image again
A new version of the image with today's engine, from the bytes it was made from: the API copies them (its result's kept original, else a version's upload while kept), so nothing is uploaded again. Every rule of POST /conversions applies: free (an unlocked image's re-runs always are), counted by the daily caps. options absent keeps the newest version's; {"maxColors": N} redraws it with at most N colors (GET /conversions/{id}/palette previews it first). 409 original_not_kept when the image's file is no longer kept: upload it again.
Path
ididrequired
Headers
Retry-Afterstring- On a 429 (
free_limit_reached, or every free conversion together reaching today's shared capacity of 2000): seconds until the caps renew, the next UTC midnight. On a 409too_many_active_jobs(guest 1, free 1, paid 5 at once): wait for one to end, or sendqueue: true.
Body
idempotencyKeystringrequiredoptionsobject- Optional choices about this image beside its preset.
{}for none. Two conversions share a cached result only with the same options. Not offered yet:merge(a redraw that merges two colors is not offered yet; merge them in the Colors tab, or ask for fewer colors).
Errors
| Status | Code | What to do |
|---|---|---|
| 402 | insufficient_ | Buy credits, then send the same request again. |
| 403 | account_ | Sign in or create an account. The conversions come with you. |
| 404 | not_ | Check the id. Another account's objects read as not found too. |
| 409 | idempotency_ | Make a new key for a new request. |
| 409 | original_ | Upload the file again. |
| 409 | too_ | Wait for one to finish, or send queue: true to wait in line. |
| 409 | unlock_ | Wait for that conversion to finish. |
| 429 | free_ | Come back after Retry-After (UTC midnight), or unlock with a credit. |
| 429 | free_ | Come back after Retry-After (UTC midnight), or unlock with a credit. |
Every refusal carries its code and a requestId. Errors and retries.
POST/v1/images/unlock
Unlock several images
1 credit per image not yet unlocked, in ONE transaction: all or nothing. A short balance unlocks none (402); so does an image with no finished result (409 not_ready) or whose hold is still running (409 unlock_pending). An image already unlocked spends nothing, so a retry is safe.
Body
idsarray of idrequired- The images, by their ids in GET /images. A repeat is read once.
Errors
| Status | Code | What to do |
|---|---|---|
| 402 | insufficient_ | Buy credits, then send the same request again. |
| 404 | not_ | Check the id. Another account's objects read as not found too. |
| 409 | not_ | Wait for it to finish (a webhook, the events stream, or a read), then ask again. |
| 409 | unlock_ | Wait for that conversion to finish. |
Every refusal carries its code and a requestId. Errors and retries.
POST/v1/images/delete
Delete several images
ONE transaction, each image's outcome said back. Partial by design: one still converting is refused (converting) and the others are still deleted. Restorable for 30 days (POST /images/restore). A repeat keeps the first date (already_deleted); another's is not_found.
Body
idsarray of idrequired- The images, by their ids in GET /images. A repeat is read once.
Errors
Every refusal carries its code and a requestId. Errors and retries.
POST/v1/images/restore
Restore several images
ONE transaction, each image's outcome said back: restored, in_library (nothing to do), not_found (another's, or past its window). A delete's Undo.
Body
idsarray of idrequired- The images, by their ids in GET /images. A repeat is read once.
Errors
Every refusal carries its code and a requestId. Errors and retries.
POST/v1/images/erase
Erase images now
With { ids }: those images, in ONE transaction, each one's outcome said back: erased, not_deleted (it is in the library: only Recently deleted is erased now), not_found. With { all: true }: every image in Recently deleted ("Erase all now"); "all" is said, never inferred. Exactly one of the two. Versions erased are gone for good, their files deleted.
Body
idsarray of id- The images, by their ids in GET /images. A repeat is read once.
alltrue- Every image in Recently deleted.
Errors
Every refusal carries its code and a requestId. Errors and retries.