pex

Webhooks API

Configure outgoing webhook subscriptions and receive incoming webhooks from external platforms. Management endpoints require authentication; incoming webhook endpoints use source-specific verification.

List Webhooks

GET/api/webhooks

List all configured webhook subscriptions

curl https://your-instance.com/api/webhooks \ -H "x-api-key: apex_key_abc123"

Returns an array of webhook configurations:

[
  {
    "id": "wh_001",
    "url": "https://example.com/hooks/apex",
    "events": ["lead.created", "experiment.completed"],
    "status": "active",
    "createdAt": "2025-01-10T08:00:00Z"
  }
]

Create Webhook

POST/api/webhooks

Subscribe a URL to receive event notifications

ParameterTypeDescription
urlrequiredstringHTTPS URL to deliver webhook payloads to
eventsrequiredarrayEvent types to subscribe to (e.g. lead.created, experiment.completed, goal.reached)
secretstringShared secret for HMAC signature verification. Auto-generated if not provided.
curl -X POST https://your-instance.com/api/webhooks \ -H "Content-Type: application/json" \ -H "x-api-key: apex_key_abc123" \ -d '{ "url": "https://example.com/hooks/apex", "events": ["lead.created", "experiment.completed", "goal.reached"] }'

Warning

Store the returned secret securely. It is used to verify webhook signatures and is only returned once at creation time.

Available Event Types

EventFired when
lead.createdA new lead is identified via identity stitching
lead.updatedA lead's data or attribution changes
experiment.startedAn experiment transitions to running
experiment.completedAn experiment reaches statistical significance or is manually stopped
goal.reachedA goal hits its target value
connector.syncedA connector sync completes successfully
connector.errorA connector sync fails

Delete Webhook

DELETE/api/webhooks

Remove a webhook subscription

ParameterTypeDescription
idrequiredstringWebhook ID to delete
curl -X DELETE https://your-instance.com/api/webhooks \ -H "Content-Type: application/json" \ -H "x-api-key: apex_key_abc123" \ -d '{ "id": "wh_001" }'

Receive External Webhook

POST/api/webhooks/:source

Receive incoming webhooks from external platforms

ParameterTypeDescription
sourcerequiredstringSource platform identifier: hubspot, stripe, github (path parameter)

Info

Incoming webhook endpoints are authenticated by the source platform's own verification mechanism (e.g. HubSpot signature header, Stripe webhook secret) rather than Apex API keys.

Configure these URLs in your external platform's webhook settings:

https://your-instance.com/api/webhooks/hubspot
https://your-instance.com/api/webhooks/stripe

Apex processes the payload, extracts relevant data (new contacts, deals, payments), and feeds it into the identity and attribution pipeline.