Quickstart Guide
Sign in, grab a sandbox key, and call any endpoint on your plan — documents, dev tools, OCR, and more.
Get your API key
Sign in to your Sigli workspace and copy your API key from the API Keys page. The same key works for document conversion, dev tools API, OCR, and every feature on your plan. Use sig_test_ in development — no credits used, capped at 50 runs a day.
# Your API key looks like this:
sig_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Or a sandbox key for testing:
sig_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxMake your first conversion
POST to /v1/process with X-Convert-Type: html-to-pdf. Two input modes: JSON body with a source string, or multipart file upload with -F file=@doc.html. Response is binary PDF. Pick your language below.
import requests
response = requests.post(
"https://api.sigli.dev/v1/process",
headers={
"X-API-Key": "sig_test_your_key_here",
"X-Convert-Type": "html-to-pdf",
},
json={
"source": "<h1>Tax Invoice KOS/2026-27/0418</h1><p>Kaveri Office Systems Pvt. Ltd. to Nandi Hills Organics LLP</p><table><tr><td>Business laptop 14 in, i5/16 GB x 6</td><td>Rs 3,74,700.00</td></tr><tr><td>CGST 9% + SGST 9%</td><td>Rs 67,446.00</td></tr></table>",
"format": "A4",
"margin": {"top": "20mm", "bottom": "20mm"},
},
)
response.raise_for_status()
with open("invoice.pdf", "wb") as out:
out.write(response.content)Customize your output
All body fields are flat — no nested options wrapper. Use source for inline HTML or file=@doc.html for multipart upload. Same params work for both modes.
# JSON body — inline HTML with layout params
POST /v1/process (Content-Type: application/json)
X-Convert-Type: html-to-pdf
{
"source": "<style>body{font-family:sans-serif}</style><h1>Report</h1>",
"format": "Letter",
"margin": { "top": "25mm", "bottom": "25mm", "left": "20mm", "right": "20mm" },
"header": { "html": "<div style='font-size:9px'>Page <span class=pageNumber></span></div>" },
"print_background": true
}
# File upload — same params as form fields
curl ... -H "X-Convert-Type: html-to-pdf" \
-F "file=@report.html;type=text/html" \
-F "format=Letter" \
-F 'margin={"top":"25mm","bottom":"25mm","left":"20mm","right":"20mm"}' \
-F "print_background=true"Batch many documents (Pro plan and above)
POST /v1/batch/submit queues up to 500 items with the same X-Convert-Type and credit metering as /v1/process. Poll GET /v1/batch/{id} or set webhook_url for batch.completed. Batch isn't included on Starter or the free trial (the call returns 402 plan_upgrade_required) — on those plans, call /v1/process from step 2 once per document instead.
curl -X POST https://api.sigli.dev/v1/batch/submit \
-H "X-API-Key: sig_test_xxx" \
-H "X-Convert-Type: html-to-pdf" \
-H "Content-Type: application/json" \
-d '{
"items": [
{ "source": "<h1>Doc 1</h1>" },
{ "source": "<h1>Doc 2</h1>" }
]
}'
# Mixed types: X-Batch-Mode: mixed + per-item "type" or file_urlHandle the response
Binary PDF is the default and works on every plan — start there. Optionally add return_url: true for a signed URL (15 min TTL) instead of bytes; it needs cloud file storage, and a deployment without it answers 503 feature_unavailable, so keep the binary response as your fallback. Supply a webhook field for async delivery — you get a job_id back and Sigli POSTs the result when it's ready.
# Binary PDF (default, every plan) — save to file
curl ... --output doc.pdf
# Optional: signed URL instead of bytes (needs cloud file storage;
# 503 feature_unavailable when it isn't enabled)
curl ... \
-d '{"source":"<h1>Doc</h1>","format":"A4","return_url":true}'
# → {"success":true,"data":{"url":"https://...","size_bytes":24891}}
# Async — supply webhook URL for large documents
curl ... \
-d '{"source":"<h1>Doc</h1>","format":"A4","webhook":"https://your.app/hook"}'
# → {"success":true,"data":{"job_id":"uuid","status":"queued","poll_url":"/jobs/uuid"}}
# Poll job status
curl https://api.sigli.dev/jobs/uuid \
-H "X-API-Key: sig_test_xxx"
# → {"success":true,"data":{"status":"completed","credits_charged":1}}Go live
Swap your sandbox key for a live key — that's it. The same request that worked in testing works in production. Sandbox runs are free but capped at 50 a day; live runs are billed by credits.
# Production-ready request:
curl -X POST https://api.sigli.dev/v1/process \
-H "X-API-Key: sig_live_your_live_key" \
-H "X-Convert-Type: html-to-pdf" \
-H "Content-Type: application/json" \
-d '{"source":"<h1>Production PDF</h1>","format":"A4"}' \
--output prod.pdf
# That's it — source, format, and the right headers.
# No sandbox flag needed; omitting it charges quota.