Hanzo
OpenapiEsign

Uploads a PDF and opens a draft ready for recipients and fields.

Uploads a PDF and opens a draft ready for recipients and fields.

POST /v1/esign/documents

Addresshttps://api.hanzo.ai/v1/esign/documents
MethodPOST
Operationpost_esign_documents
AuthAuthorization: Bearer $HANZO_API_KEY

Uploads a PDF and opens a draft ready for recipients and fields.

It answers 201 with the document in DRAFT — the state where recipients and fields may still be added, and the only state they may. The bytes go to object storage rather than into the tenant database, and the original is kept under its own key so it survives sealing untouched: a completed document can always be compared against what was uploaded. Creation is recorded on the audit trail.

This is the sender's door: a validated principal is required, and the document lands in that principal's OWN org. Isolation is physical rather than a filter — each tenant has its own store — so another org's document id is simply not there. A body over 32 MiB is refused with 413.

Request

6 fields, body application/json (required).

FieldInTypeRequiredDescription
externalIdbodyanyExternalID is your own identifier for this document, stored and echoed back so a document here can be matched to a record in your system.
messagebodyanyMessage is the covering message carried with the document.
pdfBase64bodyanyPdfBase64 is the document itself, base64-encoded; a data: URL prefix is accepted and stripped. Required.
signingOrderbodyanySigningOrder chooses PARALLEL — the default, where everyone may sign at once — or SEQUENTIAL, where each signer waits for the ones ahead of them.
subjectbodyanySubject is the covering subject line carried with the document.
titlebodyanyTitle is the document's name, shown to every recipient and used to build the download filename.

Response

StatusBodyMeaning
201esignDocumentcreated

201 body — 34 fields.

FieldInTypeAlwaysDescription
completedAtbodyintegerCompletedAt is when the document sealed, in unix milliseconds; null until it does.
createdAtbodyintegerCreatedAt is when the document was uploaded, in unix milliseconds.
externalIdbodystringExternalID is the caller's own identifier for this document, echoed back as it was given; null when none was.
fieldsbodyesignField[]Fields is every field on the document, ordered by page and then by when it was placed.
fields[].customTextbodystringCustomText is the value a non-signature field was filled with, empty until it is.
fields[].fieldMetabodyanyFieldMeta is the caller's own metadata for this field, stored verbatim at placement and never interpreted.
fields[].heightbodynumberHeight is the field's height, -1 when the renderer is to choose one.
fields[].idbodystringID is the field id.
fields[].insertedbodybooleanInserted is whether this field has been filled in.
fields[].pagebodynumberPage is the 1-based page the field sits on.
fields[].positionXbodynumberPositionX is the field's horizontal position on that page.
fields[].positionYbodynumberPositionY is the field's vertical position on that page.
fields[].recipientIdbodystringRecipientID is who must fill this field.
fields[].typebodystringType is what the field collects — SIGNATURE, DATE, NAME, EMAIL, TEXT and the rest.
fields[].widthbodynumberWidth is the field's width, -1 when the renderer is to choose one.
idbodystringID is the document id.
messagebodystringMessage is the covering message stored with the document; null when none was given.
recipientsbodyesignRecipient[]Recipients is everyone on the document, ordered by signing order and then by when they were added — which is also the order a SEQUENTIAL document enforces.
recipients[].emailbodystringEmail is where this recipient's signing link is meant to go, lower-cased.
recipients[].idbodystringID is the recipient id, which is what a field is placed against.
recipients[].namebodystringName is the recipient's display name, empty when none was given.
recipients[].readStatusbodystringReadStatus is NOT_OPENED until they first open their link, then OPENED.
recipients[].rejectionReasonbodystringRejectionReason is why they declined, null unless they did.
recipients[].rolebodystringRole is SIGNER, CC, VIEWER, APPROVER or ASSISTANT.
recipients[].sendStatusbodystringSendStatus is NOT_SENT until the document goes out, then SENT.
recipients[].signedAtbodyintegerSignedAt is when they finished or declined, in unix milliseconds; null while neither has happened.
recipients[].signingOrderbodynumberSigningOrder is their position in a SEQUENTIAL document, null when they were added without one.
recipients[].signingStatusbodystringSigningStatus is NOT_SIGNED, SIGNED or REJECTED.
signingOrderbodystringSigningOrder is PARALLEL or SEQUENTIAL, fixed when the document was created.
sourcebodystringSource is how the document came to exist.
statusbodystringStatus is DRAFT while recipients and fields may still be added, PENDING once it has gone out, then COMPLETED when every signer has finished or REJECTED if any…
subjectbodystringSubject is the covering subject line stored with the document; null when none was given.
titlebodystringTitle is the document's name, and the stem of the download filename.
updatedAtbodyintegerUpdatedAt is when the document last changed, in unix milliseconds.

Failure carries the platform error shape — see Errors.

Examples

hanzo esign documents create

Esign API · All Hanzo APIs · Interactive reference

How is this guide?

On this page