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

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

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

Addresshttps://api.hanzo.ai/v1/esign/documents/{id}/fields
MethodPOST
Operationpost_esign_documents_by_id_fields
AuthAuthorization: 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).

FieldInTypeRequiredDescription
idpathstringyes
fieldMetabodyany—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.
heightbodyany—Height is the field's height, defaulting to -1, which means the renderer chooses one when the document is sealed.
pagebodyany—Page is the 1-based page the field sits on, defaulting to 1.
positionXbodyany—PositionX is the field's horizontal position on that page, defaulting to 0.
positionYbodyany—PositionY is the field's vertical position on that page, defaulting to 0.
recipientIdbodyany—RecipientID is who must fill this field.
typebodyany—Type is what the field collects: SIGNATURE, FREE_SIGNATURE, INITIALS, NAME, EMAIL, DATE, TEXT, NUMBER, RADIO, CHECKBOX or DROPDOWN.
widthbodyany—Width is the field's width, defaulting to -1, which means the renderer chooses one when the document is sealed.

Response

StatusBodyMeaning
201esign.esignPlacementcreated
defaultproblem-detailsrefused

201 body — 4 fields.

FieldInTypeAlwaysDescription
idbodystring—ID is the new field's id.
pagebodynumber (double)—Page is the page it was placed on.
recipientIdbodystring—RecipientID is who must fill it.
typebodystring—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 := 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
}
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?;
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();
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 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:

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 · All Hanzo APIs · Interactive reference

Was this page useful?