Skip to main content
Webhooks allow your application to receive real-time notifications when events occur in your Gately project.

How Webhooks Work

  1. You register a webhook endpoint URL
  2. When an event occurs, Gately sends an HTTP POST request to your URL
  3. Your server processes the event and returns a 200 response

Creating a Webhook

Via Dashboard

  1. Navigate to Webhooks in your dashboard
  2. Click Create Webhook
  3. Enter your endpoint URL
  4. Select the events you want to receive
  5. Click Create

Via API

curl -X POST "https://api.usegately.com/api/v1/webhooks" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-server.com/webhooks/gately",
    "events": ["member.created", "member.updated", "form.submitted"],
    "active": true
  }'

Webhook Payload

All webhook payloads include:
{
  "id": "evt_abc123",
  "event": "member.created",
  "created_at": "2024-01-15T10:00:00Z",
  "project_id": "proj_xyz789",
  "data": {
    // Event-specific data
  }
}

Security

Signature Verification

All webhooks include a signature header for verification:
X-Gately-Signature: sha256=abc123def456...
Verify the signature to ensure the request is from Gately:
const crypto = require('crypto')

function verifySignature(payload, signature, secret) {
  const expected = crypto
    .createHmac('sha256', secret)
    .update(payload, 'utf8')
    .digest('hex')
  
  return signature === `sha256=${expected}`
}

Best Practices

  • Always verify webhook signatures
  • Use HTTPS endpoints only
  • Respond quickly (within 30 seconds)
  • Process events asynchronously
  • Handle duplicate events idempotently

Retry Policy

Failed webhook deliveries are retried with exponential backoff:
AttemptDelay
1Immediate
21 minute
35 minutes
430 minutes
52 hours
After 5 failed attempts, the webhook delivery is marked as failed.

Managing Webhooks

List Webhooks

curl -X GET "https://api.usegately.com/api/v1/webhooks" \
  -H "Authorization: Bearer YOUR_API_KEY"

Update Webhook

curl -X PUT "https://api.usegately.com/api/v1/webhooks/{webhook_id}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "events": ["member.created"],
    "active": false
  }'

Delete Webhook

curl -X DELETE "https://api.usegately.com/api/v1/webhooks/{webhook_id}" \
  -H "Authorization: Bearer YOUR_API_KEY"

Testing

Send Test Event

curl -X POST "https://api.usegately.com/api/v1/webhooks/{webhook_id}/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "member.created"
  }'

View Delivery Logs

curl -X GET "https://api.usegately.com/api/v1/webhooks/{webhook_id}/logs" \
  -H "Authorization: Bearer YOUR_API_KEY"