Overview
SignlyPDF gives you four building blocks. Use one or combine them: most integrations create a submission through the API, show the signing form inside their own app, and update their records from a webhook.
Quickstart
From a new account to a signed document in four steps.
-
Request API access
Create an account, open the API settings page and press Request access to tell us what you are building. Our team enables API access for your account, and your key then appears on the same page.
-
Create a template
Build it in the editor, or upload a PDF or Word file with
POST /api/templates. A template holds the document, the signer roles and the fields each role fills in. Note itsid. -
Send it for signature
Create a submission for the template. With
send_email: trueeach signer gets an invitation email. To sign inside your app instead, passfalseand use theembed_srcfrom the response.curl -X POST https://signlypdf.com/api/submissions \ -H "X-Auth-Token: $SIGNLY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "template_id": 1042, "send_email": true, "submitters": [ { "role": "Merchant", "email": "owner@harbor-bistro.com", "name": "Lena Okafor" } ] }'import os, requests res = requests.post( "https://signlypdf.com/api/submissions", headers={"X-Auth-Token": os.environ["SIGNLY_API_KEY"]}, json={ "template_id": 1042, "send_email": True, "submitters": [ { "role": "Merchant", "email": "owner@harbor-bistro.com", "name": "Lena Okafor", } ], }, ) submitters = res.json() -
Get notified
An account admin adds an endpoint under Settings › Webhooks and subscribes it to
form.completed. The payload includes the signer's values and links to the signed PDF and audit log. See Webhooks.
Authentication
Every request carries your API key in the X-Auth-Token header.
Each user has their own key on the API settings page, and it acts with that user's role inside your account. An Admin's key can do everything; an Editor's key works with templates, documents and clickwraps; a Viewer's key can only read. If an admin limited a user to their own documents, that user's key only sees the templates, submissions and clickwraps the user created. Rotating the key revokes the old one immediately.
The API is meant to be called from your server. Successful responses do not include CORS headers, so a key placed in browser code would not work and would be exposed.
- Missing, wrong or revoked key:
401 {"error":"Not authenticated"} - Account without approved API access:
403 {"error":"Forbidden"} - A record that belongs to another account, or an action the key's user is not allowed to take:
403 {"error":"Not authorized"}
curl https://signlypdf.com/api/user \
-H "X-Auth-Token: $SIGNLY_API_KEY"
{
"id": 318,
"first_name": "Marcus",
"last_name": "Reyes",
"email": "marcus@harbor-payments.com"
}
Try it now, no signup
A public, shared key for poking at the API before you create an account.
It works against every endpoint on this page, but with guardrails: it's shared by everyone reading these docs, so treat anything you create with it as temporary: everything made with this key is deleted automatically about six hours after it was created. It never sends email or SMS: invitations (even with send_email: true), completion and consent emails are skipped, so open the signing form through embed_src instead. When a clickwrap asks for a phone code, the code is shown on the page instead of being texted, so the flow is still testable. It also has a lower rate limit than a real key: 100 requests per 5 minutes in total, shared by everyone using it. The X-RateLimit-* headers still show the normal per-key budget, so do not rely on them with this key.
The sandbox account starts empty. Create a template first (see Templates), then send it or build a clickwrap on it.
For anything you intend to keep, create an account and use your own key instead.
curl https://signlypdf.com/api/templates \
-H "X-Auth-Token: signly_sandbox_9f3c2a7b1e4d6f58a0c3b7e2d5f91a4c"
Requests
JSON over HTTPS, with resource paths under /api. The full machine-readable description is in our OpenAPI 3.1 spec; import it into Postman, Insomnia or a code generator.
- Send request bodies as JSON with
Content-Type: application/json. Without that header a JSON body is not read as JSON. - Timestamps are ISO 8601 in UTC, for example
2026-10-08T15:50:34.648Z. - Use
external_idon templates and signers to store your own identifiers. You can filter lists by it later. - File links in responses (
documents[].url,audit_log_url) are signed and expire after 40 minutes. Download the file, or fetch the record again for fresh links.
Pagination
List endpoints return the newest records first and page with a cursor.
pagination.next from the previous page.pagination.prev.When data comes back with fewer items than limit, you have reached the end.
# First page
curl "https://signlypdf.com/api/submissions?limit=50" \
-H "X-Auth-Token: $SIGNLY_API_KEY"
# Next page: pass pagination.next as "after"
curl "https://signlypdf.com/api/submissions?limit=50&after=8812" \
-H "X-Auth-Token: $SIGNLY_API_KEY"
{
"data": [ { "id": 8861, "status": "pending" }, { "id": 8812, "status": "completed" } ],
"pagination": { "count": 2, "next": 8812, "prev": 8861 }
}
Errors
Failed requests return a status code and a JSON body with an error message.
{ "error": "email is invalid in `submitters[0]`." }
| Status | Meaning |
|---|---|
200 201 | Success. Creating a template returns 201; other creates return 200. |
401 | The API key is missing, wrong or revoked. |
403 | API access is not approved for the account (Forbidden), or the key's user may not do this (Not authorized): the record belongs to a different account, a Viewer's key tried to change something, or a user limited to their own documents asked for someone else's. |
404 | No record with that id. |
422 | The request was understood but invalid: a missing field, an invalid email, a file that cannot be read. The message says which. |
429 | Too many requests. Wait for the number of seconds in Retry-After; see Rate limits. |
5xx | Something failed on our side. Retry with backoff; the request can be repeated safely only if it was a read. |
Rate limits
Each API key gets 600 requests per 5 minutes, whichever IP address the calls come from.
Every API response to a request with a key tells you where you stand:
Over the limit the API answers 429 with Retry-After set to the seconds left until the reset. Separately, one IP address can make up to 1,200 API calls per 5 minutes across all keys. Spread bulk jobs over time and use webhooks instead of polling. If you need more, talk to us before you launch.
HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 587
X-RateLimit-Reset: 1791476100
Templates
A template is a document with signer roles and fields. Every submission starts from one. Every endpoint below is also described in the OpenAPI spec.
q, external_id, folder, archived=true.html), converted to PDF."archived": true. Note: in PUT, areas[].page starts at 0.name and external_id.permanently=true to delete.Creating a template
Pass one or more documents. Each file is either a public https:// URL we download, or the file content as base64. PDF, images, DOCX, DOC, ODT, RTF, XLSX, XLS, PPTX, PPT and HTML are accepted; everything that is not a PDF or an image is converted to PDF. For base64 content, give the document a name with its extension (agreement.docx) or send a data: URI; without either we detect the type from the file itself.
Place fields with areas in relative coordinates: x, y, w and h run from 0 to 1 across the page, and page starts at 1. A role that does not exist yet becomes a new signer role. Optional folder_name puts the template in a folder (created if needed). If you leave fields out, we use the form fields already in the PDF; a PDF without form fields gives a template with no fields, and you need to add some before you can send it.
Field types: text, signature, initials, date, number, checkbox, radio, select, multiple, image, file, stamp, cells, phone.
curl -X POST https://signlypdf.com/api/templates \
-H "X-Auth-Token: $SIGNLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Merchant Processing Agreement",
"external_id": "mpa-v3",
"documents": [
{
"name": "agreement.pdf",
"file": "https://harbor-payments.com/mpa-v3.pdf",
"fields": [
{
"name": "Signature",
"type": "signature",
"role": "Merchant",
"areas": [
{ "page": 4, "x": 0.12, "y": 0.78, "w": 0.3, "h": 0.06 }
]
}
]
}
]
}'
import base64, os, requests
with open("agreement.pdf", "rb") as f:
pdf = base64.b64encode(f.read()).decode()
template = requests.post(
"https://signlypdf.com/api/templates",
headers={"X-Auth-Token": os.environ["SIGNLY_API_KEY"]},
json={
"name": "Merchant Processing Agreement",
"external_id": "mpa-v3",
"documents": [{"name": "agreement.pdf", "file": pdf}],
},
).json()
Field tags
Instead of coordinates, write tags into the document text: {{Field name;role=Client;type=signature}}. When a document comes without fields, each tag becomes a field over the space it takes, and the tag text is painted over so signers do not see it. This works for PDF, Word and other office files, and HTML.
- The first part is the field name.
rolenames the signer; the first role named takes the template's default one. typeis any field type above (defaulttext).requireddefaults to true;readonlyandoptions(comma separated, forselectandradio) are optional.- The field is as wide as the tag. Signatures and initials get a minimum height; set
heightin points to change it. - In HTML you can also use field elements, for example
<signature-field name="Sign" role="Client"></signature-field>or<date-field role="Client"/>; they are read as the same tags.
<p>Client name: {{Client name;role=Client}}</p>
<p>Plan: {{Plan;role=Client;type=select;options=Basic,Pro}}</p>
<p>Signature: {{Signature;role=Client;type=signature}} Date: {{Date;role=Client;type=date}}</p>
<p>Provider: {{Provider signature;role=Provider;type=signature}}</p>
# Any document with tags works: HTML here, or a PDF/DOCX in "documents".
curl -X POST https://signlypdf.com/api/templates/html \
-H "X-Auth-Token: $SIGNLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Service Agreement",
"html": "<p>Signature: {{Signature;role=Client;type=signature}}</p>"
}'
Submissions
A submission is one signing request: a template sent to one or more signers. Each signer is a submitter.
documents (or html) instead of template_id.template_id and emails (comma separated) creates one submission per address, each with a single signer.template_id, status, q, created_at_from, completed_at_to and more.permanently=true to delete.Body
email, phone or name. Match a template role with role; signers without a matching role fill the remaining roles in order. A signer that prefills values must name an existing role, or the request fails with 422 Unknown submitter role. Also accepts values (prefill by field name), readonly_fields, external_id, metadata, completed, send_email and message.false for embedded signing.preserved invites signers one after another; random invites everyone at once.?event=completed or ?event=declined.subject and body (body is required).send_email is not false.The response is an array with one object per signer. Each has an id, a slug and an embed_src for embedded signing.
curl -X POST https://signlypdf.com/api/submissions \
-H "X-Auth-Token: $SIGNLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"template_id": 1042,
"send_email": false,
"completed_redirect_url": "https://harbor-payments.com/done",
"submitters": [
{
"role": "Merchant",
"email": "owner@harbor-bistro.com",
"name": "Lena Okafor",
"external_id": "merchant_5521",
"metadata": { "application_id": "app_9f2c" },
"values": { "Business name": "Harbor Bistro LLC" }
}
]
}'
[
{
"id": 20471,
"submission_id": 8861,
"uuid": "3f1c6a52-8d0e-4b7e-9a51-2f64b0c1d9e7",
"slug": "pX4ytYbVfQe2Lm",
"email": "owner@harbor-bistro.com",
"name": "Lena Okafor",
"role": "Merchant",
"status": "awaiting",
"external_id": "merchant_5521",
"metadata": { "application_id": "app_9f2c" },
"embed_src": "https://signlypdf.com/apiemb/pX4ytYbVfQe2Lm",
"sent_at": null,
"completed_at": null
}
]
curl https://signlypdf.com/api/submissions/8861 \
-H "X-Auth-Token: $SIGNLY_API_KEY"
Without a template
POST /api/submissions/pdf, /docx and /html take the same body, but with the document itself in documents (or html) instead of template_id. We build a template from it exactly as POST /api/templates would, using its fields or field tags, then send it. The template stays in your account, so you can reuse it.
# No template needed: send the document and the signers in one call.
curl -X POST https://signlypdf.com/api/submissions/docx \
-H "X-Auth-Token: $SIGNLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Service Agreement",
"send_email": true,
"documents": [
{ "name": "agreement.docx", "file": "https://harbor-payments.com/agreement.docx" }
],
"submitters": [
{ "role": "Client", "email": "owner@harbor-bistro.com" },
{ "role": "Provider", "email": "ops@harbor-payments.com" }
]
}'
import os, requests
submitters = requests.post(
"https://signlypdf.com/api/submissions/html",
headers={"X-Auth-Token": os.environ["SIGNLY_API_KEY"]},
json={
"name": "Service Agreement",
"html": open("agreement.html").read(), # with {{...}} field tags
"send_email": False,
"submitters": [{"role": "Client", "email": "owner@harbor-bistro.com"}],
},
).json()
embed_src = submitters[0]["embed_src"]
| Submission status | Meaning |
|---|---|
pending | At least one signer has not finished. |
completed | Every signer has signed. Signed PDFs and the audit log are available. |
declined | A signer declined. The reason is in the form.declined webhook as decline_reason, and in the API as submission_events[].data.reason on the decline_form event. |
expired | expire_at passed before everyone signed. |
Submitters
One signer inside a submission.
submission_id, external_id, completed_after.Submitter status moves through awaiting, sent, opened and ends as completed or declined. A completed submitter can no longer be changed.
curl -X PUT https://signlypdf.com/api/submitters/20471 \
-H "X-Auth-Token: $SIGNLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "lena@harbor-bistro.com",
"send_email": true
}'
Clickwrap
Create agreements and read the consents collected for them. How consent works is covered in Clickwrap consent.
"publish": true.url."publish": true to release it as a new version. The response shows the published version, so a draft change appears only after you publish.Kinds
no_document: the agreement text is thecontentyou send. Plain text keeps its line breaks. Text that starts with an HTML block tag (<p>,<h1>-<h3>,<ul>,<ol>,<blockquote>,<table>) is rendered as basic HTML; scripts, forms and other tags are stripped.view_only: the signer reads a template document in a scrollable window on the page, then agrees. After agreeing the page shows it again with a Download button. Withrequire_scroll_to_bottom(the default) the button unlocks only once the document has been scrolled to the end. This is checked in the browser, not on our server.requires_signature: after agreeing, the signer signs the template document.
Set kind explicitly. Without it the clickwrap is view_only, which needs a template_id (422 Template can't be blank otherwise). For requires_signature the template must have exactly one signer role, and name and email are always required.
curl -X POST https://signlypdf.com/api/clickwraps \
-H "X-Auth-Token: $SIGNLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Merchant Terms of Service",
"kind": "view_only",
"template_id": 1042,
"button_text": "I agree",
"require_name": true,
"require_email": true,
"checkboxes": [
{ "text": "I agree to the Merchant Terms.", "required": true },
{ "text": "Email me updates.", "required": false }
],
"publish": true
}'
{
"id": 77,
"name": "Merchant Terms of Service",
"kind": "view_only",
"slug": "ToazhJ5qkCwGQx",
"published": true,
"active_version_number": 1,
"url": "https://signlypdf.com/c/ToazhJ5qkCwGQx"
}
Body
{ "text", "required", "dialog_content" }. dialog_content is optional text shown in a popup from that checkbox. Leave the array out and you get one required box, "I have read and agree to the terms of this document." An empty array is rejected.+1 and 10 digits), and with require_phone_otp confirm it with a six-digit code sent by SMS; require_phone_otp turns require_phone on. sms_message sets the text; {code} is replaced with the code.content text, or the popup opened from inline_content) has been scrolled to the end. Checked in the browser only.I agree to the <a href="#clickwrap-dialog-content">Terms</a>. That link opens content in a popup.{clickwrap_name}, {name} and {date} are replaced.# Terms as plain text, no document. Name and email are required by default.
curl -X POST https://signlypdf.com/api/clickwraps \
-H "X-Auth-Token: $SIGNLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Platform Terms",
"kind": "no_document",
"content": "1. You keep your data.\n2. We keep it safe.",
"checkboxes": [
{ "text": "I accept the Platform Terms.", "required": true,
"dialog_content": "The full terms, shown in a popup from the checkbox." }
],
"publish": true
}'
import os, requests
clickwrap = requests.post(
"https://signlypdf.com/api/clickwraps",
headers={"X-Auth-Token": os.environ["SIGNLY_API_KEY"]},
json={
"name": "Platform Terms",
"kind": "no_document",
"content": "1. You keep your data.\n2. We keep it safe.",
"checkboxes": [{"text": "I accept the Platform Terms.", "required": True}],
"publish": True,
},
).json()
print(clickwrap["url"]) # send your users here
const res = await fetch("https://signlypdf.com/api/clickwraps", {
method: "POST",
headers: { "X-Auth-Token": process.env.SIGNLY_API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({
name: "Platform Terms",
kind: "no_document",
content: "1. You keep your data.\n2. We keep it safe.",
checkboxes: [{ text: "I accept the Platform Terms.", required: true }],
publish: true,
}),
});
const { url } = await res.json();
# Agree, then sign. The template must have exactly one signer role.
curl -X POST https://signlypdf.com/api/clickwraps \
-H "X-Auth-Token: $SIGNLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Merchant Agreement",
"kind": "requires_signature",
"template_id": 1042,
"require_phone": true,
"require_phone_otp": true,
"sms_message": "Your SignlyPDF code is {code}",
"publish": true
}'
Versions
Every publish creates a new, numbered version that never changes. Edits go to the draft; the page and the API keep using the published version until you publish again, and each consent records the version it was given for.
# Change the draft. Users keep seeing version 1 until you publish.
curl -X PUT https://signlypdf.com/api/clickwraps/77 \
-H "X-Auth-Token: $SIGNLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "button_text": "Accept and continue" }'
# Release the draft as version 2. Consents from now on record version 2.
curl -X POST https://signlypdf.com/api/clickwraps/77/publish \
-H "X-Auth-Token: $SIGNLY_API_KEY"
# Who agreed, newest first
curl "https://signlypdf.com/api/clickwraps/77/consents?limit=100" \
-H "X-Auth-Token: $SIGNLY_API_KEY"
Events
A catch-up feed of completed signers and submissions, with data in the webhook format.
completed, declined or viewed (the first time a signer opened the form), newest first.completed, created, archived or expired, with the submission as data.Use it to backfill after an outage of your webhook endpoint. after and before are Unix timestamps of the event (for example completed_at) rather than ids, with the same meaning as in Pagination: before=T returns events completed after T, after=T those completed before T. Each item has event_type, timestamp (when that event happened: completed_at, opened_at, declined_at and so on) and data in the webhook format, but no event_id.
# Events completed since 1791400000 (Unix time), newest first
curl "https://signlypdf.com/api/events/form/completed?before=1791400000&limit=100" \
-H "X-Auth-Token: $SIGNLY_API_KEY"
files as base64; returns {"data": "<base64 PDF>"}.file as base64). Returns whether we issued it and its signatures.Embedded signing
Show the signing form inside your own page, so signers never leave your product.
- Create the submission on your server with
"send_email": false. - Take
embed_srcfrom the signer in the response. It looks likehttps://signlypdf.com/apiemb/{slug}. If you only have a submitter from a list call, build the same URL from itsslug. - Render it with the
<signlypdf-embed>element, which handles resizing and turns frame messages into DOM events. A plain<iframe>pointing at the same URL works too. Give it a fixedheight(about 700px or 80vh): the answer field and the Next / Sign buttons sit at the bottom edge of the frame, so withheight="auto"on a long document they end up far below the visible part of your page. - Treat the browser event as a UI signal only. Confirm the result from the
form.completedwebhook orGET /api/submitters/{id}before you rely on it.
<script src="https://signlypdf.com/js/embed.js"></script>
<signlypdf-embed
id="signing"
src="https://signlypdf.com/apiemb/pX4ytYbVfQe2Lm"
width="100%"
height="700px">
</signlypdf-embed>
<script>
const form = document.getElementById("signing");
form.addEventListener("completed", (event) => {
// event.detail.redirect_url is set when you passed completed_redirect_url
window.location.href = event.detail.redirect_url || "/onboarding/done";
});
form.addEventListener("declined", () => {
window.location.href = "/onboarding/declined";
});
</script>
// Plain iframe, no script tag. Listen for messages from the signing frame.
window.addEventListener("message", (event) => {
if (event.origin !== "https://signlypdf.com") return;
if (event.data?.source !== "signlypdf") return;
switch (event.data.type) {
case "resize": iframe.style.height = `${event.data.payload.height}px`; break;
case "completed": showSuccess(); break;
case "declined": showDeclined(); break;
}
});
Only /apiemb/ links can be framed. Regular signing links (/s/), public template links (/d/) and clickwrap pages (/c/) refuse to load inside another site's iframe. The embed URL is a credential for that signer: generate it per signer on your server and do not share it.
Frame events
<signlypdf-embed> dispatches these as bubbling DOM events with the payload in event.detail.
| Event | When | Payload |
|---|---|---|
load | The form has loaded in the frame. | path, query |
completed | The signer submitted the form. | timestamp, redirect_url when one is set |
declined | The signer declined to sign. | timestamp, redirect_url when one is set |
The frame never navigates away on its own. When a redirect_url arrives, redirecting the page is up to you.
With a plain iframe, listen for message events. Accept only messages whose event.origin is https://signlypdf.com and whose data.source is "signlypdf"; data.type is one of loaded, resize, completed or declined. The same event can arrive more than once, so make your handler idempotent.
Clickwrap consent
A clickwrap is an agreement accepted with a click: your terms, optional required checkboxes, and an "I agree" button. There are two ways to collect consent.
Hosted page (recommended)
Send the user to the clickwrap's url. The page shows the current version, enforces the required name, email and checkboxes on our server, and records the user's own IP address and browser. Each consent gets a PDF certificate.
Prefill name, email and phone (used when the clickwrap asks for them), and pass external_id to link the consent to the user in your system. When the clickwrap verifies the phone, the user gets a six-digit code by SMS and enters it before the consent is recorded. After agreeing, requires_signature clickwraps continue straight to the signing form.
https://signlypdf.com/c/ToazhJ5qkCwGQx
?external_id=merchant_5521
&name=Lena%20Okafor
&email=owner%40harbor-bistro.com
Your own UI, recorded through the API
If the checkbox lives in your app, record the consent with POST /api/clickwraps/{id}/consents once the user agrees. We store what you send, so send the user's details, not your server's:
ipanduser_agentfrom the user's request. Without them the record shows your server's address.name,email,phoneandexternal_idfor the user.
The clickwrap must be published. Your app is responsible for showing the agreement text of the active version and for enforcing any required checkboxes and the phone code: nothing is checked on this call. The consent still gets a PDF certificate a few seconds later, and the same confirmation email goes to the address you sent. For a requires_signature clickwrap this call only records the consent; it does not start a signing session, so send the signer a submission yourself if you need the signature.
curl -X POST https://signlypdf.com/api/clickwraps/77/consents \
-H "X-Auth-Token: $SIGNLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Lena Okafor",
"email": "owner@harbor-bistro.com",
"phone": "+12025550123",
"external_id": "merchant_5521",
"ip": "203.0.113.24",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_6)"
}'
{
"id": 3190,
"clickwrap_id": 77,
"clickwrap_version_number": 1,
"name": "Lena Okafor",
"email": "owner@harbor-bistro.com",
"phone": "+12025550123",
"external_id": "merchant_5521",
"ip": "203.0.113.24",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_6)",
"agreed_at": "2026-10-08T15:50:34.648Z",
"certificate_url": null
}
Evidence and certificates
What is stored for each consent, and how the two methods compare.
| Hosted page | Recorded through the API | |
|---|---|---|
| Agreement version | Recorded | Recorded (active version) |
| Name, email, external id | Name and email entered by the user (required ones enforced); external id from the link | As sent by your server |
| Phone | Entered by the user; confirmed by SMS code when the clickwrap asks for it | As sent by your server, not verified |
| IP address and browser | Captured from the user's request | As sent by your server |
| Checkbox answers | Each box, ticked or not, printed on the certificate | Not sent by you; the certificate lists every checkbox of the version as accepted |
| Time of agreement | Recorded by SignlyPDF | Recorded by SignlyPDF when the call arrives |
| PDF certificate | Yes for both, linked as certificate_url a few seconds after the consent, and emailed to the user (when there is an email) and to the clickwrap's creator | |
If consent may be used as evidence in a dispute, prefer the hosted page: the agreement is shown and the user's action is captured by SignlyPDF directly, not reported by your server. Published versions never change, so you can always show exactly what a user agreed to.
Clickwrap widget
Show an agreement inside your own website or web app, as a dialog or as an inline checkbox, and keep your user in your product.
- Create an app: you get a public App ID and a secret App Key.
- Show the agreement in the browser with the App ID. The widget returns a
signature. - Send the signature to your server, which confirms it with the App Key (server verification). Only then does the answer count.
<script src="https://signlypdf.com/clickwrap-widget.js"></script>
<script>
SignlyClickwrap.init({ appId: 'cwa_...' })
// dialog
const result = await SignlyClickwrap.show({
clickwrap: 'SLUG', // the clickwrap's slug (its public link is /c/SLUG)
endUserId: 'user-42', // your id for this person; leave out to bind it later (deferred identity)
language: 'en', // stored with the answer
placeholders: { full_name: 'Ann Lee', company_name: 'Acme' }
})
// result: { signature, status: 'accepted' | 'declined' }
// or { alreadyAccepted: true } (no dialog is shown to someone who accepted the current version)
// or { canceled: true }
// inline checkbox
const box = SignlyClickwrap.renderInline('#terms', { clickwrap: 'SLUG', endUserId: 'user-42' },
{ onChange: ({ valid }) => submit.disabled = !valid })
const outcome = await box.finalize() // same result shape as show(); box.destroy() removes it
</script>
Options: disableClose: true removes the close button. Appearance (colors, radius, button and agreement text) comes from the clickwrap's Preview & Customize settings.
The app's allowed domains limit which sites may use the App ID (exact hosts or *.example.com; an empty list allows all). A request from another origin gets 403 with a readable error. The widget endpoints are rate limited to 1,000 requests per hour per app and IP.
Placeholders: full_name, email_address, company_name, job_title, phone_number, registration_no, vat_number, address, custom_1 to custom_10. date is always filled in by SignlyPDF. A placeholder without a value shows as an em dash.
Server verification
An answer collected by the widget stays unverified until your server confirms it. This keeps people from claiming consent that was never given.
Send the headers X-APP-ID and X-APP-KEY (never from a browser or mobile app) and the body { "signature": "...", "end_user_id": "..." }. end_user_id is required only when the widget was shown without one (deferred identity): the answer is then bound to that id.
curl -X POST https://signlypdf.com/api/clickwrap/verify \
-H "X-APP-ID: cwa_..." -H "X-APP-KEY: cwk_..." -H "Content-Type: application/json" \
-d '{"signature": "..."}'
{ "status": "ACCEPTED", "event_id": 912, "clickwrap_id": 77, "version": "1.0",
"end_user_id": "user-42", "placeholders": {...},
"technical_metadata": { "ip": "203.0.113.7", "user_agent": "..." },
"action_at": "...", "presented_at": "...", "effective_at": "...", "verified_at": "..." }
statusisACCEPTEDorDECLINED. A signature is also issued for a decline, so check the status before you grant access.- Verifying the same signature again returns the same result without repeating anything.
410: the signature is forged or older than 24 hours (the answer is thenexpired).404: it belongs to another account or app.409: it already belongs to another end user.422:end_user_idis missing.- When an answer is verified the certificate and signed agreement PDF are generated and the webhooks are sent.
Status and re-acceptance
Ask whether a person has agreed to the current terms, and ask people to agree again.
external_id or email)tag filter{ "external_ids": [...] } or { "all": true }external_id, email, status, source, version, from, to, qNO_DATA: never answered.ACCEPTED: agreed to the current major version.DECLINED: the latest answer was a decline.OVERDUE: agreed before, but a newer major version needs a new answer.reacceptance_required: trueon top ofACCEPTEDmeans the clickwrap always asks again (settingrequire_reacceptance), or somebody asked for this person to re-accept after their last consent. Old consents and certificates are never changed; a new answer is a new consent.
Versions
Each publication is an immutable version: 1.0, 1.1, 2.0.
POST /api/clickwraps/{id}/publish accepts change_type (major by default: everybody agrees again; minor: people who agreed to this major version are not asked again), effective_at (an ISO time in the future schedules it; the current version keeps serving until then) and change_summary. GET /api/clickwraps/{id}/versions lists them with their status (active, scheduled, archived) and consent counts. A newer schedule replaces an older one.
Also: POST /api/clickwraps/{id}/archive, /unarchive and /duplicate.
Apps and keys
An app is one integration: a website or backend with its own App ID and App Key. Admins manage apps; there is no charge per app.
{ "name", "allowed_domains": [...] }; the response contains app_key onceThe App ID and App Key also authenticate the clickwrap endpoints of this API (/api/clickwraps*, /api/clickwrap_consents, /api/consents, /api/clickwrap_end_users, /api/clickwrap/verify) without an API token, using the headers X-APP-ID and X-APP-KEY. They cannot be used on other endpoints or to manage apps. Keep the App Key on your server.
Bundles
Show several published clickwraps (2 to 10) on one page, for example Terms, Privacy and Marketing at sign-up. Each item can be required or optional. Pro plan.
Create and publish a bundle in Clickwraps › Bundles. Every change makes a new immutable bundle version. People answer each item or decline all at once; every answer is stored as a normal consent that points to the bundle version.
- Hosted page:
/b/{slug}. - Widget:
const result = await SignlyClickwrap.showBundle({ bundle: '{slug}', endUserId: 'user-42' }); sendresult.signatureto your server. - Deferred identity: answers from the widget are pending until your server confirms them with
POST /api/clickwrap_bundle/verify(body:signatureand optionallyend_user_id) using the App ID and App Key. Pending answers expire after 24 hours. - API:
GET /api/clickwrap_bundleslists bundles with their active version and items.
Document delivery
Email people a link to their signed agreement and certificate right after they accept. Pro plan.
- Turn on Send agreement via email in the template's settings (the field
send_agreement_emailin the API). - The email goes to the address the person entered, or to the one you pass in the widget with
SignlyClickwrap.setRecipient('person@example.com', 'Full Name')before showing it. - The link works for 7 days. After that the page offers Email me a new link. Replies go to the app's reply-to address.
Follow every email in Clickwraps › Document delivery: sent, failed or skipped, link status, downloads, plus Resend and Withdraw. Webhooks for clickwrap events can be added under Integrations; events can also be exported as CSV from Events with the filters you have set.
Audit log
Who changed what in the clickwrap console, from the dashboard or the API. Admins only.
GET /api/clickwrap_audit_logs with the optional filters action_name (for example clickwrap.published), resource_id, user_id, from, to. Each entry has the action, the resource, details, the user, IP address, user agent and whether it came from the dashboard or the API. Actions: clickwrap.created, updated, published, archived, unarchived, duplicated, reacceptance_requested and clickwrap_app.created, updated, key_regenerated, deleted.
Webhooks
We send an HTTPS POST to your endpoint when something happens to a document.
- Open Settings › Webhooks (account admins only) and add your endpoint URL. Use HTTPS in production.
- Choose the events you need. New endpoints start with the four
form.*events. - Set a secret: a header name and a random value (we recommend at least 32 characters). We use the value to sign every request.
- Until the endpoint has its first delivery, a Test Webhook button sends a sample
form.completedbuilt from your latest completed signer. It appears only when the endpoint subscribes toform.completedand the account has a completed signer. The test has noevent_idand does not appear in the delivery log.
Clickwrap consents are not among the default events: tick clickwrap.consent.created on the endpoint to receive them.
Every real delivery is listed under the endpoint with its status and response code, and can be resent from there.
{
"event_id": "0b4f3d6e-6a0c-4f7a-9d2b-1c55e8a07c3f",
"event_type": "form.completed",
"timestamp": "2026-10-08T15:50:34.648Z",
"data": {
"id": 20471,
"submission_id": 8861,
"email": "owner@harbor-bistro.com",
"name": "Lena Okafor",
"role": "Merchant",
"status": "completed",
"external_id": "merchant_5521",
"metadata": { "application_id": "app_9f2c" },
"ip": "203.0.113.24",
"completed_at": "2026-10-08T15:50:31.020Z",
"values": [
{ "field": "Business name", "value": "Harbor Bistro LLC" }
],
"documents": [{ "name": "agreement", "url": "https://signlypdf.com/file/..." }],
"audit_log_url": "https://signlypdf.com/file/...",
"submission": { "id": 8861, "status": "completed" }
}
}
POST /webhooks/signly HTTP/1.1
Content-Type: application/json
User-Agent: SignlyPDF.com Webhook
X-Signly-Event-Id: 0b4f3d6e-6a0c-4f7a-9d2b-1c55e8a07c3f
X-Signly-Event-Type: form.completed
X-Signly-Timestamp: 1791475834
X-Signly-Signature: v1=8c1f0a…e94d
X-Webhook-Secret: ••••••••
Events
Every delivery has the same envelope: event_id, event_type, timestamp and data.
Signer events, data is the submitter
form.viewedThe signer opened the form. Sent on every visit.form.startedThe signer saved their first field.form.completedThe signer finished. Includes values, signed documents and audit log.form.declinedThe signer declined, with decline_reason.Document events, data is the submission or template
submission.createdA submission was created.submission.completedEvery signer has completed.submission.expiredIt expired before everyone signed.submission.archivedIt was archived. data holds id, slug and archived_at.template.createdA template was created or cloned.template.updatedA template was changed.Clickwrap events, data is the consent
clickwrap.consent.createdSomeone agreed, on the hosted page or through the API. data matches GET /api/consents/{id}; certificate_url may still be null, so fetch the consent again for it.clickwrap.consent.declinedSomeone declined. Sent in addition to clickwrap.consent.created.clickwrap.publishedA version went live (immediately, or when its scheduled time came). data describes the clickwrap and its current version.clickwrap.archivedA clickwrap was archived; clickwrap.unarchived when it came back.clickwrap.reacceptance_requestedRe-acceptance was requested for one person or for everybody.Signer payloads are close to GET /api/submitters/{id}: the slug is in link_slug, there is no uuid or submission_events, and they add decline_reason, signer_order, total_signers, audit_log_url, the parent submission with its status, and the signer's ip and ua when they signed in the browser. Submission payloads match GET /api/submissions/{id}. Your external_id and metadata come back unchanged, so you can match events to your own records.
Signatures
Check that a request came from SignlyPDF before you act on it.
Every delivery carries X-Signly-Event-Id, X-Signly-Event-Type and X-Signly-Timestamp. When the endpoint has a secret it also carries X-Signly-Signature:
v1= followed by the hex HMAC-SHA256 of {timestamp}.{raw body}, keyed with your secret value.form.completed, so you can route before parsing the body.The secret header itself (for example X-Webhook-Secret: <value>) is also sent, for receivers that only compare a shared value. It carries the same value that keys the signature, so treat it as sensitive. Checking the signature adds what the header alone cannot: proof that the body was not changed, and protection against replays through the signed timestamp.
import crypto from "node:crypto";
import express from "express";
const app = express();
const SECRET = process.env.SIGNLY_WEBHOOK_SECRET; // the value you saved as the webhook secret
// Verify against the raw body, before JSON parsing changes it.
app.post("/webhooks/signly", express.raw({ type: "application/json" }), (req, res) => {
const timestamp = req.get("X-Signly-Timestamp");
const signature = req.get("X-Signly-Signature") || "";
const expected = "v1=" + crypto
.createHmac("sha256", SECRET)
.update(`${timestamp}.${req.body}`)
.digest("hex");
const valid = Buffer.byteLength(signature) === Buffer.byteLength(expected) &&
crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
const fresh = Math.abs(Date.now() / 1000 - Number(timestamp)) < 300;
if (!valid || !fresh) return res.sendStatus(401);
const event = JSON.parse(req.body);
// Deduplicate on event.event_id, then hand off to a queue.
res.sendStatus(200);
});
import hashlib, hmac, os, time
from flask import Flask, request, abort
app = Flask(__name__)
SECRET = os.environ["SIGNLY_WEBHOOK_SECRET"].encode()
@app.post("/webhooks/signly")
def signly_webhook():
timestamp = request.headers.get("X-Signly-Timestamp", "")
signature = request.headers.get("X-Signly-Signature", "")
body = request.get_data() # raw bytes
expected = "v1=" + hmac.new(
SECRET, timestamp.encode() + b"." + body, hashlib.sha256
).hexdigest()
if not hmac.compare_digest(signature, expected):
abort(401)
if abs(time.time() - int(timestamp)) > 300:
abort(401)
event = request.get_json()
# Deduplicate on event["event_id"], then process asynchronously.
return "", 200
# Rails controller
def signly
body = request.raw_post
timestamp = request.headers["X-Signly-Timestamp"].to_s
signature = request.headers["X-Signly-Signature"].to_s
expected = "v1=" + OpenSSL::HMAC.hexdigest("SHA256", ENV.fetch("SIGNLY_WEBHOOK_SECRET"), "#{timestamp}.#{body}")
return head :unauthorized unless ActiveSupport::SecurityUtils.secure_compare(signature, expected)
return head :unauthorized if (Time.now.to_i - timestamp.to_i).abs > 300
SignlyEventJob.perform_later(JSON.parse(body))
head :ok
end
Delivery and retries
- Answer with any
2xxstatus within 30 seconds. Do the real work in a background job after you respond. - A
4xxor5xxstatus, a timeout or a connection error counts as a failure. Redirects are not followed: a3xxis recorded as delivered and not retried. - Failed deliveries are retried with exponential backoff: 1, 2, 4, 8 minutes and so on, for about 34 hours.
form.completedkeeps retrying for almost 6 days. - Events can arrive more than once and out of order. Use
event_idto deduplicate and the record's own timestamps to order them. - Download documents from the links in the payload right away: they expire after 40 minutes. A later
GETon the submission returns fresh links. - If your endpoint was down for longer than the retry window, catch up with the events feed.
Ready to integrate?
Create an account and request API access. We review requests quickly and can help you plan your integration.