DocFlow API Reference
201 endpoints across 19 categories. Every operation available via a single POST request.
Authentication
All API requests require an API key. Include it in the X-API-Key header with every request.
X-API-Key: df_your_api_key_here
You can also pass the key as a Bearer token or ?apiKey= query parameter, but the header method is recommended.
Token System
Each operation costs tokens. Tokens are deducted on successful completion only. Response headers include:
X-Tokens-Used— tokens consumed by this requestX-Tokens-Remaining— your remaining balance
Base URL
All endpoint paths below are relative to this base URL.
Error Codes
| Status | Meaning | Resolution |
|---|---|---|
400 | Bad Request | Check your request body and parameters |
401 | Unauthorized | Invalid or missing API key |
402 | Payment Required | Insufficient tokens — top up your balance |
403 | Forbidden | Account deactivated |
500 | Server Error | Internal error — contact support |
503 | Service Unavailable | Required service not configured (e.g. Graph API, DocuSign) |
Paper Sizes
Every PDF-producing endpoint resolves paper against one shared table. The parameter is
pageSize (inside options where the endpoint has an options bag;
the legacy keys format, paperSize, and size are still read).
The default is Letter when no size is given.
An unknown size, unit, or orientation returns 400 with the valid values listed —
nothing ever falls back silently to another size.
| Name | Inches | Millimeters | Points | Notes |
|---|---|---|---|---|
Letter | 8.5 × 11 | 216 × 279 | 612 × 792 | Default. Aliases: US Letter, ANSI A |
Legal | 8.5 × 14 | 216 × 356 | 612 × 1008 | Alias: US Legal |
Tabloid | 11 × 17 | 279 × 432 | 792 × 1224 | Alias: ANSI B |
Ledger | 17 × 11 | 432 × 279 | 1224 × 792 | Landscape by definition |
Executive | 7.25 × 10.5 | 184 × 267 | 522 × 756 | |
Statement | 5.5 × 8.5 | 140 × 216 | 396 × 612 | Aliases: Half Letter, Invoice |
Folio | 8.5 × 13 | 216 × 330 | 612 × 936 | Alias: Foolscap |
A0 | 33.11 × 46.81 | 841 × 1189 | 2383.94 × 3370.39 | Too large for DOCX output |
A1 | 23.39 × 33.11 | 594 × 841 | 1683.78 × 2383.94 | Too large for DOCX output |
A2 | 16.54 × 23.39 | 420 × 594 | 1190.55 × 1683.78 | Too large for DOCX output |
A3 | 11.69 × 16.54 | 297 × 420 | 841.89 × 1190.55 | |
A4 | 8.27 × 11.69 | 210 × 297 | 595.28 × 841.89 | |
A5 | 5.83 × 8.27 | 148 × 210 | 419.53 × 595.28 | |
A6 | 4.13 × 5.83 | 105 × 148 | 297.64 × 419.53 | |
B4 | 9.84 × 13.9 | 250 × 353 | 708.66 × 1000.63 | ISO B4 |
B5 | 6.93 × 9.84 | 176 × 250 | 498.9 × 708.66 | ISO B5 |
Names are case- and punctuation-insensitive (us-letter, US Letter, and
LETTER all work). The A-series also accepts ISO A4-style spellings.
Orientation
Pass orientation alongside the size: "portrait" or "landscape".
Landscape means the long edge is horizontal — it normalizes rather than blindly swapping, so
asking for landscape Ledger (already landscape) leaves it alone. Omit it to keep the
size's own orientation.
Custom dimensions
Instead of a name, pageSize accepts an object:
{ "options": { "pageSize": { "width": 4, "height": 6, "units": "in" } } }
units is one of pt (default), px (CSS pixels, 1/96 in),
in, mm, cm. Each side must be between 1 pt and
14400 pt (200 in) — the PDF format's own limit.
Where it applies
ConvertHtmlToPdf, ConvertMarkdownToPdf, ConvertDocxToPdf,
ConvertTextToPdf, CaptureWebPage (PDF output), and ComposeFill
(PDF output) accept the full vocabulary above.
ConvertHtmlToDocx accepts it too, except A0-A2 (a Word page edge may not exceed 22 in).
GenerateTemplateFromData accepts the named sizes only (they set the template's
@page rule). ResizePdfPages takes explicit numeric
width/height — use the points column above.
Rate Limits
Currently there are no hard rate limits. The Azure Functions Consumption plan handles auto-scaling. Heavy operations (browser-based) may take 3-10 seconds on cold start.