Skip to main content

AI widgets (headless protocol)

Partners can ship modules that return presentation Cards for Airlead AI surfaces. Airlead calls your HTTPS endpoint with a signed JSON request; you respond with Widget Protocol v1 payloads. This is not the same as lead ingest or Connect delivery. Modules enrich the UI; they do not mutate workspace data.

Concepts

Surfaces

ai.chat.inline is reserved for Airlead AI tool results (drafts, delivery repair, …). Partners must not return workflow cards such as draft, deliveryRepair, or confirmDraft actions.

Registration

Airlead registers your module server-side (slug, publisher, HTTPS endpoint, surfaces, scopes). After registration, a workspace admin enables it under Settings → Apps & Module → Partner-Widgets. Local / staging helper (Airlead operators):
The script prints a signingSecret. Store it with the partner; it is never exposed to browsers. Endpoint rules:
  • Public https:// URL, or
  • Same-origin mock only: /api/widgets/partner-mock (development)

Request (Airlead → partner)

POST your dataEndpoint with:

Signature

Canonical string:
HMAC-SHA256 with the shared secret, hex-encoded, prefixed with v1=. Reject requests when:
  • Signature missing or mismatch
  • Timestamp skew greater than 5 minutes

Body

record only contains fields granted by scopes. Default partner scopes exclude email and phone unless explicitly granted at registration. For ai.chat.empty, Airlead may send a workspace-level placeholder record (id like workspace:…). Prefer workspace-level metrics in that case; do not assume a real lead id.

Response (partner → Airlead)

Rules:
  • version must be "1"
  • slug must match the request
  • widgets is an array of Card payloads
  • Airlead filters kinds to the partner allowlist ∩ surface matrix
  • Actions may only be link or followUp (confirmDraft is stripped)
Respond quickly. Airlead aborts partner fetches around 800 ms; timeouts soft-fail and hide the module for that paint.

Allowed Card kinds (partner)

trendMetric

Large number with optional delta, period, footnote, and actions.

insight

Headline + body + optional evidence prompts (good for alerts).

entityProfile

Compact entity summary (Command Deck).

actionRow

Action buttons only — link / followUp.

Scopes

Errors

Return HTTP 2xx only with a valid Protocol v1 body. Non-2xx responses are treated as partner errors. Airlead maps failures to soft UI errors (timeout, unauthorized, invalid_response, partner_error, unavailable) and does not block the rest of the deck.

Enablement

  1. Module registered and published
  2. Workspace enables it under Apps & Module
  3. Surfaces include the target surface
  4. Endpoint reachable from Airlead servers with a valid signature
Core Airlead modules default to enabled; partner modules default to disabled until toggled on.

Security checklist

  • Use TLS and rotate the signing secret if leaked
  • Verify signature + timestamp on every request
  • Do not log full record payloads with PII
  • Never return Airlead workflow cards or draft confirmations
  • Keep responses under the timeout budget