# Create recipients

URL: https://docs.hanzo.ai/docs/openapi/esign/post-esign-documents-by-id-recipients

> Adds someone to a draft and mints their signing token.

`POST /v1/esign/documents/{id}/recipients`

> [eSign →](https://docs.hanzo.ai/docs/openapi/esign) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                           |
| ------------- | --------------------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/esign/documents/{id}/recipients` |
| **Method**    | `POST`                                                    |
| **Operation** | `post_esign_documents_by_id_recipients`                   |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`                    |

Adds someone to a draft and mints their signing token.

It answers 201 with the recipient's id and their signing TOKEN — the
crypto-random capability that is the only credential the signer's surface
accepts — so this response is where the signing link is built from. A CC
recipient is recorded as already complete, because they are never asked to
sign.

Only while DRAFT: adding a recipient to a document already sent is a 409,
because the field layout and the turn order were fixed when it went out. An
unknown document is a 404. The addition is recorded on the audit trail.

## Request

5 fields, body `application/json` (required).

| Field          | In   | Type   | Required | Description                                                                                                                                     |
| -------------- | ---- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`           | path | string | yes      |                                                                                                                                                 |
| `email`        | body | any    | —        | Email is where the signing link is meant to go, lower-cased on the way in.                                                                      |
| `name`         | body | any    | —        | Name is the recipient's display name, also the fallback a NAME field is filled with when they leave it blank.                                   |
| `role`         | body | any    | —        | Role is SIGNER (the default), CC, VIEWER, APPROVER or ASSISTANT; anything else reads as SIGNER.                                                 |
| `signingOrder` | body | any    | —        | SigningOrder is this recipient's position when the document is SEQUENTIAL — lower signs first, and ties fall back to the order they were added. |

## Response

| Status    | Body              | Meaning |
| --------- | ----------------- | ------- |
| `201`     | esign.esignInvite | created |
| `default` | problem-details   | refused |

`201` body — 5 fields.

| Field   | In   | Type   | Always | Description                                                                     |
| ------- | ---- | ------ | ------ | ------------------------------------------------------------------------------- |
| `email` | body | string | —      | Email is the address the invitation is for, lower-cased.                        |
| `id`    | body | string | —      | ID is the new recipient's id, which is what a field is placed against.          |
| `name`  | body | string | —      | Name is the recipient's display name, empty when none was given.                |
| `role`  | body | string | —      | Role is the role they were recorded with — SIGNER unless another was asked for. |
| `token` | body | string | —      | Token is the crypto-random signing capability for this recipient.               |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo esign documents recipients <id>
```

**SDK**

**.ts**

```ts
import { Configuration, EsignApi } from 'hanzoai';

const api = new EsignApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postEsignDocumentsByIdRecipients({ id: 'id', email: "<email>", name: "<name>" });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import EsignApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = EsignApi(client).post_esign_documents_by_id_recipients(id='id', email="<email>", name="<name>")
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.EsignAPI.PostEsignDocumentsByIdRecipients(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, esign_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = esign_api::post_esign_documents_by_id_recipients(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.EsignApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new EsignApi(client).postEsignDocumentsByIdRecipients();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/esign/documents/<id>/recipients \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "email": "<email>",
       "name": "<name>"
     }'
```

**MCP**

MCP reaches **esign** through the `esign` tool, which names its 9 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_esign_documents"
         }
       }
     }'
```

---

[eSign API](https://docs.hanzo.ai/docs/openapi/esign) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
