Menu
ProductPricingDocsContact
Log in

Quickstart_

From sandbox key to signed PDF: upload a PDF, create a draft, send it and fetch the result. Plan for about 30 minutes.

Everything below works in the sandbox, free of charge.

1. Account and sandbox key

Create an account at app.signlayer.eu and create a workspace. You start in the sandbox: everything works, nothing is billed and every PDF gets a watermark.

Go to API keys and create a key. It starts with sl_test_ and is shown once. Keep it in your app's secret manager, not in code, chat or logs.

export SIGNLAYER_API_KEY=sl_test_…   # from your secret manager
export SIGNLAYER_BASE_URL=https://app.signlayer.eu/api/v1

2. Authentication and conventions

Every call sends Authorization: Bearer with your key. POST calls that create or send something need an Idempotency-Key: a new UUID per action. If you repeat a call after a timeout, use the same key and the same body, so no second document or request is created.

Errors come back as application/problem+json with title, detail and a request_id. Include that request_id when you contact us.

{
  "type": "about:blank",
  "title": "Invalid PDF anchors",
  "status": 400,
  "detail": "Page 1: put {{signer1}} on its own line, with no other text at the same height on the page.",
  "anchor_reason": "marker_not_alone_on_line",
  "request_id": "0fbd42cb-…"
}

3. Prepare the PDF

Put an anchor in the PDF for each signer: {{signer1}} for the first in your list, {{signer2}} for the second, and so on. A signer may have several anchors, also on different pages.

An anchor stands alone on its line: no other text at the same height on the page, not even in a second column. So stagger side-by-side signature blocks slightly in height.

The signature field is 220 × 60 points and starts at the anchor's x, 8 points below its baseline. Keep that space free of text. Scanned PDFs without a text layer do not work with anchors.

4. Upload the PDF

Uploading takes three steps. You announce the filename, size and SHA-256, put the bytes straight into EU storage with the URL you get back, and then let SignLayer verify the PDF.

The upload URL is valid for 300 seconds. Send the headers from upload.headers exactly, and never send your API key to the upload URL.

# Size and SHA-256 of the exact bytes you will upload
wc -c < contract.pdf
shasum -a 256 contract.pdf

# 1. Reserve the upload
curl -sS -X POST "$SIGNLAYER_BASE_URL/documents" \
  -H "Authorization: Bearer $SIGNLAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "filename": "contract.pdf", "byte_size": 48213,
        "sha256": "9f2c…" }'
# → 201 { "id": "…", "status": "awaiting_upload",
#        "upload": { "url": "…", "method": "PUT", "headers": { … }, "expires_in": 300 } }

# 2. PUT the bytes to upload.url with exactly upload.headers (no API key)
curl -sS -X PUT "$UPLOAD_URL" \
  -H "content-type: application/pdf" \
  -H "x-amz-server-side-encryption: AES256" \
  --upload-file contract.pdf

# 3. Let SignLayer verify the PDF
curl -sS -X POST "$SIGNLAYER_BASE_URL/documents/$DOCUMENT_ID/finalize" \
  -H "Authorization: Bearer $SIGNLAYER_API_KEY"
# → 200 { "id": "…", "status": "ready", "page_count": 5, … }

5. Create a draft

A draft sends nothing and costs nothing. With field_placement "anchors" SignLayer finds the anchors in the PDF. If an anchor is wrong, you get a 400 with the page and the reason, and no draft is created.

The response holds a signer_url per signer. That link grants access to signing: keep it only if you forward the signer yourself, and never log it. You only get it in this response.

For a fixed order, set "signing_order": "ordered" and an increasing order per signer. Without an order, all signers can sign at the same time.

curl -sS -X POST "$SIGNLAYER_BASE_URL/signing_requests" \
  -H "Authorization: Bearer $SIGNLAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "document_id": "'$DOCUMENT_ID'",
        "subject": "Partnership agreement",
        "language": "en",
        "field_placement": "anchors",
        "signers": [
          { "name": "Marit de Vries", "email": "marit@example.test" },
          { "name": "Jonas Bakker",   "email": "jonas@example.test" } ] }'
# → 201 { "id": "…", "status": "draft",
#        "signers": [ { "id": "…", "status": "pending", "signer_url": "…" }, … ] }

6. Send

Sending is a separate call. SignLayer then e-mails the signers an invitation in the request's language, with your sender name and branding from Branding in the dashboard.

In the sandbox only verified members of your workspace receive e-mail. Open other signers with the signer_url from step 5. In live, a sent request counts as one €0.99 request, however many signers it has.

curl -sS -X POST "$SIGNLAYER_BASE_URL/signing_requests/$REQUEST_ID/send" \
  -H "Authorization: Bearer $SIGNLAYER_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
# → 202 { "status": "sent" }

7. Signing

The signer opens the link in the browser, without an account or app. They view the PDF, see where the fields are, type their name and confirm explicitly. Declining is possible too. This is a simple electronic signature; SignLayer does not claim it is a qualified signature.

8. Follow the status with webhooks

Register an endpoint to receive every status change, such as signer.signed and signing_request.completed. Verify the signature over the raw body before parsing JSON, compare in constant time and reject timestamps older than 300 seconds.

An event id stays the same on every retry, so process events idempotently. The dashboard shows every delivery per request and lets you resend a failed one.

curl -sS -X POST "$SIGNLAYER_BASE_URL/webhook_endpoints" \
  -H "Authorization: Bearer $SIGNLAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/webhooks/signlayer", "events": ["*"] }'
# → 201 { "id": "…", "secret": "…" }   (the secret is shown once)

# Every delivery carries:
#   x-signlayer-event-id, x-signlayer-timestamp,
#   x-signlayer-signature: v1=<hex HMAC-SHA256 of "<timestamp>.<raw body>">

9. Fetch the signed PDF and the evidence

When every signer has signed, the request becomes completed as soon as the signed PDF and the evidence package are ready. Fetch them with download: you get a temporary URL back.

curl -sS "$SIGNLAYER_BASE_URL/signing_requests/$REQUEST_ID" \
  -H "Authorization: Bearer $SIGNLAYER_API_KEY"
# → { "status": "completed", "signers": [ { "status": "signed", … } ], … }

curl -sS "$SIGNLAYER_BASE_URL/signing_requests/$REQUEST_ID/download?kind=completed" \
  -H "Authorization: Bearer $SIGNLAYER_API_KEY"
# → { "url": "…" }   kind = completed | evidence | source

10. Go live

Confirm your e-mail address and activate payments under Billing in the dashboard. You can then create an sl_live_ key. Sandbox and live use the same contract and separate data: only the key changes.

API reference

The OpenAPI specification describes every endpoint, field and error response. This quickstart follows that contract.

Open the OpenAPI specification

Build your first signing flow
in minutes_