# Sign PDFs

> widar marks AI output for the EU AI Act and California's AI Transparency Act: an invisible watermark and a signed C2PA credential on text, images, audio and video, in one API, by Bynn Intelligence.

Documentation index: https://widar.com/llms.txt

The examples in these docs use invented companies, such as Lumen Labs B.V., and invented values: none is a real check, mark, signature or certificate.

Section: Documents. URL: https://widar.com/docs/documents/sign

Sign one PDF per call, a folder of them as a batch, or inside your own servers with the sidecar. The answer is the signed PDF; widar keeps its hash and its signatures, never the file.

Updated December 3, 2026

## One PDF

The same call that marks AI output: [`POST /v1/markings`](https://widar.com/docs/marking#mark-an-output) 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.

**Sign a PDF**

API:

```bash
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.pdf
```

CLI:

```bash
widar markings create INV-2026-4821.pdf --system-id sys_6Dq2xLr9WnKe \
  --output INV-2026-4821.signed.pdf
```

MCP tool:

```json
{
  "name": "create_marking",
  "arguments": {
    "system_id": "sys_6Dq2xLr9WnKe"
  }
}
```

Answer:

```
HTTP/1.1 201 Created
Content-Type: application/pdf
Widar-Mark-Id: mrk_4Pz8sKd2VmQe
Widar-Manifest-Id: mft_5Rc8wLp3KsNe
Widar-Timestamp-Id: tst_9Bx2mQr6TzLd
X-Request-Id: req_3Lp8wKd2QxRn

<the signed PDF: INV-2026-4821.pdf>
```

A 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

**Sign each invoice as it is issued**

TypeScript:

```typescript
// 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;
}
```

Python:

```python
from pathlib import Path

# Client: widar's Python SDK, provided with your workspace

widar = Client()  # reads WIDAR_API_KEY

def sign_invoice(path: Path, number: str) -> str:
    signed = widar.markings.create(
        system_id="sys_6Dq2xLr9WnKe",
        file=path.read_bytes(),
        content_type="application/pdf",
        idempotency_key=number,  # a retry signs once and is billed once
    )
    path.with_suffix(".signed.pdf").write_bytes(signed.body)
    return signed.mark_record_id
```

## 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.

**A statement run**

Batch:

```bash
widar marking-batches create ./statements/2026-11/*.pdf --system-id sys_6Dq2xLr9WnKe
widar marking-batches download mbt_7Kc4rTq1ZpWn --output statements-2026-11.zip
```

Single calls:

```bash
widar markings create ./statements/2026-11/*.pdf --system-id sys_6Dq2xLr9WnKe \
  --parallel 8 --output ./signed/
```

## In your sidecar

The [sidecar](https://widar.com/docs/mark/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](https://widar.com/docs/sign#sign-a-claim) 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.

**Sign through the sidecar**

Local call:

```bash
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.pdf
```

What widar receives:

```json
{
  "system": "sys_6Dq2xLr9WnKe",
  "purpose": "pdf",
  "digest": "51e9ca32557ab8084197287211e990f046f7ff7d0fa36f86b07a0eb3865ccfcb"
}
```

## By 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.

API:

```bash
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>"
  }'
```

CLI:

```bash
widar marking-batches create --system-id sys_4kT9qWm2RbXe
```

MCP tool `marking_batches_create`:

```json
{
  "name": "marking_batches_create",
  "arguments": {
    "system_id": "sys_4kT9qWm2RbXe",
    "files": "<files>"
  }
}
```

Every parameter and the full answer: [Sign many PDFs](https://widar.com/docs/documents#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.

API:

```bash
curl -X GET https://api.widar.com/v1/marking_batches/mbt_7Kc4rTq1ZpWn \
  -H "Authorization: Bearer $WIDAR_API_KEY"
```

CLI:

```bash
widar marking-batches get mbt_7Kc4rTq1ZpWn
```

MCP tool `marking_batches_get`:

```json
{
  "name": "marking_batches_get",
  "arguments": {
    "marking_batch_id": "mbt_7Kc4rTq1ZpWn"
  }
}
```

Every parameter and the full answer: [Read a batch](https://widar.com/docs/documents#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.

API:

```bash
curl -X GET https://api.widar.com/v1/marking_batches/mbt_7Kc4rTq1ZpWn/download \
  -H "Authorization: Bearer $WIDAR_API_KEY"
```

CLI:

```bash
widar marking-batches download mbt_7Kc4rTq1ZpWn
```

MCP tool `marking_batches_download`:

```json
{
  "name": "marking_batches_download",
  "arguments": {
    "marking_batch_id": "mbt_7Kc4rTq1ZpWn"
  }
}
```

Every parameter and the full answer: [Download a batch](https://widar.com/docs/documents#download-a-batch).
