Manage Webhooks

Create, list, update, and delete webhook subscriptions via the API. Each subscription listens for specific event types and delivers payloads to your URL.

Create a Webhook

Subscribe to one or more event types. The response includes your signing secret — store it securely.

curl -X POST https://api.repull.dev/v1/webhooks \
  -H "Authorization: Bearer sk_live_YOUR_KEY" \
  -H "X-Workspace-Id: YOUR_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-app.com/webhooks/repull",
    "events": ["reservation.created", "reservation.updated", "message.received"],
    "description": "Production webhook"
  }'
{
  "id": "wh_abc123",
  "url": "https://your-app.com/webhooks/repull",
  "events": ["reservation.created", "reservation.updated", "message.received"],
  "description": "Production webhook",
  "signing_secret": "whsec_k7d9f2...",
  "active": true,
  "created_at": "2025-06-15T10:00:00Z"
}

Save your signing secret

The signing_secret is only returned once at creation time. Store it in your environment variables immediately. If you lose it, delete the webhook and create a new one.

List Webhooks

Retrieve all webhook subscriptions for your workspace:

curl https://api.repull.dev/v1/webhooks \
  -H "Authorization: Bearer sk_live_YOUR_KEY" \
  -H "X-Workspace-Id: YOUR_WORKSPACE_ID"
{
  "data": [
    {
      "id": "wh_abc123",
      "url": "https://your-app.com/webhooks/repull",
      "events": ["reservation.created", "reservation.updated", "message.received"],
      "active": true,
      "created_at": "2025-06-15T10:00:00Z"
    }
  ]
}

Update a Webhook

Update the URL, events, or active status of an existing subscription:

curl -X PATCH https://api.repull.dev/v1/webhooks/wh_abc123 \
  -H "Authorization: Bearer sk_live_YOUR_KEY" \
  -H "X-Workspace-Id: YOUR_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "events": ["reservation.created", "reservation.updated", "reservation.cancelled", "message.received"],
    "active": true
  }'

Delete a Webhook

Permanently remove a webhook subscription. Pending deliveries will be cancelled.

curl -X DELETE https://api.repull.dev/v1/webhooks/wh_abc123 \
  -H "Authorization: Bearer sk_live_YOUR_KEY" \
  -H "X-Workspace-Id: YOUR_WORKSPACE_ID"

Test a Webhook

Send a test event to verify your endpoint is working. The test delivery uses a synthetic payload with realistic data:

curl -X POST https://api.repull.dev/v1/webhooks/wh_abc123/test \
  -H "Authorization: Bearer sk_live_YOUR_KEY" \
  -H "X-Workspace-Id: YOUR_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "event_type": "reservation.created"
  }'
{
  "delivery_id": "del_test_456",
  "status": "success",
  "response_code": 200,
  "response_time_ms": 142
}

Test before going live

Always send a test delivery after creating a webhook to verify your endpoint handles the payload correctly and returns a 200 status within 5 seconds.
AI