One PDF
The same call that marks AI output: POST /v1/markings with the PDF as the body and a document issuer as the system. The answer is the signed PDF, with its ids in the headers. Use the invoice number as the Idempotency-Key: a retry returns the same signed file and is billed once.
curl -X POST "https://api.widar.com/v1/markings?system_id=sys_6Dq2xLr9WnKe" \
-H "Authorization: Bearer $WIDAR_API_KEY" \
-H "Content-Type: application/pdf" \
-H "Idempotency-Key: INV-2026-4821" \
--data-binary @INV-2026-4821.pdf \
-D headers.txt -o INV-2026-4821.signed.pdfA PDF widar cannot sign is refused with its code (an encrypted file, one already signed, a PDF/A file, a hybrid file) and marking.failed is sent, so no invoice leaves unsigned without you knowing. PDFs up to 50 MB.
From your billing system
// Client: widar's TypeScript SDK, provided with your workspace
import { readFile, writeFile } from "node:fs/promises";
const widar = new Client(); // reads WIDAR_API_KEY
// Sign each invoice as the billing system issues it
export async function signInvoice(path: string, number: string) {
const signed = await widar.markings.create({
systemId: "sys_6Dq2xLr9WnKe",
file: await readFile(path),
contentType: "application/pdf",
idempotencyKey: number, // a retry signs once and is billed once
});
await writeFile(path.replace(/\.pdf$/, ".signed.pdf"), signed.body);
return signed.markRecordId;
}Many PDFs
For a monthly statement run, upload the files and sign them as one batch: the answer comes at once, and marking_batch.completed tells you when every file is done. Download the signed files once within 24 hours; then widar deletes them. To keep nothing on widar’s side even for a moment, the CLI runs single calls in parallel instead.
widar marking-batches create ./statements/2026-11/*.pdf --system-id sys_6Dq2xLr9WnKe
widar marking-batches download mbt_7Kc4rTq1ZpWn --output statements-2026-11.zipIn your sidecar
The sidecar signs PDFs on your servers, so the file never leaves them. It answers on its local address exactly as POST /v1/markings does. It builds the mark, the credential and the PDF signature there and sends widar’s remote signer three digests, one call each and in this order: identity, claim, then pdf, since each depends on the one before. Or your own HSM signs inside the sidecar.
curl -X POST "http://127.0.0.1:8790/v1/markings?system_id=sys_6Dq2xLr9WnKe" \
-H "Content-Type: application/pdf" \
--data-binary @INV-2026-4821.pdf -o INV-2026-4821.signed.pdfBy API, CLI and MCP
Sign many PDFs
Signs a set of PDFs you uploaded first, as one batch. Answers 202 at once with the batch; marking_batch.completed follows. Each file is signed exactly as by the single call, and the files and results are deleted within 24 hours.
curl -X POST https://api.widar.com/v1/marking_batches \
-H "Authorization: Bearer $WIDAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"system_id": "sys_4kT9qWm2RbXe",
"files": "<files>"
}'POST /v1/marking_batches
Every parameter and the full answer: Sign many PDFs.
Read a batch
The batch’s state and one result per file: signed, with its mark record, or refused, with the error code.
curl -X GET https://api.widar.com/v1/marking_batches/mbt_7Kc4rTq1ZpWn \
-H "Authorization: Bearer $WIDAR_API_KEY"GET /v1/marking_batches/{marking_batch_id}
Every parameter and the full answer: Read a batch.
Download a batch
The signed PDFs as one ZIP archive, once. The link expires within 24 hours of the batch completing, and widar deletes the files then.
curl -X GET https://api.widar.com/v1/marking_batches/mbt_7Kc4rTq1ZpWn/download \
-H "Authorization: Bearer $WIDAR_API_KEY"GET /v1/marking_batches/{marking_batch_id}/download
Every parameter and the full answer: Download a batch.