Response Modes
Every conversion endpoint supports three response modes. Choose based on your architecture.
Binary (default)
The response body is raw PDF or image bytes. Pipe it straight to a file. Use when you want to stream the file to your users or save it to disk immediately.
Return URL
Add return_url: true. Sigli stores the output for 15 minutes and returns a signed HTTPS URL. Useful for browser redirects or handing the link to another service.
Async + Webhook (202)
Supply a webhook field. Sigli queues the job and returns HTTP 202 with a job_id. When done it POSTs the result to your webhook. Poll GET /v1/jobs/:id as fallback.
1. Binary (default)
# Response: Content-Type: application/pdf, body = raw bytes
curl -X POST https://api.sigli.dev/v1/process \
-H "X-API-Key: sig_live_xxx" \
-H "X-Convert-Type: html-to-pdf" \
-H "Content-Type: application/json" \
-d '{ "source": "<h1>Hi</h1>", "format": "A4" }' \
--output output.pdf2. Return URL
# Response: JSON with signed URL (valid 15 min)
curl -X POST https://api.sigli.dev/v1/process \
-H "X-API-Key: sig_live_xxx" \
-H "X-Convert-Type: html-to-pdf" \
-H "Content-Type: application/json" \
-d '{ "source": "<h1>Hi</h1>", "format": "A4", "return_url": true }'
# HTTP 200
# {
# "success": true,
# "data": { "url": "https://cdn.sigli.dev/out/req_xyz.pdf?sig=...", "size_bytes": 24891 }
# }3. Async + Webhook (202)
# Step 1: Submit with a webhook URL
curl -X POST https://api.sigli.dev/v1/process \
-H "X-API-Key: sig_live_xxx" \
-H "X-Convert-Type: html-to-pdf" \
-H "Content-Type: application/json" \
-d '{ "source": "<h1>Hi</h1>", "format": "A4", "webhook": "https://your.app/hook" }'
# HTTP 202 Accepted
# { "success": true, "data": { "job_id": "uuid", "status": "queued", "poll_url": "/jobs/uuid" } }
# Step 2: Poll job status (webhook is primary; polling is the fallback)
curl https://api.sigli.dev/jobs/uuid \
-H "X-API-Key: sig_live_xxx"
# { "success": true, "data": { "status": "completed", "credits_charged": 1 } }
# status: queued | processing | completed | failed