Skip to main content

Partner webhook architecture must be tenant-aware by default.

Webhook processing for partner-managed deployments should enforce explicit tenant routing and idempotent writes.

Core event handling pattern

1

Receive and persist raw event

Store payload with receipt timestamp and original headers for auditability.
2

Resolve tenant context

Map event identifiers to tenant workspace before executing any side effects.
3

Process asynchronously

Fan out to CRM, warehouse, or downstream automation workers with retry-safe jobs.
4

Mark checkpoint and reconcile

Save processing checkpoint and run periodic reconciliation against call logs/export jobs.

Tenant routing keys

Use one or more of:
  • tenant_id from webhook payload
  • runtime_vars business identifiers (crm_account_id, partner_tenant_ref)
  • call identifiers (call_id, voice_session_id) joined with cached tenant map

Partner key and tenant key boundaries

  • Partner API key: tenant provisioning and cross-tenant administrative operations.
  • Tenant API key: tenant-scoped read/write integration tasks.
  • Do not execute tenant write-side effects in shared partner context without explicit tenant isolation.

Reconciliation playbook

Daily reconciliation job should:
  1. Pull terminal calls from voice_sessions.
  2. Compare against processed webhook dedupe records.
  3. Replay missing items to downstream systems.
  4. Raise incident if mismatch exceeds internal threshold.

Failure handling

Failure modeImmediate actionLong-term prevention
Duplicate webhook deliveriesDedupe by call_id:event keyEnforce uniqueness in storage layer
Cross-tenant misroutingHalt worker, quarantine payloadStrengthen tenant lookup validation rules
Downstream CRM timeoutRetry with backoff queueAdd circuit breaker and dead-letter review
Event backlog spikeShed non-critical jobs, prioritize terminal eventsCapacity plan worker pool and autoscaling
For partner audits, retain raw webhook receipt logs and replay outcomes for at least your agreed operational retention window.