/openapi/leadsCreate a lead. All body fields are optional, but send at least an email, phone, or name. Custom fields must be declared on the API key; unknown custom fields return 422.
Request body
| Field | Type | Description |
|---|---|---|
name | string? | Contact name (max 255) |
email | string? | Valid email address |
phone | string? | Phone number (max 50) |
message | string? | Free-text message |
source | string? | Origin label (max 255) |
status | enum? | NEW | CONTACTED | CONVERTED | CLOSED (default NEW) |
…declared custom keys | any | Must match metadataFields on the API key; stored under metadata |
const res = await fetch("https://api.leadzymarket.com/openapi/leads", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": process.env.LEADZY_API_KEY // lz_...
},
body: JSON.stringify({
name: "Jane Doe",
email: "jane@example.com",
phone: "+1 555 0100",
message: "I'd like a demo",
source: "website-contact-form",
// Declared custom fields on the API key land in metadata:
company: "Acme Inc",
plan: "pro"
})
});
const json = await res.json();
// 201 → { success: true, message: "...", data: { id, name, email, metadata, ... } }import os
import requests
res = requests.post(
"https://api.leadzymarket.com/openapi/leads",
headers={
"Content-Type": "application/json",
"x-api-key": os.environ["LEADZY_API_KEY"],
},
json={
"name": "Jane Doe",
"email": "jane@example.com",
"message": "I would like a demo",
"source": "agent-integration",
"company": "Acme Inc",
},
timeout=30,
)
res.raise_for_status()
lead = res.json()["data"]
print(lead["id"])curl -X POST https://api.leadzymarket.com/openapi/leads \
-H "Content-Type: application/json" \
-H "x-api-key: lz_YOUR_KEY_HERE" \
-d '{
"name": "Jane Doe",
"email": "jane@example.com",
"phone": "+1 555 0100",
"message": "I would like a demo",
"source": "website-contact-form",
"company": "Acme Inc"
}'Response — 201
{
"success": true,
"message": "Lead created successfully.",
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Jane Doe",
"email": "jane@example.com",
"phone": "+1 555 0100",
"message": "I'd like a demo",
"source": "website-contact-form",
"status": "NEW",
"metadata": {
"company": "Acme Inc",
"plan": "pro"
},
"deletedAt": null,
"createdAt": "2026-03-31T12:00:00.000Z",
"updatedAt": "2026-03-31T12:00:00.000Z"
}
}Cost is about 0.7–1.0 tokens per create. Insufficient balance returns 402.