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.

MethodEndpoints
GET/blocklist/check, /blocklist, /forms/:id, /getServiceOptions/:business_id
POST/submitForm

Headers

HeaderWhen to send it
x-zoie-api-keyOn every Blocklist API request. See Authentication.
X-Form-Api-KeyOn submitForm when the form has a form API key.
Content-Type: application/jsonOn submitForm.
X-Request-IDOptional, 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.

LimitValueOver the limit
Whole request body5 MB413
The submitted values (leadDetails, or the flat body’s fields)256 KB as JSON413 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.

ValueFormat
Phone numbersE.164, for example +19495550123. Zoie normalises what it receives.
Email addressesA normal address. Fields of type email are checked for a valid format.
serviceThe service’s name exactly as it appears in the business’s services, to link the lead to it.
ip_addressThe 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, POST and OPTIONS. Allowed request headers are Content-Type, Authorization, x-form-api-key and x-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 429 and 5xx.
  • 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 a 2xx. A 429 means nothing was processed, so retry after the Retry-After delay. Don’t retry other 4xx responses unchanged, because they’ll fail the same way.