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

<h2 id="documents"><a class="anchor" href="#documents" aria-hidden="true">#</a>Documents</h2>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/documents</code></p>

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

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/documents</code></p>

**List documents**

| Parameter | In | Description |
| --- | --- | --- |
| `limit` | query |  |
| `starting_after` | query |  |
| `ending_before` | query |  |
| `status` | query |  |
| `template` | query |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/documents/{id}</code></p>

**Retrieve a document**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-patch">PATCH</span> <code>/v2/documents/{id}</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-delete">DELETE</span> <code>/v2/documents/{id}</code></p>

**Delete a draft**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/documents/{id}/send</code></p>

**Send for signature**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/documents/{id}/void</code></p>

**Void (withdraw) a sent document**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

| Field | Type | Description |
| --- | --- | --- |
| `reason` | string | null |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/documents/{id}/remind</code></p>

**Remind waiting signers**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

| Field | Type | Description |
| --- | --- | --- |
| `party` | string |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/documents/{id}/content</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-patch">PATCH</span> <code>/v2/documents/{id}/content</code></p>

**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 | What this edit is and why, kept with the revision: the change log people and agents read. |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/documents/{id}/revisions</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/documents/{id}/revisions/compare</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/documents/{id}/revisions/{target}/restore</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/documents/{id}/docx</code></p>

**Download as DOCX**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/documents/{id}/pdf</code></p>

**Download the PDF**

The signed PDF with its certificate once completed; before that, a preview with the current values.

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/documents/{id}/audit_trail</code></p>

**Audit trail**

Every event of the document with its hash chain, and whether the chain verifies.

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/documents/{id}/parties</code></p>

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

</section>

<section class="endpoint"><p class="ep"><span class="method m-patch">PATCH</span> <code>/v2/documents/{id}/parties/{party}</code></p>

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

</section>

<section class="endpoint"><p class="ep"><span class="method m-delete">DELETE</span> <code>/v2/documents/{id}/parties/{party}</code></p>

**Remove a party from a draft**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |
| `party` * | path |  |

</section>

<h2 id="files"><a class="anchor" href="#files" aria-hidden="true">#</a>Files</h2>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/files</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/files</code></p>

**List files**

| Parameter | In | Description |
| --- | --- | --- |
| `limit` | query |  |
| `starting_after` | query |  |
| `ending_before` | query |  |
| `purpose` | query |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/files/{id}</code></p>

**Retrieve a file**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/files/{id}/content</code></p>

**Download a file**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

</section>

<h2 id="templates"><a class="anchor" href="#templates" aria-hidden="true">#</a>Templates</h2>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/templates</code></p>

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

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/templates</code></p>

**List templates**

| Parameter | In | Description |
| --- | --- | --- |
| `limit` | query |  |
| `starting_after` | query |  |
| `ending_before` | query |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/templates/{id}</code></p>

**Retrieve a template**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |
| `version` | query |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-patch">PATCH</span> <code>/v2/templates/{id}</code></p>

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

</section>

<section class="endpoint"><p class="ep"><span class="method m-delete">DELETE</span> <code>/v2/templates/{id}</code></p>

**Archive a template**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/templates/{id}/versions</code></p>

**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 |  |

</section>

<h2 id="sessions"><a class="anchor" href="#sessions" aria-hidden="true">#</a>Sessions</h2>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/sessions</code></p>

**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 |  |

</section>

<h2 id="webhooks"><a class="anchor" href="#webhooks" aria-hidden="true">#</a>Webhooks</h2>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/webhook_endpoints</code></p>

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

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/webhook_endpoints</code></p>

**List webhook endpoints**

| Parameter | In | Description |
| --- | --- | --- |
| `limit` | query |  |
| `starting_after` | query |  |
| `ending_before` | query |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/webhook_endpoints/{id}</code></p>

**Retrieve a webhook endpoint**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-patch">PATCH</span> <code>/v2/webhook_endpoints/{id}</code></p>

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

</section>

<section class="endpoint"><p class="ep"><span class="method m-delete">DELETE</span> <code>/v2/webhook_endpoints/{id}</code></p>

**Delete a webhook endpoint**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/webhook_endpoints/{id}/deliveries</code></p>

**Delivery log**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |
| `limit` | query |  |
| `starting_after` | query |  |
| `ending_before` | query |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/webhook_endpoints/{id}/deliveries/{delivery}/retry</code></p>

**Retry a delivery now**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |
| `delivery` * | path |  |

</section>

<h2 id="events"><a class="anchor" href="#events" aria-hidden="true">#</a>Events</h2>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/events</code></p>

**List events**

The last 30 days, newest first.

| Parameter | In | Description |
| --- | --- | --- |
| `limit` | query |  |
| `starting_after` | query |  |
| `ending_before` | query |  |
| `type` | query |  |
| `document` | query |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/events/{id}</code></p>

**Retrieve an event**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

</section>

<h2 id="account"><a class="anchor" href="#account" aria-hidden="true">#</a>Account</h2>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/account</code></p>

**The account and key in use**

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/usage</code></p>

**Usage by month**

| Parameter | In | Description |
| --- | --- | --- |
| `months` | query |  |

</section>

<h2 id="api-keys"><a class="anchor" href="#api-keys" aria-hidden="true">#</a>API keys</h2>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/api_keys</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/api_keys</code></p>

**List API keys**

| Parameter | In | Description |
| --- | --- | --- |
| `limit` | query |  |
| `starting_after` | query |  |
| `ending_before` | query |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/api_keys/{id}/revoke</code></p>

**Revoke an API key**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

</section>

<h2 id="tenants"><a class="anchor" href="#tenants" aria-hidden="true">#</a>Tenants</h2>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/tenants</code></p>

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

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/tenants</code></p>

**List tenants**

| Parameter | In | Description |
| --- | --- | --- |
| `limit` | query |  |
| `starting_after` | query |  |
| `ending_before` | query |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/tenants/{id}</code></p>

**Retrieve a tenant**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-patch">PATCH</span> <code>/v2/tenants/{id}</code></p>

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

</section>

<h2 id="client"><a class="anchor" href="#client" aria-hidden="true">#</a>Client</h2>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/client/session</code></p>

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

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/client/session/values</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/client/session/sign</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/client/session/decline</code></p>

**Decline to sign**

| Field | Type | Description |
| --- | --- | --- |
| `reason` | string |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/client/session/source.pdf</code></p>

**The PDF being signed (PDF documents)**

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/client/session/signed.pdf</code></p>

**The signed PDF, once everyone signed**

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/client/session/send</code></p>

**Send for signature**

Editing sessions with "send". Fails with the first readiness issue.

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/client/session/remind</code></p>

**Remind waiting signers**

Sessions with "remind". Without a party, every signer whose turn it is gets a reminder.

| Field | Type | Description |
| --- | --- | --- |
| `party` | string |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/client/session/void</code></p>

**Withdraw the document**

Sessions with "void". Signers can no longer open it.

| Field | Type | Description |
| --- | --- | --- |
| `reason` | string |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/client/session/parties</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/client/session/settings</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/client/session/content</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/client/session/revisions</code></p>

**The document’s revisions**

Viewing and editing sessions. Newest first; `before` pages back.

| Parameter | In | Description |
| --- | --- | --- |
| `before` | query |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/client/session/revisions/compare</code></p>

**Compare two revisions**

Viewing and editing sessions. Defaults: `to` = current, `from` = the one before.

| Parameter | In | Description |
| --- | --- | --- |
| `from` | query |  |
| `to` | query |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/client/session/revisions/restore</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/client/session/fields</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/client/session/document</code></p>

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

</section>

<h2 id="review"><a class="anchor" href="#review" aria-hidden="true">#</a>Review</h2>

<section class="endpoint"><p class="ep"><span class="method m-get">GET</span> <code>/v2/documents/{id}/review</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/documents/{id}/reviews</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/documents/{id}/reviews/{review}/cancel</code></p>

**Cancel a review round**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |
| `review` * | path |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/documents/{id}/comments</code></p>

**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 | The block it is about (from content?format=blocks) |
| `quote` | string | null | The exact words it is about |
| `thread` | string | null | Reply to this comment |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/documents/{id}/comments/{comment}/resolve</code></p>

**Resolve a comment thread (or reopen it)**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |
| `comment` * | path |  |

| Field | Type | Description |
| --- | --- | --- |
| `resolved` | boolean |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/documents/{id}/suggestions</code></p>

**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 |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/documents/{id}/suggestions/{suggestion}/accept</code></p>

**Accept a suggested edit**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |
| `suggestion` * | path |  |

</section>

<section class="endpoint"><p class="ep"><span class="method m-post">POST</span> <code>/v2/documents/{id}/suggestions/{suggestion}/reject</code></p>

**Reject a suggested edit**

| Parameter | In | Description |
| --- | --- | --- |
| `id` * | path |  |
| `suggestion` * | path |  |

</section>

