Auth & Security

Every API request must include a valid API key. Keys can be managed in the API Keys section.

X-API-Key Header (recommended)

Pass your key in the X-API-Key request header:

# JSON body
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>Hello</h1>", "format": "A4" }' \
  --output result.pdf

# File upload (multipart)
curl -X POST https://api.sigli.dev/v1/process \
  -H "X-API-Key: sig_live_xxx" \
  -H "X-Convert-Type: html-to-pdf" \
  -F "file=@invoice.html;type=text/html" \
  -F "format=A4" \
  --output result.pdf

Bearer Token (portal session)

Authorization: Bearer is for a signed-in portal session token (the JWT from POST /auth/login), not your API key — passing an API key here returns 401. Most document endpoints accept either credential type interchangeably, so a logged-in user never needs to also create an API key just to call the API from the browser:

curl -X POST https://api.sigli.dev/v1/process \
  -H "Authorization: Bearer <access_token from /auth/login>" \
  -H "X-Convert-Type: html-to-pdf" \
  -H "Content-Type: application/json" \
  -d '{ "source": "<h1>Hello</h1>", "format": "A4" }' \
  --output result.pdf

Language Examples

const response = await fetch(
  "https://api.sigli.dev/v1/process",
  {
    method: "POST",
    headers: {
      "X-API-Key": "sig_live_xxx",
      "X-Convert-Type": "html-to-pdf",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ source: "<h1>Hello</h1>", format: "A4" }),
  }
);
const pdfBlob = await response.blob();
import requests

resp = requests.post(
    "https://api.sigli.dev/v1/process",
    headers={"X-API-Key": "sig_live_xxx", "X-Convert-Type": "html-to-pdf"},
    json={"source": "<h1>Hello</h1>", "format": "A4"},
)
with open("output.pdf", "wb") as f:
    f.write(resp.content)
Key formats
sig_live_Live key — counts against your monthly quota
sig_test_Test key — equivalent to setting sandbox: true