API reference
Every endpoint of API v2, generated from the OpenAPI document (/v2/openapi.json).
Base URL https://api2.sendforsign.com. Authenticate with Authorization: Bearer sk_test_… (or sk_live_…); browser routes under /v2/client take a session secret instead. Fields marked * are required.
Documents
POST /v2/documents
Create a document
From an uploaded DOCX or PDF (file), from Markdown, from a template, or empty. Word documents keep their layout one to one. Pass send: true to send at once.
| Field | Type | Description |
|---|---|---|
name |
string | |
file |
string | A file_ id (DOCX or PDF) uploaded with purpose "document". |
markdown |
string | The document as Markdown; {{markers}} become fields. |
template |
string | |
template_version |
integer | |
locale |
string | |
message |
string | null |
signing_order |
string | |
expires_at |
string | null |
reminders |
object | null |
parties |
array | |
fields |
array | |
data |
object | Field values by key. |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
send |
boolean | Send right after creating. |
GET /v2/documents
List documents
| Parameter | In | Description |
|---|---|---|
limit |
query | |
starting_after |
query | |
ending_before |
query | |
status |
query | |
template |
query |
GET /v2/documents/{id}
Retrieve a document
| Parameter | In | Description |
|---|---|---|
id * |
path |
PATCH /v2/documents/{id}
Update a document
Drafts can change everything; after sending only metadata changes.
| Parameter | In | Description |
|---|---|---|
id * |
path |
| Field | Type | Description |
|---|---|---|
name |
string | |
locale |
string | |
message |
string | null |
signing_order |
string | |
expires_at |
string | null |
reminders |
object | null |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
fields |
array | |
remove_fields |
array | Keys of fields to remove. Only fields that are not part of the text: a PDF's boxes, form questions. |
data |
object |
DELETE /v2/documents/{id}
Delete a draft
| Parameter | In | Description |
|---|---|---|
id * |
path |
POST /v2/documents/{id}/send
Send for signature
| Parameter | In | Description |
|---|---|---|
id * |
path |
POST /v2/documents/{id}/void
Void (withdraw) a sent document
| Parameter | In | Description |
|---|---|---|
id * |
path |
| Field | Type | Description |
|---|---|---|
reason |
string | null |
POST /v2/documents/{id}/remind
Remind waiting signers
| Parameter | In | Description |
|---|---|---|
id * |
path |
| Field | Type | Description |
|---|---|---|
party |
string |
GET /v2/documents/{id}/content
Read the content
markdown for agents (fields as values or {{key}}), html to display, blocks with ids for targeted edits, json for editors.
| Parameter | In | Description |
|---|---|---|
id * |
path | |
format |
query | |
values |
query | |
revision |
query |
PATCH /v2/documents/{id}/content
Edit the content by block id
Replace, insert or delete blocks, or replace exact text. Formatting and numbering of the surrounding clauses stay.
| Parameter | In | Description |
|---|---|---|
id * |
path |
| Field | Type | Description |
|---|---|---|
revision * |
integer | The revision you edited; a newer one is a conflict. |
operations * |
array | |
note |
string | null |
GET /v2/documents/{id}/revisions
List revisions
Every edit is a revision, kept whole: who made it (sender, agent), its note and how (operation kinds). Newest first. Read one with GET /content?revision=N.
| Parameter | In | Description |
|---|---|---|
id * |
path | |
limit |
query | |
before |
query |
GET /v2/documents/{id}/revisions/compare
Compare two revisions
Blocks added, removed, changed (with the words that went and came) and reformatted, and fields added, removed or changed. Defaults: to = current, from = the one before.
| Parameter | In | Description |
|---|---|---|
id * |
path | |
from |
query | |
to |
query |
POST /v2/documents/{id}/revisions/{target}/restore
Restore an earlier revision
Drafts only. The earlier text becomes a new revision; the ones in between stay readable. Pass the current revision you saw.
| Parameter | In | Description |
|---|---|---|
id * |
path | |
target * |
path |
| Field | Type | Description |
|---|---|---|
revision * |
integer | |
note |
string | null |
GET /v2/documents/{id}/docx
Download as DOCX
| Parameter | In | Description |
|---|---|---|
id * |
path |
GET /v2/documents/{id}/pdf
Download the PDF
The signed PDF with its certificate once completed; before that, a preview with the current values.
| Parameter | In | Description |
|---|---|---|
id * |
path |
GET /v2/documents/{id}/audit_trail
Audit trail
Every event of the document with its hash chain, and whether the chain verifies.
| Parameter | In | Description |
|---|---|---|
id * |
path |
POST /v2/documents/{id}/parties
Add a party
| Parameter | In | Description |
|---|---|---|
id * |
path |
| Field | Type | Description |
|---|---|---|
role |
string | |
kind |
string | |
name |
string | null |
email |
string | null |
locale |
string | null |
delivery |
string | email: we send the link. link: you get signing_url. embedded: you open a signing session. |
order |
integer | |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
PATCH /v2/documents/{id}/parties/{party}
Update a party
After sending, only the details of a party who has not acted yet can change.
| Parameter | In | Description |
|---|---|---|
id * |
path | |
party * |
path |
| Field | Type | Description |
|---|---|---|
role |
string | |
kind |
string | |
name |
string | null |
email |
string | null |
locale |
string | null |
delivery |
string | email: we send the link. link: you get signing_url. embedded: you open a signing session. |
order |
integer | |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
DELETE /v2/documents/{id}/parties/{party}
Remove a party from a draft
| Parameter | In | Description |
|---|---|---|
id * |
path | |
party * |
path |
Files
POST /v2/files
Upload a file
Multipart form with file and purpose (document for DOCX or PDF to sign, image, attachment); or JSON with content_base64, filename and purpose, which is easier for agents.
| Field | Type | Description |
|---|---|---|
content_base64 * |
string | |
filename |
string | |
purpose * |
string |
GET /v2/files
List files
| Parameter | In | Description |
|---|---|---|
limit |
query | |
starting_after |
query | |
ending_before |
query | |
purpose |
query |
GET /v2/files/{id}
Retrieve a file
| Parameter | In | Description |
|---|---|---|
id * |
path |
GET /v2/files/{id}/content
Download a file
| Parameter | In | Description |
|---|---|---|
id * |
path |
Templates
POST /v2/templates
Create a template
| Field | Type | Description |
|---|---|---|
file |
string | A file_ id: DOCX keeps its layout, PDF gets placed fields. |
markdown |
string | |
document |
string | Turn an existing document into a template. |
fields |
array | |
roles |
array | |
name |
string | |
description |
string | null |
locale |
string | null |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
GET /v2/templates
List templates
| Parameter | In | Description |
|---|---|---|
limit |
query | |
starting_after |
query | |
ending_before |
query |
GET /v2/templates/{id}
Retrieve a template
| Parameter | In | Description |
|---|---|---|
id * |
path | |
version |
query |
PATCH /v2/templates/{id}
Update a template
| Parameter | In | Description |
|---|---|---|
id * |
path |
| Field | Type | Description |
|---|---|---|
name |
string | |
description |
string | null |
locale |
string | null |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
DELETE /v2/templates/{id}
Archive a template
| Parameter | In | Description |
|---|---|---|
id * |
path |
POST /v2/templates/{id}/versions
Publish a new version
Documents created before keep the version they were made from.
| Parameter | In | Description |
|---|---|---|
id * |
path |
| Field | Type | Description |
|---|---|---|
file |
string | A file_ id: DOCX keeps its layout, PDF gets placed fields. |
markdown |
string | |
document |
string | Turn an existing document into a template. |
fields |
array | |
roles |
array |
Sessions
POST /v2/sessions
Create a session for an embedded component
Returns a short-lived client_secret for the browser. signing needs a party and is refused for agent keys; viewing shows a document; editing opens a draft in the editor.
| Field | Type | Description |
|---|---|---|
kind * |
string | |
document * |
string | |
party |
string | null |
expires_in |
integer | |
return_url |
string | null |
features |
array |
Webhooks
POST /v2/webhook_endpoints
Create a webhook endpoint
The response holds the signing secret; it is shown only here.
| Field | Type | Description |
|---|---|---|
url * |
string | |
enabled_events * |
array | |
description |
string | null |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
GET /v2/webhook_endpoints
List webhook endpoints
| Parameter | In | Description |
|---|---|---|
limit |
query | |
starting_after |
query | |
ending_before |
query |
GET /v2/webhook_endpoints/{id}
Retrieve a webhook endpoint
| Parameter | In | Description |
|---|---|---|
id * |
path |
PATCH /v2/webhook_endpoints/{id}
Update a webhook endpoint
| Parameter | In | Description |
|---|---|---|
id * |
path |
| Field | Type | Description |
|---|---|---|
url |
string | |
enabled_events |
array | |
description |
string | null |
status |
string | |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
DELETE /v2/webhook_endpoints/{id}
Delete a webhook endpoint
| Parameter | In | Description |
|---|---|---|
id * |
path |
GET /v2/webhook_endpoints/{id}/deliveries
Delivery log
| Parameter | In | Description |
|---|---|---|
id * |
path | |
limit |
query | |
starting_after |
query | |
ending_before |
query |
POST /v2/webhook_endpoints/{id}/deliveries/{delivery}/retry
Retry a delivery now
| Parameter | In | Description |
|---|---|---|
id * |
path | |
delivery * |
path |
Events
GET /v2/events
List events
The last 30 days, newest first.
| Parameter | In | Description |
|---|---|---|
limit |
query | |
starting_after |
query | |
ending_before |
query | |
type |
query | |
document |
query |
GET /v2/events/{id}
Retrieve an event
| Parameter | In | Description |
|---|---|---|
id * |
path |
Account
GET /v2/account
The account and key in use
GET /v2/usage
Usage by month
| Parameter | In | Description |
|---|---|---|
months |
query |
API keys
POST /v2/api_keys
Create an API key
Restricted keys carry permissions; agent: true keys can do everything their permissions allow except sign, and every key they create is an agent key too. The secret is shown only here.
| Field | Type | Description |
|---|---|---|
kind |
string | |
name |
string | null |
permissions |
array | |
tenant |
string | null |
agent |
boolean | |
allowed_recipient_domains |
array | null |
expires_at |
string | null |
GET /v2/api_keys
List API keys
| Parameter | In | Description |
|---|---|---|
limit |
query | |
starting_after |
query | |
ending_before |
query |
POST /v2/api_keys/{id}/revoke
Revoke an API key
| Parameter | In | Description |
|---|---|---|
id * |
path |
Tenants
POST /v2/tenants
Create a tenant
A customer of your platform with its own brand, sender name and documents. Act for it with the Sendforsign-Tenant header.
| Field | Type | Description |
|---|---|---|
name * |
string | |
email |
string | null |
locale |
string | null |
branding |
object | |
sender |
object | |
external_id |
string | null |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
GET /v2/tenants
List tenants
| Parameter | In | Description |
|---|---|---|
limit |
query | |
starting_after |
query | |
ending_before |
query |
GET /v2/tenants/{id}
Retrieve a tenant
| Parameter | In | Description |
|---|---|---|
id * |
path |
PATCH /v2/tenants/{id}
Update a tenant
| Parameter | In | Description |
|---|---|---|
id * |
path |
| Field | Type | Description |
|---|---|---|
name |
string | |
email |
string | null |
locale |
string | null |
branding |
object | |
sender |
object | |
external_id |
string | null |
metadata |
object | Up to 50 keys of your own data. An empty string removes a key. |
Client
GET /v2/client/session
What the session’s browser sees
Signing sessions get the signing view. Viewing and editing sessions get the document view: status, parties, history, content, readiness and the actions the session allows.
POST /v2/client/session/values
Save field values
A signer saves their own fields; an editing session with "values" fills the sender’s fields of a draft.
| Field | Type | Description |
|---|---|---|
data * |
object |
POST /v2/client/session/sign
Sign
The signature is a PNG (drawn, or a typed name drawn in a script face by the component). Consent must be true.
| Field | Type | Description |
|---|---|---|
data |
object | |
name |
string | |
signature * |
object | |
initials |
object | |
consent * |
boolean |
POST /v2/client/session/decline
Decline to sign
| Field | Type | Description |
|---|---|---|
reason |
string |
GET /v2/client/session/source.pdf
The PDF being signed (PDF documents)
GET /v2/client/session/signed.pdf
The signed PDF, once everyone signed
POST /v2/client/session/send
Send for signature
Editing sessions with "send". Fails with the first readiness issue.
POST /v2/client/session/remind
Remind waiting signers
Sessions with "remind". Without a party, every signer whose turn it is gets a reminder.
| Field | Type | Description |
|---|---|---|
party |
string |
POST /v2/client/session/void
Withdraw the document
Sessions with "void". Signers can no longer open it.
| Field | Type | Description |
|---|---|---|
reason |
string |
POST /v2/client/session/parties
Change the parties of a draft
Editing sessions with "parties". Removals run first, then updates, then additions.
| Field | Type | Description |
|---|---|---|
add |
array | |
update |
array | |
remove |
array |
POST /v2/client/session/settings
Change the draft’s name, message or signing order
Editing sessions with "values". The message is what signers read above the document.
| Field | Type | Description |
|---|---|---|
name |
string | |
message |
string | null |
signing_order |
string |
POST /v2/client/session/content
Edit the text of a draft
Editing sessions with "content". Operations address blocks by id; revision guards against lost updates.
| Field | Type | Description |
|---|---|---|
revision * |
integer | |
operations * |
array |
GET /v2/client/session/revisions
The document’s revisions
Viewing and editing sessions. Newest first; before pages back.
| Parameter | In | Description |
|---|---|---|
before |
query |
GET /v2/client/session/revisions/compare
Compare two revisions
Viewing and editing sessions. Defaults: to = current, from = the one before.
| Parameter | In | Description |
|---|---|---|
from |
query | |
to |
query |
POST /v2/client/session/revisions/restore
Restore an earlier revision
Editing sessions with "content". target becomes current again as a new revision; revision is the current one you saw.
| Field | Type | Description |
|---|---|---|
target * |
integer | |
revision * |
integer | |
note |
string | null |
POST /v2/client/session/fields
Place and change the fields of a draft
Editing sessions with "content". For a PDF, a field's placements are its boxes on the pages, in points from the top-left corner.
| Field | Type | Description |
|---|---|---|
upsert |
array | |
remove |
array |
GET /v2/client/session/document
The draft in the Sendforsign model, for an editor
Editing sessions with "content". Send it back changed with a replace_body operation to /v2/client/session/content.
Review
GET /v2/documents/{id}/review
Review state
Rounds of approval (newest first) with each reviewer’s status, decision, comment and review link; comments with threads; suggested edits.
| Parameter | In | Description |
|---|---|---|
id * |
path |
POST /v2/documents/{id}/reviews
Start a review round
Asks named people to approve the draft as it is now, in order or all at once. Each gets a review link (review_url) to pass on. Any later change to the text makes the round outdated. Sending waits for an approved round (or a cancelled one).
| Parameter | In | Description |
|---|---|---|
id * |
path |
| Field | Type | Description |
|---|---|---|
reviewers * |
array | |
order |
string | Default: sequential |
message |
string | null |
POST /v2/documents/{id}/reviews/{review}/cancel
Cancel a review round
| Parameter | In | Description |
|---|---|---|
id * |
path | |
review * |
path |
POST /v2/documents/{id}/comments
Comment on the text
On a block and the exact words (quote), or a reply in a thread.
| Parameter | In | Description |
|---|---|---|
id * |
path |
| Field | Type | Description |
|---|---|---|
body * |
string | |
block |
string | null |
quote |
string | null |
thread |
string | null |
POST /v2/documents/{id}/comments/{comment}/resolve
Resolve a comment thread (or reopen it)
| Parameter | In | Description |
|---|---|---|
id * |
path | |
comment * |
path |
| Field | Type | Description |
|---|---|---|
resolved |
boolean |
POST /v2/documents/{id}/suggestions
Suggest an edit
Exact text in a block and what to put instead. The sender’s side accepts it (it becomes a new version) or rejects it.
| Parameter | In | Description |
|---|---|---|
id * |
path |
| Field | Type | Description |
|---|---|---|
block * |
string | |
find * |
string | Exact text in the block to change |
replace * |
string | What to put instead (empty to delete) |
note |
string | null |
POST /v2/documents/{id}/suggestions/{suggestion}/accept
Accept a suggested edit
| Parameter | In | Description |
|---|---|---|
id * |
path | |
suggestion * |
path |
POST /v2/documents/{id}/suggestions/{suggestion}/reject
Reject a suggested edit
| Parameter | In | Description |
|---|---|---|
id * |
path | |
suggestion * |
path |