# Create fields — POST /v1/esign/documents/{id}/fields

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

> Places a field on the page for one recipient to fill.

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

> [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}/fields` |
| **Method**    | `POST`                                                |
| **Operation** | `post_esign_documents_by_id_fields`                   |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`                |

Places a field on the page for one recipient to fill.

It adds a signature, date, name, email or text box at a page and position for
ONE named recipient, and answers 201 with its id. The recipient must belong to
this document; one from elsewhere is refused.

Fields are what make a recipient signable: a document cannot be sent while any
signing recipient has none. Only while DRAFT — adding a field to a sent document
is a 409 — and an unknown document is a 404. The addition is recorded on the
audit trail.

## Request

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

| Field         | In   | Type   | Required | Description                                                                                                                                              |
| ------------- | ---- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`          | path | string | yes      |                                                                                                                                                          |
| `fieldMeta`   | body | any    | —        | FieldMeta is your own metadata for this field — a label, a placeholder, a required flag — stored verbatim and handed back on every read of the document. |
| `height`      | body | any    | —        | Height is the field's height, defaulting to -1, which means the renderer chooses one when the document is sealed.                                        |
| `page`        | body | any    | —        | Page is the 1-based page the field sits on, defaulting to 1.                                                                                             |
| `positionX`   | body | any    | —        | PositionX is the field's horizontal position on that page, defaulting to 0.                                                                              |
| `positionY`   | body | any    | —        | PositionY is the field's vertical position on that page, defaulting to 0.                                                                                |
| `recipientId` | body | any    | —        | RecipientID is who must fill this field.                                                                                                                 |
| `type`        | body | any    | —        | Type is what the field collects: SIGNATURE, FREE\_SIGNATURE, INITIALS, NAME, EMAIL, DATE, TEXT, NUMBER, RADIO, CHECKBOX or DROPDOWN.                     |
| `width`       | body | any    | —        | Width is the field's width, defaulting to -1, which means the renderer chooses one when the document is sealed.                                          |

## Response

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

`201` body — 4 fields.

| Field         | In   | Type            | Always | Description                        |
| ------------- | ---- | --------------- | ------ | ---------------------------------- |
| `id`          | body | string          | —      | ID is the new field's id.          |
| `page`        | body | number (double) | —      | Page is the page it was placed on. |
| `recipientId` | body | string          | —      | RecipientID is who must fill it.   |
| `type`        | body | string          | —      | Type is what it collects.          |

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

## Examples

**CLI**

```bash
hanzo esign documents fields <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.postEsignDocumentsByIdFields({ id: 'id', fieldMeta: "<fieldMeta>", height: "<height>" });
```

**.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_fields(id='id', field_meta="<fieldMeta>", height="<height>")
```

**.go**

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

resp, _, err := client.EsignAPI.PostEsignDocumentsByIdFields(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_fields(&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).postEsignDocumentsByIdFields();
```

**HTTP**

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

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