Create esign

Takes Hanzo eSign's webhook: a SAFE was signed, countersigned, completed, declined or voided, and the investor's form in the brand's CRM moves to that status.

POST /v1/marketing/leads/esign

Addresshttps://api.hanzo.ai/v1/marketing/leads/esign
MethodPOST
Operationpost_marketing_leads_esign
AuthAuthorization: Bearer $HANZO_API_KEY

Takes Hanzo eSign's webhook: a SAFE was signed, countersigned, completed, declined or voided, and the investor's form in the brand's CRM moves to that status. The caller is Hanzo eSign acting as itself: its own IAM client_credentials token, verified by the identity boundary like every other. No caller answers 401, and any caller but eSign's application 403.

A status only moves forward (submitted, investor signed, countersigned, completed; or declined, or voided), so a replay or a late event changes nothing. The document must be the one the form recorded; any other, and any reference that names no investor's form, answers 200 with no status and changes nothing.

Request

7 fields, body application/json (required).

FieldInTypeRequiredDescription
eventbodystring—Event is what happened: DOCUMENT_SIGNED (a recipient signed), DOCUMENT_COMPLETED, DOCUMENT_REJECTED or DOCUMENT_CANCELLED.
payloadbodymarketing.EsignDocument—
payload.externalIdbodystring—ExternalID is the reference the document was made under: the lead's.
payload.idbodyinteger (int64)—ID is the document's id in eSign.
payload.recipientsbodymarketing.EsignRecipient[]—Recipients are the document's signers.
payload.recipients[].signingOrderbodyinteger (int64)—SigningOrder is the signer's turn: 1 is the investor, 2 the countersigner.
payload.recipients[].signingStatusbodystring—SigningStatus is NOT_SIGNED, SIGNED or REJECTED.

Response

StatusBodyMeaning
200marketing.Signingok
defaultproblem-detailsrefused

200 body — 1 field.

FieldInTypeAlwaysDescription
statusbodystring—Status is where the SAFE stands: submitted, investor signed, countersigned, completed, declined or voided.

Failure carries the platform error shape — see Errors.

Examples

hanzo marketing leads esign
import { Configuration, MarketingApi } from 'hanzoai';

const api = new MarketingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postMarketingLeadsEsign({ event: "<event>", payload: {"externalId":"<externalId>","id":0,"recipients":[{"signingOrder":0,"signingStatus":"<signingStatus>"}]} });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import MarketingApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = MarketingApi(client).post_marketing_leads_esign(event="<event>", payload={"externalId":"<externalId>","id":0,"recipients":[{"signingOrder":0,"signingStatus":"<signingStatus>"}]})
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.MarketingAPI.PostMarketingLeadsEsign(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, marketing_api};

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

let result = marketing_api::post_marketing_leads_esign(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.MarketingApi;

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

var result = new MarketingApi(client).postMarketingLeadsEsign();
curl -X POST https://api.hanzo.ai/v1/marketing/leads/esign \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "event": "<event>",
       "payload": {
         "externalId": "<externalId>",
         "id": 0,
         "recipients": [
           {
             "signingOrder": 0,
             "signingStatus": "<signingStatus>"
           }
         ]
       }
     }'

MCP reaches marketing through the marketing tool, which names its 82 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_marketing_audiences"
         }
       }
     }'

Marketing API · All Hanzo APIs · Interactive reference

Was this page useful?
Broken link or missing step? Drop it in #docs on Discord or open a PR.