Authentication

The credentials Zoie's developer surfaces accept — the x-zoie-api-key business key, the X-Form-Api-Key form key, OAuth 2.1 bearer tokens for MCP and webhook URL tokens — and how to send each one.

There’s no single key for “the Zoie API”. Each developer surface has its own credential, sent in its own way. None of them uses a signed-in user’s web app session. That session token belongs to the internal API and isn’t a supported way to integrate.

At a glance

SurfaceCredentialHow to send itWhere to get it
Blocklist APIBusiness API key, starting zbk_x-zoie-api-key headerSettings › Leads › Blocked Leads › Website API access. See API keys.
Forms API, server to serverForm API key, starting zfk_ (optional, per form)X-Form-Api-Key headerThe form builder: Publish Form › REST API. See API keys.
Forms API, from a browserNone—Protected by the form’s allowed domains, rate limits and bot checks.
MCP serverOAuth 2.1 access tokenAuthorization: Bearer <token>The OAuth flow on https://api-us.zoie.ai.
Workflow incoming webhookThe token in the URLPart of the URL pathThe workflow’s Webhook trigger.
Workflow Send webhook (Zoie calling you)A secret you chooseZoie sends X-Zoie-Webhook-Secret; you check itThe step’s Secret field.

HTTP header names aren’t case-sensitive, so x-zoie-api-key and X-Zoie-Api-Key are the same header.

Business API key

The Blocklist API takes a business API key in the x-zoie-api-key header. It doesn’t read the Authorization header. The key identifies the business, so there’s no business ID to send.

curl -G "https://api-us.zoie.ai/api/v1/public/blocklist/check" \
  --data-urlencode "[email protected]" \
  -H "x-zoie-api-key: <API_KEY>"
const res = await fetch(
  'https://api-us.zoie.ai/api/v1/public/blocklist/check?email=maya%40example.com',
  { headers: { 'x-zoie-api-key': process.env.ZOIE_API_KEY } }
);

Zoie looks up the key before doing anything else:

SituationStatusBody
No header, or an empty one401{"success":false,"message":"Missing API key. Send your key in the x-zoie-api-key header."}
Unknown or revoked key401{"success":false,"message":"Invalid or revoked API key."}
Zoie couldn’t check the key500{"success":false,"message":"Authentication error."}

Every business API key carries the scope blocklist:read and works on both Blocklist endpoints. It can’t reach any other endpoint.

Form API key

A form API key is optional. Until you generate one, a form accepts submissions without any credential. Once a form has a key, every submission to that form must send it in X-Form-Api-Key, or it’s refused with 401 {"success":false,"message":"Invalid or missing API key."}.

curl -X POST "https://api-us.zoie.ai/api/v1/public/submitForm" \
  -H "Content-Type: application/json" \
  -H "X-Form-Api-Key: <FORM_API_KEY>" \
  -d '{"formId":"<FORM_ID>","leadDetails":{"first_name":"Maya","email":"[email protected]"}}'

A valid form key also lets the request skip the form’s Allowed Domains check, which is what makes server-to-server submissions possible on a locked-down form.

Browser calls without a credential

GET /api/v1/public/forms/:id, GET /api/v1/public/getServiceOptions/:business_id and POST /api/v1/public/submitForm (on a form with no key) take no credential, because they run in visitors’ browsers. Instead they’re protected by:

  • Allowed Domains. If the form has a list, the request’s Origin (or Referer) must match one of the domains. Zoie’s own domains are always allowed. With no list, any site can load and submit the form.
  • Rate limits per IP address and form. See Rate limits.
  • Bot checks on submissions, and the business’s blocked list.
  • CORS. Browsers can only call these endpoints from Zoie’s own domains and from websites registered with Zoie for a business.

OAuth 2.1 for the MCP server

The MCP server takes an OAuth 2.1 access token as a bearer token. You don’t create it in the web app. An MCP client gets it by sending the user through Zoie’s consent screen.

ItemValue
Protected resource metadata (RFC 9728)https://mcp-us.zoie.ai/.well-known/oauth-protected-resource
Authorisation serverhttps://api-us.zoie.ai (metadata at /.well-known/oauth-authorization-server)
Client registrationDynamic, at POST https://api-us.zoie.ai/oauth/register. Public clients only: no client secret.
GrantAuthorisation code with PKCE (S256 only), plus refresh_token
Access token lifetime8 hours
Refresh token lifetime30 days, replaced with a new one every time it’s used
POST / HTTP/1.1
Host: mcp-us.zoie.ai
Authorization: Bearer <ACCESS_TOKEN>
Content-Type: application/json
Accept: application/json, text/event-stream

A request without a valid token gets 401 and a WWW-Authenticate header that points the client at the metadata:

HTTP/2 401
WWW-Authenticate: Bearer realm="https://mcp-us.zoie.ai", resource_metadata="https://mcp-us.zoie.ai/.well-known/oauth-protected-resource", error="invalid_token", error_description="Missing bearer token"

{"error":"unauthorized","message":"Missing bearer token."}

The token acts as the user who connected, in the business or businesses they approved, within the scopes they granted and their own Zoie role. For the full flow, scopes and revocation, see the developer MCP authentication page. For what users see, see Authentication in the MCP guide.

Webhook credentials

  • Incoming. A workflow’s webhook URL ends in a long random token, and that token is the credential. Anyone who has the URL can start the workflow, so keep it private, and click Rotate in the trigger if it leaks. The old URL stops working straight away.
  • Outgoing. If you fill in the Send webhook step’s Secret, Zoie sends it in the X-Zoie-Webhook-Secret header on every call. Your endpoint should reject calls where the header doesn’t match.

Details and verification examples are in Webhook security.

Keeping credentials safe

  • Keep keys on your server. CORS stops other websites’ pages from reading the responses, but it does nothing against someone who copies a key out of your page and calls the API directly.
  • Use one business API key per website. Give each a label, so you can revoke one without breaking the others.
  • Rotate without downtime. For a business API key: generate a new key, deploy it, then revoke the old one. For a form key, generating a new key retires the old one immediately, so deploy the new key straight away.