Zapier connector API reference for integrators
Use the current Britixo lead API, OAuth and REST Hook contracts through an approved integration, with the correct methods, scopes and boundaries.
Before you begin
This guide is for an authorised integrator. Confirm the registered callback and approved app configuration with support. Keep all credentials in the approved secret/connection store and use HTTPS.
CRM workspace → Tools → Zapier Ready Integration (or Utilities in a classic layout)
Follow these steps
- Resolve the workspace through the CRM launch handoff and retain the canonical workspace_url returned by OAuth.
- Use the registered confidential OAuth client and exact callback. The shared app exchanges codes and refreshes through the fixed master broker using its client secret; S256 PKCE is supported when enabled.
- Send API access only in Authorization: Bearer. Authentication and database context determine the workspace; a caller cannot switch tenants by supplying an ID.
- Handle success/data envelopes, strict lead input validation, 64 KiB bodies, 401/403/409/422/429 responses and Retry-After.
- For Create Lead, pass a stable Idempotency-Key or idempotency_key when retry deduplication is needed. Protection is scoped to the OAuth connection and normalised request.
- Verify X-Britixo-Signature as HMAC-SHA256 over the exact raw webhook body with the connection’s computed webhook_signing_key. Preserve returned auth fields during refresh.
Check the result
The app consumes the documented response envelopes and correctly handles expiry, scopes, workspace context, empty results, errors and event references.
Rules, fields and operating limits
- Resource URLs are relative to the canonical workspace URL. The broker and workspace validator are master-only resources.
- Lead API successes use success/data; token responses return OAuth fields directly, including workspace_url and the connection’s webhook signing key for webhook-enabled scopes.
- Native lead date fields are transported as ISO 8601 with the workspace time-zone offset; absent/zero dates are null.
- Event bodies contain id, event, occurred_at and data. Updated Lead uses event ID as Zapier id and exposes the native CRM ID separately as lead_id.
- Destinations must be exact approved hooks.zapier.com HTTPS catch/standard paths. DNS is checked and pinned; redirects are not followed.
Endpoint reference
Use the canonical workspace base address before tenant resource paths. Master-only rows use the central Britixo base URL supplied by the shared app; they are not tenant resources.
| Method | Workspace-relative endpoint | Access | Behaviour |
|---|---|---|---|
GET | /britixo_zapier/api/v1 | Public | API discovery; version and endpoint links. |
GET | /britixo_zapier/api/v1/health | Public | Basic availability; does not test a connection or Zap. |
GET | /britixo_zapier/api/v1/me | identity.read | Connected workspace, staff identity and scopes. |
GET | /britixo_zapier/api/v1/leads | leads.read | List with limit and after_id; success/data envelope. |
GET | /britixo_zapier/api/v1/leads/{id} | leads.read | One workspace-local lead, or 404. |
GET | /britixo_zapier/api/v1/leads/search | leads.read | email, phonenumber and query; OR matching; up to 20 rows. |
GET | /britixo_zapier/api/v1/leads/sources | leads.read | Available lead source IDs and names. |
GET | /britixo_zapier/api/v1/leads/statuses | leads.read | Available lead status IDs and names. |
POST | /britixo_zapier/api/v1/leads | leads.write | Create one lead from the documented field allowlist. |
POST | /britixo_zapier/api/v1/webhooks | webhooks.manage | Subscribe using event and target_url; stores subscription ID. |
DELETE | /britixo_zapier/api/v1/webhooks/{id} | webhooks.manage | Remove a subscription owned by the current connection. |
GET | /britixo_zapier/oauth/authorize | Staff sign-in + consent | response_type=code, client_id, approved redirect_uri, state and scope; S256 PKCE when used. |
POST | /britixo_zapier/oauth/token | Approved OAuth client | Form-encoded authorization_code or refresh_token grant. |
POST | /britixo_zapier/oauth/revoke | Approved OAuth client | Form-encoded token revocation. |
GET | /britixo_zapier/oauth/connect | Public OAuth entry | Validated client, callback, state and scopes; selects the current workspace or displays account-portal guidance. |
GET | /britixo_zapier/oauth/launch | CRM-generated selection | Master-only signed workspace selection link; expires after 20 minutes. Generated by the CRM, not entered manually. |
GET | /britixo_zapier/api/v1/workspaces/validate | Master only | url query; validates an active registered HTTPS workspace. Returns data.valid and data.workspace_url. |
POST | /britixo_zapier/oauth/broker/token | Confidential client; master only | Form-encoded code exchange or refresh with workspace_url. Canonical workspace and registered client are validated before forwarding. |
Request and response contracts
Send lead API requests with Authorization: Bearer ACCESS_TOKEN and Accept: application/json. Write bodies use JSON. Native CRM date fields are ISO 8601 strings with the workspace UTC offset, or null when unset. Names, email addresses and other values below are fictional.
Read and search leads
GET /britixo_zapier/api/v1/leads?limit=20&after_id=100 returns at most 100 records. With after_id, results are in ascending ID order above that ID; otherwise newest first. Search accepts email, phonenumber and query, combines them with OR and returns at most 20 matches.
{"success":true,"data":[{"id":101,"name":"Example Lead","email":"lead@example.test","status":1,"source":1,"dateadded":"2026-11-05T12:00:00+00:00"}],"meta":{"count":1}}
Create one lead
POST /britixo_zapier/api/v1/leads requires a non-empty name. Optional fields and their exact limits are in the field-mapping guide. Source/status IDs must exist in this workspace when supplied. Omitted values use valid defaults. Assigned staff must be active; a non-zero country must exist. Unknown fields, invalid types, oversized text and bodies above 64 KiB are rejected.
{"name":"Example Lead","email":"lead@example.test","source":1,"status":1,"idempotency_key":"enquiry:12345"}
Success is HTTP 201 with {"success":true,"data":{...lead}}. Idempotency-Key may instead be sent as a header; it takes precedence over the body key. A retained key is scoped to the OAuth connection and normalised request. Repeated equivalent requests return the recorded lead; changed data or a missing recorded lead returns HTTP 409. Never reuse a source key for another enquiry.
OAuth and refresh
Authorisation uses response_type=code, the registered client_id, exact redirect_uri, non-empty state and space-separated scopes. Optional S256 PKCE uses code_challenge/code_challenge_method and code_verifier. Consent returns a single-use code, unchanged state and the canonical workspace_url. The shared app uses the master broker, with form fields workspace_url, grant_type=authorization_code, client_id, client_secret, code, redirect_uri and optional code_verifier. Refresh uses workspace_url, grant_type=refresh_token, client_id, client_secret and refresh_token. A confidential client always requires its secret.
Token responses contain access_token, token_type, expires_in, refresh_token, scope and workspace_url. Webhook-enabled connections also receive webhook_signing_key. Preserve returned computed fields on refresh and replace the rotated access/refresh pair. OAuth errors use error and error_description. Client credentials belong in the provider credential store and are never client-entered lead fields.
Subscriptions and signed events
Subscribe with {"event":"lead.created","target_url":"https://hooks.zapier.com/hooks/standard/..."} or event lead.updated. HTTP 201 returns success/data with id, event and status. DELETE the returned subscription ID using the same connection to unsubscribe. Unavailable or differently owned subscriptions return 404.
{"id":"67d8c1bb-bb2d-4fa1-bdcb-e1c6ab051889","event":"lead.updated","occurred_at":"2026-11-05T12:00:00+00:00","data":{"id":101,"name":"Example Lead"}}
X-Britixo-Signature contains sha256= followed by the hexadecimal HMAC-SHA256 of the exact raw UTF-8 body using the connection’s computed webhook_signing_key. Verify it with a timing-safe comparison before parsing. X-Britixo-Delivery identifies a delivery. Updated Lead uses the event UUID as Zapier id and data.id as lead_id; New Lead keeps the native lead ID. Webhook retries may repeat an event.
Errors and limits
Lead API failures use success=false with error and, where applicable, message. HTTP 401 means unusable or insufficiently authorised credentials; 409 means an idempotency conflict; 422 means invalid input; 429 includes Retry-After. HTTP 403 can be native session/CSRF protection. 405 means an unsupported method; 404 means an unavailable resource or broker context. Record X-Britixo-Request-Id and the time for support, without credentials. Honour Retry-After, inspect uncertain writes and use a stable source key rather than blindly repeating them.
If something does not look right
If the app expects a flat record but receives an envelope, fix the app mapping rather than modifying customer data. Request an exact callback registration or unsupported action through the implementation process.
Questions and answers
Which methods create and remove a subscription?
POST /britixo_zapier/api/v1/webhooks with event and target_url creates a subscription; DELETE /britixo_zapier/api/v1/webhooks/{id} removes one owned by the current connection.
Which events can the backend accept?
lead.created and lead.updated. Native update/status/junk/lost hooks and bounded scheduled reconciliation cover observed changes to the documented native lead payload; this is not complete change-data capture.
How does list pagination work?
GET leads accepts limit and after_id. With a positive after_id it returns IDs above that value in ascending order; without it the default is newest first. Track returned IDs explicitly and do not invent an opaque cursor or total-count field.
How are multiple search fields combined?
email, phonenumber and query are alternatives combined with OR. Text query matches name, company or email. Inspect and verify candidate matches.
Where is workspace validation available?
The parent broker exposes GET /britixo_zapier/api/v1/workspaces/validate?url=... for active registered workspace validation. It is not a general resolver on a tenant workspace.
Which token endpoint should the app use?
Use the approved configuration. The module provides a workspace /britixo_zapier/oauth/token endpoint and a parent /britixo_zapier/oauth/broker/token endpoint that validates and forwards to a workspace. Do not swap them without checking the app contract.
Can I use the event’s delivery signature in a custom receiver?
The shared connector verifies X-Britixo-Signature using its OAuth-returned connection key and the exact raw body. Custom receivers remain outside the approved destination allowlist and require a separately authorised extension.
Can the API return data from another company?
Use a distinct connection for the other workspace. The module operates against the database namespace selected for the current workspace, not a caller-supplied tenant switch.
Useful next steps
Contact Britixo support. Include the workspace, action, run reference and time; keep credentials private.
