> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# DocuSeal plugin

> E-signature platform for fillable PDF forms - manage templates, create submissions from templates, PDFs, HTML or DOCX, track submitters, and read back signed documents.

Use **DocuSeal** through Corsair: one client, typed API calls, and incoming webhooks.

Create an API key at console.docuseal.com under API. Every DocuSeal account also gets a free sandbox with separate keys, so you can test without touching production documents. Things to know before you send:

* **Real signatures.** `submissions.create` sends the signature-request emails immediately unless you pass `send_email: false`; the same applies to the create-from-PDF, HTML and DOCX variants. `submitters.update` with `completed: true` counter-signs the document as that submitter, which cannot be undone.
* **Archive, not delete.** The hosted API has no hard delete. `templates.archive` and `submissions.archive` archive; restore either with `templates.update` or `submissions.update` and `archived: false`.
* **Signed document URLs.** `submissions.getDocuments` returns URLs of the signed documents. They act as bearer credentials, so treat the result as sensitive.
* **Paging.** The three list endpoints page by id cursor: pass `pagination.next` from one page as `after` on the next. Page size is capped at 100 (DocuSeal defaults to 10).
* **Plans and editions.** On DocuSeal Cloud every operation works in the free test mode (checked 11-28). The open-source self-hosted build has no routes for templates from HTML, PDF or DOCX, `templates.merge`, `templates.updateDocuments` or one-off submissions from PDF, HTML or DOCX: those answer 404 there. Without Pro, Cloud's `submissions.createFromEmails` creates a submission for the first address only.
* **Webhooks.** DocuSeal sends 11 event types (form viewed, started, completed, declined; submission created, completed, expired, archived; template created, updated, archived). Add the webhook URL in DocuSeal's webhook settings and store its signing secret (`whsec_...`) as the webhook signature: every delivery is checked against `X-Docuseal-Signature` (an HMAC-SHA256 of the timestamp and body) and refused when it is more than five minutes old. `events.listFormCompleted` and `events.listSubmissionCompleted` give the same completed events by polling.
* **Hosts.** Calls go to `api.docuseal.com`. Pass `baseUrl` to the plugin for the EU cloud (`https://api.docuseal.eu`) or a self-hosted site (`https://sign.example.com`; `/api` is added).

**What you get:**

* 28 typed API operations
* 11 incoming webhook event types

## Setup

**1. Install**

```bash npm theme={null}
npm install corsair @corsair-dev/docuseal better-sqlite3
npm install --save-dev @types/better-sqlite3
```

```bash yarn theme={null}
yarn add corsair @corsair-dev/docuseal better-sqlite3
yarn add --dev @types/better-sqlite3
```

```bash pnpm theme={null}
pnpm install corsair @corsair-dev/docuseal better-sqlite3
pnpm install --save-dev @types/better-sqlite3
```

```bash bun theme={null}
bun add corsair @corsair-dev/docuseal better-sqlite3
bun add --dev @types/better-sqlite3
```

**2. Add the plugin**

```ts corsair.ts theme={null}
import Database from 'better-sqlite3';
import { createCorsair } from 'corsair';
import { docuseal } from '@corsair-dev/docuseal';

export const corsair = createCorsair({
	plugins: [
		docuseal(),
	],
	database: new Database('corsair.db'),
	kek: process.env.CORSAIR_KEK!,
	multiTenancy: true,
	hub: {
		projectApiKey: process.env.CORSAIR_API_KEY!,
		signingSecret: process.env.CORSAIR_SIGNING_SECRET!,
	},
});
```

With `multiTenancy: true`, scope calls with `corsair.withTenant(id)`. See [Quick start](https://docs.corsair.dev/quick-start.md) for KEK + Hub keys, and [Multi-tenancy](https://docs.corsair.dev/concepts/multi-tenancy.md) for account isolation.

**3. Choose authentication**

> [tab] API Key (Recommended)
>
> Store the DocuSeal API key before the first call: `pnpm corsair setup --plugin=docuseal --tenant=acme api_key=<your-key>` (leave out `--tenant` without `multiTenancy`), or pass it as `key` in the plugin options. With Hub, each tenant enters their own key on the connect page. See [API key auth](https://docs.corsair.dev/concepts/api-key).
>
> ```ts theme={null}
> docuseal()
> ```
>
> More: [API Key](https://docs.corsair.dev/concepts/api-key)

**4. Connect a tenant**

Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see [Connect / OAuth](https://docs.corsair.dev/management/connect).

```ts theme={null}
const { connectUrl } = await corsair.manage.connect.createLink({
	plugin: 'docuseal',
	tenantId: 'acme',
});
// redirect the user's browser to connectUrl
```

## Example API calls

**List templates**

```ts theme={null}
const tenant = corsair.withTenant('acme');
await tenant.docuseal.api.templates.list({});
```

**Send a template for signature**

```ts theme={null}
const tenant = corsair.withTenant('acme');
await tenant.docuseal.api.submissions.create({
	template_id: 123456,
	submitters: [{ role: 'First party', email: 'jordan@acme-logistics.com' }],
});
```

See the full list on the [API](https://docs.corsair.dev/plugins/docuseal/api.md) page.

## Webhooks

This plugin registers **11** webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use `webhookHooks` on the plugin factory.

See [Webhooks](https://docs.corsair.dev/plugins/docuseal/webhooks.md) for every event path and payload shape, and [Webhooks concept](https://docs.corsair.dev/concepts/webhooks.md) for routing.

## What's next

> [card] [API reference](https://docs.corsair.dev/plugins/docuseal/api.md)
>
> Every `docuseal.api.*` operation with input and output types.

> [card] [Webhooks](https://docs.corsair.dev/plugins/docuseal/webhooks.md)
>
> Event paths, payloads, and `webhookHooks` examples.

> [card] [Connect / OAuth](https://docs.corsair.dev/management/connect)
>
> createLink, Hub delivery, and tenant connect flows.

> [card] [Use with agents](https://docs.corsair.dev/mcp-adapters/mcp-adapters)
>
> Expose this plugin's operations as MCP tools.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.