Build an Audience connector
Audience holds the working copy of an organization’s people. A connector keeps that copy in step with the organization’s own system of record: a CRM, a billing system, a membership database. The connector is the part that knows how to talk to that system. A connector you host is added to an organization by pasting your address into Hub, and from then on Audience reads from your service on a schedule, can write the changes people make in Audience back through it, and can pass it a vendor’s webhooks to check.
A connector holds no ebitex credential and runs no code inside ebitex. It is a conduit: it reads and writes the connected system on the organization’s behalf and keeps nothing of its own.
What a connector is
Section titled “What a connector is”Two endpoints under one HTTPS base address:
| Call | Purpose |
|---|---|
GET {base}/manifest |
Says who the connector is, its version, the settings a connection takes, what it can do, the fields it reads and writes, and the one permission it may ask for. |
POST {base}/connector |
One of four actions, named in the body: ping, pull, push or inbound. |
The address must be HTTPS and reachable from the public internet. ebitex follows no redirect and will not call a private address.
The manifest
Section titled “The manifest”{ "protocol": 1, "key": "acme-crm", "name": "Acme CRM", "description": "Keeps Audience in step with Acme CRM.", "version": "1.0.0", "types": { "audience.connector": { "capabilities": ["pull", "push", "receivesEvents"], "settings": [ { "key": "account", "label": "Account", "kind": "text", "required": true, "help": "The short name in your Acme address." }, { "key": "apiKey", "label": "API key", "kind": "secret", "required": true }, { "key": "signingKey", "label": "Webhook signing key", "kind": "secret", "required": true } ], "permissions": [ { "permission": "individuals.writeBack", "required": false, "reason": "To keep Acme CRM in step with the changes you make in Audience." } ], "fields": [ { "key": "plan", "label": "Plan", "type": "string", "writable": true }, { "key": "seats", "label": "Seats", "type": "number" } ], "inboundHeaders": ["X-Acme-Signature"] } }}keyis lowercase letters, digits and hyphens, 3 to 64 characters. It does not change.versionismajor.minor.patch. A higher one is an upgrade the organization approves.- The manifest has exactly one type,
audience.connector, and no account-level settings. capabilitiesis a list ofpull,pushandreceivesEvents, each at most once. A connector must at leastpullor receive events, because a write-back only reaches people it has already brought in.settingsare asked for each time an organization connects you (text,urlorsecret; a secret is stored protected and never shown again). They are the credentials for the connected system, such as an API key. They are sent to you insettingson every call. Nothing is per mode.fieldsare the values you can read, and which of them you accept back (writable). At most 100, each with akey(letters, digits, dot, dash and underscore), alabeland atypeofstring,number,booleanordate. The organization maps these onto Audience’s own fields, so a key is stable: removing or retyping one is a change they review.permissionsmay name one permission,individuals.writeBack, and only with"required": false. It is the only way anything about a person leaves ebitex for you. A connector that declarespushmust name it, a connector that names it must declarepush, andpushneeds at least one writable field. Without the organization’s approval, you are never sent a push and the connector only reads.inboundHeadersis required, and only allowed, when you declarereceivesEvents: one to ten names of the request headers a vendor’s signature travels in. Only these are relayed to you.Cookie,Set-Cookie,Authorization,Host,Forwardedand the family of headers that carry a caller’s address are refused.- Removing a setting or field, changing a kind or type, adding a required setting, dropping a capability, making a field read-only, asking for write-back for the first time or removing an inbound header is a change the organization reviews before it applies.
The call
Section titled “The call”Every action is a POST {base}/connector with a JSON body. The members every call carries:
{ "protocol": 1, "action": "pull", "organizationId": "08b27ef8-fb84-4800-99f1-40302e68830e", "settings": { "account": "acme-eu", "apiKey": "…", "signingKey": "…" }, "limit": 200}action |
Extra members | Answer with |
|---|---|---|
ping |
none (no settings) |
{ "ok": true } |
pull |
limit, and cursor after the first page |
{ "people": [ … ], "nextCursor": "…", "hasMore": true } |
push |
externalId, idempotencyKey, name (when mapped), fields |
{ "succeeded": true } or { "succeeded": false, "retryable": false, "error": "…" } |
inbound |
headers, body (base64) |
{ "accepted": true, "people": [ … ] } or { "accepted": false, "rejectReason": "…" } |
Answer with a 2xx and a JSON body.
ping is the call Hub’s Send a test makes. It carries no settings and no one’s data. Answer { "ok": true }.
pull returns a page of people who changed since the cursor. The first call has no cursor; each later one carries what you returned as nextCursor. ebitex stores it and never reads it, so put whatever you need to resume in it, up to 2 KB. Return at most limit people (never more than 200; extras are dropped), hasMore while there is another page, and nextCursor as null on the last. A pull sends you no person: only the cursor, the page size and the connection’s own settings.
{ "externalId": "cus_1042", "name": "Ada Lovelace", "modifiedAt": "2026-11-01T09:00:00Z", "handles": [ { "type": "email", "value": "ada@example.com", "verified": false } ], "fields": { "plan": "pro", "seats": 5 }, "deleted": false, "events": [ { "kind": "acme-crm.plan-changed", "sourceEventId": "evt_88", "occurredAt": "2026-11-01T09:00:00Z" } ], "channelSignals": [ { "channel": "email", "status": "unsubscribed", "sourceEventId": "evt_91", "occurredAt": "2026-11-01T09:00:00Z" } ]}externalIdis your system’s own id for the person, required, at most 200 characters. It is how Audience finds them again.modifiedAtis a required date: when your system last changed this record.handlesare the person’semailorphonevalues, at most 10.verifiedis your system’s word, which Audience uses to match a person and never to raise a handle to verified on its own.fieldsmay only name keys you declared in the manifest. Any other key is dropped. A value is a short string, number, boolean or date, at most 2000 characters; an object or a list refuses the person.deletedsays your system no longer holds the person. Audience unlinks them and never deletes them.eventsbecome entries on the person’s timeline. Eachkindmust start with your connector’s key and a dot, andsourceEventIdis your system’s own id for it, so a replay writes nothing twice.channelSignalscan take a permission away and never give one: onlyunsubscribedis applied, and anything else is ignored.- A person that breaks any of this refuses the whole page. ebitex never keeps part of a person or part of a page, so the run fails with a short message and the next one tries again from the same cursor.
push writes one change back, for a person you already know. It is sent only if the organization approved individuals.writeBack. The body carries only your own id for the person, an idempotencyKey that stays the same across retries (pass it to your system if it takes one), the name if the organization mapped it, and the writable fields that changed:
{ "protocol": 1, "action": "push", "organizationId": "08b27ef8-fb84-4800-99f1-40302e68830e", "settings": { "account": "acme-eu", "apiKey": "…", "signingKey": "…" }, "externalId": "cus_1042", "idempotencyKey": "5b0c3d9a", "name": "Ada Lovelace", "fields": { "plan": "enterprise" }}Never an email address or a phone number. Say retryable: true when trying again could succeed (your own system is busy); a refusal that will answer the same next time is retryable: false, and the change is dropped with your message. ebitex also retries a call that timed out or failed to connect, up to eight times with a growing wait, and never sends a push for a person it did not get from you.
inbound relays a vendor’s webhook, when you declare receivesEvents. The organization gives the vendor an ebitex address; ebitex passes each delivery to you so you can check the vendor’s signature, because only you know its scheme. The body is the raw bytes, base64, because a signature is over the bytes; headers holds only the ones you named in inboundHeaders that the request carried. A request that carries none of them is refused before it reaches you. Answer accepted: false for a signature that does not check, and the vendor gets a 401. Answer accepted: true with the people the event concerns (at most 500), shaped as in a pull. An inbound delivery never moves the pull cursor.
What a connector can never do
Section titled “What a connector can never do”ebitex enforces these on every answer, whatever a connector returns:
- It cannot grant permission or consent. There is no way to say “granted”; a
channelSignalsentry other thanunsubscribedis ignored. - It cannot create a person. It describes people in the connected system, and Audience matches them to individuals by id or by a verified email, never by name, and decides what to do.
- It cannot use another connector’s event kinds, and it cannot return a field it did not declare.
- It cannot see or change anything in Audience beyond what a call hands it.
What a connector is never sent
Section titled “What a connector is never sent”A call carries the organization, the connection’s settings and what the action needs, and nothing else:
- a pull: no person at all;
- a push: your own id for the person, the name and the changed writable fields, and only with the organization’s approval;
- never an email address or phone number, consent choices, other fields of the person, or anyone’s identity in ebitex.
When someone is forgotten. Audience stops sending or bringing back that person: it remembers the id so a later pull does not recreate them. It does not call you, and it does not delete them from the connected system. That is why a connector should keep nothing of its own: it reads and writes the connected system and forgets. Your settings hold the organization’s credentials for that system, so do not log request bodies. ebitex cannot check that you do not, and says so to the people who add you.
Speed and limits
Section titled “Speed and limits”| Call | Time to answer | Answer or body |
|---|---|---|
ping |
10 seconds | small |
pull |
30 seconds | at most 1 MB, at most 200 people, a cursor of at most 2 KB |
push |
10 seconds | request at most 64 KB |
inbound |
5 seconds | request body at most 256 KB, at most 500 people |
A slower answer, an unreachable address or any error fails the call: a pull ends its run with a short message and tries again at the next one, with what was already applied kept; a push is retried while it is retryable; an inbound delivery is refused so the vendor tries again. An organization in sandbox is never called at all. Deliveries to a single connection are limited to 60 a minute.
Verify every call
Section titled “Verify every call”Each call carries an X-Ebitex-Signature header made exactly as the organization webhooks’ is: an HMAC-SHA256 of {timestamp}.{body} under the signing secret, which the organization is shown once when they add you. Verify it against the raw bytes you receive, compare in constant time and refuse a timestamp more than five minutes from now. Pushes carry an idempotency key, so a repeat is safe; pulls and pings are reads.
A complete example
Section titled “A complete example”A single file of Node, with no dependencies. It serves the manifest, verifies the signature, pages a small fixed list of people, accepts a write-back, and checks a vendor’s webhook signature. A real connector replaces the fixed list with calls to its system and puts the onPush hook’s work there.
// example:audience-connectorimport { createServer } from 'node:http'import { createHmac, timingSafeEqual } from 'node:crypto'
export const MANIFEST = { protocol: 1, key: 'example-crm', name: 'Example CRM', description: 'A small fixed list of people.', version: '1.0.0', types: { 'audience.connector': { capabilities: ['pull', 'push', 'receivesEvents'], settings: [ { key: 'apiKey', label: 'API key', kind: 'secret', required: true }, { key: 'signingKey', label: 'Webhook signing key', kind: 'secret', required: true }, ], permissions: [{ permission: 'individuals.writeBack', required: false, reason: 'To keep the CRM in step with the changes you make in Audience.' }], fields: [ { key: 'plan', label: 'Plan', type: 'string', writable: true }, { key: 'seats', label: 'Seats', type: 'number' }, ], inboundHeaders: ['X-Example-Signature'], }, },}
const PEOPLE = [ { id: 'p-1', name: 'Ada Example', email: 'ada@example.com', plan: 'free', seats: 1 }, { id: 'p-2', name: 'Grace Example', email: 'grace@example.com', plan: 'team', seats: 5 }, { id: 'p-3', name: 'Alan Example', email: 'alan@example.com', plan: 'pro', seats: 12 },]
const person = (p, plan = p.plan) => ({ externalId: p.id, name: p.name, modifiedAt: '2026-11-01T09:00:00Z', handles: [{ type: 'email', value: p.email, verified: false }], fields: { plan, seats: p.seats },})
/** True when `header` (`v1,t=<unix seconds>[,k=<key id>],s=<hex>`) is a fresh, correct signature of `rawBody`. */export function verify(rawBody, header, secret, now = Date.now()) { const match = /^v1,t=(\d+)(?:,k=[A-Za-z0-9._-]{1,32})?,s=([0-9a-f]{64})$/.exec(header ?? '') if (!match) return false const [, t, s] = match if (Math.abs(now / 1000 - Number(t)) > 300) return false const expected = createHmac('sha256', secret).update(`${t}.`).update(rawBody).digest() const given = Buffer.from(s, 'hex') return given.length === expected.length && timingSafeEqual(given, expected)}
/** The vendor's own scheme in this example: a hex HMAC-SHA256 of the raw body under the connection's signing key. */function vendorSignatureOk(rawBody, header, signingKey) { const expected = createHmac('sha256', signingKey).update(rawBody).digest('hex') return typeof header === 'string' && header.length === expected.length && timingSafeEqual(Buffer.from(header), Buffer.from(expected))}
export function createConnector(secret, { onPush = () => {} } = {}) { return createServer((request, response) => { const send = (status, body) => { response.writeHead(status, { 'Content-Type': 'application/json' }) response.end(JSON.stringify(body)) }
if (request.method === 'GET' && request.url?.endsWith('/manifest')) return send(200, MANIFEST)
const chunks = [] request.on('data', (chunk) => chunks.push(chunk)) request.on('end', () => { const raw = Buffer.concat(chunks) if (!verify(raw, request.headers['x-ebitex-signature'], secret)) return send(401, { error: 'bad_signature' })
const call = JSON.parse(raw.toString('utf8')) switch (call.action) { case 'ping': return send(200, { ok: true }) case 'pull': { const start = Number(call.cursor ?? 0) const from = Number.isInteger(start) && start >= 0 ? start : 0 const size = Math.min(Math.max(Number(call.limit) || 200, 1), 200) return send(200, { people: PEOPLE.slice(from, from + size).map((p) => person(p)), nextCursor: from + size < PEOPLE.length ? String(from + size) : null, hasMore: from + size < PEOPLE.length, }) } case 'push': { if (!PEOPLE.some((p) => p.id === call.externalId)) return send(200, { succeeded: false, retryable: false, error: 'No such person.' }) onPush(call) // a real connector calls its system here, passing call.idempotencyKey on return send(200, { succeeded: true }) } case 'inbound': { const body = Buffer.from(call.body ?? '', 'base64') if (!vendorSignatureOk(body, call.headers?.['X-Example-Signature'], call.settings?.signingKey ?? '')) return send(200, { accepted: false, rejectReason: 'bad signature' }) const event = JSON.parse(body.toString('utf8')) const found = PEOPLE.find((p) => p.id === event.id) return send(200, { accepted: true, people: found ? [person(found, String(event.plan))] : [] }) } default: return send(400, { error: 'unknown_action' }) } }) })}Add it, then try it
Section titled “Add it, then try it”In Hub, open Plugins and choose Add by address. Paste your base address and read the manifest. Hub names your host, says that the details people enter to connect you are sent there with every call, and shows the permission in plain words with a choice to approve it. Add it, and Hub shows the signing secret once. Then use Send a test: it makes one signed ping, the same a real registration makes, and reports whether it answered.
Then, in Audience’s Plugins section, Add a connector lists you with your host beside you. The person connecting enters your settings, maps your fields onto Audience’s, and confirms what connecting means: that Audience keeps a copy, whose server receives their credentials, and what is and is not sent. If they did not approve write-back, the connector says it only reads and no outbound mapping is offered.
Open the provider in Hub to review a newer version, send a test, turn it off or remove it. A provider a connection uses cannot be removed until the connection is, and Hub names it. Turning it off stops calls: nothing is read or sent, nothing is deleted, and syncing picks up again when it is turned back on.
What is not hosted
Section titled “What is not hosted”Connectors, payments, fulfilment, form handlers and content providers can be hosted by you. AI models stay inside ebitex: a model would see prompts and content, so it is not offered to a third party.