Create leads

Files a sales inquiry as a new lead in the deployment's own CRM and states it on the event plane.

POST /v1/marketing/leads

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

Files a sales inquiry as a new lead in the deployment's own CRM and states it on the event plane. No account is needed and none is read: every lead lands in the brand's org. Answers 201 with an opaque reference.

A brand org without the CRM installed answers 503, a body over 16 KiB answers 413, and a missing or malformed email answers 400 — in that order.

Request

21 fields, body application/json (required).

FieldInTypeRequiredDescription
companybodystring—Company is the person's company.
countrybodystring—Country is where the person is.
emailbodystring—Email is where sales replies: the person's work email.
namebodystring—Name is the person's name.
needbodystring—Need is what the person wants from sales, in their own words.
rolebodystring—Role is the person's job title.
sizebodystring—Size is the company's headcount band: 1-49, 50-249, 250-999, 1000-4999 or 5000+.
sourcebodystring—Source is the page the form was filed from, such as hanzo.ai/contact-sales.
visitbodymarketing.Visit—
visit.cidbodystring—Cid is the Google Analytics client id, the last two fields of _ga.
visit.clickedbodyinteger (int64)—Clicked is when the page captured the click, in unix seconds.
visit.consentbodystring—Consent is the Cookie Preferences the visitor granted, comma separated: any of analytics, marketing and ads.
visit.fbcbodystring—Fbc is Meta's click cookie, fb.1.<ms>.<fbclid>.
visit.fbclidbodystring—Fbclid is the Meta click id the visitor arrived with.
visit.fbpbodystring—Fbp is Meta's browser cookie, fb.1.<ms>.<random>.
visit.gbraidbodystring—Gbraid is the Google Ads click id for an iOS app click.
visit.gclidbodystring—Gclid is the Google Ads click id the visitor arrived with.
visit.tagsbodystring—Tags is which of the page's ad tags already saw this lead: ga, meta.
visit.urlbodystring—URL is the page the form was filed from, in full.
visit.userAgentbodystring—UserAgent is the visitor's browser, as navigator.userAgent reads.
visit.wbraidbodystring—Wbraid is the Google Ads click id for an iOS web click.

Response

StatusBodyMeaning
201marketing.Leadcreated
defaultproblem-detailsrefused

201 body — 2 fields.

FieldInTypeAlwaysDescription
leadbodystring—Lead is the lead's reference, "lead_" and 24 hex characters.
stagebodystring—Stage is where the lead stands.

Failure carries the platform error shape — see Errors.

Examples

hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.

import { Configuration, MarketingApi } from 'hanzoai';

const api = new MarketingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postMarketingLeads({ company: "<company>", country: "<country>" });
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(company="<company>", country="<country>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.MarketingAPI.PostMarketingLeads(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(&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).postMarketingLeads();
curl -X POST https://api.hanzo.ai/v1/marketing/leads \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "company": "<company>",
       "country": "<country>"
     }'

MCP reaches marketing through the marketing tool, which names its 35 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?