Payloads
The exact request Zoie's Send webhook step makes, field by field, and what Zoie's two inbound endpoints accept: the workflow Webhook trigger with its field mapping and the website lead webhook with its field list, with every response.
This page describes the three webhook surfaces in Webhooks overview at the level of the bytes on the wire.
Outgoing: Send webhook
When a run reaches a Send webhook step, Zoie makes one HTTP request to the step’s URL.
Request
| Part | Value |
|---|---|
| Method | POST or PUT, as chosen on the step. POST if not set. |
| URL | Exactly as entered. It must be https:// and resolve to a public address. See Security. |
Content-Type | application/json |
X-Zoie-Webhook-Secret | The step’s Secret, sent as-is. Only present when a secret is set. |
Other headers, such as User-Agent, are the HTTP client’s defaults and can change. The URL, headers and body can’t be customised, and the step has no placeholders.
Body
{
"event": "workflow.action.webhook",
"workflow": {
"id": 87,
"name": "New leads to our CRM"
},
"sent_at": "2026-10-02T09:14:09.120Z",
"lead": {
"id": 18342,
"business_id": 42,
"first_name": "Jane",
"last_name": "Smith",
"email": "[email protected]",
"phone_number": "+15551234567",
"lead_status": "New",
"lead_source": null,
"labels": "VIP, Implants"
}
}
| Field | Type | Description |
|---|---|---|
event | string | Always workflow.action.webhook, whatever the trigger. |
workflow.id | integer | The workflow’s ID. It stays the same for the workflow’s life, so use it to route calls. |
workflow.name | string | The workflow’s name when the call was made. |
sent_at | string | When Zoie built the request, ISO 8601 in UTC. |
lead.id | integer | The lead’s Zoie ID. Use it with the MCP get_lead tool to fetch more. |
lead.business_id | integer | The business the lead belongs to. |
lead.first_name, lead.last_name | string or null | Can be an empty string when the lead has no name yet, for example an anonymous widget visitor. |
lead.email | string or null | Can be an empty string. |
lead.phone_number | string or null | As stored on the lead, usually E.164 such as +15551234567. Can be an empty string. |
lead.lead_status | string or null | The status when the step ran. |
lead.lead_source | null | Currently always null. The lead’s source isn’t included in the payload. |
lead.labels | string or null | The lead’s labels as one comma-separated string, for example "VIP, Implants". Split on commas and trim each label. |
The lead is read when the step runs, so the values reflect any earlier steps and waits in the same run. Nothing else is sent: no custom fields, appointment details, conversation or the trigger that started the run. To get more, look the lead up by lead.id through the MCP server.
Your response
| Your endpoint returns | Zoie records |
|---|---|
Any status below 400, within 10 seconds | The step succeeded, with Webhook sent to your host and the status. A 3xx counts as success but isn’t followed. |
400 or above | The step failed with Webhook returned and the status. The run stops. |
| No response within 10 seconds, or a connection or TLS error | The step failed. The run stops. |
Zoie ignores the response body. It doesn’t retry by itself. Someone can rerun the failed step from the workflow’s Executions tab with Retry failed step, which sends the request again with a new sent_at.
Incoming: workflow Webhook trigger
A workflow whose trigger is Webhook has its own URL. Open the trigger in the builder to see it. A saved workflow gets its URL the first time the trigger panel is opened, and Rotate replaces it.
POST https://api-us.zoie.ai/api/v1/auth/webhooks/trigger/wf_<48 hex characters>
Content-Type: application/json
Request
| Rule | Detail |
|---|---|
| Method | POST |
| Body | A JSON object (application/json) or form fields (application/x-www-form-urlencoded). Any other content type arrives as an empty body. |
| Size | Up to 64 KB, measured as the JSON of the received body. |
| Authentication | None beyond the URL. See Security. |
| Caller | A server or automation tool. Browsers on other websites can’t read the response. |
Zoie keeps the most recent body as the trigger’s sample, even when the workflow isn’t live yet. Send one realistic request, click Fetch sample in the trigger, and the builder lists the fields it received so you can map them.
Responses
| Status | Body | Meaning |
|---|---|---|
202 | { "received": true, "ran": true } | Queued to run. The response has no lead ID, and the run can still stop later, for example on the daily limit or a missing email and phone. |
202 | { "received": true, "ran": false, "reason": "workflow not live" } | Saved as the sample only. The workflow is a draft or paused. |
404 | { "message": "Not found" } | No workflow has this token. It was mistyped, rotated, or the workflow was deleted. |
413 | { "message": "Payload too large" } | The body is over 64 KB. |
429 | See Rate limits | Too many requests from your IP address. |
500 | { "message": "Failed to accept webhook" } | Zoie couldn’t store or queue the request. Try again. |
Mapping the body to a lead
A Webhook run starts with no lead. A Create lead step with Create lead from set to Incoming webhook payload builds one using its Map fields table. Each row maps a path in the body to a lead field:
| Lead field in the builder | Notes |
|---|---|
| First Name, Last Name | |
| Email, Phone Number | At least one must be mapped and present. Without either, the run fails with Payload carried neither an email nor a phone number to map. Send phone numbers in E.164, for example +15551234567, so the lead can be texted. |
| Company, Job Title, Website | |
| Service, Notes, Location | |
| UTM Source, UTM Medium, UTM Campaign | UTM Source is set to Webhook when you don’t map it. |
- Nested fields. Map nested objects with dotted paths, for example
contact.emailfor{ "contact": { "email": "…" } }. The builder doesn’t list paths inside arrays. - Values. Values are turned into text and trimmed. An object mapped to a field is stored as its JSON. Empty values are skipped.
- Unmapped fields are ignored. The Create lead step can’t write custom fields.
If the lead already exists decides what happens when the lead is already in the business:
| Option | Matches on |
|---|---|
| Match on email (default) | The email, ignoring case. |
| Match on phone number | The phone number exactly as stored, so the formats must agree. |
| Always create a new lead | Nothing. Every request creates a lead. |
A matched lead is used as it is: the request doesn’t update its fields. A new lead gets the status New and the step’s Lead Source, which defaults to Web_Lead. After that the run carries on like any other, and the workflow’s Run Frequency is applied to the lead. See Triggers and actions.
Incoming: website lead webhook
An older endpoint that some website form plugins post to. It identifies the business by a website identifier in the body, not by a credential. Read Security before using it, and prefer the Forms API or a Webhook trigger for new integrations.
POST https://api-us.zoie.ai/api/v1/auth/form-leads-webhook
Content-Type: application/json
The body can be JSON or form fields. Every request that passes the checks creates a lead with the type Form_Lead and the status New.
Fields
| Key | Becomes |
|---|---|
website_user_name | Required. The identifier of a website registered on your business. Zoie support gives you this value. The lead goes to that website’s business. |
first_name, last_name | Name |
email | Email. Spaces before the @ are removed, which repairs a + that form encoding turned into a space. |
phone_number | Phone number, stored as sent. Use E.164. |
treatment | Service |
treatment_value | Service value. Defaults to "0". A service_value key is ignored. |
currency_code | Currency of the service value |
message | Message |
note_for_doctor | Notes |
website_name | Website name |
utm_source | UTM source. Also sets the lead’s platform: Facebook for facebook, Tiktok for Tiktok, otherwise Google. |
utm_medium, utm_campaign, utm_term, utm_adgroup, utm_matchtype, utm_device, utm_network | Campaign tracking |
gclid, gcld_google, gbraid, wbraid | Google Ads click IDs |
consent_state | Consent state |
ip_address | The visitor’s IP address, used for the block-list check |
location, geo_zip, geo_latitude, geo_longitude, geo_location, user_location, user_zip | Location fields |
createdtime, modifiedtime | The lead’s created and updated times. Default to now. |
creditscore | Credit score |
finance_score, annual_salary, co_signer, home_owner | Financing fields. annual_salary defaults to 0. |
email_verify, phone_verify, unique_id, how_to_contact, assign_to, form_status | Stored as sent |
missingteeth, methodcomm, methodtime, whatage, activeinfection, hearaboutus, dentalinsu, medicalinsu | Dental-intake fields, stored as sent |
Any other key is saved to a lead custom field whose name matches it, ignoring case, if the business has one that’s active. A key that matches no custom field is dropped, and so is a key named after a lead field that isn’t in the table above, such as company_name.
What Zoie does with a request
- Finds the website by
website_user_name. An unknown or missing value returns404. - Checks the phone number and
ip_addressagainst the business’s blocked contacts. - If duplicate-lead handling is on for the business, compares the email and phone number with its existing leads. A lead matching both is marked duplicate, one matching either is marked related, and either way it joins that lead’s group. The new lead is created regardless.
- Creates the lead and saves any custom-field values.
- Starts New Lead Added workflows, sends new-lead notifications to the team, logs the activity and starts AI outreach according to the business’s agents and AI settings.
Responses
The responses have no success field.
| Status | Body | Meaning |
|---|---|---|
201 | { "message": "Lead stored successfully", "id": 18342 } | The lead was created. id is its Zoie ID. |
400 | { "message": "Validation error", "errors": ["…"] } | A value was rejected by the database, for example too long for its field. |
403 | { "message": "This lead is blocked." } | The phone number or IP address is blocked for the business. |
404 | { "message": "Website details not found" } | website_user_name is missing or unknown. |
404 | { "message": "No user Business details found" } | The business has no team members. |
409 | { "message": "Duplicate entry detected", "error": "…" } | A unique value clashed with an existing record. |
429 | See Rate limits | Too many requests from your IP address. |
500 | { "message": "Failed to store lead due to a server error", "error": "…" } | Other 500 messages include Error creating lead and Error fetching required data. |