{"openapi":"3.1.0","info":{"title":"Iminify API","version":"1.0.0","summary":"Compress, convert and resize images, and scan web pages for every image they load.","description":"Everything the Iminify website does with images, over HTTP. Every request carries a personal access token from Settings > API Tokens as a Bearer token, for an account whose email is verified. Compressions and page scans run in the background: create one, then poll it until it has finished, or on a paid plan have it sent to your server as a signed webhook when it does (https://www.iminify.com/docs/webhooks). The guides are at https://www.iminify.com/docs.","termsOfService":"https://www.iminify.com/terms-of-service","contact":{"name":"Iminify","url":"https://www.iminify.com/docs"}},"servers":[{"url":"https://www.iminify.com/api/v1"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Images","description":"Compress, convert and resize images, then download, rename, share or run them again."},{"name":"Upload groups","description":"One image and every size and format made from it, counted as one image: for a site or an app that keeps several sizes of each upload."},{"name":"Page scans","description":"Scan a web page for every image it loads and compress them all at once."},{"name":"Site crawls","description":"Crawl several pages of one site at once, from its sitemap or a list, with one report and one zip for the whole site."},{"name":"Weekly site checks","description":"Have a site you crawled crawled again every week, compressing only the images that are new or changed, with an email when a check finds some."},{"name":"Account","description":"The account a key belongs to: its plan, its limits and what today has used."}],"paths":{"/images":{"get":{"operationId":"listImages","description":"Every image on your account, newest first: your uploads, the images your page scans found, and every re-run. The website's results table lists the same images. Follow `links.next` for the next page.","summary":"List images","tags":["Images"],"parameters":[{"name":"status","in":"query","description":"Only images with this status.","schema":{"$ref":"#/components/schemas/CompressStatus"}},{"name":"source","in":"query","description":"`upload` for images you sent (and their re-runs), `scan` for the ones page scans found.","schema":{"type":"string","enum":["upload","scan"]}},{"name":"scan","in":"query","description":"Only the images of this page scan.","schema":{"type":"string","format":"uuid"}},{"name":"per_page","in":"query","description":"Images a page, 1 to 100.","schema":{"type":"integer","default":15,"minimum":1,"maximum":100}},{"name":"page","in":"query","description":"The page to read.","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000000}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Image"}},"links":{"type":"object","properties":{"first":{"type":["string","null"]},"last":{"type":["string","null"]},"prev":{"type":["string","null"]},"next":{"type":["string","null"]}},"required":["first","last","prev","next"]},"meta":{"type":"object","properties":{"current_page":{"type":"integer","minimum":1},"from":{"type":["integer","null"],"minimum":1},"last_page":{"type":"integer","minimum":1},"links":{"type":"array","description":"Generated paginator links.","items":{"type":"object","properties":{"url":{"type":["string","null"]},"label":{"type":"string"},"active":{"type":"boolean"}},"required":["url","label","active"]}},"path":{"type":["string","null"],"description":"Base path for paginator generated URLs."},"per_page":{"type":"integer","description":"Number of items shown per page.","minimum":0},"to":{"type":["integer","null"],"description":"Number of the last item in the slice.","minimum":1},"total":{"type":"integer","description":"Total number of items being paginated.","minimum":0}},"required":["current_page","from","last_page","links","path","per_page","to","total"]}},"required":["data","links","meta"]},"example":{"data":[{"id":"9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35","status":"completed","name":"team-offsite.webp","original":{"name":"team-offsite.jpg","format":"jpg","size":2841205,"width":4032,"height":3024,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download?type=original"},"optimized":{"name":"team-offsite.webp","format":"webp","size":212877,"width":1600,"height":1200,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download"},"saved_bytes":2628328,"saved_percent":92.51,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null,"size_limit":250,"responsive_widths":[480,768,1200,1600]},"size_limit_status":"under","content_credentials":{"status":"removed","generative_ai":false},"alt_text":{"status":"written","text":"Six colleagues laughing around a picnic table on a lakeside lawn","language":"en","suggested_name":"colleagues-picnic-table-lakeside"},"responsive":{"status":"ready","files":[{"width":480,"height":360,"size":24118,"name":"team-offsite-480w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/480"},{"width":768,"height":576,"size":55904,"name":"team-offsite-768w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/768"},{"width":1200,"height":900,"size":128330,"name":"team-offsite-1200w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/1200"},{"width":1600,"height":1200,"size":212877,"name":"team-offsite-1600w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/1600"}],"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive.zip","html":"<img\n  src=\"team-offsite-1600w.webp\"\n  srcset=\"team-offsite-480w.webp 480w, team-offsite-768w.webp 768w, team-offsite-1200w.webp 1200w, team-offsite-1600w.webp 1600w\"\n  sizes=\"(max-width: 1600px) 100vw, 1600px\"\n  width=\"1600\"\n  height=\"1200\"\n  alt=\"Six colleagues laughing around a picnic table on a lakeside lawn\"\n  style=\"max-width: 100%; height: auto\"\n  decoding=\"async\"\n>"},"scan_id":null,"source_url":null,"folder":null,"share_url":null,"created_at":"2026-10-01T09:30:00+00:00","updated_at":"2026-10-01T09:30:09+00:00"},{"id":"9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d","status":"queued","name":"IMG_4471.heic","original":{"name":"IMG_4471.heic","format":"heic","size":3402118,"width":4032,"height":3024,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d/download?type=original"},"optimized":null,"saved_bytes":null,"saved_percent":null,"settings":{"level":"ultra","format":"auto","keep_metadata":true,"width":null,"height":null,"scale":null,"size_limit":null,"responsive_widths":[480,768,1200,1600]},"size_limit_status":null,"content_credentials":null,"alt_text":{"status":"pending","text":null,"language":"de","suggested_name":null},"responsive":{"status":"pending","files":[],"download_url":null,"html":null},"scan_id":null,"source_url":null,"folder":null,"share_url":null,"created_at":"2026-10-01T09:31:12+00:00","updated_at":"2026-10-01T09:31:12+00:00"}],"links":{"first":"https://www.iminify.com/api/v1/images?page=1","last":"https://www.iminify.com/api/v1/images?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"&laquo; Previous","page":null,"active":false},{"url":"https://www.iminify.com/api/v1/images?page=1","label":"1","page":1,"active":true},{"url":null,"label":"Next &raquo;","page":null,"active":false}],"path":"https://www.iminify.com/api/v1/images","per_page":15,"to":2,"total":2}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://www.iminify.com/api/v1/images?status=completed&per_page=20\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/images\",\n    headers=HEADERS,\n    timeout=(10, 30),\n    params={\n        \"status\": \"completed\",\n        \"per_page\": 20,\n    },\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('images', [\n    'query' => [\n        'status' => 'completed',\n        'per_page' => 20,\n    ],\n]);\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/images?status=completed&per_page=20', {\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]},"post":{"operationId":"createImage","description":"Send the image itself as a multipart `file`, or its address as `url` and Iminify fetches it. The answer comes straight back with the status `queued` and a `Location` header; the compression runs in the background, usually for a few seconds, so poll the image until its status is `completed`, `already-optimized`, `failed` or `cancelled`. Each image counts one against your daily images and your compressions a minute, whether it came through here or through the website.\n\nThe file goes through the same checks as an upload on the website: a format Iminify reads (PNG, JPG, JPEG, WEBP, GIF, HEIC, HEIF, TIFF, TIF), your plan's file size, a name of at most 128 bytes, and at most 64 megapixels, before and after any resize. An animated WebP or PNG can't be resized: with `width`, `height` or `scale` it is refused with `animation_not_resizable`, and one sent without them, in its own format, comes back with every frame. An address has to be public `http` or `https`: Iminify fetches it from its own servers, refuses private networks on the address and on every redirect, follows up to five redirects and gives up after 30 seconds. A file larger than your plan's size is refused, and Iminify keeps no more of it than that size. The file is named after the address. Iminify fetches up to 2 addresses for you at a time; one more sent before those finish is refused with `rate_limited`.","summary":"Compress an image","tags":["Images"],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/StoreImageRequest"}},"application/json":{"schema":{"type":"object","description":"The image, as a file or as the address to fetch it from, and the settings to compress it with.","properties":{"url":{"type":"string","format":"uri","description":"The public address of the image to fetch. Send either this or `file`.","maxLength":2048},"folder":{"type":["string","null"],"description":"The folder the image belongs in, like `holiday/beach`, so a zip of several images (`POST /images/download`) puts it there. Either slash separates folders, and characters a file name can't hold become a hyphen. Keeping folders comes with a paid plan; sent on another plan, the image is refused with `pro_required`.","maxLength":1024},"ephemeral":{"type":"boolean","description":"Delete the image once you've saved it, for a caller that keeps its own copy. Send `DELETE /images/{id}` once you've written the result; anything you leave is deleted for you about 24 hours after the image finished, its files with it. Off by default, which keeps the image until you delete it. See [Deleting images once saved](/docs/images#deleting-images-once-saved).","default":false},"priority":{"description":"`background` for bulk work nobody waits on, such as a whole library: it runs after every image sent without it, on every plan, and counts against your limits the same. See [Bulk work](/docs/images#bulk-work).","default":"interactive","$ref":"#/components/schemas/CompressPriority"},"level":{"description":"How hard to compress. `smart` finds the lowest quality that still looks like your upload, `ultra` goes further and softens fine texture a little, `lossless` changes no pixel unless a `size_limit` needs it to, `none` only applies the format, the resize, the size limit and the metadata choice. See [Compression settings](/docs/compression-settings).","default":"smart","$ref":"#/components/schemas/CompressLevel"},"format":{"anyOf":[{"description":"Convert to this format. `auto` encodes the image in every format that can hold it and keeps the smallest. Leave it out to keep the upload's own format; a HEIC or TIFF always comes back in another one, because Iminify doesn't write either. `jpeg` is read as `jpg`.","$ref":"#/components/schemas/CompressOutputExtension"},{"type":"null"}]},"keep_metadata":{"type":"boolean","description":"Keep the EXIF metadata (camera, date, location) in the optimized copy. Off by default, which strips it; the orientation is applied to the pixels first, so a photo never comes back on its side.","default":false},"width":{"type":["integer","null"],"description":"Resize to this width in pixels. Alone, the height follows the aspect ratio. With `height` too, the image is resized to exactly that size, and its proportions change if they differ. Up to 65535.","minimum":1,"maximum":65535},"height":{"type":["integer","null"],"description":"Resize to this height in pixels, the same way as `width`. Up to 65535.","minimum":1,"maximum":65535},"scale":{"type":["integer","null"],"description":"Resize to this percentage of the original, 1 to 100. Cannot be combined with `width` or `height`.","minimum":1,"maximum":100},"size_limit":{"type":["integer","null"],"description":"The most the optimized copy may weigh, in kilobytes of 1,000 bytes, from 5 KB up. Iminify lowers the quality until the file fits, and makes the image smaller in pixels when the lowest quality is still over it. The limit comes before the level: under `lossless` or `none`, a file over it is encoded again with loss. A PNG or GIF kept in its own format that is over the limit comes back in a format with a quality to lower (JPG, WebP or AVIF), so `png` as the `format` is refused; an animation is never fitted. `size_limit_status` on the finished image says how it came out. See [Size limit](/docs/compression-settings#size-limit).","minimum":5},"responsive_widths":{"type":["array","null"],"description":"Paid plans: also make the image at each of these widths in pixels, for an `<img srcset>`, like `[480, 768, 1200, 1600]`, the website's default. Up to 8 widths, each from 16 to 65535. Each width is made from the upload, at the same level and in the format the image is delivered in, and never enlarged: a width wider than the upload is made at the upload's own width, once. In a multipart form, repeat `responsive_widths[]` or send them in one field, separated by commas. They are made a few seconds after the image finishes; `responsive` on the image lists them. Sent on another plan, the image is refused with `pro_required`. See [Responsive sizes](/docs/images#responsive-sizes).","items":{"type":"integer","minimum":16,"maximum":65535},"minItems":1,"maxItems":8},"alt_text":{"type":"boolean","description":"Write an alt text and a suggested file name for the image with AI. On by default; send `false` to leave it out. A small copy of the image goes to Anthropic, whose Claude model writes both, and they arrive a few seconds after the image finishes. Each one counts against your daily AI alt texts; once those are used up the image still compresses, without one. See [Alt text and file names](/docs/images#alt-text-and-file-names).","default":true},"alt_text_language":{"type":"string","description":"The language to write the alt text in, as one of these tags: `en` (English), `es` (Spanish), `fr` (French), `de` (German), `it` (Italian), `pt` (Portuguese), `nl` (Dutch), `pl` (Polish), `sv` (Swedish), `tr` (Turkish), `ru` (Russian), `uk` (Ukrainian), `ar` (Arabic), `fa` (Persian), `he` (Hebrew), `hi` (Hindi), `id` (Indonesian), `vi` (Vietnamese), `th` (Thai), `ja` (Japanese), `ko` (Korean), `zh-Hans` (Simplified Chinese), `zh-Hant` (Traditional Chinese). The suggested file name follows it when the language is written in the Latin alphabet, and is in English otherwise.","enum":["en","es","fr","de","it","pt","nl","pl","sv","tr","ru","uk","ar","fa","he","hi","id","vi","th","ja","ko","zh-Hans","zh-Hant"],"default":"en"},"use_suggested_name":{"type":"boolean","description":"Rename the optimized copy to the suggested file name as soon as the alt text arrives, unless it already has a new name by then: yours, or an earlier suggestion.","default":false}},"required":["url"]}}}},"responses":{"202":{"description":"Queued. `Location` points at the new record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"]},"example":{"data":{"id":"9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d","status":"queued","name":"IMG_4471.heic","original":{"name":"IMG_4471.heic","format":"heic","size":3402118,"width":4032,"height":3024,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d/download?type=original"},"optimized":null,"saved_bytes":null,"saved_percent":null,"settings":{"level":"ultra","format":"auto","keep_metadata":true,"width":null,"height":null,"scale":null,"size_limit":null,"responsive_widths":[480,768,1200,1600]},"size_limit_status":null,"content_credentials":null,"alt_text":{"status":"pending","text":null,"language":"de","suggested_name":null},"responsive":{"status":"pending","files":[],"download_url":null,"html":null},"scan_id":null,"source_url":null,"folder":null,"share_url":null,"created_at":"2026-10-01T09:31:12+00:00","updated_at":"2026-10-01T09:31:12+00:00"}}}},"headers":{"Location":{"description":"The address to poll.","schema":{"type":"string","format":"uri"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban. `pro_required`: The call needs a paid plan, Pro or Max: keeping the `folder` an image came from, `responsive_widths`, starting a site crawl or a weekly site check, and sharing a page report or downloading it as CSV or PDF come with them. The report itself comes with every scan, and a crawl started on a paid plan can still be read, downloaded and deleted after the plan ends.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}},"pro_required":{"summary":"pro_required","value":{"message":"Sharing a page report and downloading it as CSV or PDF come with Pro.","code":"pro_required"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages. `animation_not_resizable`: A resize was asked of an animated WebP or an animated PNG, and Iminify cannot resize their frames: only the first one would be kept. Without `width`, `height` or `scale`, and in its own format, it comes back with every frame. An animated GIF can be resized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}},"animation_not_resizable":{"summary":"animation_not_resizable","value":{"message":"A resize was asked of an animated WebP or an animated PNG, and Iminify cannot resize their frames: only the first one would be kept. Without `width`, `height` or `scale`, and in its own format, it comes back with every frame. An animated GIF can be resized.","code":"animation_not_resizable"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again. `daily_limit_reached`: Your plan's images, page scans, site crawls or AI alt texts for the day are used up, or an upload group would make more files than today has left. `Retry-After` holds the seconds until the rolling 24-hour window opens again. An image sent while only the alt texts are used up still compresses, without one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}},"daily_limit_reached":{"summary":"daily_limit_reached","value":{"message":"You've used your 40 images for today. Come back in about an hour, or go Pro for 1,000 a day.","code":"daily_limit_reached"}}}}}},"503":{"description":"`start_failed`: The file could not be stored or queued, usually a short hiccup at the storage. Nothing was counted. Send the same request again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"start_failed":{"summary":"start_failed","value":{"message":"The file could not be stored or queued, usually a short hiccup at the storage. Nothing was counted. Send the same request again.","code":"start_failed"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://www.iminify.com/api/v1/images\" \\\n  --connect-timeout 10 --max-time 1800 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\" \\\n  -F \"file=@photo.jpg\" \\\n  -F \"level=smart\" \\\n  -F \"format=webp\" \\\n  -F \"width=1600\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nwith open(\"photo.jpg\", \"rb\") as file:\n    response = requests.post(\n        f\"{API}/images\",\n        headers=HEADERS,\n        timeout=(10, 300),\n        data={\n            \"level\": \"smart\",\n            \"format\": \"webp\",\n            \"width\": \"1600\",\n        },\n        files={\"file\": file},\n    )\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('images', [\n    'multipart' => [\n        ['name' => 'file', 'contents' => fopen('photo.jpg', 'r'), 'filename' => 'photo.jpg'],\n        ['name' => 'level', 'contents' => 'smart'],\n        ['name' => 'format', 'contents' => 'webp'],\n        ['name' => 'width', 'contents' => '1600'],\n    ],\n    'timeout' => 1800,\n]);\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"import { openAsBlob } from 'node:fs';\n\nconst form = new FormData();\nform.append('file', await openAsBlob('photo.jpg'), 'photo.jpg');\nform.append('level', 'smart');\nform.append('format', 'webp');\nform.append('width', '1600');\n\nconst response = await fetch('https://www.iminify.com/api/v1/images', {\n  method: 'POST',\n  signal: AbortSignal.timeout(1800_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n  body: form,\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]}},"/images/{id}":{"get":{"operationId":"getImage","description":"One image, with its status. This is the call to poll while an image is compressing; once a second or two apart is plenty.","summary":"Get an image","tags":["Images"],"parameters":[{"name":"id","in":"path","required":true,"description":"The image's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"]},"example":{"data":{"id":"9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35","status":"completed","name":"team-offsite.webp","original":{"name":"team-offsite.jpg","format":"jpg","size":2841205,"width":4032,"height":3024,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download?type=original"},"optimized":{"name":"team-offsite.webp","format":"webp","size":212877,"width":1600,"height":1200,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download"},"saved_bytes":2628328,"saved_percent":92.51,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null,"size_limit":250,"responsive_widths":[480,768,1200,1600]},"size_limit_status":"under","content_credentials":{"status":"removed","generative_ai":false},"alt_text":{"status":"written","text":"Six colleagues laughing around a picnic table on a lakeside lawn","language":"en","suggested_name":"colleagues-picnic-table-lakeside"},"responsive":{"status":"ready","files":[{"width":480,"height":360,"size":24118,"name":"team-offsite-480w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/480"},{"width":768,"height":576,"size":55904,"name":"team-offsite-768w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/768"},{"width":1200,"height":900,"size":128330,"name":"team-offsite-1200w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/1200"},{"width":1600,"height":1200,"size":212877,"name":"team-offsite-1600w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/1600"}],"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive.zip","html":"<img\n  src=\"team-offsite-1600w.webp\"\n  srcset=\"team-offsite-480w.webp 480w, team-offsite-768w.webp 768w, team-offsite-1200w.webp 1200w, team-offsite-1600w.webp 1600w\"\n  sizes=\"(max-width: 1600px) 100vw, 1600px\"\n  width=\"1600\"\n  height=\"1200\"\n  alt=\"Six colleagues laughing around a picnic table on a lakeside lawn\"\n  style=\"max-width: 100%; height: auto\"\n  decoding=\"async\"\n>"},"scan_id":null,"source_url":null,"folder":null,"share_url":null,"created_at":"2026-10-01T09:30:00+00:00","updated_at":"2026-10-01T09:30:09+00:00"}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35');\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35', {\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]},"patch":{"operationId":"renameImage","description":"Changes the name the optimized copy downloads under. The original keeps the name it was uploaded with. The extension is always the delivered format's, so a typed one (`hero.webp`) is dropped, and characters that don't belong in a file name become a hyphen. Only a finished image can be renamed.","summary":"Rename an image","tags":["Images"],"parameters":[{"name":"id","in":"path","required":true,"description":"The image's id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameImageRequest"}}}},"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"]},"example":{"data":{"id":"9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35","status":"completed","name":"team-offsite.webp","original":{"name":"team-offsite.jpg","format":"jpg","size":2841205,"width":4032,"height":3024,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download?type=original"},"optimized":{"name":"team-offsite.webp","format":"webp","size":212877,"width":1600,"height":1200,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download"},"saved_bytes":2628328,"saved_percent":92.51,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null,"size_limit":250,"responsive_widths":[480,768,1200,1600]},"size_limit_status":"under","content_credentials":{"status":"removed","generative_ai":false},"alt_text":{"status":"written","text":"Six colleagues laughing around a picnic table on a lakeside lawn","language":"en","suggested_name":"colleagues-picnic-table-lakeside"},"responsive":{"status":"ready","files":[{"width":480,"height":360,"size":24118,"name":"team-offsite-480w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/480"},{"width":768,"height":576,"size":55904,"name":"team-offsite-768w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/768"},{"width":1200,"height":900,"size":128330,"name":"team-offsite-1200w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/1200"},{"width":1600,"height":1200,"size":212877,"name":"team-offsite-1600w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/1600"}],"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive.zip","html":"<img\n  src=\"team-offsite-1600w.webp\"\n  srcset=\"team-offsite-480w.webp 480w, team-offsite-768w.webp 768w, team-offsite-1200w.webp 1200w, team-offsite-1600w.webp 1600w\"\n  sizes=\"(max-width: 1600px) 100vw, 1600px\"\n  width=\"1600\"\n  height=\"1200\"\n  alt=\"Six colleagues laughing around a picnic table on a lakeside lawn\"\n  style=\"max-width: 100%; height: auto\"\n  decoding=\"async\"\n>"},"scan_id":null,"source_url":null,"folder":null,"share_url":null,"created_at":"2026-10-01T09:30:00+00:00","updated_at":"2026-10-01T09:30:09+00:00"}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`image_not_finished`: The call needs an optimized copy (to download, rename or zip it, or to write its alt text) and the image has not finished. In a batch call, none of the images named had finished, and a site crawl whose pages compressed no image has no zip. Nor has an upload group whose source has not arrived, or never did.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"image_not_finished":{"summary":"image_not_finished","value":{"message":"Only an image that has finished optimizing can be downloaded.","code":"image_not_finished"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X PATCH \"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"team-offsite\"}'"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.patch(\n    f\"{API}/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35\",\n    headers=HEADERS,\n    timeout=(10, 30),\n    json={\n        \"name\": \"team-offsite\",\n    },\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->patch('images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35', [\n    'json' => [\n        'name' => 'team-offsite',\n    ],\n]);\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35', {\n  method: 'PATCH',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    name: 'team-offsite',\n  }),\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]},"delete":{"operationId":"deleteImage","description":"Deletes the image and both of its files from storage for good, its responsive sizes too. There is no trash and no undo. An image that is still queued or compressing, or whose responsive sizes are still being made, is refused; cancel it while it is queued, or wait for it to finish.","summary":"Delete an image","tags":["Images"],"parameters":[{"name":"id","in":"path","required":true,"description":"The image's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done. The body is empty."},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`image_in_progress`: The image is still queued or being compressed, or its responsive sizes are still being made, or an upload group still has a file queued or being made. Wait for it to finish, or cancel an image while it is still queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"image_in_progress":{"summary":"image_in_progress","value":{"message":"The compression is still running and cannot be deleted yet.","code":"image_in_progress"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}},"503":{"description":"`delete_failed`: The files could not be removed from storage just now, so nothing was deleted. Send the same request again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"delete_failed":{"summary":"delete_failed","value":{"message":"The files could not be removed from storage just now, so nothing was deleted. Send the same request again.","code":"delete_failed"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X DELETE \"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.delete(\n    f\"{API}/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.status_code)  # 204, nothing in the body"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->delete('images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35');\n\necho $response->getStatusCode(), PHP_EOL; // 204, nothing in the body"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35', {\n  method: 'DELETE',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(response.status); // 204, nothing in the body"}]}},"/images/{id}/download":{"get":{"operationId":"downloadImage","description":"The optimized copy, or with `type=original` the file exactly as it was uploaded. The answer is the file itself, with its type in `Content-Type` and its name in `Content-Disposition`. The original is there from the moment the image is queued; the optimized copy once it has finished.","summary":"Download an image","tags":["Images"],"parameters":[{"name":"id","in":"path","required":true,"description":"The image's id.","schema":{"type":"string","format":"uuid"}},{"name":"type","in":"query","description":"Which file: the optimized copy, or the original as it was uploaded.","schema":{"type":"string","enum":["optimized","original"],"default":"optimized"}}],"responses":{"200":{"description":"The file.","content":{"image/*":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`image_not_finished`: The call needs an optimized copy (to download, rename or zip it, or to write its alt text) and the image has not finished. In a batch call, none of the images named had finished, and a site crawl whose pages compressed no image has no zip. Nor has an upload group whose source has not arrived, or never did.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"image_not_finished":{"summary":"image_not_finished","value":{"message":"Only an image that has finished optimizing can be downloaded.","code":"image_not_finished"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}},"503":{"description":"`download_failed`: The file could not be read from storage just now, so nothing was sent. Send the same request again. A zip reads its files while it streams, so a file that fails after the zip has started stops the download short of its `Content-Length` instead: download the zip again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"download_failed":{"summary":"download_failed","value":{"message":"The file could not be read from storage just now, so nothing was sent. Send the same request again. A zip reads its files while it streams, so a file that fails after the zip has started stops the download short of its `Content-Length` instead: download the zip again.","code":"download_failed"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl --fail-with-body -o team-offsite.webp \"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download\" \\\n  --connect-timeout 10 --max-time 1800 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download\",\n    headers=HEADERS,\n    timeout=(10, 300),\n)\nresponse.raise_for_status()\n\nwith open(\"team-offsite.webp\", \"wb\") as out:\n    out.write(response.content)"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download', [\n    'sink' => 'team-offsite.webp',\n    'timeout' => 1800,\n]);\n\necho 'Saved team-offsite.webp', PHP_EOL;"},{"lang":"javascript","label":"JavaScript","source":"import { writeFile } from 'node:fs/promises';\n\nconst response = await fetch('https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download', {\n  signal: AbortSignal.timeout(1800_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nawait writeFile('team-offsite.webp', Buffer.from(await response.arrayBuffer()));"}]}},"/images/{id}/responsive/{width}":{"get":{"operationId":"downloadResponsiveImage","description":"One width of the image's responsive sizes, under the name it has in `responsive.files`, like `team-offsite-768w.webp`. The answer is the file itself, with its type in `Content-Type` and its name in `Content-Disposition`. The sizes can be downloaded once `responsive.status` is `ready`, and stay downloadable if the plan lapses. See [Responsive sizes](/docs/images#responsive-sizes).","summary":"Download one responsive size","tags":["Images"],"parameters":[{"name":"id","in":"path","required":true,"description":"The image's id.","schema":{"type":"string","format":"uuid"}},{"name":"width","in":"path","required":true,"description":"One of the widths in `responsive.files`.","schema":{"type":"integer"}}],"responses":{"200":{"description":"The file.","content":{"image/*":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`responsive_not_ready`: The call downloads an image's responsive sizes and there are none to download: they are still being made, they could not be made, or the image was sent without `responsive_widths`. The image's `responsive.status` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"responsive_not_ready":{"summary":"responsive_not_ready","value":{"message":"The call downloads an image's responsive sizes and there are none to download: they are still being made, they could not be made, or the image was sent without `responsive_widths`. The image's `responsive.status` says which.","code":"responsive_not_ready"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}},"503":{"description":"`download_failed`: The file could not be read from storage just now, so nothing was sent. Send the same request again. A zip reads its files while it streams, so a file that fails after the zip has started stops the download short of its `Content-Length` instead: download the zip again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"download_failed":{"summary":"download_failed","value":{"message":"The file could not be read from storage just now, so nothing was sent. Send the same request again. A zip reads its files while it streams, so a file that fails after the zip has started stops the download short of its `Content-Length` instead: download the zip again.","code":"download_failed"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl --fail-with-body -o team-offsite-768w.webp \"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/768\" \\\n  --connect-timeout 10 --max-time 1800 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/768\",\n    headers=HEADERS,\n    timeout=(10, 300),\n)\nresponse.raise_for_status()\n\nwith open(\"team-offsite-768w.webp\", \"wb\") as out:\n    out.write(response.content)"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/768', [\n    'sink' => 'team-offsite-768w.webp',\n    'timeout' => 1800,\n]);\n\necho 'Saved team-offsite-768w.webp', PHP_EOL;"},{"lang":"javascript","label":"JavaScript","source":"import { writeFile } from 'node:fs/promises';\n\nconst response = await fetch('https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/768', {\n  signal: AbortSignal.timeout(1800_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nawait writeFile('team-offsite-768w.webp', Buffer.from(await response.arrayBuffer()));"}]}},"/images/{id}/responsive.zip":{"get":{"operationId":"downloadResponsiveImages","description":"Every width of the image's responsive sizes in one zip, each file under the name it has in `responsive.files`. The sizes can be downloaded once `responsive.status` is `ready`. See [Responsive sizes](/docs/images#responsive-sizes).","summary":"Download every responsive size","tags":["Images"],"parameters":[{"name":"id","in":"path","required":true,"description":"The image's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The zip.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`responsive_not_ready`: The call downloads an image's responsive sizes and there are none to download: they are still being made, they could not be made, or the image was sent without `responsive_widths`. The image's `responsive.status` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"responsive_not_ready":{"summary":"responsive_not_ready","value":{"message":"The call downloads an image's responsive sizes and there are none to download: they are still being made, they could not be made, or the image was sent without `responsive_widths`. The image's `responsive.status` says which.","code":"responsive_not_ready"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}},"503":{"description":"`download_failed`: The file could not be read from storage just now, so nothing was sent. Send the same request again. A zip reads its files while it streams, so a file that fails after the zip has started stops the download short of its `Content-Length` instead: download the zip again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"download_failed":{"summary":"download_failed","value":{"message":"The file could not be read from storage just now, so nothing was sent. Send the same request again. A zip reads its files while it streams, so a file that fails after the zip has started stops the download short of its `Content-Length` instead: download the zip again.","code":"download_failed"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl --fail-with-body -o team-offsite-sizes.zip \"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive.zip\" \\\n  --connect-timeout 10 --max-time 1800 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive.zip\",\n    headers=HEADERS,\n    timeout=(10, 300),\n)\nresponse.raise_for_status()\n\nwith open(\"team-offsite-sizes.zip\", \"wb\") as out:\n    out.write(response.content)"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive.zip', [\n    'sink' => 'team-offsite-sizes.zip',\n    'timeout' => 1800,\n]);\n\necho 'Saved team-offsite-sizes.zip', PHP_EOL;"},{"lang":"javascript","label":"JavaScript","source":"import { writeFile } from 'node:fs/promises';\n\nconst response = await fetch('https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive.zip', {\n  signal: AbortSignal.timeout(1800_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nawait writeFile('team-offsite-sizes.zip', Buffer.from(await response.arrayBuffer()));"}]}},"/images/{id}/recompress":{"post":{"operationId":"recompressImage","description":"Runs the stored original through again with new settings and answers with a new image; the one you started from stays as it is. Nothing is uploaded again, but it counts as a compression like an upload does. It is how you try `ultra` after `smart`, or AVIF after WebP. Any image that isn't still running can go again, a failed or cancelled one included. A resize that would take the image past 64 megapixels is refused with the message under `errors.image`.","summary":"Compress an image again","tags":["Images"],"parameters":[{"name":"id","in":"path","required":true,"description":"The image's id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecompressImageRequest"}}}},"responses":{"202":{"description":"Queued. `Location` points at the new record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"]},"example":{"data":{"id":"9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d","status":"queued","name":"IMG_4471.heic","original":{"name":"IMG_4471.heic","format":"heic","size":3402118,"width":4032,"height":3024,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d/download?type=original"},"optimized":null,"saved_bytes":null,"saved_percent":null,"settings":{"level":"ultra","format":"auto","keep_metadata":true,"width":null,"height":null,"scale":null,"size_limit":null,"responsive_widths":[480,768,1200,1600]},"size_limit_status":null,"content_credentials":null,"alt_text":{"status":"pending","text":null,"language":"de","suggested_name":null},"responsive":{"status":"pending","files":[],"download_url":null,"html":null},"scan_id":null,"source_url":null,"folder":null,"share_url":null,"created_at":"2026-10-01T09:31:12+00:00","updated_at":"2026-10-01T09:31:12+00:00"}}}},"headers":{"Location":{"description":"The address to poll.","schema":{"type":"string","format":"uri"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban. `pro_required`: The call needs a paid plan, Pro or Max: keeping the `folder` an image came from, `responsive_widths`, starting a site crawl or a weekly site check, and sharing a page report or downloading it as CSV or PDF come with them. The report itself comes with every scan, and a crawl started on a paid plan can still be read, downloaded and deleted after the plan ends.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}},"pro_required":{"summary":"pro_required","value":{"message":"Sharing a page report and downloading it as CSV or PDF come with Pro.","code":"pro_required"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`image_in_progress`: The image is still queued or being compressed, or its responsive sizes are still being made, or an upload group still has a file queued or being made. Wait for it to finish, or cancel an image while it is still queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"image_in_progress":{"summary":"image_in_progress","value":{"message":"The compression is still running and cannot be deleted yet.","code":"image_in_progress"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages. `animation_not_resizable`: A resize was asked of an animated WebP or an animated PNG, and Iminify cannot resize their frames: only the first one would be kept. Without `width`, `height` or `scale`, and in its own format, it comes back with every frame. An animated GIF can be resized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}},"animation_not_resizable":{"summary":"animation_not_resizable","value":{"message":"A resize was asked of an animated WebP or an animated PNG, and Iminify cannot resize their frames: only the first one would be kept. Without `width`, `height` or `scale`, and in its own format, it comes back with every frame. An animated GIF can be resized.","code":"animation_not_resizable"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again. `daily_limit_reached`: Your plan's images, page scans, site crawls or AI alt texts for the day are used up, or an upload group would make more files than today has left. `Retry-After` holds the seconds until the rolling 24-hour window opens again. An image sent while only the alt texts are used up still compresses, without one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}},"daily_limit_reached":{"summary":"daily_limit_reached","value":{"message":"You've used your 40 images for today. Come back in about an hour, or go Pro for 1,000 a day.","code":"daily_limit_reached"}}}}}},"503":{"description":"`start_failed`: The file could not be stored or queued, usually a short hiccup at the storage. Nothing was counted. Send the same request again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"start_failed":{"summary":"start_failed","value":{"message":"The file could not be stored or queued, usually a short hiccup at the storage. Nothing was counted. Send the same request again.","code":"start_failed"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/recompress\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"level\":\"ultra\",\"format\":\"avif\"}'"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.post(\n    f\"{API}/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/recompress\",\n    headers=HEADERS,\n    timeout=(10, 30),\n    json={\n        \"level\": \"ultra\",\n        \"format\": \"avif\",\n    },\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/recompress', [\n    'json' => [\n        'level' => 'ultra',\n        'format' => 'avif',\n    ],\n]);\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/recompress', {\n  method: 'POST',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    level: 'ultra',\n    format: 'avif',\n  }),\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]}},"/images/{id}/retry":{"post":{"operationId":"retryImage","description":"Queues a failed or cancelled image again with the settings it had. It counts as a compression.","summary":"Retry an image","tags":["Images"],"parameters":[{"name":"id","in":"path","required":true,"description":"The image's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"Queued. `Location` points at the new record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"]},"example":{"data":{"id":"9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d","status":"queued","name":"IMG_4471.heic","original":{"name":"IMG_4471.heic","format":"heic","size":3402118,"width":4032,"height":3024,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d/download?type=original"},"optimized":null,"saved_bytes":null,"saved_percent":null,"settings":{"level":"ultra","format":"auto","keep_metadata":true,"width":null,"height":null,"scale":null,"size_limit":null,"responsive_widths":[480,768,1200,1600]},"size_limit_status":null,"content_credentials":null,"alt_text":{"status":"pending","text":null,"language":"de","suggested_name":null},"responsive":{"status":"pending","files":[],"download_url":null,"html":null},"scan_id":null,"source_url":null,"folder":null,"share_url":null,"created_at":"2026-10-01T09:31:12+00:00","updated_at":"2026-10-01T09:31:12+00:00"}}}},"headers":{"Location":{"description":"The address to poll.","schema":{"type":"string","format":"uri"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`image_not_retryable`: Only a failed or cancelled image can be retried. To run a finished one again with other settings, recompress it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"image_not_retryable":{"summary":"image_not_retryable","value":{"message":"Only a failed or cancelled image can be retried. To run a finished one again with other settings, recompress it.","code":"image_not_retryable"}}}}}},"422":{"description":"`animation_not_resizable`: A resize was asked of an animated WebP or an animated PNG, and Iminify cannot resize their frames: only the first one would be kept. Without `width`, `height` or `scale`, and in its own format, it comes back with every frame. An animated GIF can be resized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"animation_not_resizable":{"summary":"animation_not_resizable","value":{"message":"A resize was asked of an animated WebP or an animated PNG, and Iminify cannot resize their frames: only the first one would be kept. Without `width`, `height` or `scale`, and in its own format, it comes back with every frame. An animated GIF can be resized.","code":"animation_not_resizable"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again. `daily_limit_reached`: Your plan's images, page scans, site crawls or AI alt texts for the day are used up, or an upload group would make more files than today has left. `Retry-After` holds the seconds until the rolling 24-hour window opens again. An image sent while only the alt texts are used up still compresses, without one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}},"daily_limit_reached":{"summary":"daily_limit_reached","value":{"message":"You've used your 40 images for today. Come back in about an hour, or go Pro for 1,000 a day.","code":"daily_limit_reached"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/retry\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.post(\n    f\"{API}/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/retry\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/retry');\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/retry', {\n  method: 'POST',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]}},"/images/{id}/cancel":{"post":{"operationId":"cancelImage","description":"Calls off an image still waiting in the queue. Once a worker has picked it up it runs to the end.","summary":"Cancel an image","tags":["Images"],"parameters":[{"name":"id","in":"path","required":true,"description":"The image's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"]},"example":{"data":{"id":"9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d","status":"cancelled","name":"IMG_4471.heic","original":{"name":"IMG_4471.heic","format":"heic","size":3402118,"width":4032,"height":3024,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d/download?type=original"},"optimized":null,"saved_bytes":null,"saved_percent":null,"settings":{"level":"ultra","format":"auto","keep_metadata":true,"width":null,"height":null,"scale":null,"size_limit":null,"responsive_widths":[480,768,1200,1600]},"size_limit_status":null,"content_credentials":null,"alt_text":{"status":"pending","text":null,"language":"de","suggested_name":null},"responsive":{"status":"pending","files":[],"download_url":null,"html":null},"scan_id":null,"source_url":null,"folder":null,"share_url":null,"created_at":"2026-10-01T09:31:12+00:00","updated_at":"2026-10-01T09:31:40+00:00"}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`image_not_cancellable`: Only an image still waiting in the queue can be cancelled. This one has started, or already ended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"image_not_cancellable":{"summary":"image_not_cancellable","value":{"message":"Only an image still waiting in the queue can be cancelled. This one has started, or already ended.","code":"image_not_cancellable"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/cancel\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.post(\n    f\"{API}/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/cancel\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/cancel');\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/cancel', {\n  method: 'POST',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]}},"/images/{id}/alt-text":{"post":{"operationId":"writeAltText","description":"Asks AI for the alt text and suggested file name of a finished image: one sent with `alt_text` off, compressed before alt text existed, whose alt text failed, or skipped on a day that was used up. A written one can be asked again in another language. It counts one against your daily AI alt texts, unless an image with the same bytes already has one in that language, which is copied at once and costs nothing. The answer is the image; poll it until `alt_text.status` is no longer `pending`. While one is being written, asking again changes nothing.","summary":"Write an image's alt text","tags":["Images"],"parameters":[{"name":"id","in":"path","required":true,"description":"The image's id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteAltTextRequest"}}}},"responses":{"202":{"description":"Queued. `Location` points at the new record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"]},"example":{"data":{"id":"9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35","status":"completed","name":"team-offsite.webp","original":{"name":"team-offsite.jpg","format":"jpg","size":2841205,"width":4032,"height":3024,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download?type=original"},"optimized":{"name":"team-offsite.webp","format":"webp","size":212877,"width":1600,"height":1200,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download"},"saved_bytes":2628328,"saved_percent":92.51,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null,"size_limit":250,"responsive_widths":[480,768,1200,1600]},"size_limit_status":"under","content_credentials":{"status":"removed","generative_ai":false},"alt_text":{"status":"pending","text":null,"language":"fr","suggested_name":null},"responsive":{"status":"ready","files":[{"width":480,"height":360,"size":24118,"name":"team-offsite-480w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/480"},{"width":768,"height":576,"size":55904,"name":"team-offsite-768w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/768"},{"width":1200,"height":900,"size":128330,"name":"team-offsite-1200w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/1200"},{"width":1600,"height":1200,"size":212877,"name":"team-offsite-1600w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/1600"}],"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive.zip","html":"<img\n  src=\"team-offsite-1600w.webp\"\n  srcset=\"team-offsite-480w.webp 480w, team-offsite-768w.webp 768w, team-offsite-1200w.webp 1200w, team-offsite-1600w.webp 1600w\"\n  sizes=\"(max-width: 1600px) 100vw, 1600px\"\n  width=\"1600\"\n  height=\"1200\"\n  alt=\"\"\n  style=\"max-width: 100%; height: auto\"\n  decoding=\"async\"\n>"},"scan_id":null,"source_url":null,"folder":null,"share_url":null,"created_at":"2026-10-01T09:30:00+00:00","updated_at":"2026-10-01T09:30:09+00:00"}}}},"headers":{"Location":{"description":"The address to poll.","schema":{"type":"string","format":"uri"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`image_not_finished`: The call needs an optimized copy (to download, rename or zip it, or to write its alt text) and the image has not finished. In a batch call, none of the images named had finished, and a site crawl whose pages compressed no image has no zip. Nor has an upload group whose source has not arrived, or never did.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"image_not_finished":{"summary":"image_not_finished","value":{"message":"Only an image that has finished optimizing can be downloaded.","code":"image_not_finished"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again. `daily_limit_reached`: Your plan's images, page scans, site crawls or AI alt texts for the day are used up, or an upload group would make more files than today has left. `Retry-After` holds the seconds until the rolling 24-hour window opens again. An image sent while only the alt texts are used up still compresses, without one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}},"daily_limit_reached":{"summary":"daily_limit_reached","value":{"message":"You've used your 40 images for today. Come back in about an hour, or go Pro for 1,000 a day.","code":"daily_limit_reached"}}}}}},"503":{"description":"`alt_text_not_available`: AI alt text is switched off on the service right now. Images still compress; ask for alt text again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"alt_text_not_available":{"summary":"alt_text_not_available","value":{"message":"AI alt text is switched off on the service right now. Images still compress; ask for alt text again later.","code":"alt_text_not_available"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/alt-text\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"alt_text_language\":\"fr\",\"use_suggested_name\":true}'"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.post(\n    f\"{API}/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/alt-text\",\n    headers=HEADERS,\n    timeout=(10, 30),\n    json={\n        \"alt_text_language\": \"fr\",\n        \"use_suggested_name\": True,\n    },\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/alt-text', [\n    'json' => [\n        'alt_text_language' => 'fr',\n        'use_suggested_name' => true,\n    ],\n]);\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/alt-text', {\n  method: 'POST',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    alt_text_language: 'fr',\n    use_suggested_name: true,\n  }),\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]}},"/images/{id}/share":{"post":{"operationId":"shareImage","description":"Gives a finished image a public page at an address nobody can guess, returned as `share_url`. Anyone with the link can see the optimized copy, compare it with the original, download either one, and run the original through Iminify with their own settings. The page is kept out of search engines. Sharing an image that is already shared keeps its link.","summary":"Share an image","tags":["Images"],"parameters":[{"name":"id","in":"path","required":true,"description":"The image's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"]},"example":{"data":{"id":"9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35","status":"completed","name":"team-offsite.webp","original":{"name":"team-offsite.jpg","format":"jpg","size":2841205,"width":4032,"height":3024,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download?type=original"},"optimized":{"name":"team-offsite.webp","format":"webp","size":212877,"width":1600,"height":1200,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download"},"saved_bytes":2628328,"saved_percent":92.51,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null,"size_limit":250,"responsive_widths":[480,768,1200,1600]},"size_limit_status":"under","content_credentials":{"status":"removed","generative_ai":false},"alt_text":{"status":"written","text":"Six colleagues laughing around a picnic table on a lakeside lawn","language":"en","suggested_name":"colleagues-picnic-table-lakeside"},"responsive":{"status":"ready","files":[{"width":480,"height":360,"size":24118,"name":"team-offsite-480w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/480"},{"width":768,"height":576,"size":55904,"name":"team-offsite-768w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/768"},{"width":1200,"height":900,"size":128330,"name":"team-offsite-1200w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/1200"},{"width":1600,"height":1200,"size":212877,"name":"team-offsite-1600w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/1600"}],"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive.zip","html":"<img\n  src=\"team-offsite-1600w.webp\"\n  srcset=\"team-offsite-480w.webp 480w, team-offsite-768w.webp 768w, team-offsite-1200w.webp 1200w, team-offsite-1600w.webp 1600w\"\n  sizes=\"(max-width: 1600px) 100vw, 1600px\"\n  width=\"1600\"\n  height=\"1200\"\n  alt=\"Six colleagues laughing around a picnic table on a lakeside lawn\"\n  style=\"max-width: 100%; height: auto\"\n  decoding=\"async\"\n>"},"scan_id":null,"source_url":null,"folder":null,"share_url":"https://www.iminify.com/s/k3Xw9QmT2vLp8RzN4bYc6HdJ","created_at":"2026-10-01T09:30:00+00:00","updated_at":"2026-10-01T09:30:09+00:00"}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`image_not_shareable`: Only a finished image whose files a browser can show can be shared. A HEIC or TIFF handed back unconverted cannot.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"image_not_shareable":{"summary":"image_not_shareable","value":{"message":"Only a finished image whose files a browser can show can be shared. A HEIC or TIFF handed back unconverted cannot.","code":"image_not_shareable"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/share\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.post(\n    f\"{API}/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/share\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/share');\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/share', {\n  method: 'POST',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]},"delete":{"operationId":"unshareImage","description":"Switches the public link off. The page and both of its files answer 404 from the next request on. Sharing the image again later gives it a new link.","summary":"Stop sharing an image","tags":["Images"],"parameters":[{"name":"id","in":"path","required":true,"description":"The image's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done. The body is empty."},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X DELETE \"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/share\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.delete(\n    f\"{API}/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/share\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.status_code)  # 204, nothing in the body"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->delete('images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/share');\n\necho $response->getStatusCode(), PHP_EOL; // 204, nothing in the body"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/share', {\n  method: 'DELETE',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(response.status); // 204, nothing in the body"}]}},"/images/rename":{"post":{"operationId":"renameImages","description":"Gives every finished image in `ids` the same name followed by its place in upload order, oldest first: `trip-01`, `trip-02`. The number has at least two digits, more when the count needs them. A single image gets the name alone. Images that haven't finished are passed over, and if none has, the call is refused. It is all or nothing: when one of the names would be too long, none changes. Every id has to be one of your images; the ones that aren't are named in `errors`.","summary":"Rename several images","tags":["Images"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameImagesRequest"}}}},"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Image"}}},"required":["data"]},"example":{"data":[{"id":"9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35","status":"completed","name":"team-offsite-01.webp","original":{"name":"team-offsite.jpg","format":"jpg","size":2841205,"width":4032,"height":3024,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download?type=original"},"optimized":{"name":"team-offsite-01.webp","format":"webp","size":212877,"width":1600,"height":1200,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download"},"saved_bytes":2628328,"saved_percent":92.51,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null,"size_limit":250,"responsive_widths":[480,768,1200,1600]},"size_limit_status":"under","content_credentials":{"status":"removed","generative_ai":false},"alt_text":{"status":"written","text":"Six colleagues laughing around a picnic table on a lakeside lawn","language":"en","suggested_name":"colleagues-picnic-table-lakeside"},"responsive":{"status":"ready","files":[{"width":480,"height":360,"size":24118,"name":"team-offsite-01-480w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/480"},{"width":768,"height":576,"size":55904,"name":"team-offsite-01-768w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/768"},{"width":1200,"height":900,"size":128330,"name":"team-offsite-01-1200w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/1200"},{"width":1600,"height":1200,"size":212877,"name":"team-offsite-01-1600w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive/1600"}],"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/responsive.zip","html":"<img\n  src=\"team-offsite-01-1600w.webp\"\n  srcset=\"team-offsite-01-480w.webp 480w, team-offsite-01-768w.webp 768w, team-offsite-01-1200w.webp 1200w, team-offsite-01-1600w.webp 1600w\"\n  sizes=\"(max-width: 1600px) 100vw, 1600px\"\n  width=\"1600\"\n  height=\"1200\"\n  alt=\"Six colleagues laughing around a picnic table on a lakeside lawn\"\n  style=\"max-width: 100%; height: auto\"\n  decoding=\"async\"\n>"},"scan_id":null,"source_url":null,"folder":null,"share_url":null,"created_at":"2026-10-01T09:30:00+00:00","updated_at":"2026-10-01T09:30:09+00:00"},{"id":"9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d","status":"completed","name":"team-offsite-02.webp","original":{"name":"IMG_4471.jpg","format":"jpg","size":2841205,"width":4032,"height":3024,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d/download?type=original"},"optimized":{"name":"team-offsite-02.webp","format":"webp","size":212877,"width":1600,"height":1200,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d/download"},"saved_bytes":2628328,"saved_percent":92.51,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null,"size_limit":250,"responsive_widths":[480,768,1200,1600]},"size_limit_status":"under","content_credentials":{"status":"removed","generative_ai":false},"alt_text":{"status":"written","text":"Six colleagues laughing around a picnic table on a lakeside lawn","language":"en","suggested_name":"colleagues-picnic-table-lakeside"},"responsive":{"status":"ready","files":[{"width":480,"height":360,"size":24118,"name":"team-offsite-02-480w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d/responsive/480"},{"width":768,"height":576,"size":55904,"name":"team-offsite-02-768w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d/responsive/768"},{"width":1200,"height":900,"size":128330,"name":"team-offsite-02-1200w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d/responsive/1200"},{"width":1600,"height":1200,"size":212877,"name":"team-offsite-02-1600w.webp","download_url":"https://www.iminify.com/api/v1/images/9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d/responsive/1600"}],"download_url":"https://www.iminify.com/api/v1/images/9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d/responsive.zip","html":"<img\n  src=\"team-offsite-02-1600w.webp\"\n  srcset=\"team-offsite-02-480w.webp 480w, team-offsite-02-768w.webp 768w, team-offsite-02-1200w.webp 1200w, team-offsite-02-1600w.webp 1600w\"\n  sizes=\"(max-width: 1600px) 100vw, 1600px\"\n  width=\"1600\"\n  height=\"1200\"\n  alt=\"Six colleagues laughing around a picnic table on a lakeside lawn\"\n  style=\"max-width: 100%; height: auto\"\n  decoding=\"async\"\n>"},"scan_id":null,"source_url":null,"folder":null,"share_url":null,"created_at":"2026-10-01T09:30:00+00:00","updated_at":"2026-10-01T09:30:09+00:00"}]}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"409":{"description":"`image_not_finished`: The call needs an optimized copy (to download, rename or zip it, or to write its alt text) and the image has not finished. In a batch call, none of the images named had finished, and a site crawl whose pages compressed no image has no zip. Nor has an upload group whose source has not arrived, or never did.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"image_not_finished":{"summary":"image_not_finished","value":{"message":"Only an image that has finished optimizing can be downloaded.","code":"image_not_finished"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://www.iminify.com/api/v1/images/rename\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"ids\":[\"9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35\",\"9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d\"],\"name\":\"team-offsite\"}'"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.post(\n    f\"{API}/images/rename\",\n    headers=HEADERS,\n    timeout=(10, 30),\n    json={\n        \"ids\": [\"9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35\", \"9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d\"],\n        \"name\": \"team-offsite\",\n    },\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('images/rename', [\n    'json' => [\n        'ids' => ['9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35', '9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d'],\n        'name' => 'team-offsite',\n    ],\n]);\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/images/rename', {\n  method: 'POST',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    ids: ['9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35', '9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d'],\n    name: 'team-offsite',\n  }),\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]}},"/images/download":{"post":{"operationId":"downloadImages","description":"One zip holding the optimized copy of every finished image in `ids`, oldest first. An image uploaded with a `folder` goes in that folder, and one without at the top of the zip. Two images with the same name in one folder are kept apart as `name.webp` and `name (2).webp`. Images that haven't finished are left out, and if none has, the call is refused.","summary":"Download several images as a zip","tags":["Images"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchImagesRequest"}}}},"responses":{"200":{"description":"The zip.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"409":{"description":"`image_not_finished`: The call needs an optimized copy (to download, rename or zip it, or to write its alt text) and the image has not finished. In a batch call, none of the images named had finished, and a site crawl whose pages compressed no image has no zip. Nor has an upload group whose source has not arrived, or never did.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"image_not_finished":{"summary":"image_not_finished","value":{"message":"Only an image that has finished optimizing can be downloaded.","code":"image_not_finished"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}},"503":{"description":"`download_failed`: The file could not be read from storage just now, so nothing was sent. Send the same request again. A zip reads its files while it streams, so a file that fails after the zip has started stops the download short of its `Content-Length` instead: download the zip again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"download_failed":{"summary":"download_failed","value":{"message":"The file could not be read from storage just now, so nothing was sent. Send the same request again. A zip reads its files while it streams, so a file that fails after the zip has started stops the download short of its `Content-Length` instead: download the zip again.","code":"download_failed"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST --fail-with-body -o images.zip \"https://www.iminify.com/api/v1/images/download\" \\\n  --connect-timeout 10 --max-time 1800 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"ids\":[\"9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35\",\"9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d\"]}'"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.post(\n    f\"{API}/images/download\",\n    headers=HEADERS,\n    timeout=(10, 300),\n    json={\n        \"ids\": [\"9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35\", \"9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d\"],\n    },\n)\nresponse.raise_for_status()\n\nwith open(\"images.zip\", \"wb\") as out:\n    out.write(response.content)"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('images/download', [\n    'json' => [\n        'ids' => ['9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35', '9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d'],\n    ],\n    'sink' => 'images.zip',\n    'timeout' => 1800,\n]);\n\necho 'Saved images.zip', PHP_EOL;"},{"lang":"javascript","label":"JavaScript","source":"import { writeFile } from 'node:fs/promises';\n\nconst response = await fetch('https://www.iminify.com/api/v1/images/download', {\n  method: 'POST',\n  signal: AbortSignal.timeout(1800_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    ids: ['9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35', '9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d'],\n  }),\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nawait writeFile('images.zip', Buffer.from(await response.arrayBuffer()));"}]}},"/scans":{"get":{"operationId":"listScans","description":"Every page scan on your account, newest first, each with its counts and totals. The pages of a [site crawl](/docs/site-crawls) are left out: the crawl lists them. The images themselves come with a single scan, or from the image list filtered by `scan`.","summary":"List page scans","tags":["Page scans"],"parameters":[{"name":"status","in":"query","description":"Only scans with this status.","schema":{"$ref":"#/components/schemas/ScanStatus"}},{"name":"per_page","in":"query","description":"Scans a page, 1 to 100.","schema":{"type":"integer","default":15,"minimum":1,"maximum":100}},{"name":"page","in":"query","description":"The page to read.","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000000}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Scan"}},"links":{"type":"object","properties":{"first":{"type":["string","null"]},"last":{"type":["string","null"]},"prev":{"type":["string","null"]},"next":{"type":["string","null"]}},"required":["first","last","prev","next"]},"meta":{"type":"object","properties":{"current_page":{"type":"integer","minimum":1},"from":{"type":["integer","null"],"minimum":1},"last_page":{"type":"integer","minimum":1},"links":{"type":"array","description":"Generated paginator links.","items":{"type":"object","properties":{"url":{"type":["string","null"]},"label":{"type":"string"},"active":{"type":"boolean"}},"required":["url","label","active"]}},"path":{"type":["string","null"],"description":"Base path for paginator generated URLs."},"per_page":{"type":"integer","description":"Number of items shown per page.","minimum":0},"to":{"type":["integer","null"],"description":"Number of the last item in the slice.","minimum":1},"total":{"type":"integer","description":"Total number of items being paginated.","minimum":0}},"required":["current_page","from","last_page","links","path","per_page","to","total"]}},"required":["data","links","meta"]},"example":{"data":[{"id":"9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7","url":"https://example.com/pricing","crawl_id":null,"status":"completed","note":"Rendered in a headless browser. 14 image URLs found: 12 queued for compression, 1 duplicates of an image already queued, 1 in a format the compressor does not accept.","settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"skipped":[{"url":"https://cdn.example.com/pricing/hero.jpg?v=2","reason":"duplicate","message":"The same image as https://example.com/images/hero.jpg, so it was compressed once."},{"url":"https://example.com/images/logo.svg","reason":"unsupported_format","message":"The file is SVG, a format Iminify does not compress."}],"images_count":12,"images_in_progress":0,"alt_texts_in_progress":0,"images_finished":12,"original_size":18406331,"optimized_size":2114902,"saved_bytes":16291429,"saved_percent":88.51,"download_url":"https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/download","share_url":null,"created_at":"2026-10-01T11:05:00+00:00","updated_at":"2026-10-01T11:05:41+00:00"}],"links":{"first":"https://www.iminify.com/api/v1/scans?page=1","last":"https://www.iminify.com/api/v1/scans?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"&laquo; Previous","page":null,"active":false},{"url":"https://www.iminify.com/api/v1/scans?page=1","label":"1","page":1,"active":true},{"url":null,"label":"Next &raquo;","page":null,"active":false}],"path":"https://www.iminify.com/api/v1/scans","per_page":15,"to":1,"total":1}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://www.iminify.com/api/v1/scans?status=completed\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/scans\",\n    headers=HEADERS,\n    timeout=(10, 30),\n    params={\n        \"status\": \"completed\",\n    },\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('scans', [\n    'query' => [\n        'status' => 'completed',\n    ],\n]);\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/scans?status=completed', {\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]},"post":{"operationId":"createScan","description":"Opens the page in a browser on Iminify's servers, waits for it to load, scrolls to the bottom and collects every image it loaded, then compresses each one with the settings you send. It answers straight away with the status `queued`; a scan takes from a few seconds to a few minutes. Each scan counts one against your daily scans and your page scans a minute, and the images it finds don't count against your daily images. A scan stops at your plan's images per scan, skips SVG and AVIF files and anything over your plan's file size, and compresses an image that appears twice once.\n\nThe address can leave out `https://`. A page on a private network is refused. A page behind a login, or one that blocks automated browsers, usually comes back with no images, because the scanner sees what a signed-out visitor would.","summary":"Scan a page","tags":["Page scans"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreScanRequest"}}}},"responses":{"202":{"description":"Queued. `Location` points at the new record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Scan"}},"required":["data"]},"example":{"data":{"id":"9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7","url":"https://example.com/pricing","crawl_id":null,"status":"queued","note":null,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"skipped":[],"images_count":0,"images_in_progress":0,"alt_texts_in_progress":0,"images_finished":0,"original_size":0,"optimized_size":0,"saved_bytes":0,"saved_percent":null,"download_url":"https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/download","share_url":null,"created_at":"2026-10-01T11:05:00+00:00","updated_at":"2026-10-01T11:05:00+00:00"}}}},"headers":{"Location":{"description":"The address to poll.","schema":{"type":"string","format":"uri"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban. `scans_not_available`: Your plan does not include page scans.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}},"scans_not_available":{"summary":"scans_not_available","value":{"message":"Your plan does not include page scans.","code":"scans_not_available"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again. `daily_limit_reached`: Your plan's images, page scans, site crawls or AI alt texts for the day are used up, or an upload group would make more files than today has left. `Retry-After` holds the seconds until the rolling 24-hour window opens again. An image sent while only the alt texts are used up still compresses, without one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}},"daily_limit_reached":{"summary":"daily_limit_reached","value":{"message":"You've used your 40 images for today. Come back in about an hour, or go Pro for 1,000 a day.","code":"daily_limit_reached"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://www.iminify.com/api/v1/scans\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"url\":\"https://example.com/pricing\",\"level\":\"smart\",\"format\":\"webp\"}'"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.post(\n    f\"{API}/scans\",\n    headers=HEADERS,\n    timeout=(10, 30),\n    json={\n        \"url\": \"https://example.com/pricing\",\n        \"level\": \"smart\",\n        \"format\": \"webp\",\n    },\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('scans', [\n    'json' => [\n        'url' => 'https://example.com/pricing',\n        'level' => 'smart',\n        'format' => 'webp',\n    ],\n]);\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/scans', {\n  method: 'POST',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    url: 'https://example.com/pricing',\n    level: 'smart',\n    format: 'webp',\n  }),\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]}},"/scans/{id}":{"get":{"operationId":"getScan","description":"One scan with every image it found, newest first, and its page audit. Poll this while a scan runs: it is done once its status is no longer `queued` or `scanning` and `images_in_progress` is 0, and the report's `suggested_alt` texts once `alt_texts_in_progress` is 0 too.","summary":"Get a page scan","tags":["Page scans"],"parameters":[{"name":"id","in":"path","required":true,"description":"The scan's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Scan"},{"type":"object","required":["images","audit"]}]}},"required":["data"]},"example":{"data":{"id":"9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7","url":"https://example.com/pricing","crawl_id":null,"status":"completed","note":"Rendered in a headless browser. 14 image URLs found: 12 queued for compression, 1 duplicates of an image already queued, 1 in a format the compressor does not accept.","settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"skipped":[{"url":"https://cdn.example.com/pricing/hero.jpg?v=2","reason":"duplicate","message":"The same image as https://example.com/images/hero.jpg, so it was compressed once."},{"url":"https://example.com/images/logo.svg","reason":"unsupported_format","message":"The file is SVG, a format Iminify does not compress."}],"images_count":12,"images_in_progress":0,"alt_texts_in_progress":0,"images_finished":12,"original_size":18406331,"optimized_size":2114902,"saved_bytes":16291429,"saved_percent":88.51,"download_url":"https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/download","images":[{"id":"9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35","status":"completed","name":"team-offsite.webp","original":{"name":"team-offsite.jpg","format":"jpg","size":2841205,"width":4032,"height":3024,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download?type=original"},"optimized":{"name":"team-offsite.webp","format":"webp","size":212877,"width":1600,"height":1200,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35/download"},"saved_bytes":2628328,"saved_percent":92.51,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null,"size_limit":null,"responsive_widths":null},"size_limit_status":null,"content_credentials":{"status":"removed","generative_ai":false},"alt_text":null,"responsive":null,"scan_id":"9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7","source_url":"https://example.com/images/team-offsite.jpg","folder":null,"share_url":null,"created_at":"2026-10-01T09:30:00+00:00","updated_at":"2026-10-01T09:30:09+00:00"},{"id":"9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d","status":"completed","name":"hero-banner.webp","original":{"name":"hero-banner.jpg","format":"jpg","size":2841205,"width":4032,"height":3024,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d/download?type=original"},"optimized":{"name":"hero-banner.webp","format":"webp","size":212877,"width":1600,"height":1200,"download_url":"https://www.iminify.com/api/v1/images/9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d/download"},"saved_bytes":2628328,"saved_percent":92.51,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null,"size_limit":null,"responsive_widths":null},"size_limit_status":null,"content_credentials":{"status":"removed","generative_ai":false},"alt_text":null,"responsive":null,"scan_id":"9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7","source_url":"https://example.com/images/hero-banner.jpg","folder":null,"share_url":null,"created_at":"2026-10-01T09:30:00+00:00","updated_at":"2026-10-01T09:30:09+00:00"}],"audit":{"rendered":true,"images_found":14,"largest_paint":{"kind":"image","element":"img","url":"https://example.com/images/hero-banner.jpg"},"findings":{"oversized":1,"without_dimensions":1,"lazy_above_fold":0,"eager_below_fold":1,"missing_alt":1,"lcp_not_prioritized":1},"oversized_bytes":180384,"bytes":899380,"formats":[{"format":"webp","count":2},{"format":"jpg","count":1},{"format":"svg","count":1}],"images":[{"url":"https://example.com/images/hero-banner.jpg","format":"webp","bytes":412306,"natural_width":3200,"natural_height":1800,"rendered_width":1200,"rendered_height":675,"above_fold":true,"largest_paint":true,"alt":"present","findings":["oversized","lcp_not_prioritized"],"wasted_bytes":180384,"outcome":"compressed","skip_reason":null,"image_id":"9d3c5b91-0b2e-4a7f-8c1d-5e6f7a8b9c0d","format_sizes":null,"suggested_alt":null},{"url":"https://example.com/images/team-offsite.jpg","format":"webp","bytes":96118,"natural_width":1600,"natural_height":1200,"rendered_width":800,"rendered_height":600,"above_fold":false,"largest_paint":false,"alt":"missing","findings":["without_dimensions","eager_below_fold","missing_alt"],"wasted_bytes":null,"outcome":"compressed","skip_reason":null,"image_id":"9d3c5b8e-6f0a-4c1e-9b7d-2a4e8f1c6b35","format_sizes":null,"suggested_alt":null},{"url":"https://cdn.example.com/pricing/hero.jpg?v=2","format":"jpg","bytes":388042,"natural_width":null,"natural_height":null,"rendered_width":null,"rendered_height":null,"above_fold":null,"largest_paint":false,"alt":null,"findings":[],"wasted_bytes":null,"outcome":"skipped","skip_reason":"duplicate","image_id":null,"format_sizes":null,"suggested_alt":null},{"url":"https://example.com/images/logo.svg","format":"svg","bytes":2914,"natural_width":160,"natural_height":40,"rendered_width":160,"rendered_height":40,"above_fold":true,"largest_paint":false,"alt":"present","findings":[],"wasted_bytes":null,"outcome":"skipped","skip_reason":"unsupported_format","image_id":null,"format_sizes":null,"suggested_alt":null}]},"share_url":null,"created_at":"2026-10-01T11:05:00+00:00","updated_at":"2026-10-01T11:05:41+00:00"}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7');\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7', {\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]},"delete":{"operationId":"deleteScan","description":"Deletes the scan and every image it produced, with their files, for good. A scan that is still running, or has an image still compressing, is refused, and so is a page of a site crawl, which goes with its crawl.","summary":"Delete a page scan","tags":["Page scans"],"parameters":[{"name":"id","in":"path","required":true,"description":"The scan's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done. The body is empty."},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`scan_in_progress`: The scan or site crawl is still running, or one of its images is still being compressed. A weekly site check is stopped only while none of its crawls is running. Wait for everything to finish. `part_of_crawl`: The scan is one page of a site crawl, and a crawl's pages share the images they have in common, so a page cannot be deleted on its own. Delete the crawl it belongs to instead.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"scan_in_progress":{"summary":"scan_in_progress","value":{"message":"The scan or site crawl is still running, or one of its images is still being compressed. A weekly site check is stopped only while none of its crawls is running. Wait for everything to finish.","code":"scan_in_progress"}},"part_of_crawl":{"summary":"part_of_crawl","value":{"message":"The scan is one page of a site crawl, and a crawl's pages share the images they have in common, so a page cannot be deleted on its own. Delete the crawl it belongs to instead.","code":"part_of_crawl"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}},"503":{"description":"`delete_failed`: The files could not be removed from storage just now, so nothing was deleted. Send the same request again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"delete_failed":{"summary":"delete_failed","value":{"message":"The files could not be removed from storage just now, so nothing was deleted. Send the same request again.","code":"delete_failed"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X DELETE \"https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7\" \\\n  --connect-timeout 10 --max-time 1800 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.delete(\n    f\"{API}/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7\",\n    headers=HEADERS,\n    timeout=(10, 300),\n)\nresponse.raise_for_status()\n\nprint(response.status_code)  # 204, nothing in the body"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->delete('scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7', [\n    'timeout' => 1800,\n]);\n\necho $response->getStatusCode(), PHP_EOL; // 204, nothing in the body"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7', {\n  method: 'DELETE',\n  signal: AbortSignal.timeout(1800_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(response.status); // 204, nothing in the body"}]}},"/scans/{id}/retry":{"post":{"operationId":"retryScan","description":"Queues a failed or cancelled scan again with the settings it had. It counts as a scan.","summary":"Retry a page scan","tags":["Page scans"],"parameters":[{"name":"id","in":"path","required":true,"description":"The scan's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"Queued. `Location` points at the new record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Scan"}},"required":["data"]},"example":{"data":{"id":"9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7","url":"https://example.com/pricing","crawl_id":null,"status":"queued","note":null,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"skipped":[],"images_count":0,"images_in_progress":0,"alt_texts_in_progress":0,"images_finished":0,"original_size":0,"optimized_size":0,"saved_bytes":0,"saved_percent":null,"download_url":"https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/download","share_url":null,"created_at":"2026-10-01T11:05:00+00:00","updated_at":"2026-10-01T11:05:00+00:00"}}}},"headers":{"Location":{"description":"The address to poll.","schema":{"type":"string","format":"uri"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban. `scans_not_available`: Your plan does not include page scans.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}},"scans_not_available":{"summary":"scans_not_available","value":{"message":"Your plan does not include page scans.","code":"scans_not_available"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`scan_not_retryable`: Only a failed or cancelled scan can be retried.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"scan_not_retryable":{"summary":"scan_not_retryable","value":{"message":"Only a failed or cancelled scan can be retried.","code":"scan_not_retryable"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again. `daily_limit_reached`: Your plan's images, page scans, site crawls or AI alt texts for the day are used up, or an upload group would make more files than today has left. `Retry-After` holds the seconds until the rolling 24-hour window opens again. An image sent while only the alt texts are used up still compresses, without one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}},"daily_limit_reached":{"summary":"daily_limit_reached","value":{"message":"You've used your 40 images for today. Come back in about an hour, or go Pro for 1,000 a day.","code":"daily_limit_reached"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/retry\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.post(\n    f\"{API}/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/retry\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/retry');\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/retry', {\n  method: 'POST',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]}},"/scans/{id}/cancel":{"post":{"operationId":"cancelScan","description":"Calls off a scan still waiting in the queue. Once the scanner has started, the scan runs to the end; its images can still be cancelled one by one.","summary":"Cancel a page scan","tags":["Page scans"],"parameters":[{"name":"id","in":"path","required":true,"description":"The scan's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Scan"}},"required":["data"]},"example":{"data":{"id":"9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7","url":"https://example.com/pricing","crawl_id":null,"status":"cancelled","note":null,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"skipped":[],"images_count":0,"images_in_progress":0,"alt_texts_in_progress":0,"images_finished":0,"original_size":0,"optimized_size":0,"saved_bytes":0,"saved_percent":null,"download_url":"https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/download","share_url":null,"created_at":"2026-10-01T11:05:00+00:00","updated_at":"2026-10-01T11:05:20+00:00"}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`scan_not_cancellable`: Only a scan still waiting in the queue can be cancelled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"scan_not_cancellable":{"summary":"scan_not_cancellable","value":{"message":"Only a scan still waiting in the queue can be cancelled.","code":"scan_not_cancellable"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/cancel\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.post(\n    f\"{API}/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/cancel\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/cancel');\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/cancel', {\n  method: 'POST',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]}},"/scans/{id}/download":{"get":{"operationId":"downloadScan","description":"One zip with the optimized copy of every image of the scan that has finished, in the order the scanner found them. Images still compressing are left out, so wait for `images_in_progress` to reach 0 first.\n\nThe zip is laid out like the page: each image sits in the folders of its address (`wp-content/uploads/hero.jpg`), and an image from another host under a folder named after that host. It keeps its file name while its format is unchanged; a converted one takes its new extension. `manifest.csv` at the root lists every image address the scan fetched with its file in the zip, status, formats and sizes, then the addresses it passed over (a duplicate names the file it shares) and how many images your plan's per-scan limit left out.","summary":"Download a page scan as a zip","tags":["Page scans"],"parameters":[{"name":"id","in":"path","required":true,"description":"The scan's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The zip.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`image_not_finished`: The call needs an optimized copy (to download, rename or zip it, or to write its alt text) and the image has not finished. In a batch call, none of the images named had finished, and a site crawl whose pages compressed no image has no zip. Nor has an upload group whose source has not arrived, or never did.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"image_not_finished":{"summary":"image_not_finished","value":{"message":"Only an image that has finished optimizing can be downloaded.","code":"image_not_finished"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}},"503":{"description":"`download_failed`: The file could not be read from storage just now, so nothing was sent. Send the same request again. A zip reads its files while it streams, so a file that fails after the zip has started stops the download short of its `Content-Length` instead: download the zip again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"download_failed":{"summary":"download_failed","value":{"message":"The file could not be read from storage just now, so nothing was sent. Send the same request again. A zip reads its files while it streams, so a file that fails after the zip has started stops the download short of its `Content-Length` instead: download the zip again.","code":"download_failed"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl --fail-with-body -o scan.zip \"https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/download\" \\\n  --connect-timeout 10 --max-time 1800 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/download\",\n    headers=HEADERS,\n    timeout=(10, 300),\n)\nresponse.raise_for_status()\n\nwith open(\"scan.zip\", \"wb\") as out:\n    out.write(response.content)"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/download', [\n    'sink' => 'scan.zip',\n    'timeout' => 1800,\n]);\n\necho 'Saved scan.zip', PHP_EOL;"},{"lang":"javascript","label":"JavaScript","source":"import { writeFile } from 'node:fs/promises';\n\nconst response = await fetch('https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/download', {\n  signal: AbortSignal.timeout(1800_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nawait writeFile('scan.zip', Buffer.from(await response.arrayBuffer()));"}]}},"/scans/{id}/share":{"post":{"operationId":"shareScanReport","description":"Gives the scan's page report a public page at an address nobody can guess, returned as `share_url`. Anyone with the link can read the report as you see it, with thumbnails of the compressed images, without signing in; nothing on it can be downloaded or changed. The page is kept out of search engines. Comes with a paid plan: the link answers only while your account is on a paid plan, and comes back if it lapses and renews. Sharing a report that is already shared keeps its link.","summary":"Share a page report","tags":["Page scans"],"parameters":[{"name":"id","in":"path","required":true,"description":"The scan's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Scan"}},"required":["data"]},"example":{"data":{"id":"9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7","url":"https://example.com/pricing","crawl_id":null,"status":"completed","note":"Rendered in a headless browser. 14 image URLs found: 12 queued for compression, 1 duplicates of an image already queued, 1 in a format the compressor does not accept.","settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"skipped":[{"url":"https://cdn.example.com/pricing/hero.jpg?v=2","reason":"duplicate","message":"The same image as https://example.com/images/hero.jpg, so it was compressed once."},{"url":"https://example.com/images/logo.svg","reason":"unsupported_format","message":"The file is SVG, a format Iminify does not compress."}],"images_count":12,"images_in_progress":0,"alt_texts_in_progress":0,"images_finished":12,"original_size":18406331,"optimized_size":2114902,"saved_bytes":16291429,"saved_percent":88.51,"download_url":"https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/download","share_url":"https://www.iminify.com/r/k3Xw9QmT2vLp8RzN4bYc6HdJ","created_at":"2026-10-01T11:05:00+00:00","updated_at":"2026-10-01T11:05:41+00:00"}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban. `pro_required`: The call needs a paid plan, Pro or Max: keeping the `folder` an image came from, `responsive_widths`, starting a site crawl or a weekly site check, and sharing a page report or downloading it as CSV or PDF come with them. The report itself comes with every scan, and a crawl started on a paid plan can still be read, downloaded and deleted after the plan ends.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}},"pro_required":{"summary":"pro_required","value":{"message":"Sharing a page report and downloading it as CSV or PDF come with Pro.","code":"pro_required"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`report_not_available`: The scan has no page report to share or download: it has not finished, it failed, or it was made before scans measured pages. Wait for it to finish, or scan the page again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"report_not_available":{"summary":"report_not_available","value":{"message":"This scan has no page report: it has not finished, or it was made before scans measured pages. Scan the page again to get one.","code":"report_not_available"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/share\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.post(\n    f\"{API}/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/share\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/share');\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/share', {\n  method: 'POST',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]},"delete":{"operationId":"unshareScanReport","description":"Switches the report's public link off. The page and its thumbnails answer 404 from the next request on. Sharing the report again later gives it a new link. Works on any plan, so a link can be taken down after a paid plan has ended.","summary":"Stop sharing a page report","tags":["Page scans"],"parameters":[{"name":"id","in":"path","required":true,"description":"The scan's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done. The body is empty."},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X DELETE \"https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/share\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.delete(\n    f\"{API}/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/share\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.status_code)  # 204, nothing in the body"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->delete('scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/share');\n\necho $response->getStatusCode(), PHP_EOL; // 204, nothing in the body"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/share', {\n  method: 'DELETE',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(response.status); // 204, nothing in the body"}]}},"/scans/{id}/report.csv":{"get":{"operationId":"downloadScanReportCsv","description":"The page audit as a spreadsheet, one row per image address in the page's order: `url`, the `format` and `bytes` a browser received, `natural_width` and `natural_height` (the file's own size), `rendered_width` and `rendered_height` (the size it is shown at), `above_fold`, `largest_paint` (`yes`, `no`, or empty when not known), `alt`, `findings` (separated by spaces), `wasted_bytes`, `outcome`, `skip_reason`, then the `original_bytes` of the file the scan downloaded and the `compressed_format` and `compressed_bytes` of its compressed copy. The fields mean what they mean on the scan's `audit`. A cell that would start with `=`, `+`, `-` or `@` starts with an apostrophe, so a spreadsheet never runs it. Comes with a paid plan, for a scan that has finished with a report.","summary":"Download a page report as CSV","tags":["Page scans"],"parameters":[{"name":"id","in":"path","required":true,"description":"The scan's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK.","content":{"text/csv; charset=UTF-8":{"schema":{"type":"string"}},"text/csv":{"schema":{"type":"string"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban. `pro_required`: The call needs a paid plan, Pro or Max: keeping the `folder` an image came from, `responsive_widths`, starting a site crawl or a weekly site check, and sharing a page report or downloading it as CSV or PDF come with them. The report itself comes with every scan, and a crawl started on a paid plan can still be read, downloaded and deleted after the plan ends.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}},"pro_required":{"summary":"pro_required","value":{"message":"Sharing a page report and downloading it as CSV or PDF come with Pro.","code":"pro_required"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`report_not_available`: The scan has no page report to share or download: it has not finished, it failed, or it was made before scans measured pages. Wait for it to finish, or scan the page again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"report_not_available":{"summary":"report_not_available","value":{"message":"This scan has no page report: it has not finished, or it was made before scans measured pages. Scan the page again to get one.","code":"report_not_available"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl --fail-with-body -o report.csv \"https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/report.csv\" \\\n  --connect-timeout 10 --max-time 1800 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/report.csv\",\n    headers=HEADERS,\n    timeout=(10, 300),\n)\nresponse.raise_for_status()\n\nwith open(\"report.csv\", \"wb\") as out:\n    out.write(response.content)"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/report.csv', [\n    'sink' => 'report.csv',\n    'timeout' => 1800,\n]);\n\necho 'Saved report.csv', PHP_EOL;"},{"lang":"javascript","label":"JavaScript","source":"import { writeFile } from 'node:fs/promises';\n\nconst response = await fetch('https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/report.csv', {\n  signal: AbortSignal.timeout(1800_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nawait writeFile('report.csv', Buffer.from(await response.arrayBuffer()));"}]}},"/scans/{id}/report.pdf":{"get":{"operationId":"downloadScanReportPdf","description":"The page report printed for a client or a colleague: the page, how many images need fixing, each finding with how to fix it, the page's largest paint, the bytes that resizing would save and the formats received, then every image to fix with its findings and its compressed size. The CSV lists every image. Printing takes a second or two, and one PDF prints at a time on your account: a second request while one prints is answered with `rate_limited`. Comes with a paid plan, for a scan that has finished with a report.","summary":"Download a page report as PDF","tags":["Page scans"],"parameters":[{"name":"id","in":"path","required":true,"description":"The scan's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The PDF.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban. `pro_required`: The call needs a paid plan, Pro or Max: keeping the `folder` an image came from, `responsive_widths`, starting a site crawl or a weekly site check, and sharing a page report or downloading it as CSV or PDF come with them. The report itself comes with every scan, and a crawl started on a paid plan can still be read, downloaded and deleted after the plan ends.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}},"pro_required":{"summary":"pro_required","value":{"message":"Sharing a page report and downloading it as CSV or PDF come with Pro.","code":"pro_required"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`report_not_available`: The scan has no page report to share or download: it has not finished, it failed, or it was made before scans measured pages. Wait for it to finish, or scan the page again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"report_not_available":{"summary":"report_not_available","value":{"message":"This scan has no page report: it has not finished, or it was made before scans measured pages. Scan the page again to get one.","code":"report_not_available"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl --fail-with-body -o report.pdf \"https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/report.pdf\" \\\n  --connect-timeout 10 --max-time 1800 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/report.pdf\",\n    headers=HEADERS,\n    timeout=(10, 300),\n)\nresponse.raise_for_status()\n\nwith open(\"report.pdf\", \"wb\") as out:\n    out.write(response.content)"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/report.pdf', [\n    'sink' => 'report.pdf',\n    'timeout' => 1800,\n]);\n\necho 'Saved report.pdf', PHP_EOL;"},{"lang":"javascript","label":"JavaScript","source":"import { writeFile } from 'node:fs/promises';\n\nconst response = await fetch('https://www.iminify.com/api/v1/scans/9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7/report.pdf', {\n  signal: AbortSignal.timeout(1800_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nawait writeFile('report.pdf', Buffer.from(await response.arrayBuffer()));"}]}},"/groups":{"post":{"operationId":"createGroup","description":"Declares one image and the outputs to make from it: each a name, a width and a height, a crop for a cropped size, and the bytes of the copy you already have, in each of the `formats`. Nothing is uploaded yet. The group answers with the status `awaiting_source` and an `upload_by` 60 minutes away: send the image to `POST /groups/{id}/source` before then.\n\nEvery limit is checked here, at once: the source against your plan's file size and 64 megapixels, the outputs against the group's rules, one of your daily images and of your compressions a minute, a file for each output in each format against your daily files, and the files your groups already have waiting. A group past any of them is refused whole with nothing counted; one taken spends its image and its files now, and is never refused part-way. A source that never comes in time gives them back. See [Upload groups](/docs/upload-groups).","summary":"Open an upload group","tags":["Upload groups"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreGroupRequest"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Group"}},"required":["data"]},"example":{"data":{"id":"9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24","name":"IMG_2041","status":"awaiting_source","upload_by":"2026-10-01T10:40:00+00:00","source":{"format":"jpg","size":2841205,"width":2560,"height":1707},"settings":{"level":"smart","formats":["original","webp"],"keep_metadata":false,"ephemeral":true,"priority":"interactive"},"files":6,"outputs":[],"alt_text":null,"download_url":null,"created_at":"2026-10-01T09:40:00+00:00","received_at":null}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"413":{"description":"`payload_too_large`: The request body is over 100 MB, the most any request can carry. A body that large may be turned away before it reaches the API, and then the 413 is not JSON. Your plan's file size limit is lower and is answered with `validation_failed`. An upload group's declaration (`POST /groups`) is held to 64 KB, far more than its largest needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"payload_too_large":{"summary":"payload_too_large","value":{"message":"The request body is over 100 MB, the most any request can carry. A body that large may be turned away before it reaches the API, and then the 413 is not JSON. Your plan's file size limit is lower and is answered with `validation_failed`. An upload group's declaration (`POST /groups`) is held to 64 KB, far more than its largest needs.","code":"payload_too_large"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages. `outputs_refused`: An upload group's outputs break one of its rules: each output at most the source's width and height, one that is not cropped keeping the source's shape, and the limits on how many outputs, how many cropped ones, how large a cropped one, and how many pixels together. The whole group is refused and nothing is counted; the message names the rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}},"outputs_refused":{"summary":"outputs_refused","value":{"message":"An upload group's outputs break one of its rules: each output at most the source's width and height, one that is not cropped keeping the source's shape, and the limits on how many outputs, how many cropped ones, how large a cropped one, and how many pixels together. The whole group is refused and nothing is counted; the message names the rule.","code":"outputs_refused"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again. `daily_limit_reached`: Your plan's images, page scans, site crawls or AI alt texts for the day are used up, or an upload group would make more files than today has left. `Retry-After` holds the seconds until the rolling 24-hour window opens again. An image sent while only the alt texts are used up still compresses, without one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}},"daily_limit_reached":{"summary":"daily_limit_reached","value":{"message":"You've used your 40 images for today. Come back in about an hour, or go Pro for 1,000 a day.","code":"daily_limit_reached"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://www.iminify.com/api/v1/groups\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"IMG_2041\",\"source\":{\"format\":\"jpg\",\"size\":2841205,\"width\":2560,\"height\":1707},\"outputs\":[{\"name\":\"full\",\"width\":2560,\"height\":1707,\"size\":2841205},{\"name\":\"medium\",\"width\":300,\"height\":200,\"size\":21204},{\"name\":\"thumbnail\",\"width\":150,\"height\":150,\"crop\":[\"center\",\"center\"],\"size\":7311}],\"formats\":[\"original\",\"webp\"],\"ephemeral\":true}'"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.post(\n    f\"{API}/groups\",\n    headers=HEADERS,\n    timeout=(10, 30),\n    json={\n        \"name\": \"IMG_2041\",\n        \"source\": {\n            \"format\": \"jpg\",\n            \"size\": 2841205,\n            \"width\": 2560,\n            \"height\": 1707,\n        },\n        \"outputs\": [\n            {\n                \"name\": \"full\",\n                \"width\": 2560,\n                \"height\": 1707,\n                \"size\": 2841205,\n            },\n            {\n                \"name\": \"medium\",\n                \"width\": 300,\n                \"height\": 200,\n                \"size\": 21204,\n            },\n            {\n                \"name\": \"thumbnail\",\n                \"width\": 150,\n                \"height\": 150,\n                \"crop\": [\"center\", \"center\"],\n                \"size\": 7311,\n            },\n        ],\n        \"formats\": [\"original\", \"webp\"],\n        \"ephemeral\": True,\n    },\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('groups', [\n    'json' => [\n        'name' => 'IMG_2041',\n        'source' => [\n            'format' => 'jpg',\n            'size' => 2841205,\n            'width' => 2560,\n            'height' => 1707,\n        ],\n        'outputs' => [\n            [\n                'name' => 'full',\n                'width' => 2560,\n                'height' => 1707,\n                'size' => 2841205,\n            ],\n            [\n                'name' => 'medium',\n                'width' => 300,\n                'height' => 200,\n                'size' => 21204,\n            ],\n            [\n                'name' => 'thumbnail',\n                'width' => 150,\n                'height' => 150,\n                'crop' => ['center', 'center'],\n                'size' => 7311,\n            ],\n        ],\n        'formats' => ['original', 'webp'],\n        'ephemeral' => true,\n    ],\n]);\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/groups', {\n  method: 'POST',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    name: 'IMG_2041',\n    source: {\n      format: 'jpg',\n      size: 2841205,\n      width: 2560,\n      height: 1707,\n    },\n    outputs: [\n      {\n        name: 'full',\n        width: 2560,\n        height: 1707,\n        size: 2841205,\n      },\n      {\n        name: 'medium',\n        width: 300,\n        height: 200,\n        size: 21204,\n      },\n      {\n        name: 'thumbnail',\n        width: 150,\n        height: 150,\n        crop: ['center', 'center'],\n        size: 7311,\n      },\n    ],\n    formats: ['original', 'webp'],\n    ephemeral: true,\n  }),\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]}},"/groups/{id}/source":{"post":{"operationId":"sendGroupSource","description":"The image the group was opened for, as a multipart `file`, once, before `upload_by`. It has to be that image exactly: its format, its bytes, and its width and height as displayed. It also goes through the checks every upload does. A file that differs is refused, and the group still takes the right one until `upload_by`. The answer comes straight back with the status `in_progress` and a `Location` header; every output is made in the background, so poll the group until its status is `finished`.\n\nAn animated WebP or PNG can't be resized: a group that makes any output at another size from one is refused with `animation_not_resizable`. An animated GIF's cropped outputs are its first frame.","summary":"Send a group's source","tags":["Upload groups"],"parameters":[{"name":"id","in":"path","required":true,"description":"The group's id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/SendGroupSourceRequest"}}}},"responses":{"202":{"description":"Queued. `Location` points at the new record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Group"}},"required":["data"]},"example":{"data":{"id":"9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24","name":"IMG_2041","status":"in_progress","upload_by":null,"source":{"format":"jpg","size":2841205,"width":2560,"height":1707},"settings":{"level":"smart","formats":["original","webp"],"keep_metadata":false,"ephemeral":true,"priority":"interactive"},"files":6,"outputs":[{"name":"full","format":"original","status":"completed","file":"full.jpg","width":2560,"height":1707,"size":612480,"replace":true},{"name":"full","format":"webp","status":"completed","file":"full.webp","width":2560,"height":1707,"size":401226,"replace":true},{"name":"medium","format":"original","status":"queued","file":null,"width":null,"height":null,"size":null,"replace":false},{"name":"medium","format":"webp","status":"queued","file":null,"width":null,"height":null,"size":null,"replace":false},{"name":"thumbnail","format":"original","status":"queued","file":null,"width":null,"height":null,"size":null,"replace":false},{"name":"thumbnail","format":"webp","status":"queued","file":null,"width":null,"height":null,"size":null,"replace":false}],"alt_text":{"status":"pending","text":null,"language":"en","suggested_name":null},"download_url":null,"created_at":"2026-10-01T09:40:00+00:00","received_at":"2026-10-01T09:40:21+00:00"}}}},"headers":{"Location":{"description":"The address to poll.","schema":{"type":"string","format":"uri"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`group_closed`: An upload group takes its source once, within an hour of opening. This one already has it, or its hour to send it passed. Open a new group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"group_closed":{"summary":"group_closed","value":{"message":"An upload group takes its source once, within an hour of opening. This one already has it, or its hour to send it passed. Open a new group.","code":"group_closed"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages. `animation_not_resizable`: A resize was asked of an animated WebP or an animated PNG, and Iminify cannot resize their frames: only the first one would be kept. Without `width`, `height` or `scale`, and in its own format, it comes back with every frame. An animated GIF can be resized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}},"animation_not_resizable":{"summary":"animation_not_resizable","value":{"message":"A resize was asked of an animated WebP or an animated PNG, and Iminify cannot resize their frames: only the first one would be kept. Without `width`, `height` or `scale`, and in its own format, it comes back with every frame. An animated GIF can be resized.","code":"animation_not_resizable"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}},"503":{"description":"`start_failed`: The file could not be stored or queued, usually a short hiccup at the storage. Nothing was counted. Send the same request again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"start_failed":{"summary":"start_failed","value":{"message":"The file could not be stored or queued, usually a short hiccup at the storage. Nothing was counted. Send the same request again.","code":"start_failed"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://www.iminify.com/api/v1/groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24/source\" \\\n  --connect-timeout 10 --max-time 1800 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\" \\\n  -F \"file=@IMG_2041.jpg\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nwith open(\"IMG_2041.jpg\", \"rb\") as file:\n    response = requests.post(\n        f\"{API}/groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24/source\",\n        headers=HEADERS,\n        timeout=(10, 300),\n        files={\"file\": file},\n    )\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24/source', [\n    'multipart' => [\n        ['name' => 'file', 'contents' => fopen('IMG_2041.jpg', 'r'), 'filename' => 'IMG_2041.jpg'],\n    ],\n    'timeout' => 1800,\n]);\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"import { openAsBlob } from 'node:fs';\n\nconst form = new FormData();\nform.append('file', await openAsBlob('IMG_2041.jpg'), 'IMG_2041.jpg');\n\nconst response = await fetch('https://www.iminify.com/api/v1/groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24/source', {\n  method: 'POST',\n  signal: AbortSignal.timeout(1800_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n  body: form,\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]}},"/groups/{id}":{"get":{"operationId":"getGroup","description":"One group with each output in each of its formats: its status, the made file's size and dimensions, and `replace`, whether to write it over your copy. Poll this while a group is `in_progress`; once a few seconds apart is plenty. A group whose source never came reads `expired` until it is deleted for you, shortly after.","summary":"Get an upload group","tags":["Upload groups"],"parameters":[{"name":"id","in":"path","required":true,"description":"The group's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Group"}},"required":["data"]},"example":{"data":{"id":"9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24","name":"IMG_2041","status":"finished","upload_by":null,"source":{"format":"jpg","size":2841205,"width":2560,"height":1707},"settings":{"level":"smart","formats":["original","webp"],"keep_metadata":false,"ephemeral":true,"priority":"interactive"},"files":6,"outputs":[{"name":"full","format":"original","status":"completed","file":"full.jpg","width":2560,"height":1707,"size":612480,"replace":true},{"name":"full","format":"webp","status":"completed","file":"full.webp","width":2560,"height":1707,"size":401226,"replace":true},{"name":"medium","format":"original","status":"completed","file":"medium.jpg","width":300,"height":200,"size":14880,"replace":true},{"name":"medium","format":"webp","status":"completed","file":"medium.webp","width":300,"height":200,"size":11402,"replace":true},{"name":"thumbnail","format":"original","status":"completed","file":"thumbnail.jpg","width":150,"height":150,"size":6950,"replace":true},{"name":"thumbnail","format":"webp","status":"completed","file":null,"width":150,"height":150,"size":7402,"replace":false}],"alt_text":{"status":"written","text":"A red tram crossing a stone bridge at dusk","language":"en","suggested_name":"red-tram-stone-bridge-dusk"},"download_url":"https://www.iminify.com/api/v1/groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24/download","created_at":"2026-10-01T09:40:00+00:00","received_at":"2026-10-01T09:40:21+00:00"}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://www.iminify.com/api/v1/groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24');\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24', {\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]},"delete":{"operationId":"deleteGroup","description":"Deletes the group, every file it made and its source, for good. A group with a file still queued or being made is refused; wait for it to finish. Deleting a group gives back nothing it counted: only a source that never came does that.","summary":"Delete an upload group","tags":["Upload groups"],"parameters":[{"name":"id","in":"path","required":true,"description":"The group's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done. The body is empty."},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`image_in_progress`: The image is still queued or being compressed, or its responsive sizes are still being made, or an upload group still has a file queued or being made. Wait for it to finish, or cancel an image while it is still queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"image_in_progress":{"summary":"image_in_progress","value":{"message":"The compression is still running and cannot be deleted yet.","code":"image_in_progress"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}},"503":{"description":"`delete_failed`: The files could not be removed from storage just now, so nothing was deleted. Send the same request again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"delete_failed":{"summary":"delete_failed","value":{"message":"The files could not be removed from storage just now, so nothing was deleted. Send the same request again.","code":"delete_failed"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X DELETE \"https://www.iminify.com/api/v1/groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.delete(\n    f\"{API}/groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.status_code)  # 204, nothing in the body"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->delete('groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24');\n\necho $response->getStatusCode(), PHP_EOL; // 204, nothing in the body"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24', {\n  method: 'DELETE',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(response.status); // 204, nothing in the body"}]}},"/groups/{id}/download":{"get":{"operationId":"downloadGroup","description":"Every file marked `replace`, each named after its output and format (`thumbnail.webp`), and a `manifest.csv` listing every output in every format with its status, width, height, bytes and `replace`. A file that doesn't replace your copy isn't in the zip, and a group with nothing to replace answers with the manifest alone. It is ready once the group has `finished`, so a group still at work is refused.","summary":"Download an upload group as a zip","tags":["Upload groups"],"parameters":[{"name":"id","in":"path","required":true,"description":"The group's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The zip.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`image_in_progress`: The image is still queued or being compressed, or its responsive sizes are still being made, or an upload group still has a file queued or being made. Wait for it to finish, or cancel an image while it is still queued. `image_not_finished`: The call needs an optimized copy (to download, rename or zip it, or to write its alt text) and the image has not finished. In a batch call, none of the images named had finished, and a site crawl whose pages compressed no image has no zip. Nor has an upload group whose source has not arrived, or never did.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"image_in_progress":{"summary":"image_in_progress","value":{"message":"The compression is still running and cannot be deleted yet.","code":"image_in_progress"}},"image_not_finished":{"summary":"image_not_finished","value":{"message":"Only an image that has finished optimizing can be downloaded.","code":"image_not_finished"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}},"503":{"description":"`download_failed`: The file could not be read from storage just now, so nothing was sent. Send the same request again. A zip reads its files while it streams, so a file that fails after the zip has started stops the download short of its `Content-Length` instead: download the zip again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"download_failed":{"summary":"download_failed","value":{"message":"The file could not be read from storage just now, so nothing was sent. Send the same request again. A zip reads its files while it streams, so a file that fails after the zip has started stops the download short of its `Content-Length` instead: download the zip again.","code":"download_failed"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl --fail-with-body -o group.zip \"https://www.iminify.com/api/v1/groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24/download\" \\\n  --connect-timeout 10 --max-time 1800 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24/download\",\n    headers=HEADERS,\n    timeout=(10, 300),\n)\nresponse.raise_for_status()\n\nwith open(\"group.zip\", \"wb\") as out:\n    out.write(response.content)"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24/download', [\n    'sink' => 'group.zip',\n    'timeout' => 1800,\n]);\n\necho 'Saved group.zip', PHP_EOL;"},{"lang":"javascript","label":"JavaScript","source":"import { writeFile } from 'node:fs/promises';\n\nconst response = await fetch('https://www.iminify.com/api/v1/groups/9d3c5c02-4e1f-4a6b-8d2c-3f5a7b9c1e24/download', {\n  signal: AbortSignal.timeout(1800_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nawait writeFile('group.zip', Buffer.from(await response.arrayBuffer()));"}]}},"/crawls":{"get":{"operationId":"listCrawls","description":"Every site crawl on your account, newest first, each with its counts and totals. The pages themselves come with a single crawl. The crawls a weekly site check runs by itself are not listed.","summary":"List site crawls","tags":["Site crawls"],"parameters":[{"name":"per_page","in":"query","description":"Crawls a page, 1 to 100.","schema":{"type":"integer","default":15,"minimum":1,"maximum":100}},{"name":"page","in":"query","description":"The page to read.","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000000}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Crawl"}},"links":{"type":"object","properties":{"first":{"type":["string","null"]},"last":{"type":["string","null"]},"prev":{"type":["string","null"]},"next":{"type":["string","null"]}},"required":["first","last","prev","next"]},"meta":{"type":"object","properties":{"current_page":{"type":"integer","minimum":1},"from":{"type":["integer","null"],"minimum":1},"last_page":{"type":"integer","minimum":1},"links":{"type":"array","description":"Generated paginator links.","items":{"type":"object","properties":{"url":{"type":["string","null"]},"label":{"type":"string"},"active":{"type":"boolean"}},"required":["url","label","active"]}},"path":{"type":["string","null"],"description":"Base path for paginator generated URLs."},"per_page":{"type":"integer","description":"Number of items shown per page.","minimum":0},"to":{"type":["integer","null"],"description":"Number of the last item in the slice.","minimum":1},"total":{"type":"integer","description":"Total number of items being paginated.","minimum":0}},"required":["current_page","from","last_page","links","path","per_page","to","total"]}},"required":["data","links","meta"]},"example":{"data":[{"id":"9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6","url":"https://example.com/sitemap.xml","source":"sitemap","monitor_id":null,"status":"completed","note":null,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"pages_count":2,"pages_in_progress":0,"pages_failed":0,"pages_left_out":0,"images_count":12,"images_in_progress":0,"images_finished":12,"original_size":18406331,"optimized_size":2114902,"saved_bytes":16291429,"saved_percent":88.51,"download_url":"https://www.iminify.com/api/v1/crawls/9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6/download","created_at":"2026-10-01T11:04:50+00:00","updated_at":"2026-10-01T11:04:55+00:00"}],"links":{"first":"https://www.iminify.com/api/v1/crawls?page=1","last":"https://www.iminify.com/api/v1/crawls?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"&laquo; Previous","page":null,"active":false},{"url":"https://www.iminify.com/api/v1/crawls?page=1","label":"1","page":1,"active":true},{"url":null,"label":"Next &raquo;","page":null,"active":false}],"path":"https://www.iminify.com/api/v1/crawls","per_page":15,"to":1,"total":1}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://www.iminify.com/api/v1/crawls?per_page=5\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/crawls\",\n    headers=HEADERS,\n    timeout=(10, 30),\n    params={\n        \"per_page\": 5,\n    },\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('crawls', [\n    'query' => [\n        'per_page' => 5,\n    ],\n]);\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/crawls?per_page=5', {\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]},"post":{"operationId":"createCrawl","description":"Comes with a paid plan. Reads the site's sitemap, or takes the pages you list, and scans each page as a [page scan](/docs/page-scans) of its own, with the settings you send. An image the pages share is compressed once, unless two pages reach it at the same moment. It answers straight away with the status `queued`; a crawl takes a few minutes. Each crawl counts one against your daily site crawls, even when its sitemap turns out to be unreadable; its pages don't count against your daily page scans, nor their images against your daily images.\n\nEach page stops at your plan's images per scan, as a scan does. A sitemap on a private network is refused, and so is a page on one.","summary":"Crawl a site","tags":["Site crawls"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreCrawlRequest"}}}},"responses":{"202":{"description":"Queued. `Location` points at the new record.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Crawl"}},"required":["data"]},"example":{"data":{"id":"9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6","url":"https://example.com/sitemap.xml","source":"sitemap","monitor_id":null,"status":"queued","note":null,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"pages_count":0,"pages_in_progress":0,"pages_failed":0,"pages_left_out":0,"images_count":0,"images_in_progress":0,"images_finished":0,"original_size":0,"optimized_size":0,"saved_bytes":0,"saved_percent":null,"download_url":"https://www.iminify.com/api/v1/crawls/9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6/download","created_at":"2026-10-01T11:04:50+00:00","updated_at":"2026-10-01T11:04:50+00:00"}}}},"headers":{"Location":{"description":"The address to poll.","schema":{"type":"string","format":"uri"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban. `pro_required`: The call needs a paid plan, Pro or Max: keeping the `folder` an image came from, `responsive_widths`, starting a site crawl or a weekly site check, and sharing a page report or downloading it as CSV or PDF come with them. The report itself comes with every scan, and a crawl started on a paid plan can still be read, downloaded and deleted after the plan ends.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}},"pro_required":{"summary":"pro_required","value":{"message":"Sharing a page report and downloading it as CSV or PDF come with Pro.","code":"pro_required"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again. `daily_limit_reached`: Your plan's images, page scans, site crawls or AI alt texts for the day are used up, or an upload group would make more files than today has left. `Retry-After` holds the seconds until the rolling 24-hour window opens again. An image sent while only the alt texts are used up still compresses, without one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}},"daily_limit_reached":{"summary":"daily_limit_reached","value":{"message":"You've used your 40 images for today. Come back in about an hour, or go Pro for 1,000 a day.","code":"daily_limit_reached"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://www.iminify.com/api/v1/crawls\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"sitemap\":\"https://example.com/sitemap.xml\",\"level\":\"smart\",\"format\":\"webp\"}'"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.post(\n    f\"{API}/crawls\",\n    headers=HEADERS,\n    timeout=(10, 30),\n    json={\n        \"sitemap\": \"https://example.com/sitemap.xml\",\n        \"level\": \"smart\",\n        \"format\": \"webp\",\n    },\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('crawls', [\n    'json' => [\n        'sitemap' => 'https://example.com/sitemap.xml',\n        'level' => 'smart',\n        'format' => 'webp',\n    ],\n]);\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/crawls', {\n  method: 'POST',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    sitemap: 'https://example.com/sitemap.xml',\n    level: 'smart',\n    format: 'webp',\n  }),\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]}},"/crawls/{id}":{"get":{"operationId":"getCrawl","description":"One crawl with its pages and, once nothing is at work, the site's report. Poll this while a crawl runs: it is done once its status is `completed` or `failed` and both `pages_in_progress` and `images_in_progress` are 0. Each page is a page scan: get it for its images, its skipped addresses and its own report.","summary":"Get a site crawl","tags":["Site crawls"],"parameters":[{"name":"id","in":"path","required":true,"description":"The crawl's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Crawl"},{"type":"object","required":["pages","audit"]}]}},"required":["data"]},"example":{"data":{"id":"9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6","url":"https://example.com/sitemap.xml","source":"sitemap","monitor_id":null,"status":"completed","note":null,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"pages_count":2,"pages_in_progress":0,"pages_failed":0,"pages_left_out":0,"images_count":12,"images_in_progress":0,"images_finished":12,"original_size":18406331,"optimized_size":2114902,"saved_bytes":16291429,"saved_percent":88.51,"download_url":"https://www.iminify.com/api/v1/crawls/9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6/download","pages":[{"id":"9d3c4f2a-1b2c-4d3e-8f4a-5b6c7d8e9f01","url":"https://example.com/","status":"completed","note":"Rendered in a headless browser. 1 image URL found: 1 in a format the compressor does not accept.","images_count":0,"images_in_progress":0,"images_to_fix":0},{"id":"9d3c4f12-7a8b-4c9d-a0e1-f2a3b4c5d6e7","url":"https://example.com/pricing","status":"completed","note":"Rendered in a headless browser. 14 image URLs found: 12 queued for compression, 1 duplicates of an image already queued, 1 in a format the compressor does not accept.","images_count":12,"images_in_progress":0,"images_to_fix":2}],"audit":{"pages_audited":2,"images_found":4,"images_to_fix":2,"findings":{"oversized":1,"without_dimensions":1,"lazy_above_fold":0,"eager_below_fold":1,"missing_alt":1,"lcp_not_prioritized":1},"oversized_bytes":180384,"bytes":899380},"created_at":"2026-10-01T11:04:50+00:00","updated_at":"2026-10-01T11:04:55+00:00"}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://www.iminify.com/api/v1/crawls/9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/crawls/9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('crawls/9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6');\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/crawls/9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6', {\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]},"delete":{"operationId":"deleteCrawl","description":"Deletes the crawl, every page it scanned and every image they produced, with their files, for good. The pages share the images they have in common, so they go with their crawl, never one by one. A crawl with a page or an image still at work is refused.","summary":"Delete a site crawl","tags":["Site crawls"],"parameters":[{"name":"id","in":"path","required":true,"description":"The crawl's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done. The body is empty."},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`scan_in_progress`: The scan or site crawl is still running, or one of its images is still being compressed. A weekly site check is stopped only while none of its crawls is running. Wait for everything to finish.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"scan_in_progress":{"summary":"scan_in_progress","value":{"message":"The scan or site crawl is still running, or one of its images is still being compressed. A weekly site check is stopped only while none of its crawls is running. Wait for everything to finish.","code":"scan_in_progress"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}},"503":{"description":"`delete_failed`: The files could not be removed from storage just now, so nothing was deleted. Send the same request again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"delete_failed":{"summary":"delete_failed","value":{"message":"The files could not be removed from storage just now, so nothing was deleted. Send the same request again.","code":"delete_failed"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X DELETE \"https://www.iminify.com/api/v1/crawls/9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.delete(\n    f\"{API}/crawls/9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.status_code)  # 204, nothing in the body"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->delete('crawls/9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6');\n\necho $response->getStatusCode(), PHP_EOL; // 204, nothing in the body"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/crawls/9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6', {\n  method: 'DELETE',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(response.status); // 204, nothing in the body"}]}},"/crawls/{id}/download":{"get":{"operationId":"downloadCrawl","description":"One zip with a folder for each page, named after the page's path (`blog-hello-world`, and `home` for the front page). Each folder is laid out like that page's own [scan zip](/docs/page-scans#what-the-zip-holds), with its `manifest.csv`. An image the pages share is in the folder of the page that compressed it, and the other pages' manifests point at it there, every path from the zip's root. It is ready once the crawl is done, so a crawl still at work is refused.","summary":"Download a site crawl as a zip","tags":["Site crawls"],"parameters":[{"name":"id","in":"path","required":true,"description":"The crawl's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The zip.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`scan_in_progress`: The scan or site crawl is still running, or one of its images is still being compressed. A weekly site check is stopped only while none of its crawls is running. Wait for everything to finish. `image_not_finished`: The call needs an optimized copy (to download, rename or zip it, or to write its alt text) and the image has not finished. In a batch call, none of the images named had finished, and a site crawl whose pages compressed no image has no zip. Nor has an upload group whose source has not arrived, or never did.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"scan_in_progress":{"summary":"scan_in_progress","value":{"message":"The scan or site crawl is still running, or one of its images is still being compressed. A weekly site check is stopped only while none of its crawls is running. Wait for everything to finish.","code":"scan_in_progress"}},"image_not_finished":{"summary":"image_not_finished","value":{"message":"Only an image that has finished optimizing can be downloaded.","code":"image_not_finished"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}},"503":{"description":"`download_failed`: The file could not be read from storage just now, so nothing was sent. Send the same request again. A zip reads its files while it streams, so a file that fails after the zip has started stops the download short of its `Content-Length` instead: download the zip again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"download_failed":{"summary":"download_failed","value":{"message":"The file could not be read from storage just now, so nothing was sent. Send the same request again. A zip reads its files while it streams, so a file that fails after the zip has started stops the download short of its `Content-Length` instead: download the zip again.","code":"download_failed"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl --fail-with-body -o crawl.zip \"https://www.iminify.com/api/v1/crawls/9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6/download\" \\\n  --connect-timeout 10 --max-time 1800 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/crawls/9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6/download\",\n    headers=HEADERS,\n    timeout=(10, 300),\n)\nresponse.raise_for_status()\n\nwith open(\"crawl.zip\", \"wb\") as out:\n    out.write(response.content)"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('crawls/9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6/download', [\n    'sink' => 'crawl.zip',\n    'timeout' => 1800,\n]);\n\necho 'Saved crawl.zip', PHP_EOL;"},{"lang":"javascript","label":"JavaScript","source":"import { writeFile } from 'node:fs/promises';\n\nconst response = await fetch('https://www.iminify.com/api/v1/crawls/9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6/download', {\n  signal: AbortSignal.timeout(1800_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nawait writeFile('crawl.zip', Buffer.from(await response.arrayBuffer()));"}]}},"/monitors":{"get":{"operationId":"listMonitors","description":"Every weekly site check on your account, oldest first, each with its newest run. Your plan sets how many there can be, so the list is never paged.","summary":"List weekly site checks","tags":["Weekly site checks"],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Monitor"}}},"required":["data"]},"example":{"data":[{"id":"9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8","url":"https://example.com/sitemap.xml","source":"sitemap","crawl_id":"9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6","settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"emails":true,"paused":false,"next_run_at":"2026-10-15T11:04:55+00:00","last_run":{"id":"9d3c6a14-2b3c-4d5e-8f6a-7b8c9d0e1f23","url":"https://example.com/sitemap.xml","source":"sitemap","monitor_id":"9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8","status":"completed","note":null,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"pages_count":2,"pages_in_progress":0,"pages_failed":0,"pages_left_out":0,"images_count":1,"images_in_progress":0,"images_finished":1,"original_size":1204118,"optimized_size":151009,"saved_bytes":1053109,"saved_percent":87.46,"download_url":"https://www.iminify.com/api/v1/crawls/9d3c6a14-2b3c-4d5e-8f6a-7b8c9d0e1f23/download","created_at":"2026-10-08T11:09:00+00:00","updated_at":"2026-10-08T11:09:04+00:00"},"created_at":"2026-10-01T11:06:12+00:00"}]}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://www.iminify.com/api/v1/monitors\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/monitors\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('monitors');\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/monitors', {\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]},"post":{"operationId":"createMonitor","description":"Comes with a paid plan. Turns one of your site crawls into a weekly check of its site. Nothing runs now and nothing is counted: the first run is a week from now and is compared with the crawl you name, and each run after that with every earlier one, so a run compresses only the images whose files no earlier run or that crawl compressed. Runs don't count against your daily site crawls.\n\nIt answers 201 with the new check, or 200 with the check already made from that crawl. A crawl that is itself a check's run answers its check.","summary":"Check a site every week","tags":["Weekly site checks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreMonitorRequest"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Monitor"}},"required":["data"]},"example":{"data":{"id":"9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8","url":"https://example.com/sitemap.xml","source":"sitemap","crawl_id":"9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6","settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"emails":true,"paused":false,"next_run_at":"2026-10-08T11:06:12+00:00","last_run":null,"created_at":"2026-10-01T11:06:12+00:00"}}}}},"200":{"description":"The check already made from that crawl.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Monitor"}},"required":["data"]},"example":{"data":{"id":"9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8","url":"https://example.com/sitemap.xml","source":"sitemap","crawl_id":"9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6","settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"emails":true,"paused":false,"next_run_at":"2026-10-15T11:04:55+00:00","last_run":{"id":"9d3c6a14-2b3c-4d5e-8f6a-7b8c9d0e1f23","url":"https://example.com/sitemap.xml","source":"sitemap","monitor_id":"9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8","status":"completed","note":null,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"pages_count":2,"pages_in_progress":0,"pages_failed":0,"pages_left_out":0,"images_count":1,"images_in_progress":0,"images_finished":1,"original_size":1204118,"optimized_size":151009,"saved_bytes":1053109,"saved_percent":87.46,"download_url":"https://www.iminify.com/api/v1/crawls/9d3c6a14-2b3c-4d5e-8f6a-7b8c9d0e1f23/download","created_at":"2026-10-08T11:09:00+00:00","updated_at":"2026-10-08T11:09:04+00:00"},"created_at":"2026-10-01T11:06:12+00:00"}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban. `pro_required`: The call needs a paid plan, Pro or Max: keeping the `folder` an image came from, `responsive_widths`, starting a site crawl or a weekly site check, and sharing a page report or downloading it as CSV or PDF come with them. The report itself comes with every scan, and a crawl started on a paid plan can still be read, downloaded and deleted after the plan ends.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}},"pro_required":{"summary":"pro_required","value":{"message":"Sharing a page report and downloading it as CSV or PDF come with Pro.","code":"pro_required"}}}}}},"409":{"description":"`crawl_has_no_pages`: A weekly site check is made from a site crawl that scanned at least one page, and this one has none: it is still reading its sitemap, or it failed before scanning any page (its `note` says why). Wait for it, or crawl the site again and start the check from that crawl. `monitor_limit_reached`: Every weekly site check your plan includes is in use. Stop one before starting another.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"crawl_has_no_pages":{"summary":"crawl_has_no_pages","value":{"message":"A weekly site check is made from a site crawl that scanned at least one page, and this one has none: it is still reading its sitemap, or it failed before scanning any page (its `note` says why). Wait for it, or crawl the site again and start the check from that crawl.","code":"crawl_has_no_pages"}},"monitor_limit_reached":{"summary":"monitor_limit_reached","value":{"message":"Every weekly site check your plan includes is in use. Stop one before starting another.","code":"monitor_limit_reached"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://www.iminify.com/api/v1/monitors\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"crawl_id\":\"9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6\"}'"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.post(\n    f\"{API}/monitors\",\n    headers=HEADERS,\n    timeout=(10, 30),\n    json={\n        \"crawl_id\": \"9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6\",\n    },\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->post('monitors', [\n    'json' => [\n        'crawl_id' => '9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6',\n    ],\n]);\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/monitors', {\n  method: 'POST',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    crawl_id: '9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6',\n  }),\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]}},"/monitors/{id}":{"get":{"operationId":"getMonitor","description":"One weekly check with its newest run. A run is a site crawl: get it with `last_run.id` for its pages and the site's report, and download its zip, which holds only the images that run compressed.","summary":"Get a weekly site check","tags":["Weekly site checks"],"parameters":[{"name":"id","in":"path","required":true,"description":"The weekly check's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Monitor"}},"required":["data"]},"example":{"data":{"id":"9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8","url":"https://example.com/sitemap.xml","source":"sitemap","crawl_id":"9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6","settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"emails":true,"paused":false,"next_run_at":"2026-10-15T11:04:55+00:00","last_run":{"id":"9d3c6a14-2b3c-4d5e-8f6a-7b8c9d0e1f23","url":"https://example.com/sitemap.xml","source":"sitemap","monitor_id":"9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8","status":"completed","note":null,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"pages_count":2,"pages_in_progress":0,"pages_failed":0,"pages_left_out":0,"images_count":1,"images_in_progress":0,"images_finished":1,"original_size":1204118,"optimized_size":151009,"saved_bytes":1053109,"saved_percent":87.46,"download_url":"https://www.iminify.com/api/v1/crawls/9d3c6a14-2b3c-4d5e-8f6a-7b8c9d0e1f23/download","created_at":"2026-10-08T11:09:00+00:00","updated_at":"2026-10-08T11:09:04+00:00"},"created_at":"2026-10-01T11:06:12+00:00"}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://www.iminify.com/api/v1/monitors/9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/monitors/9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('monitors/9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8');\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/monitors/9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8', {\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]},"patch":{"operationId":"updateMonitor","description":"Turns the check's emails off or back on. The check runs either way.","summary":"Update a weekly site check","tags":["Weekly site checks"],"parameters":[{"name":"id","in":"path","required":true,"description":"The weekly check's id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMonitorRequest"}}}},"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Monitor"}},"required":["data"]},"example":{"data":{"id":"9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8","url":"https://example.com/sitemap.xml","source":"sitemap","crawl_id":"9d3c4e07-5c6d-4e7f-9a0b-c1d2e3f4a5b6","settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"emails":false,"paused":false,"next_run_at":"2026-10-15T11:04:55+00:00","last_run":{"id":"9d3c6a14-2b3c-4d5e-8f6a-7b8c9d0e1f23","url":"https://example.com/sitemap.xml","source":"sitemap","monitor_id":"9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8","status":"completed","note":null,"settings":{"level":"smart","format":"webp","keep_metadata":false,"width":1600,"height":null,"scale":null},"pages_count":2,"pages_in_progress":0,"pages_failed":0,"pages_left_out":0,"images_count":1,"images_in_progress":0,"images_finished":1,"original_size":1204118,"optimized_size":151009,"saved_bytes":1053109,"saved_percent":87.46,"download_url":"https://www.iminify.com/api/v1/crawls/9d3c6a14-2b3c-4d5e-8f6a-7b8c9d0e1f23/download","created_at":"2026-10-08T11:09:00+00:00","updated_at":"2026-10-08T11:09:04+00:00"},"created_at":"2026-10-01T11:06:12+00:00"}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"422":{"description":"`validation_failed`: A field is missing or wrong, or the file or address did not pass the checks every upload goes through. `errors` names each field with its messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"},"examples":{"validation_failed":{"summary":"validation_failed","value":{"message":"The selected level is invalid. (and 1 more error)","code":"validation_failed","errors":{"level":["The selected level is invalid."],"width":["Send either scale or width and height, not both."]}}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X PATCH \"https://www.iminify.com/api/v1/monitors/9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"emails\":false}'"},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.patch(\n    f\"{API}/monitors/9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8\",\n    headers=HEADERS,\n    timeout=(10, 30),\n    json={\n        \"emails\": False,\n    },\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->patch('monitors/9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8', [\n    'json' => [\n        'emails' => false,\n    ],\n]);\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/monitors/9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8', {\n  method: 'PATCH',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    emails: false,\n  }),\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]},"delete":{"operationId":"deleteMonitor","description":"Stops the check for good and deletes every run it made, with their pages, images and files. The crawl it was made from stays. A check whose run is still at work is refused; stop it once the run has finished.","summary":"Stop a weekly site check","tags":["Weekly site checks"],"parameters":[{"name":"id","in":"path","required":true,"description":"The weekly check's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done. The body is empty."},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"404":{"description":"`not_found`: No image, upload group, scan, site crawl or weekly site check with that id on your account, or no such address. An id from another account answers the same way as one that never existed, and so does the id of a file an upload group made: it answers only through its group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"summary":"not_found","value":{"message":"No image with this id.","code":"not_found"}}}}}},"409":{"description":"`scan_in_progress`: The scan or site crawl is still running, or one of its images is still being compressed. A weekly site check is stopped only while none of its crawls is running. Wait for everything to finish.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"scan_in_progress":{"summary":"scan_in_progress","value":{"message":"The scan or site crawl is still running, or one of its images is still being compressed. A weekly site check is stopped only while none of its crawls is running. Wait for everything to finish.","code":"scan_in_progress"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X DELETE \"https://www.iminify.com/api/v1/monitors/9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.delete(\n    f\"{API}/monitors/9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.status_code)  # 204, nothing in the body"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->delete('monitors/9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8');\n\necho $response->getStatusCode(), PHP_EOL; // 204, nothing in the body"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/monitors/9d3c4e3b-8d9e-4f0a-b1c2-d3e4f5a6b7c8', {\n  method: 'DELETE',\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(response.status); // 204, nothing in the body"}]}},"/account":{"get":{"operationId":"getAccount","description":"Your plan, what it allows and how much of today's allowance is gone. The website and the API spend the same daily counts, so an image compressed on the site shows up in `usage` here too. On `max`, which is unlimited, the images and page scans a day and what is left of them are `null`. The window is a rolling 24 hours that starts with your first image or scan, not midnight, so `resets_at` is `null` until something has been used. This is also the cheapest way to check that a key works.","summary":"Get your account","tags":["Account"],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Account"}},"required":["data"]},"example":{"data":{"name":"Ada Lovelace","email":"ada@example.com","plan":"free","plan_ends_at":null,"limits":{"images_per_day":40,"scans_per_day":3,"alt_texts_per_day":40,"files_per_day":1500,"images_per_scan":20,"crawls_per_day":0,"pages_per_crawl":0,"monitors":0,"max_file_size":33554432,"max_megapixels":64,"compressions_per_minute":20,"scans_per_minute":1,"requests_per_minute":60,"max_batch":150},"usage":{"images":{"used":12,"remaining":28,"resets_at":"2026-10-02T09:30:00+00:00"},"scans":{"used":1,"remaining":2,"resets_at":"2026-10-02T11:05:00+00:00"},"crawls":{"used":0,"remaining":0,"resets_at":null},"alt_texts":{"used":12,"remaining":28,"resets_at":"2026-10-02T09:30:00+00:00"},"files":{"used":6,"remaining":1494,"resets_at":"2026-10-02T09:40:00+00:00"}}}}}}},"401":{"description":"`unauthenticated`: No key was sent, or the key does not exist (it was mistyped or deleted). Send it as `Authorization: Bearer <key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthenticated":{"summary":"unauthenticated","value":{"message":"Unauthenticated. Send your API key as a Bearer token in the Authorization header.","code":"unauthenticated"}}}}}},"403":{"description":"`email_not_verified`: The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key. `account_banned`: The account behind the key has been banned. Its keys stop working with the ban.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"email_not_verified":{"summary":"email_not_verified","value":{"message":"The key belongs to an account whose email address is not verified yet. Follow the link in the verification email, then call again with the same key.","code":"email_not_verified"}},"account_banned":{"summary":"account_banned","value":{"message":"The account behind the key has been banned. Its keys stop working with the ban.","code":"account_banned"}}}}}},"429":{"description":"`rate_limited`: One of your per-minute limits is spent: requests, compressions or page scans. The compressions and scans are counted together with the website's, so work queued there counts too. A new upload group is refused this way too while your groups already have many files waiting to be made. Nothing was done; wait for the number of seconds in the `Retry-After` header and send it again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"summary":"rate_limited","value":{"message":"You can start 20 compressions a minute. Try again in 42 seconds.","code":"rate_limited"}}}}}}},"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://www.iminify.com/api/v1/account\" \\\n  --connect-timeout 10 --max-time 30 \\\n  -H \"Authorization: Bearer $IMINIFY_API_KEY\" \\\n  -H \"Accept: application/json\""},{"lang":"python","label":"Python","source":"import os\n\nimport requests\n\nAPI = \"https://www.iminify.com/api/v1\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {os.environ['IMINIFY_API_KEY']}\",\n    \"Accept\": \"application/json\",\n}\n\nresponse = requests.get(\n    f\"{API}/account\",\n    headers=HEADERS,\n    timeout=(10, 30),\n)\nresponse.raise_for_status()\n\nprint(response.json())"},{"lang":"php","label":"PHP","source":"<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse GuzzleHttp\\Client;\n\n$client = new Client([\n    'base_uri' => 'https://www.iminify.com/api/v1/',\n    'connect_timeout' => 10,\n    'timeout' => 30,\n    'headers' => [\n        'Authorization' => 'Bearer ' . getenv('IMINIFY_API_KEY'),\n        'Accept' => 'application/json',\n    ],\n]);\n\n$response = $client->get('account');\n\nprint_r(json_decode((string) $response->getBody(), true));"},{"lang":"javascript","label":"JavaScript","source":"const response = await fetch('https://www.iminify.com/api/v1/account', {\n  signal: AbortSignal.timeout(30_000),\n  headers: {\n    Authorization: `Bearer ${process.env.IMINIFY_API_KEY}`,\n    Accept: 'application/json',\n  },\n});\n\nif (!response.ok) {\n  throw new Error(`${response.status}: ${(await response.json()).message}`);\n}\n\nconsole.log(await response.json());"}]}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"A personal access token from Settings > API Tokens on www.iminify.com."}},"schemas":{"Account":{"type":"object","properties":{"name":{"type":"string","description":"The account's name."},"email":{"type":"string","format":"email","description":"Its email address."},"plan":{"type":"string","description":"The plan the account is on: `pro` and `max` are the paid plans, and `trial` is the days of Pro an account gets once, as its email is verified or with the trial button on the website, after which it answers `free`.","enum":["free","trial","pro","max"]},"plan_ends_at":{"type":["string","null"],"format":"date-time","description":"When a paid plan or a trial ends, or `null` while a paid plan renews or on the free plan."},"limits":{"type":"object","description":"What the plan allows.","properties":{"images_per_day":{"type":["integer","null"],"description":"Images a rolling 24 hours, or `null` on `max`, which is unlimited."},"scans_per_day":{"type":["integer","null"],"description":"Page scans a rolling 24 hours, or `null` on `max`, which is unlimited."},"alt_texts_per_day":{"type":"integer","description":"AI alt texts a rolling 24 hours. Every plan has a number here, `max` included."},"files_per_day":{"type":["integer","null"],"description":"Files a rolling 24 hours that your [upload groups](/docs/upload-groups) make: every output in every format is one. `null` on `max`, which is unlimited."},"images_per_scan":{"type":"integer","description":"The most images one page scan compresses."},"crawls_per_day":{"type":["integer","null"],"description":"Site crawls a rolling 24 hours: 0 on a plan without site crawls."},"pages_per_crawl":{"type":"integer","description":"The most pages one site crawl scans, from a sitemap or a list: 0 on a plan without site crawls."},"monitors":{"type":"integer","description":"How many sites can have a weekly site check at once: 0 on a plan without weekly checks."},"max_file_size":{"type":"integer","description":"The largest file you can upload or have fetched, in bytes."},"max_megapixels":{"type":"integer","description":"The most pixels an image, or the image a resize would produce, may have, in millions."},"compressions_per_minute":{"type":"integer","description":"Compressions you can queue in a minute: uploads, recompresses and retries together, from the API and the website combined."},"scans_per_minute":{"type":"integer","description":"Page scans you can start in a minute, new and retried together, from the API and the website combined."},"requests_per_minute":{"type":"integer","description":"Calls to the API in a minute, of every kind."},"max_batch":{"type":"integer","description":"The most ids one batch call takes."}},"required":["images_per_day","scans_per_day","alt_texts_per_day","files_per_day","images_per_scan","crawls_per_day","pages_per_crawl","monitors","max_file_size","max_megapixels","compressions_per_minute","scans_per_minute","requests_per_minute","max_batch"]},"usage":{"type":"object","description":"How much of the day's allowance is used. The website and the API spend the same counts.","properties":{"images":{"type":"object","description":"Images compressed.","properties":{"used":{"type":"integer","description":"How many the current window has used."},"remaining":{"type":["integer","null"],"description":"How many are left, or `null` where the plan's daily limit is `null`."},"resets_at":{"type":["string","null"],"format":"date-time","description":"When the window opens again, or `null` while nothing has been used. The window is a rolling 24 hours from the first use, not midnight."}},"required":["used","remaining","resets_at"]},"scans":{"type":"object","description":"Page scans run.","properties":{"used":{"type":"integer","description":"How many the current window has used."},"remaining":{"type":["integer","null"],"description":"How many are left, or `null` where the plan's daily limit is `null`."},"resets_at":{"type":["string","null"],"format":"date-time","description":"When the window opens again, or `null` while nothing has been used. The window is a rolling 24 hours from the first use, not midnight."}},"required":["used","remaining","resets_at"]},"crawls":{"type":"object","description":"Site crawls started.","properties":{"used":{"type":"integer","description":"How many the current window has used."},"remaining":{"type":["integer","null"],"description":"How many are left, or `null` where the plan's daily limit is `null`."},"resets_at":{"type":["string","null"],"format":"date-time","description":"When the window opens again, or `null` while nothing has been used. The window is a rolling 24 hours from the first use, not midnight."}},"required":["used","remaining","resets_at"]},"alt_texts":{"type":"object","description":"AI alt texts written.","properties":{"used":{"type":"integer","description":"How many the current window has used."},"remaining":{"type":"integer","description":"How many are left, or `null` where the plan's daily limit is `null`."},"resets_at":{"type":["string","null"],"format":"date-time","description":"When the window opens again, or `null` while nothing has been used. The window is a rolling 24 hours from the first use, not midnight."}},"required":["used","remaining","resets_at"]},"files":{"type":"object","description":"Files your upload groups made, counted when each group opened.","properties":{"used":{"type":"integer","description":"How many the current window has used."},"remaining":{"type":["integer","null"],"description":"How many are left, or `null` where the plan's daily limit is `null`."},"resets_at":{"type":["string","null"],"format":"date-time","description":"When the window opens again, or `null` while nothing has been used. The window is a rolling 24 hours from the first use, not midnight."}},"required":["used","remaining","resets_at"]}},"required":["images","scans","crawls","alt_texts","files"]}},"required":["name","email","plan","plan_ends_at","limits","usage"],"title":"Account"},"AltTextStatus":{"type":"string","description":"Where a result's AI alt text stands. `pending`: asked for and not written yet (only a finished result shows it as in progress; a failed compression keeps the request for its retry). `written`: the text and the suggested file name are stored. `failed`: the model refused, or the call or its thumbnail failed; it can be asked for again. `skipped`: asked for on a day whose alt texts were spent.\n","enum":["pending","written","failed","skipped"],"title":"AltTextStatus"},"AuditFinding":{"type":"string","description":"Something a page scan found worth fixing about one image. `oversized`: its file is more than twice as wide and twice as tall as the space it is shown in. `without_dimensions`: shown without width and height attributes, so the page can move while it loads. `lazy_above_fold`: lazy loaded although it is in the first screen, which delays it. `eager_below_fold`: below the first screen and not lazy loaded, so it competes with what the visitor sees first. `missing_alt`: no alt text. `lcp_not_prioritized`: the page's largest paint without `fetchpriority=\"high\"`.\n","enum":["oversized","without_dimensions","lazy_above_fold","eager_below_fold","missing_alt","lcp_not_prioritized"],"title":"AuditFinding"},"BatchImagesRequest":{"type":"object","description":"The images, by id.","properties":{"ids":{"type":"array","description":"The images, by id. 1 to 150.","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":150,"uniqueItems":true}},"required":["ids"],"title":"BatchImagesRequest"},"CompressLevel":{"type":"string","enum":["none","lossless","ultra","smart"],"title":"CompressLevel"},"CompressOutputExtension":{"type":"string","enum":["auto","webp","avif","png","jpg"],"title":"CompressOutputExtension"},"CompressPriority":{"type":"string","description":"How soon the work should run. `interactive`, the default, is for work someone waits on. `background` is for bulk work nobody waits on, such as a whole library: it waits behind every image sent without it, on every plan, and counts against your limits exactly the same.\n","enum":["interactive","background"],"title":"CompressPriority"},"CompressStatus":{"type":"string","enum":["queued","optimizing","completed","failed","already-optimized","cancelled"],"title":"CompressStatus"},"ContentCredentialsStatus":{"type":"string","description":"What became of the Content Credentials the upload carried. `removed`: the optimized copy doesn't carry them. Their signature covers the upload's exact bytes, so any change to the file breaks it, and Iminify doesn't sign a new record of its own. `kept`: nothing came out smaller, so the optimized copy is the upload itself, credentials and all.\n","enum":["removed","kept"],"title":"ContentCredentialsStatus"},"Crawl":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The crawl's id."},"url":{"type":"string","format":"uri","description":"The sitemap the crawl read, or the first of the pages it was given."},"source":{"type":"string","description":"Where its pages came from: `sitemap` or `pages`, a list.","enum":["sitemap","pages"]},"monitor_id":{"type":["string","null"],"format":"uuid","description":"The weekly site check this crawl is a run of, or `null` for a crawl you started. A check's runs are left out of the crawl list; the check names its newest."},"status":{"description":"Where the crawl is. `queued`: waiting to start. `reading`: its sitemap is being read. `scanning`: its pages have been handed to the scanner and they, or their images, are still at work. `completed`: every page has finished, its images included. `failed`: the crawl could not start its pages (`note` says why); a failed crawl may still have pages it started, which finish on their own.","$ref":"#/components/schemas/CrawlStatus"},"note":{"type":["string","null"],"description":"Why the crawl failed, or `null`."},"settings":{"type":"object","description":"The settings every image of every page is compressed with.","properties":{"level":{"description":"The compression level.","$ref":"#/components/schemas/CompressLevel"},"format":{"anyOf":[{"description":"The format every image is converted to, or `null` to keep each one's own.","$ref":"#/components/schemas/CompressOutputExtension"},{"type":"null"}]},"keep_metadata":{"type":"boolean","description":"Whether EXIF metadata is kept."},"width":{"type":["integer","null"],"description":"The width every image is resized to, or `null`."},"height":{"type":["integer","null"],"description":"The height every image is resized to, or `null`."},"scale":{"type":["integer","null"],"description":"The percentage every image is scaled to, or `null`."}},"required":["level","format","keep_metadata","width","height","scale"]},"pages_count":{"type":"integer","description":"How many pages the crawl took. 0 until its sitemap has been read."},"pages_in_progress":{"type":"integer","description":"How many of them are still queued or being scanned."},"pages_failed":{"type":"integer","description":"How many of them failed. Each one's `note` says why."},"pages_left_out":{"type":"integer","description":"How many more pages the sitemap or the list had past your plan's pages per crawl, which were not scanned. For a sitemap index, a floor: it stops reading once it has enough."},"images_count":{"type":"integer","description":"How many images the pages queued. An image the pages share is compressed once, so it counts once."},"images_in_progress":{"type":"integer","description":"How many of them are still queued or being compressed. The crawl is done once its status is `completed` or `failed` and both `pages_in_progress` and this are 0."},"images_finished":{"type":"integer","description":"How many of them have finished."},"original_size":{"type":"integer","description":"Bytes of the finished images before compression."},"optimized_size":{"type":"integer","description":"Bytes of the same images after compression."},"saved_bytes":{"type":"integer","description":"The difference between the two."},"saved_percent":{"type":["number","null"],"description":"The same saving as a percentage, or `null` while no image has finished."},"download_url":{"type":"string","format":"uri","description":"Where to download every page's images as one zip, a folder per page with its manifest, once the crawl is done."},"pages":{"type":"array","description":"The pages, in the order the crawl took them, each a page scan of its own. Only on a single crawl, not in a list.","items":{"$ref":"#/components/schemas/CrawlPage"}},"audit":{"anyOf":[{"description":"The site's report: every page's audit added up, an image the pages share counted once. `null` while any page or image is at work, and for a crawl with no page. Only on a single crawl, not in a list.","$ref":"#/components/schemas/CrawlAudit"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","description":"When the crawl was queued."},"updated_at":{"type":"string","format":"date-time","description":"When it last changed."}},"required":["id","url","source","monitor_id","status","note","settings","pages_count","pages_in_progress","pages_failed","pages_left_out","images_count","images_in_progress","images_finished","original_size","optimized_size","saved_bytes","saved_percent","download_url","created_at","updated_at"],"title":"Crawl"},"CrawlAudit":{"type":"object","properties":{"pages_audited":{"type":"integer","description":"How many of the pages have a report. A page that failed has none.","minimum":0},"images_found":{"type":"integer","description":"How many image addresses the pages had, each counted once however many pages show it.","minimum":0},"images_to_fix":{"type":"integer","description":"How many of them at least one page found something worth fixing about.","minimum":0},"findings":{"type":"object","description":"How many image addresses have each finding on at least one page. An image's findings depend on the page showing it (its size there, the first screen), so one page can flag an image another doesn't.","properties":{"oversized":{"type":"integer","description":"Images whose file is more than twice as wide and twice as tall as the space they are shown in.","minimum":0},"without_dimensions":{"type":"integer","description":"Images shown without width and height attributes (and no CSS aspect ratio).","minimum":0},"lazy_above_fold":{"type":"integer","description":"Images in the first screen that are lazy loaded.","minimum":0},"eager_below_fold":{"type":"integer","description":"Images below the first screen that are not lazy loaded.","minimum":0},"missing_alt":{"type":"integer","description":"Images without alt text.","minimum":0},"lcp_not_prioritized":{"type":"integer","description":"Images that are a page's largest paint and lack `fetchpriority=\"high\"`.","minimum":0}},"required":["oversized","without_dimensions","lazy_above_fold","eager_below_fold","missing_alt","lcp_not_prioritized"]},"oversized_bytes":{"type":"integer","description":"About how many bytes the oversized images would shed if each were served at twice the size it is shown, each address once, at the most any page measured."},"bytes":{"type":"integer","description":"The bytes a browser downloaded for the images, each address once."}},"required":["pages_audited","images_found","images_to_fix","findings","oversized_bytes","bytes"],"title":"CrawlAudit"},"CrawlPage":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The page scan's id, for [`GET /scans/{id}`](/docs/page-scans#get-scan), its report, and its images in the image list's `scan`."},"url":{"type":"string","format":"uri","description":"The page."},"status":{"description":"Where the scanner is, as on a page scan.","$ref":"#/components/schemas/ScanStatus"},"note":{"type":["string","null"],"description":"What the scanner wrote when it finished, or why it failed. `null` until then."},"images_count":{"type":"integer","description":"How many images the page queued. An image another page of the crawl compressed first is not among them."},"images_in_progress":{"type":"integer","description":"How many of them are still queued or being compressed."},"images_to_fix":{"type":["integer","null"],"description":"How many image addresses the page's report found something worth fixing about, or `null` until the crawl's report exists."}},"required":["id","url","status","note","images_count","images_in_progress","images_to_fix"],"title":"CrawlPage"},"CrawlStatus":{"type":"string","description":"Where a site crawl stands: waiting to start, reading its sitemap, its pages handed to the scanner, every page finished with its images, or failed before its pages could start.\n","enum":["queued","reading","scanning","completed","failed"],"title":"CrawlStatus"},"CropAnchor":{"type":"string","description":"Where a cropped output is cut from the source on one axis, after the source is scaled to cover the output: `start` keeps the left or top edge, `center` the middle, `end` the right or bottom edge. WordPress names them left, center and right across, top, center and bottom down.\n","enum":["start","center","end"],"title":"CropAnchor"},"Group":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The group's id."},"name":{"type":"string","description":"The image's name, as you sent it."},"status":{"$ref":"#/components/schemas/GroupStatus"},"upload_by":{"type":["string","null"],"format":"date-time","description":"The last moment the group takes its source, 60 minutes after it opened, or `null` once it has it."},"source":{"type":"object","description":"The source the group was opened for.","properties":{"format":{"type":"string","description":"Its format.","enum":["png","jpg","jpeg","webp","gif","heic","heif","tiff","tif"]},"size":{"type":"integer","description":"Its size in bytes."},"width":{"type":"integer","description":"Its width in pixels."},"height":{"type":"integer","description":"Its height in pixels."}},"required":["format","size","width","height"]},"settings":{"type":"object","description":"The settings every output is made with, as they were sent.","properties":{"level":{"description":"The compression level.","$ref":"#/components/schemas/CompressLevel"},"formats":{"type":"array","description":"The formats each output is made in, the source's own first.","items":{"$ref":"#/components/schemas/GroupFormat"}},"keep_metadata":{"type":"boolean","description":"Whether the EXIF metadata is kept."},"ephemeral":{"type":"boolean","description":"Whether the group is deleted for you about 24 hours after its last file finished, if you haven't deleted it by then."},"priority":{"$ref":"#/components/schemas/CompressPriority"}},"required":["level","formats","keep_metadata","ephemeral","priority"]},"files":{"type":"integer","description":"Files the group makes: every output in every format. Each counts one against your daily files."},"outputs":{"type":"array","description":"Each output in each of its formats, the main one first, or an empty list until the source arrives.","items":{"$ref":"#/components/schemas/GroupOutput"}},"alt_text":{"type":["object","null"],"description":"The AI alt text and suggested file name for the main output, or `null` when none was asked for, or until the source arrives.","properties":{"status":{"description":"`pending`: being written; it arrives a few seconds after the main output finishes. `written`: ready. `failed`: the model gave no usable answer, or something broke. `skipped`: your daily AI alt texts were used up when the source arrived.","$ref":"#/components/schemas/AltTextStatus"},"text":{"type":["string","null"],"description":"One sentence for the image's `alt` attribute, or `null` until it is written."},"language":{"type":["string","null"],"description":"The language tag it was written in."},"suggested_name":{"type":["string","null"],"description":"A short descriptive file name without an extension, or `null` until it is written or when the model offered none."}},"required":["status","text","language","suggested_name"]},"download_url":{"type":["string","null"],"format":"uri","description":"Where to download the group's files as one zip, once it has `finished`; `null` until then."},"created_at":{"type":"string","format":"date-time","description":"When the group was opened."},"received_at":{"type":["string","null"],"format":"date-time","description":"When its source arrived, or `null`."}},"required":["id","name","status","upload_by","source","settings","files","outputs","alt_text","download_url","created_at","received_at"],"title":"Group"},"GroupFormat":{"type":"string","description":"A format an upload group makes each of its outputs in: `original` is the source's own format, `webp` and `avif` a copy beside it. A WebP source asking for `webp` gets it once, as its own format.\n","enum":["original","webp","avif"],"title":"GroupFormat"},"GroupOutput":{"type":"object","properties":{"name":{"type":"string","description":"The output's name."},"format":{"description":"The format asked for: `original`, `webp` or `avif`.","$ref":"#/components/schemas/GroupFormat"},"status":{"description":"Where this file is: `queued`, `optimizing`, `completed`, `already-optimized` (nothing came out smaller than the source, which is handed back), `failed` or `cancelled`.","$ref":"#/components/schemas/CompressStatus"},"file":{"type":["string","null"],"description":"Its name in the group's zip, like `thumbnail.webp`, or `null` when it isn't there: only a file marked `replace` is."},"width":{"type":["integer","null"],"description":"The made file's width in pixels, or `null` until it has finished."},"height":{"type":["integer","null"],"description":"The made file's height in pixels, or `null` until it has finished."},"size":{"type":["integer","null"],"description":"The made file's size in bytes, or `null` until it has finished."},"replace":{"type":"boolean","description":"Whether to write this file over your copy: it finished at the output's width and height and is smaller than the copy you have (the `size` you sent), or you have none. A WebP or AVIF is marked only when it is smaller than the file you keep for that output."}},"required":["name","format","status","file","width","height","size","replace"],"title":"GroupOutput"},"GroupStatus":{"type":"string","description":"Where an upload group is. `awaiting_source`: opened, waiting for its source, which it takes until `upload_by`. `expired`: its source never came in time, so it makes nothing; it is deleted for you shortly after, and the image and files it counted are given back then. `in_progress`: the source arrived and its files are being made. `finished`: every file has ended, each with its own status.\n","enum":["awaiting_source","expired","in_progress","finished"],"title":"GroupStatus"},"Image":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The image's id."},"status":{"description":"Where the image is. `queued`: waiting for a worker. `optimizing`: being compressed. `completed`: finished, the optimized copy is ready. `already-optimized`: finished, but nothing came out smaller than the upload, so the upload itself is handed back as the optimized copy. `failed`: it could not be compressed. `cancelled`: called off before it started.","$ref":"#/components/schemas/CompressStatus"},"name":{"type":"string","description":"The name the optimized copy downloads under: the uploaded name, or the one you gave it, with the delivered format's extension. An `auto` conversion has no format until it finishes, so until then the extension is the uploaded file's own."},"original":{"type":"object","description":"The file as it was uploaded.","properties":{"name":{"type":"string","description":"The file name it downloads under."},"format":{"type":"string","description":"The file's format, as its extension: `jpg`, `png`, `webp`, `avif`, `gif`, `heic`, `tiff` and so on.","enum":["png","jpg","jpeg","webp","gif","heic","heif","tiff","tif"]},"size":{"type":"integer","description":"Its size in bytes."},"width":{"type":"integer","description":"Its width in pixels, the way it displays: a phone photo stored on its side is measured upright."},"height":{"type":"integer","description":"Its height in pixels, the way it displays."},"download_url":{"type":"string","format":"uri","description":"Where to download it with your key."}},"required":["name","format","size","width","height","download_url"]},"optimized":{"type":["object","null"],"description":"The optimized copy, or `null` until the image has finished.","properties":{"name":{"type":"string","description":"The file name it downloads under."},"format":{"type":"string","description":"The file's format, as its extension: `jpg`, `png`, `webp`, `avif`, `gif`, `heic`, `tiff` and so on.","enum":["png","jpg","jpeg","webp","gif","heic","heif","tiff","tif","auto","avif"]},"size":{"type":"integer","description":"Its size in bytes."},"width":{"type":"integer","description":"Its width in pixels, the way it displays: a phone photo stored on its side is measured upright."},"height":{"type":"integer","description":"Its height in pixels, the way it displays."},"download_url":{"type":"string","format":"uri","description":"Where to download it with your key."}},"required":["name","format","size","width","height","download_url"]},"saved_bytes":{"type":["integer","null"],"description":"Bytes the optimized copy saves against the original. Negative when a conversion or an enlargement made the file bigger. `null` until the image has finished."},"saved_percent":{"type":["number","null"],"description":"The same saving as a percentage of the original, to two decimal places. `null` until the image has finished."},"settings":{"type":"object","description":"The settings the image was compressed with, as they were sent.","properties":{"level":{"description":"The compression level.","$ref":"#/components/schemas/CompressLevel"},"format":{"anyOf":[{"description":"The format that was asked for, or `null` when none was sent. `auto` stays `auto` after the image finishes; the format the optimized copy came out in is `optimized.format`.","$ref":"#/components/schemas/CompressOutputExtension"},{"type":"null"}]},"keep_metadata":{"type":"boolean","description":"Whether the EXIF metadata was kept."},"width":{"type":["integer","null"],"description":"The width it was resized to, or `null`."},"height":{"type":["integer","null"],"description":"The height it was resized to, or `null`."},"scale":{"type":["integer","null"],"description":"The percentage it was scaled to, or `null`."},"size_limit":{"type":["integer","null"],"description":"The most the optimized copy may weigh, in kilobytes of 1,000 bytes, or `null` when no limit was sent."},"responsive_widths":{"type":["array","null"],"description":"The widths of the responsive sizes asked for, narrowest first, or `null` when none were.","items":{"type":"integer"}}},"required":["level","format","keep_metadata","width","height","scale","size_limit","responsive_widths"]},"size_limit_status":{"anyOf":[{"description":"How the optimized copy came out against `settings.size_limit`. `under`: at or under it. `resized`: under it, made smaller in pixels to get there, so `optimized.width` and `optimized.height` are smaller than the size you asked for, or than the upload's own. `over`: still over it after everything Iminify could try; an animation is never fitted. `null` when no limit was sent, and until the image has finished.","$ref":"#/components/schemas/SizeLimitStatus"},{"type":"null"}]},"content_credentials":{"type":["object","null"],"description":"The Content Credentials the upload carried, a signed C2PA record of where the image came from, and what became of them. `null` when it carried none, and until the image has finished. See [Content Credentials](/docs/compression-settings#content-credentials).","properties":{"status":{"description":"Whether the optimized copy still carries them.","$ref":"#/components/schemas/ContentCredentialsStatus"},"generative_ai":{"type":"boolean","description":"Whether they say generative AI made the image, wholly or in part. Iminify reads what they state and doesn't check their signature."}},"required":["status","generative_ai"]},"alt_text":{"type":["object","null"],"description":"The AI alt text and suggested file name, or `null` when none was asked for. See [Alt text and file names](/docs/images#alt-text-and-file-names).","properties":{"status":{"description":"`pending`: being written; it arrives a few seconds after the image finishes, and waits for a retry while the image is failed or cancelled. `written`: ready. `failed`: the model gave no usable answer, or something broke; ask again with the alt text call. `skipped`: your daily AI alt texts were used up when the image was queued.","$ref":"#/components/schemas/AltTextStatus"},"text":{"type":["string","null"],"description":"One sentence for the image's `alt` attribute, or `null` until it is written."},"language":{"type":["string","null"],"description":"The language tag it was written in."},"suggested_name":{"type":["string","null"],"description":"A short descriptive file name without an extension, ready for the rename call, or `null` until it is written or when the model offered none."}},"required":["status","text","language","suggested_name"]},"responsive":{"type":["object","null"],"description":"The image's responsive sizes (paid plans), or `null` when none were asked for. See [Responsive sizes](/docs/images#responsive-sizes).","properties":{"status":{"description":"`pending`: being made, a few seconds after the image finishes; it waits for a retry while the image is failed or cancelled. `ready`: every width is made. `failed`: a width could not be made, so none was kept; compress the image again with `responsive_widths` to try again. `skipped`: an animation, which gets none.","$ref":"#/components/schemas/ImageSetStatus"},"files":{"type":"array","description":"Each width once it is `ready`, narrowest first, empty until then: its `width` and `height` in pixels, its `size` in bytes, the `name` it downloads under (the image's name, then the width, like `team-offsite-768w.webp`) and where to download it with your key. A width wider than the upload was made at the upload's own width.","items":{"type":"object","properties":{"width":{"type":"integer"},"height":{"type":"integer"},"size":{"type":"integer"},"name":{"type":"string"},"download_url":{"type":"string"}},"required":["width","height","size","name","download_url"]}},"download_url":{"type":["string","null"],"format":"uri","description":"Where to download every width in one zip with your key, or `null` until they are `ready`."},"html":{"type":["string","null"],"description":"An `<img>` with a `srcset` over the files, ready to paste beside them, or `null` until they are `ready`. It names each file by its `name`, so put the folder's path in front when the files sit in another folder, and change `sizes` to the width the image takes in your layout."}},"required":["status","files","download_url","html"]},"scan_id":{"type":["string","null"],"format":"uuid","description":"The page scan that found the image, or `null` for an upload."},"source_url":{"type":["string","null"],"format":"uri","description":"The address the image was fetched from: the image's address on the scanned page, or the `url` you sent instead of a file. `null` for a file you sent."},"folder":{"type":["string","null"],"description":"The folder the image was uploaded from, inside the folder you picked, like `holiday/beach`: the zip of several images puts it there. `null` for an image sent on its own. Keeping folders comes with a paid plan. See [Folders](/docs/images#folders)."},"share_url":{"type":["string","null"],"format":"uri","description":"The public page while the image is shared, or `null`."},"created_at":{"type":"string","format":"date-time","description":"When the image was queued."},"updated_at":{"type":"string","format":"date-time","description":"When anything about it last changed, its status included."}},"required":["id","status","name","original","optimized","saved_bytes","saved_percent","settings","size_limit_status","content_credentials","alt_text","responsive","scan_id","source_url","folder","share_url","created_at","updated_at"],"title":"Image"},"ImageAlt":{"type":"string","description":"What an image on a scanned page says to a screen reader. `missing`: no alt text at all, which is the finding. `empty`: alt=\"\" (or marked decorative), which is right for an image that carries no meaning. `present`: it has a text alternative.\n","enum":["missing","empty","present"],"title":"ImageAlt"},"ImageSetStatus":{"type":"string","description":"Where an image's responsive sizes stand. `pending`: asked for and not made yet; they are made a few seconds after the image finishes, and wait for a retry while the image is failed or cancelled. `ready`: every width is made and can be downloaded. `failed`: a width could not be made, so none was kept; compress the image again with the widths to try again. `skipped`: the image is an animation, which gets no responsive sizes.\n","enum":["pending","ready","failed","skipped"],"title":"ImageSetStatus"},"Monitor":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The weekly check's id."},"url":{"type":"string","format":"uri","description":"The sitemap each run reads again, or the first of the pages each run takes."},"source":{"type":"string","description":"Where each run gets its pages: `sitemap`, read again every week, or `pages`, the same list every week.","enum":["sitemap","pages"]},"crawl_id":{"type":["string","null"],"format":"uuid","description":"The site crawl the check was made from, which its first run is compared with, or `null` once that crawl is deleted."},"settings":{"type":"object","description":"The settings every image of every run is compressed with: the crawl's own.","properties":{"level":{"description":"The compression level.","$ref":"#/components/schemas/CompressLevel"},"format":{"anyOf":[{"description":"The format every image is converted to, or `null` to keep each one's own.","$ref":"#/components/schemas/CompressOutputExtension"},{"type":"null"}]},"keep_metadata":{"type":"boolean","description":"Whether EXIF metadata is kept."},"width":{"type":["integer","null"],"description":"The width every image is resized to, or `null`."},"height":{"type":["integer","null"],"description":"The height every image is resized to, or `null`."},"scale":{"type":["integer","null"],"description":"The percentage every image is scaled to, or `null`."}},"required":["level","format","keep_metadata","width","height","scale"]},"emails":{"type":"boolean","description":"Whether a run that finds new or changed images, or scans no page at all, emails you. The email also carries a link that turns this off."},"paused":{"type":"boolean","description":"`true` while the check does not run on your plan: your plan has no weekly site checks, or it checks fewer sites than you hold and this is not among your oldest. The check is kept and runs again once your plan covers it."},"next_run_at":{"type":"string","format":"date-time","description":"When the next run is due. A run starts soon after it, and while the check is paused it moves on a week at a time."},"last_run":{"anyOf":[{"description":"The newest run, a site crawl in the shape the crawl list gives, or `null` before the first one. Get it with its id for its pages and the site's report; its zip holds only the images it compressed, the new or changed ones.","$ref":"#/components/schemas/Crawl"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","description":"When the check was started."}},"required":["id","url","source","crawl_id","settings","emails","paused","next_run_at","last_run","created_at"],"title":"Monitor"},"RecompressImageRequest":{"type":"object","description":"The settings to run the stored original through again with.","properties":{"level":{"description":"How hard to compress. `smart` finds the lowest quality that still looks like your upload, `ultra` goes further and softens fine texture a little, `lossless` changes no pixel unless a `size_limit` needs it to, `none` only applies the format, the resize, the size limit and the metadata choice. See [Compression settings](/docs/compression-settings).","default":"smart","$ref":"#/components/schemas/CompressLevel"},"format":{"anyOf":[{"description":"Convert to this format. `auto` encodes the image in every format that can hold it and keeps the smallest. Leave it out to keep the upload's own format; a HEIC or TIFF always comes back in another one, because Iminify doesn't write either. `jpeg` is read as `jpg`.","$ref":"#/components/schemas/CompressOutputExtension"},{"type":"null"}]},"keep_metadata":{"type":"boolean","description":"Keep the EXIF metadata (camera, date, location) in the optimized copy. Off by default, which strips it; the orientation is applied to the pixels first, so a photo never comes back on its side.","default":false},"width":{"type":["integer","null"],"description":"Resize to this width in pixels. Alone, the height follows the aspect ratio. With `height` too, the image is resized to exactly that size, and its proportions change if they differ. Up to 65535.","minimum":1,"maximum":65535},"height":{"type":["integer","null"],"description":"Resize to this height in pixels, the same way as `width`. Up to 65535.","minimum":1,"maximum":65535},"scale":{"type":["integer","null"],"description":"Resize to this percentage of the original, 1 to 100. Cannot be combined with `width` or `height`.","minimum":1,"maximum":100},"size_limit":{"type":["integer","null"],"description":"The most the optimized copy may weigh, in kilobytes of 1,000 bytes, from 5 KB up. Iminify lowers the quality until the file fits, and makes the image smaller in pixels when the lowest quality is still over it. The limit comes before the level: under `lossless` or `none`, a file over it is encoded again with loss. A PNG or GIF kept in its own format that is over the limit comes back in a format with a quality to lower (JPG, WebP or AVIF), so `png` as the `format` is refused; an animation is never fitted. `size_limit_status` on the finished image says how it came out. See [Size limit](/docs/compression-settings#size-limit).","minimum":5},"responsive_widths":{"type":["array","null"],"description":"Paid plans: also make the image at each of these widths in pixels, for an `<img srcset>`, like `[480, 768, 1200, 1600]`, the website's default. Up to 8 widths, each from 16 to 65535. Each width is made from the upload, at the same level and in the format the image is delivered in, and never enlarged: a width wider than the upload is made at the upload's own width, once. In a multipart form, repeat `responsive_widths[]` or send them in one field, separated by commas. They are made a few seconds after the image finishes; `responsive` on the image lists them. Sent on another plan, the image is refused with `pro_required`. See [Responsive sizes](/docs/images#responsive-sizes).","items":{"type":"integer","minimum":16,"maximum":65535},"minItems":1,"maxItems":8},"alt_text":{"type":"boolean","description":"Write an alt text and a suggested file name for the image with AI. On by default; send `false` to leave it out. A small copy of the image goes to Anthropic, whose Claude model writes both, and they arrive a few seconds after the image finishes. Each one counts against your daily AI alt texts; once those are used up the image still compresses, without one. See [Alt text and file names](/docs/images#alt-text-and-file-names).","default":true},"alt_text_language":{"type":"string","description":"The language to write the alt text in, as one of these tags: `en` (English), `es` (Spanish), `fr` (French), `de` (German), `it` (Italian), `pt` (Portuguese), `nl` (Dutch), `pl` (Polish), `sv` (Swedish), `tr` (Turkish), `ru` (Russian), `uk` (Ukrainian), `ar` (Arabic), `fa` (Persian), `he` (Hebrew), `hi` (Hindi), `id` (Indonesian), `vi` (Vietnamese), `th` (Thai), `ja` (Japanese), `ko` (Korean), `zh-Hans` (Simplified Chinese), `zh-Hant` (Traditional Chinese). The suggested file name follows it when the language is written in the Latin alphabet, and is in English otherwise.","enum":["en","es","fr","de","it","pt","nl","pl","sv","tr","ru","uk","ar","fa","he","hi","id","vi","th","ja","ko","zh-Hans","zh-Hant"],"default":"en"},"use_suggested_name":{"type":"boolean","description":"Rename the optimized copy to the suggested file name as soon as the alt text arrives, unless it already has a new name by then: yours, or an earlier suggestion.","default":false}},"title":"RecompressImageRequest"},"RenameImageRequest":{"type":"object","description":"The new name.","properties":{"name":{"type":"string","description":"The new name, without an extension. With the extension it has to fit in 128 bytes.","examples":["team-offsite"],"maxLength":255}},"required":["name"],"title":"RenameImageRequest"},"RenameImagesRequest":{"type":"object","description":"The images, by id, and the one name they are numbered under.","properties":{"ids":{"type":"array","description":"The images, by id. 1 to 150.","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":150,"uniqueItems":true},"name":{"type":"string","description":"The name they share, without an extension.","examples":["team-offsite"],"maxLength":255}},"required":["ids","name"],"title":"RenameImagesRequest"},"Scan":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The scan's id."},"url":{"type":"string","format":"uri","description":"The page that was scanned."},"crawl_id":{"type":["string","null"],"format":"uuid","description":"The site crawl this scan is a page of, or `null` for a page scanned on its own. A crawl's pages are left out of the scan list, because the crawl lists them, and are deleted with their crawl."},"status":{"description":"Where the scanner is. `queued`: waiting for the scanner. `scanning`: the page is open and its images are being collected. `completed`: images were found and queued. `no-image-found`: the page loaded but nothing on it could be compressed. `failed`: the page could not be scanned. `cancelled`: called off before it started. The images themselves keep compressing after `completed`; watch `images_in_progress`.","$ref":"#/components/schemas/ScanStatus"},"note":{"type":["string","null"],"description":"What the scanner wrote when it finished: how many images it found and what became of each, or why it failed. `null` until then."},"settings":{"type":"object","description":"The settings every image the scan found is compressed with.","properties":{"level":{"description":"The compression level.","$ref":"#/components/schemas/CompressLevel"},"format":{"anyOf":[{"description":"The format every image is converted to, or `null` to keep each one's own.","$ref":"#/components/schemas/CompressOutputExtension"},{"type":"null"}]},"keep_metadata":{"type":"boolean","description":"Whether EXIF metadata is kept."},"width":{"type":["integer","null"],"description":"The width every image is resized to, or `null`."},"height":{"type":["integer","null"],"description":"The height every image is resized to, or `null`."},"scale":{"type":["integer","null"],"description":"The percentage every image is scaled to, or `null`."}},"required":["level","format","keep_metadata","width","height","scale"]},"skipped":{"type":"array","description":"Every image the scan found and did not compress, with why: `duplicate` (the same bytes as another address on the page, which was tried instead, or on a page of a site crawl an image another page of the crawl compressed first, which `message` names), `unsupported_format` (an SVG, say), `too_large`, `tracking_pixel`, `private_network`, `unreadable`, `unreachable` (the address failed to answer, or answered with an error), `refused` (it failed the checks every upload goes through) or `failed`. `message` says the same in a sentence. Images past your plan's per-scan limit or the scan's time budget were never fetched, so they are not listed; `note` counts them. Empty until the scan finishes.","items":{"type":"object","properties":{"url":{"type":"string"},"reason":{"$ref":"#/components/schemas/SkippedImageReason"},"message":{"type":"string"}},"required":["url","reason","message"]}},"images_count":{"type":"integer","description":"How many images the scan queued."},"images_in_progress":{"type":"integer","description":"How many of them are still queued or being compressed. The scan is done once its status has ended and this is 0."},"alt_texts_in_progress":{"type":"integer","description":"How many finished images still have an AI alt text being written for the report's `suggested_alt`. They are written one at a time, so this can take a minute after `images_in_progress` reaches 0."},"images_finished":{"type":"integer","description":"How many of them have finished."},"original_size":{"type":"integer","description":"Bytes of the finished images before compression."},"optimized_size":{"type":"integer","description":"Bytes of the same images after compression."},"saved_bytes":{"type":"integer","description":"The difference between the two."},"saved_percent":{"type":["number","null"],"description":"The same saving as a percentage, or `null` while no image has finished."},"download_url":{"type":"string","format":"uri","description":"Where to download every finished image as one zip."},"images":{"type":"array","description":"The scan's images, newest first. Only on a single scan, not in a list.","items":{"$ref":"#/components/schemas/Image"}},"audit":{"anyOf":[{"description":"The page audit: how the page shows its images (oversized files, missing dimensions, lazy loading in the wrong place, missing alt text, the largest contentful paint), measured in a browser for every image the page had, including the ones past your plan's images per scan. `null` until the scan has finished, for a scan that failed, and for one made before the audit existed. Only on a single scan, not in a list.","$ref":"#/components/schemas/ScanAudit"},{"type":"null"}]},"share_url":{"type":["string","null"],"format":"uri","description":"The page report's public link while it is shared, or `null`. The link answers only while your account is on a paid plan."},"created_at":{"type":"string","format":"date-time","description":"When the scan was queued."},"updated_at":{"type":"string","format":"date-time","description":"When it last changed."}},"required":["id","url","crawl_id","status","note","settings","skipped","images_count","images_in_progress","alt_texts_in_progress","images_finished","original_size","optimized_size","saved_bytes","saved_percent","download_url","share_url","created_at","updated_at"],"title":"Scan"},"ScanAudit":{"type":"object","properties":{"rendered":{"type":"boolean","description":"Whether a browser opened the page. `false` when only its HTML could be read: then the image addresses are known and nothing about how they are shown, so every finding count is 0."},"images_found":{"type":"integer","description":"How many image addresses the page had. `images` lists them all unless a page had more than 1000."},"largest_paint":{"type":["object","null"],"description":"The page's largest contentful paint (LCP): the biggest thing in the first screen, which is when a visitor sees the page as loaded. `null` when it could not be measured.","properties":{"kind":{"type":"string","description":"`image` (a picture or a background), `text`, or `none` when the page painted nothing.","enum":["image","text","none"]},"element":{"type":["string","null"],"description":"The element's tag, such as `img`, `h1` or `div`."},"url":{"type":["string","null"],"description":"The image's address, when it is one. The image's own entry in `images` says `largest_paint: true`."}},"required":["kind","element","url"]},"findings":{"type":"object","description":"How many images have each finding.","properties":{"oversized":{"type":"integer","description":"Images whose file is more than twice as wide and twice as tall as the space they are shown in."},"without_dimensions":{"type":"integer","description":"Images shown without width and height attributes (and no CSS aspect ratio), so the page can move as they load."},"lazy_above_fold":{"type":"integer","description":"Images in the first screen that are lazy loaded, which delays them."},"eager_below_fold":{"type":"integer","description":"Images below the first screen that are not lazy loaded, so they load before they are needed."},"missing_alt":{"type":"integer","description":"Images without alt text. An empty `alt=\"\"`, which marks an image as decorative, is not counted."},"lcp_not_prioritized":{"type":"integer","description":"1 when the largest paint is an image without `fetchpriority=\"high\"`, which would have the browser fetch it first."}},"required":["oversized","without_dimensions","lazy_above_fold","eager_below_fold","missing_alt","lcp_not_prioritized"]},"oversized_bytes":{"type":"integer","description":"About how many bytes the oversized images would shed if each were served at twice the size it is shown, the size a high density screen draws. An estimate from the share of pixels that would go."},"bytes":{"type":"integer","description":"The bytes a browser downloaded for the images listed."},"formats":{"type":"array","description":"How many images arrived in each format, the commonest first, as a browser received them: a site can send a browser WebP or AVIF and the scan's own download the original format.","items":{"type":"object","properties":{"format":{"type":"string"},"count":{"type":"integer"}},"required":["format","count"]}},"images":{"type":"array","description":"Every image address the page had, in the page's order.","items":{"$ref":"#/components/schemas/ScanAuditImage"}}},"required":["rendered","images_found","largest_paint","findings","oversized_bytes","bytes","formats","images"],"title":"ScanAudit"},"ScanAuditImage":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The image's address on the page."},"format":{"type":["string","null"],"description":"The format a browser received it in (`jpg`, `png`, `webp`, `avif`, `gif`, `svg`, ...), or `null` when it did not load as an image."},"bytes":{"type":["integer","null"],"description":"The bytes a browser downloaded for it, or `null` when it did not load as an image."},"natural_width":{"type":["integer","null"],"description":"The file's own width in pixels, or `null` when it is not shown by an `img` element or did not load."},"natural_height":{"type":["integer","null"],"description":"The file's own height in pixels."},"rendered_width":{"type":["integer","null"],"description":"The width it is shown at on a desktop screen 1366 pixels wide, the largest where the page shows it more than once. `null` when no `img` element shows it (a CSS background, a hidden image)."},"rendered_height":{"type":["integer","null"],"description":"The height it is shown at."},"above_fold":{"type":["boolean","null"],"description":"Whether it is in the first screen before scrolling, or `null` when that is not known."},"largest_paint":{"type":"boolean","description":"Whether it is the page's largest contentful paint."},"alt":{"anyOf":[{"description":"Whether it has alt text: `present`, `empty` (`alt=\"\"`, or marked as decorative) or `missing`. `null` when no `img` element shows it.","$ref":"#/components/schemas/ImageAlt"},{"type":"null"}]},"findings":{"type":"array","description":"What is worth fixing about it, empty when nothing.","items":{"$ref":"#/components/schemas/AuditFinding"}},"wasted_bytes":{"type":["integer","null"],"description":"About how many bytes it would shed at twice the size it is shown, when it is oversized; otherwise `null`."},"outcome":{"type":"string","description":"What the scan did with it. `compressed`: it is one of the scan's images (`image_id`). `skipped`: passed over, with `skip_reason`; a `duplicate` names the image it shares its bytes with in `image_id`, which on a page of a site crawl can be an image another page of the crawl compressed. `left_out`: never compressed, because the scan stopped at your plan's images per scan or its time budget, or the image has been deleted since.","enum":["compressed","skipped","left_out"]},"skip_reason":{"anyOf":[{"description":"Why it was skipped, the same codes as the scan's `skipped` list, or `null`.","$ref":"#/components/schemas/SkippedImageReason"},{"type":"null"}]},"image_id":{"type":["string","null"],"format":"uuid","description":"The id of its compressed image, or `null`."},"format_sizes":{"type":["array","null"],"description":"What the compressed file came to in each format, smallest first, when the scan's format was `auto` and more than one format was tried; otherwise `null`.","items":{"type":"object","properties":{"format":{"type":"string"},"bytes":{"type":"integer"}},"required":["format","bytes"]}},"suggested_alt":{"type":["string","null"],"description":"An AI alt text for an image the page shows without one, written from its compressed copy, or `null`: the image has alt text, the scan was asked for none, it is still being written (the scan's `alt_texts_in_progress` counts it), the day's AI alt texts were used up, or the model gave no usable answer. See [Alt text and file names](/docs/images#alt-text-and-file-names)."}},"required":["url","format","bytes","natural_width","natural_height","rendered_width","rendered_height","above_fold","largest_paint","alt","findings","wasted_bytes","outcome","skip_reason","image_id","format_sizes","suggested_alt"],"title":"ScanAuditImage"},"ScanStatus":{"type":"string","enum":["queued","scanning","completed","failed","no-image-found","cancelled"],"title":"ScanStatus"},"SendGroupSourceRequest":{"type":"object","description":"The group's source, the file it was opened for, as a multipart form.","properties":{"file":{"type":"string","format":"binary","contentMediaType":"application/octet-stream","description":"The source image: the format, bytes and dimensions the group was opened with."}},"required":["file"],"title":"SendGroupSourceRequest"},"SizeLimitStatus":{"type":"string","description":"How the optimized copy came out against the size limit it was compressed with. `under`: at or under it, at the image's own size or the one asked for. `resized`: under it, after Iminify made the image smaller in pixels because a lower quality alone could not get it there. `over`: still over it after everything Iminify could try; an animation is never fitted.\n","enum":["under","resized","over"],"title":"SizeLimitStatus"},"SkippedImageReason":{"type":"string","description":"Why a page scan passed over an image it found on the page.\n","enum":["duplicate","unsupported_format","too_large","tracking_pixel","private_network","unreadable","unreachable","refused","failed","unchanged"],"title":"SkippedImageReason"},"StoreCrawlRequest":{"type":"object","description":"The site to crawl, as a sitemap's address or a list of its pages, and the settings every image found on its pages is compressed with.","properties":{"sitemap":{"type":"string","format":"uri","description":"The address of the site's sitemap: an XML sitemap, a sitemap index or a text file with one address a line, gzipped or not. The crawl takes its first pages on the sitemap's own site, with or without `www.`, up to your plan's pages per crawl. `https://` can be left out. Send this or `pages`, not both.","maxLength":2048},"pages":{"type":"array","description":"The pages to crawl, all on one site (with or without `www.`), up to your plan's pages per crawl. `https://` can be left out of each, and an address listed twice is crawled once. A longer list is refused, not cut. Send this or `sitemap`, not both.","items":{"type":"string"}},"level":{"description":"How hard to compress. `smart` finds the lowest quality that still looks like your upload, `ultra` goes further and softens fine texture a little, `lossless` changes no pixel unless a `size_limit` needs it to, `none` only applies the format, the resize, the size limit and the metadata choice. See [Compression settings](/docs/compression-settings).","default":"smart","$ref":"#/components/schemas/CompressLevel"},"format":{"anyOf":[{"description":"Convert to this format. `auto` encodes the image in every format that can hold it and keeps the smallest. Leave it out to keep the upload's own format; a HEIC or TIFF always comes back in another one, because Iminify doesn't write either. `jpeg` is read as `jpg`.","$ref":"#/components/schemas/CompressOutputExtension"},{"type":"null"}]},"keep_metadata":{"type":"boolean","description":"Keep the EXIF metadata (camera, date, location) in the optimized copy. Off by default, which strips it; the orientation is applied to the pixels first, so a photo never comes back on its side.","default":false},"width":{"type":["integer","null"],"description":"Resize to this width in pixels. Alone, the height follows the aspect ratio. With `height` too, the image is resized to exactly that size, and its proportions change if they differ. Up to 65535.","minimum":1,"maximum":65535},"height":{"type":["integer","null"],"description":"Resize to this height in pixels, the same way as `width`. Up to 65535.","minimum":1,"maximum":65535},"scale":{"type":["integer","null"],"description":"Resize to this percentage of the original, 1 to 100. Cannot be combined with `width` or `height`.","minimum":1,"maximum":100},"alt_text":{"type":"boolean","description":"Write an AI alt text for each image a page shows with no alt attribute at all, from its compressed copy, for that page's report (`suggested_alt` on its scan). On by default; send `false` to leave it out. Each one counts against your daily AI alt texts. See [Alt text and file names](/docs/images#alt-text-and-file-names).","default":true},"alt_text_language":{"type":"string","description":"The language to write the alt text in, as one of these tags: `en` (English), `es` (Spanish), `fr` (French), `de` (German), `it` (Italian), `pt` (Portuguese), `nl` (Dutch), `pl` (Polish), `sv` (Swedish), `tr` (Turkish), `ru` (Russian), `uk` (Ukrainian), `ar` (Arabic), `fa` (Persian), `he` (Hebrew), `hi` (Hindi), `id` (Indonesian), `vi` (Vietnamese), `th` (Thai), `ja` (Japanese), `ko` (Korean), `zh-Hans` (Simplified Chinese), `zh-Hant` (Traditional Chinese). The suggested file name follows it when the language is written in the Latin alphabet, and is in English otherwise.","enum":["en","es","fr","de","it","pt","nl","pl","sv","tr","ru","uk","ar","fa","he","hi","id","vi","th","ja","ko","zh-Hans","zh-Hant"],"default":"en"}},"title":"StoreCrawlRequest"},"StoreGroupRequest":{"type":"object","description":"The image a group stands for, as you will send it, and the outputs to make from it. Iminify makes every output itself from that one image, so you never send a size file. See [Upload groups](/docs/upload-groups).","properties":{"name":{"type":"string","description":"The image's name, without its extension, like `IMG_2041`.","maxLength":125},"source":{"type":"object","description":"The image you will send as the group's source, described exactly: the upload is refused unless its format, its bytes and its width and height (as displayed, with its orientation applied) are these.","properties":{"format":{"type":"string","description":"Its format: `jpg`, `png`, `webp` or `gif`. `jpeg` is read as `jpg`.","enum":["jpg","jpeg","png","webp","gif"]},"size":{"type":"integer","description":"Its size in bytes, at most your plan's file size.","minimum":1},"width":{"type":"integer","description":"Its width in pixels.","minimum":1,"maximum":65535},"height":{"type":"integer","description":"Its height in pixels.","minimum":1,"maximum":65535}},"required":["format","size","width","height"]},"outputs":{"type":"array","description":"The outputs to make, the main one first: up to 30, each at most the source's width and height. The first output in the source's own format is the one an alt text is written for.","items":{"type":"object","properties":{"name":{"type":"string","description":"The output's name, like `thumbnail` or `medium_large`: letters, digits, dots, hyphens and underscores, up to 64, unique in the group whatever their case. It names the output's files, `thumbnail.webp` in the zip.","pattern":"^[A-Za-z0-9_][A-Za-z0-9._-]*$","maxLength":64},"width":{"type":"integer","description":"The output's width in pixels.","minimum":1,"maximum":65535},"height":{"type":"integer","description":"The output's height in pixels.","minimum":1,"maximum":65535},"crop":{"type":["array","null"],"description":"Where to cut a cropped output, across then down: `start`, `center` or `end` each, like `[\"center\", \"center\"]`. The source is scaled to cover the output, then cut at these anchors, as WordPress crops a size. Leave it out for an output that keeps the source's shape.","items":{"$ref":"#/components/schemas/CropAnchor"},"minItems":2,"maxItems":2},"size":{"type":["integer","null"],"description":"The bytes of the copy of this output you already have, if any. A file made for the output replaces your copy only when it is smaller.","minimum":1}},"required":["name","width","height"]},"minItems":1},"formats":{"type":"array","description":"The formats to make each output in: `original` is the source's own, `webp` and `avif` a copy beside it. A WebP source's `webp` is its own format, made once. Leave it out for `original` alone.","items":{"$ref":"#/components/schemas/GroupFormat"},"minItems":1,"uniqueItems":true},"level":{"description":"How hard to compress every output. `smart` finds the lowest quality that still looks like the source, `ultra` goes further and softens fine texture a little, `lossless` changes no pixel, `none` only resizes, crops and converts. See [Compression settings](/docs/compression-settings).","default":"smart","$ref":"#/components/schemas/CompressLevel"},"keep_metadata":{"type":"boolean","description":"Keep the EXIF metadata (camera, date, location) in the outputs. Off by default, which strips it; the orientation is applied to the pixels first.","default":false},"alt_text":{"type":"boolean","description":"Write an AI alt text and a suggested file name for the main output once the source arrives. Off by default for a group. A small copy of the image goes to Anthropic, whose Claude model writes both; it counts one against your daily AI alt texts, and once those are used up the group still runs, without one. See [Alt text and file names](/docs/images#alt-text-and-file-names).","default":false},"alt_text_language":{"type":"string","description":"The language to write the alt text in, as one of these tags: `en` (English), `es` (Spanish), `fr` (French), `de` (German), `it` (Italian), `pt` (Portuguese), `nl` (Dutch), `pl` (Polish), `sv` (Swedish), `tr` (Turkish), `ru` (Russian), `uk` (Ukrainian), `ar` (Arabic), `fa` (Persian), `he` (Hebrew), `hi` (Hindi), `id` (Indonesian), `vi` (Vietnamese), `th` (Thai), `ja` (Japanese), `ko` (Korean), `zh-Hans` (Simplified Chinese), `zh-Hant` (Traditional Chinese). The suggested file name follows it when the language is written in the Latin alphabet, and is in English otherwise.","enum":["en","es","fr","de","it","pt","nl","pl","sv","tr","ru","uk","ar","fa","he","hi","id","vi","th","ja","ko","zh-Hans","zh-Hant"],"default":"en"},"ephemeral":{"type":"boolean","description":"Delete the group once you've saved its files, for a caller that keeps its own copies. Send `DELETE /groups/{id}` once you've written them; a group you leave is deleted for you about 24 hours after its last file finished, its files and its source with it. Off by default, which keeps the group until you delete it. See [Deleting images once saved](/docs/images#deleting-images-once-saved).","default":false},"priority":{"description":"`background` for bulk work nobody waits on, such as a whole library: its files are made after every image sent without it, on every plan, and count against your limits the same. See [Bulk work](/docs/images#bulk-work).","default":"interactive","$ref":"#/components/schemas/CompressPriority"}},"required":["name","source","outputs"],"title":"StoreGroupRequest"},"StoreImageRequest":{"type":"object","description":"The image, as a file or as the address to fetch it from, and the settings to compress it with.","properties":{"file":{"type":"string","format":"binary","contentMediaType":"application/octet-stream","description":"The image. Send either this or `url`."},"url":{"type":"string","format":"uri","description":"The public address of the image to fetch. Send either this or `file`.","maxLength":2048},"folder":{"type":["string","null"],"description":"The folder the image belongs in, like `holiday/beach`, so a zip of several images (`POST /images/download`) puts it there. Either slash separates folders, and characters a file name can't hold become a hyphen. Keeping folders comes with a paid plan; sent on another plan, the image is refused with `pro_required`.","maxLength":1024},"ephemeral":{"type":"boolean","description":"Delete the image once you've saved it, for a caller that keeps its own copy. Send `DELETE /images/{id}` once you've written the result; anything you leave is deleted for you about 24 hours after the image finished, its files with it. Off by default, which keeps the image until you delete it. See [Deleting images once saved](/docs/images#deleting-images-once-saved).","default":false},"priority":{"description":"`background` for bulk work nobody waits on, such as a whole library: it runs after every image sent without it, on every plan, and counts against your limits the same. See [Bulk work](/docs/images#bulk-work).","default":"interactive","$ref":"#/components/schemas/CompressPriority"},"level":{"description":"How hard to compress. `smart` finds the lowest quality that still looks like your upload, `ultra` goes further and softens fine texture a little, `lossless` changes no pixel unless a `size_limit` needs it to, `none` only applies the format, the resize, the size limit and the metadata choice. See [Compression settings](/docs/compression-settings).","default":"smart","$ref":"#/components/schemas/CompressLevel"},"format":{"anyOf":[{"description":"Convert to this format. `auto` encodes the image in every format that can hold it and keeps the smallest. Leave it out to keep the upload's own format; a HEIC or TIFF always comes back in another one, because Iminify doesn't write either. `jpeg` is read as `jpg`.","$ref":"#/components/schemas/CompressOutputExtension"},{"type":"null"}]},"keep_metadata":{"type":"boolean","description":"Keep the EXIF metadata (camera, date, location) in the optimized copy. Off by default, which strips it; the orientation is applied to the pixels first, so a photo never comes back on its side.","default":false},"width":{"type":["integer","null"],"description":"Resize to this width in pixels. Alone, the height follows the aspect ratio. With `height` too, the image is resized to exactly that size, and its proportions change if they differ. Up to 65535.","minimum":1,"maximum":65535},"height":{"type":["integer","null"],"description":"Resize to this height in pixels, the same way as `width`. Up to 65535.","minimum":1,"maximum":65535},"scale":{"type":["integer","null"],"description":"Resize to this percentage of the original, 1 to 100. Cannot be combined with `width` or `height`.","minimum":1,"maximum":100},"size_limit":{"type":["integer","null"],"description":"The most the optimized copy may weigh, in kilobytes of 1,000 bytes, from 5 KB up. Iminify lowers the quality until the file fits, and makes the image smaller in pixels when the lowest quality is still over it. The limit comes before the level: under `lossless` or `none`, a file over it is encoded again with loss. A PNG or GIF kept in its own format that is over the limit comes back in a format with a quality to lower (JPG, WebP or AVIF), so `png` as the `format` is refused; an animation is never fitted. `size_limit_status` on the finished image says how it came out. See [Size limit](/docs/compression-settings#size-limit).","minimum":5},"responsive_widths":{"type":["array","null"],"description":"Paid plans: also make the image at each of these widths in pixels, for an `<img srcset>`, like `[480, 768, 1200, 1600]`, the website's default. Up to 8 widths, each from 16 to 65535. Each width is made from the upload, at the same level and in the format the image is delivered in, and never enlarged: a width wider than the upload is made at the upload's own width, once. In a multipart form, repeat `responsive_widths[]` or send them in one field, separated by commas. They are made a few seconds after the image finishes; `responsive` on the image lists them. Sent on another plan, the image is refused with `pro_required`. See [Responsive sizes](/docs/images#responsive-sizes).","items":{"type":"integer","minimum":16,"maximum":65535},"minItems":1,"maxItems":8},"alt_text":{"type":"boolean","description":"Write an alt text and a suggested file name for the image with AI. On by default; send `false` to leave it out. A small copy of the image goes to Anthropic, whose Claude model writes both, and they arrive a few seconds after the image finishes. Each one counts against your daily AI alt texts; once those are used up the image still compresses, without one. See [Alt text and file names](/docs/images#alt-text-and-file-names).","default":true},"alt_text_language":{"type":"string","description":"The language to write the alt text in, as one of these tags: `en` (English), `es` (Spanish), `fr` (French), `de` (German), `it` (Italian), `pt` (Portuguese), `nl` (Dutch), `pl` (Polish), `sv` (Swedish), `tr` (Turkish), `ru` (Russian), `uk` (Ukrainian), `ar` (Arabic), `fa` (Persian), `he` (Hebrew), `hi` (Hindi), `id` (Indonesian), `vi` (Vietnamese), `th` (Thai), `ja` (Japanese), `ko` (Korean), `zh-Hans` (Simplified Chinese), `zh-Hant` (Traditional Chinese). The suggested file name follows it when the language is written in the Latin alphabet, and is in English otherwise.","enum":["en","es","fr","de","it","pt","nl","pl","sv","tr","ru","uk","ar","fa","he","hi","id","vi","th","ja","ko","zh-Hans","zh-Hant"],"default":"en"},"use_suggested_name":{"type":"boolean","description":"Rename the optimized copy to the suggested file name as soon as the alt text arrives, unless it already has a new name by then: yours, or an earlier suggestion.","default":false}},"title":"StoreImageRequest"},"StoreMonitorRequest":{"type":"object","description":"The site crawl to check every week.","properties":{"crawl_id":{"type":"string","format":"uuid","description":"The id of one of your site crawls that scanned at least one page. The check crawls the site the same way every week: its sitemap read again, or the same pages, with the same settings."}},"required":["crawl_id"],"title":"StoreMonitorRequest"},"StoreScanRequest":{"type":"object","description":"The page to scan and the settings every image found on it is compressed with.","properties":{"url":{"type":"string","format":"uri","description":"The page to scan. `https://` can be left out.","maxLength":2048},"level":{"description":"How hard to compress. `smart` finds the lowest quality that still looks like your upload, `ultra` goes further and softens fine texture a little, `lossless` changes no pixel unless a `size_limit` needs it to, `none` only applies the format, the resize, the size limit and the metadata choice. See [Compression settings](/docs/compression-settings).","default":"smart","$ref":"#/components/schemas/CompressLevel"},"format":{"anyOf":[{"description":"Convert to this format. `auto` encodes the image in every format that can hold it and keeps the smallest. Leave it out to keep the upload's own format; a HEIC or TIFF always comes back in another one, because Iminify doesn't write either. `jpeg` is read as `jpg`.","$ref":"#/components/schemas/CompressOutputExtension"},{"type":"null"}]},"keep_metadata":{"type":"boolean","description":"Keep the EXIF metadata (camera, date, location) in the optimized copy. Off by default, which strips it; the orientation is applied to the pixels first, so a photo never comes back on its side.","default":false},"width":{"type":["integer","null"],"description":"Resize to this width in pixels. Alone, the height follows the aspect ratio. With `height` too, the image is resized to exactly that size, and its proportions change if they differ. Up to 65535.","minimum":1,"maximum":65535},"height":{"type":["integer","null"],"description":"Resize to this height in pixels, the same way as `width`. Up to 65535.","minimum":1,"maximum":65535},"scale":{"type":["integer","null"],"description":"Resize to this percentage of the original, 1 to 100. Cannot be combined with `width` or `height`.","minimum":1,"maximum":100},"alt_text":{"type":"boolean","description":"Write an AI alt text for each image the page shows with no alt attribute at all, from its compressed copy, for the report's `suggested_alt`. On by default; send `false` to leave it out. Images marked decorative (`alt=\"\"`) or that already have alt text get none. Each one counts against your daily AI alt texts. See [Alt text and file names](/docs/images#alt-text-and-file-names).","default":true},"alt_text_language":{"type":"string","description":"The language to write the alt text in, as one of these tags: `en` (English), `es` (Spanish), `fr` (French), `de` (German), `it` (Italian), `pt` (Portuguese), `nl` (Dutch), `pl` (Polish), `sv` (Swedish), `tr` (Turkish), `ru` (Russian), `uk` (Ukrainian), `ar` (Arabic), `fa` (Persian), `he` (Hebrew), `hi` (Hindi), `id` (Indonesian), `vi` (Vietnamese), `th` (Thai), `ja` (Japanese), `ko` (Korean), `zh-Hans` (Simplified Chinese), `zh-Hant` (Traditional Chinese). The suggested file name follows it when the language is written in the Latin alphabet, and is in English otherwise.","enum":["en","es","fr","de","it","pt","nl","pl","sv","tr","ru","uk","ar","fa","he","hi","id","vi","th","ja","ko","zh-Hans","zh-Hant"],"default":"en"}},"required":["url"],"title":"StoreScanRequest"},"UpdateMonitorRequest":{"type":"object","description":"What to change on the check.","properties":{"emails":{"type":"boolean","description":"`false` stops the check's emails and keeps the check running; `true` turns them back on."}},"required":["emails"],"title":"UpdateMonitorRequest"},"WriteAltTextRequest":{"type":"object","description":"The language to write the alt text in, and whether its suggested name renames the download. Both are optional.","properties":{"alt_text_language":{"type":"string","description":"The language to write the alt text in, as one of these tags: `en` (English), `es` (Spanish), `fr` (French), `de` (German), `it` (Italian), `pt` (Portuguese), `nl` (Dutch), `pl` (Polish), `sv` (Swedish), `tr` (Turkish), `ru` (Russian), `uk` (Ukrainian), `ar` (Arabic), `fa` (Persian), `he` (Hebrew), `hi` (Hindi), `id` (Indonesian), `vi` (Vietnamese), `th` (Thai), `ja` (Japanese), `ko` (Korean), `zh-Hans` (Simplified Chinese), `zh-Hant` (Traditional Chinese). The suggested file name follows it when the language is written in the Latin alphabet, and is in English otherwise.","enum":["en","es","fr","de","it","pt","nl","pl","sv","tr","ru","uk","ar","fa","he","hi","id","vi","th","ja","ko","zh-Hans","zh-Hant"],"default":"en"},"use_suggested_name":{"type":"boolean","description":"Rename the optimized copy to the suggested file name as soon as the alt text arrives, unless it already has a new name by then: yours, or an earlier suggestion.","default":false}},"title":"WriteAltTextRequest"},"Error":{"type":"object","description":"An error.","properties":{"message":{"type":"string","description":"What went wrong, in a sentence you can show a person."},"code":{"type":"string","description":"What went wrong, as a code a program can branch on. Every code is on the errors page.","enum":["unauthenticated","email_not_verified","account_banned","scans_not_available","pro_required","site_key_not_allowed","site_key_required","not_found","method_not_allowed","image_in_progress","image_not_cancellable","image_not_retryable","image_not_finished","responsive_not_ready","image_not_shareable","scan_in_progress","scan_not_cancellable","scan_not_retryable","part_of_crawl","monitor_limit_reached","crawl_has_no_pages","report_not_available","group_closed","site_moved","pairing_pending","uploads_waiting","pairing_closed","payload_too_large","animation_not_resizable","outputs_refused","validation_failed","rate_limited","daily_limit_reached","server_error","start_failed","delete_failed","download_failed","alt_text_not_available","http_error"]}},"required":["message","code"]},"ValidationError":{"type":"object","description":"A request that failed validation.","properties":{"message":{"type":"string","description":"What went wrong, in a sentence you can show a person."},"code":{"type":"string","description":"What went wrong, as a code a program can branch on. Every code is on the errors page.","enum":["unauthenticated","email_not_verified","account_banned","scans_not_available","pro_required","site_key_not_allowed","site_key_required","not_found","method_not_allowed","image_in_progress","image_not_cancellable","image_not_retryable","image_not_finished","responsive_not_ready","image_not_shareable","scan_in_progress","scan_not_cancellable","scan_not_retryable","part_of_crawl","monitor_limit_reached","crawl_has_no_pages","report_not_available","group_closed","site_moved","pairing_pending","uploads_waiting","pairing_closed","payload_too_large","animation_not_resizable","outputs_refused","validation_failed","rate_limited","daily_limit_reached","server_error","start_failed","delete_failed","download_failed","alt_text_not_available","http_error"]},"errors":{"type":"object","description":"Each field that failed, with its messages.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","code","errors"]}}}}