# Create leads

URL: https://docs.hanzo.ai/docs/openapi/marketing/post-marketing-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`

> [Marketing →](https://docs.hanzo.ai/docs/openapi/marketing) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                           |
| ------------- | ----------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/marketing/leads` |
| **Method**    | `POST`                                    |
| **Operation** | `post_marketing_leads`                    |
| **Auth**      | `Authorization: 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).

| Field             | In   | Type            | Required | Description                                                                                                  |
| ----------------- | ---- | --------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| `company`         | body | string          | —        | Company is the person's company.                                                                             |
| `country`         | body | string          | —        | Country is where the person is.                                                                              |
| `email`           | body | string          | —        | Email is where sales replies: the person's work email.                                                       |
| `name`            | body | string          | —        | Name is the person's name.                                                                                   |
| `need`            | body | string          | —        | Need is what the person wants from sales, in their own words.                                                |
| `role`            | body | string          | —        | Role is the person's job title.                                                                              |
| `size`            | body | string          | —        | Size is the company's headcount band: 1-49, 50-249, 250-999, 1000-4999 or 5000+.                             |
| `source`          | body | string          | —        | Source is the page the form was filed from, such as hanzo.ai/contact-sales.                                  |
| `visit`           | body | marketing.Visit | —        |                                                                                                              |
| `visit.cid`       | body | string          | —        | Cid is the Google Analytics client id, the last two fields of \_ga.                                          |
| `visit.clicked`   | body | integer (int64) | —        | Clicked is when the page captured the click, in unix seconds.                                                |
| `visit.consent`   | body | string          | —        | Consent is the Cookie Preferences the visitor granted, comma separated: any of analytics, marketing and ads. |
| `visit.fbc`       | body | string          | —        | Fbc is Meta's click cookie, fb.1.\<ms>.\<fbclid>.                                                            |
| `visit.fbclid`    | body | string          | —        | Fbclid is the Meta click id the visitor arrived with.                                                        |
| `visit.fbp`       | body | string          | —        | Fbp is Meta's browser cookie, fb.1.\<ms>.\<random>.                                                          |
| `visit.gbraid`    | body | string          | —        | Gbraid is the Google Ads click id for an iOS app click.                                                      |
| `visit.gclid`     | body | string          | —        | Gclid is the Google Ads click id the visitor arrived with.                                                   |
| `visit.tags`      | body | string          | —        | Tags is which of the page's ad tags already saw this lead: ga, meta.                                         |
| `visit.url`       | body | string          | —        | URL is the page the form was filed from, in full.                                                            |
| `visit.userAgent` | body | string          | —        | UserAgent is the visitor's browser, as navigator.userAgent reads.                                            |
| `visit.wbraid`    | body | string          | —        | Wbraid is the Google Ads click id for an iOS web click.                                                      |

## Response

| Status    | Body            | Meaning |
| --------- | --------------- | ------- |
| `201`     | marketing.Lead  | created |
| `default` | problem-details | refused |

`201` body — 2 fields.

| Field   | In   | Type   | Always | Description                                                   |
| ------- | ---- | ------ | ------ | ------------------------------------------------------------- |
| `lead`  | body | string | —      | Lead is the lead's reference, "lead\_" and 24 hex characters. |
| `stage` | body | string | —      | Stage is where the lead stands.                               |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

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

**SDK**

**.ts**

```ts
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>" });
```

**.py**

```python
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>")
```

**.go**

```go
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
}
```

**.rs**

```rust
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?;
```

**.java**

```java
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();
```

**HTTP**

```bash
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**

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:

```bash
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](https://docs.hanzo.ai/docs/openapi/marketing) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
