Places a field on the page for one recipient to fill.
Places a field on the page for one recipient to fill.
POST /v1/esign/documents/{id}/fields
| 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 | esignPlacement | created |
201 body — 4 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
id | body | string | — | ID is the new field's id. |
page | body | number | — | 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.
Examples
hanzo esign documents fields <id>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>" });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>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.EsignAPI.PostEsignDocumentsByIdFields(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::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?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.EsignApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new EsignApi(client).postEsignDocumentsByIdFields();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>"
}'The door reaches esign through the esign tool, which names its 9 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
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"
}
}
}'How is this guide?