Requests
How to build requests to Zoie's public HTTP APIs: base URL, headers, query-string encoding, JSON bodies and size limits, form field keys, CORS for browser calls, and retry behaviour.
These conventions apply to the Blocklist API and Forms API. The MCP server speaks JSON-RPC over Streamable HTTP instead. See MCP overview.
Base URL and methods
All public endpoints are under https://api-us.zoie.ai/api/v1/public/. Use HTTPS.
| Method | Endpoints |
|---|---|
GET | /blocklist/check, /blocklist, /forms/:id, /getServiceOptions/:business_id |
POST | /submitForm |
Headers
| Header | When to send it |
|---|---|
x-zoie-api-key | On every Blocklist API request. See Authentication. |
X-Form-Api-Key | On submitForm when the form has a form API key. |
Content-Type: application/json | On submitForm. |
X-Request-ID | Optional, server-side calls only (browsers can’t send it cross-origin). Zoie returns the same value in the response’s X-Request-ID header, or makes up its own if you don’t send one. Log it, and quote it if you contact Zoie support about a request. |
Query parameters
URL-encode every query value. The one that catches people out is the + in an E.164 phone number: unencoded, it’s read as a space. Send %2B instead.
# -G with --data-urlencode builds an encoded query string
curl -G "https://api-us.zoie.ai/api/v1/public/blocklist/check" \
--data-urlencode "phone=+19495550123" \
-H "x-zoie-api-key: <API_KEY>"// URLSearchParams encodes '+' as %2B
const qs = new URLSearchParams({ phone: '+19495550123' });
await fetch(`https://api-us.zoie.ai/api/v1/public/blocklist/check?${qs}`, {
headers: { 'x-zoie-api-key': process.env.ZOIE_API_KEY },
});Parameters an endpoint doesn’t know about are ignored. Out-of-range paging values are adjusted rather than rejected. See Pagination.
Request bodies
Only submitForm takes a body. Send it as UTF-8 JSON.
| Limit | Value | Over the limit |
|---|---|---|
| Whole request body | 5 MB | 413 |
The submitted values (leadDetails, or the flat body’s fields) | 256 KB as JSON | 413 Submission payload exceeds maximum allowed size. |
A body that isn’t valid JSON is rejected with 400, and the parser’s message comes back in message.
Field keys
leadDetails is keyed by each form field’s lead-field name, for example first_name, last_name, email, phone_number or service. Custom fields use their own keys. The quickest way to get the exact keys for a form is Copy JSON on the form builder’s REST API tab. Send keys exactly as they appear there.
| Value | Format |
|---|---|
| Phone numbers | E.164, for example +19495550123. Zoie normalises what it receives. |
| Email addresses | A normal address. Fields of type email are checked for a valid format. |
service | The service’s name exactly as it appears in the business’s services, to link the lead to it. |
ip_address | The visitor’s IP address. If you leave it out, Zoie records the IP that sent the request, which for a server-to-server call is your server’s. The blocked-list check uses the same IP. |
Calling from a browser
Zoie’s own embed script calls forms/:id and submitForm from visitors’ browsers. If you build your own browser client:
- The API answers cross-origin requests only from Zoie’s own domains and from websites registered with Zoie for a business. Calls from other origins are blocked by the browser.
- Allowed methods are
GET,POSTandOPTIONS. Allowed request headers areContent-Type,Authorization,x-form-api-keyandx-zoie-api-key. - If the form has Allowed Domains, the page’s origin must be on the list.
- Never put a business API key or form API key in browser code. See Keeping credentials safe.
Retries and duplicates
The public endpoints have no idempotency keys.
- Blocklist API. Both endpoints only read, so retrying is safe. Back off on
429and5xx. submitForm. If a request times out, it may still have created the lead, and a retry creates a second lead, flagged as a duplicate of the first rather than rejected. Never retry after a2xx. A429means nothing was processed, so retry after theRetry-Afterdelay. Don’t retry other4xxresponses unchanged, because they’ll fail the same way.