Document & website conversion
Convert DOCX pages, XLSX sheets, PPTX slides and public web pages into PNG, JPEG or WebP with authenticated, project-scoped jobs.
On this page
Quote, submit and retrieve
Send either a project X-API-Key or customer bearer token, never both. Check GET /v1/projects/{projectId}/conversions/capabilities for enabled engines, formats and current bounds. Access also follows your plan.
- QuoteRequest a processing quote with the matching kind and
units: 1. - SubmitSend the quote ID as
X-Quote-IDand a new UUIDv4Idempotency-Key. Office inputs use multipart fieldfile; website input is JSON. All rendering options are query parameters. - Check statusA successful submission returns
202with a JSON job envelope. Poll the job until completed, failed or cancelled. Queued, running and cancelling are intermediate states. - Retrieve the outputDownload the completed image before
expiresAt, orPOSTto its save endpoint to retain a private artifact. Inspectresult.warningsbefore publishing.
// Node.js 20+. Set IMAZEO_API_ORIGIN, IMAZEO_PROJECT_ID and IMAZEO_API_KEY.
import { readFile, writeFile } from 'node:fs/promises';
import { randomUUID } from 'node:crypto';
import { setTimeout as delay } from 'node:timers/promises';
const { IMAZEO_API_ORIGIN: origin, IMAZEO_PROJECT_ID: project, IMAZEO_API_KEY: key } = process.env;
if (!origin || !project || !key) throw new Error('Set the API origin, project ID and key');
const base = '/v1/projects/' + encodeURIComponent(project);
async function json(path, init = {}) {
const response = await fetch(new URL(base + path, origin), {
...init, redirect: 'error', signal: AbortSignal.timeout(120000),
headers: { 'X-API-Key': key, ...init.headers },
});
const envelope = await response.json();
if (!response.ok || envelope.success !== true)
throw new Error(envelope.error?.code ?? 'REQUEST_FAILED');
return envelope.data;
}
const quote = await json('/credits/quote', {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ kind: 'docx.render', units: 1 }),
});
const form = new FormData();
form.append('file', new Blob([await readFile('document.docx')]), 'document.docx');
// Keep this key if you need to recover this exact request.
const operationKey = randomUUID();
let job = await json('/conversions?page=1&format=png&scale=1.5', {
method: 'POST', body: form,
headers: { 'X-Quote-ID': quote.id, 'Idempotency-Key': operationKey },
});
for (let attempt = 0; attempt < 120; attempt++) {
if (job.status === 'completed') break;
if (['failed', 'cancelled'].includes(job.status))
throw new Error(job.errorCode ?? job.status);
await delay(1000);
job = await json('/conversions/' + encodeURIComponent(job.id));
}
if (job.status !== 'completed') throw new Error('Still processing; check this job again later');
const response = await fetch(new URL(base + '/conversions/' + encodeURIComponent(job.id) + '/download', origin), {
headers: { 'X-API-Key': key }, redirect: 'error', signal: AbortSignal.timeout(120000),
});
if (!response.ok) throw new Error('DOWNLOAD_FAILED');
await writeFile('document-page.png', new Uint8Array(await response.arrayBuffer()));Conversion endpoints
Prefix these paths with /v1/projects/{projectId}. Keep the same key and input when recovering a submission with an unknown outcome.
| Method | Project-relative path | Purpose |
|---|---|---|
GET | /conversions/capabilities | Engine availability and bounds |
POST | /conversions | DOCX file; docx.render quote |
POST | /conversions/xlsx | XLSX file; xlsx.render quote |
POST | /conversions/pptx | PPTX file; pptx.render quote |
POST | /conversions/website | JSON URL; website.capture quote |
GET | /conversions/{id} | Owned job status, expiry, result metadata and error code |
GET | /conversions/{id}/download | Completed PNG, JPEG or WebP bytes |
POST | /conversions/{id}/save | Save a completed result as a private artifact |
POST | /conversions/{id}/cancel | Request cancellation; inspect returned state |
GET | /conversions/lookup?key={key} | Recover a submission using its idempotency key |
GET | /conversions?engine=docx | Recent jobs for one engine; not a paginated history API |
DOCX pages
Upload a DOCX file to /conversions. Select page (1–50), or use fitSinglePage to lay the content out as one page. Control Word page breaks, headers, footers, footnotes, endnotes and tracked changes. Repair and normalization options help with document structure; they do not guarantee identical Office rendering.
| Field | Type / values | Contract |
|---|---|---|
page | number | Optional. Default: 1. Min 1. Max 50. |
scale | number | Optional. Default: 1.5. Min 0.1. Max 6. |
format | png | jpeg | webp | Optional. Default: png. |
quality | number | Optional. Default: 90. Min 1. Max 100. |
fitSinglePage | boolean | Optional. Default: false. |
honorWordPageBreaks | boolean | Optional. Default: true. |
renderHeaders | boolean | Optional. Default: true. |
renderFooters | boolean | Optional. Default: true. |
renderFootnotes | boolean | Optional. Default: true. |
renderEndnotes | boolean | Optional. Default: true. |
repairBrokenRelationships | boolean | Optional. Default: true. |
unwrapSdt | boolean | Optional. Default: true. |
collapseMcAlternate | boolean | Optional. Default: true. |
ignoreImageWrap | boolean | Optional. Default: false. |
ignoreTableWrap | boolean | Optional. Default: false. |
applyWordChrome | boolean | Optional. Default: true. |
normalizeTheme | boolean | Optional. Default: true. |
renderChanges | boolean | Optional. Default: false. |
XLSX sheets and ranges
Upload an XLSX file to /conversions/xlsx with an xlsx.render quote. Choose a 1-based sheet index (1–50), an optional A1 cell range and either sheet or print render mode. In print mode, page selects the print page. Gridlines default off. Paper size can use saved settings, A3, A4, A5, Letter, Legal, Tabloid or B5.
/conversions/xlsx?sheet=1&range=A1%3AF20&renderMode=sheet&showGridLines=true&format=webp| Field | Type / values | Contract |
|---|---|---|
page | number | Optional. Default: 1. Min 1. Max 50. |
scale | number | Optional. Default: 1.5. Min 0.1. Max 6. |
format | png | jpeg | webp | Optional. Default: png. |
quality | number | Optional. Default: 90. Min 1. Max 100. |
engine | xlsx | Optional. Default: xlsx. |
sheet | number | Optional. Default: 1. Min 1. Max 50. |
renderMode | sheet | print | Optional. Default: sheet. |
range | string | Optional. Default: . Up to 40 characters. Optional A1:B20 cell range. |
showGridLines | boolean | Optional. Default: false. |
paperSize | saved | A3 | A4 | A5 | Letter | Legal | Tabloid | B5 | Optional. Default: saved. |
PPTX slides
Upload a PPTX file to /conversions/pptx with a pptx.render quote. The 1-based page parameter selects a slide (1–50). Choose scale, format and quality for that one slide. Output is a still image; animations, transitions and embedded playback are not reproduced as interactive media.
| Field | Type / values | Contract |
|---|---|---|
page | number | Optional. Default: 1. Min 1. Max 50. |
scale | number | Optional. Default: 1.5. Min 0.1. Max 6. |
format | png | jpeg | webp | Optional. Default: png. |
quality | number | Optional. Default: 90. Min 1. Max 100. |
engine | pptx | Optional. Default: pptx. |
Public website captures
POST JSON {"url":"https://example.com/"} to /conversions/website with a website.capture quote. Options go in the query string. The URL must be public HTTP(S), up to 2,048 characters, with no fragment. Cookies, credentials, login sessions and private destinations are not supported. Redirects and page resources are also validated.
| mode | Selection |
|---|---|
| viewport | Visible area at width × height; default 1440 × 900 |
fullPage | Full page within pixel/output bounds |
| element | A required CSS selector |
| clip | clipX, clipY, clipWidth and clipHeight define a region |
Viewport width is 240–3840 and height is 240–2160. waitUntil accepts load, domcontentloaded (default) or networkidle2; waitMs adds 0–3000 ms (default 250). JavaScript, tracker blocking, auto-scroll, animation freezing and reduced motion default on. Choose light/dark color scheme and optional transparent background. JPEG cannot preserve transparency.
Capture query parameters
| Field | Type / values | Contract |
|---|---|---|
page | number | Optional. Default: 1. Min 1. Max 50. |
scale | number | Optional. Default: 1.5. Min 0.1. Max 6. |
format | png | jpeg | webp | Optional. Default: png. |
quality | number | Optional. Default: 90. Min 1. Max 100. |
engine | website | Optional. Default: website. |
mode | viewport | fullPage | element | clip | Optional. Default: viewport. |
width | number | Optional. Default: 1440. Min 240. Max 3840. |
height | number | Optional. Default: 900. Min 240. Max 2160. |
selector | string | Optional. Default: . Up to 200 characters. |
clipX | number | Optional. Default: 0. Min 0. Max 30000. |
clipY | number | Optional. Default: 0. Min 0. Max 30000. |
clipWidth | number | Optional. Default: 800. Min 1. Max 3840. |
clipHeight | number | Optional. Default: 600. Min 1. Max 16000. |
javascriptEnabled | boolean | Optional. Default: true. |
blockTrackers | boolean | Optional. Default: true. |
autoScroll | boolean | Optional. Default: true. |
freezeAnimations | boolean | Optional. Default: true. |
omitBackground | boolean | Optional. Default: false. |
colorScheme | light | dark | Optional. Default: light. |
reducedMotion | boolean | Optional. Default: true. |
waitUntil | load | domcontentloaded | networkidle2 | Optional. Default: domcontentloaded. |
waitMs | number | Optional. Default: 250. Min 0. Max 3000. |
Formats, limits and result lifetime
Office inputs are DOCX, XLSX and PPTX, not older DOC/XLS/PPT binaries or PDFs. Output formats are PNG (default), JPEG and WebP. Shared defaults are scale 1.5 (0.1–6) and quality 90 (1–100). Source content, fonts and complex layouts can differ from the original application; inspect the result and any warnings.
Read capabilities for current upload, pixel, output-byte and temporary-result limits. The configured result lifetime defaults to 15 minutes and is represented by the job’s actual expiry. Large files, encrypted or malformed documents, unsupported content, blocked websites and requests above your account limits can fail. Do not treat a 202 response as a completed conversion.
Download or save before expiry. Saving keeps the completed file in private Outputs and consumes storage; it does not create a public delivery URL. A saved artifact is retrieved using the artifact APIs. Use a new key for a genuinely new conversion and inspect errors before retrying.
