Webhooks

Webhooks let your application receive real‑time events when messages are received, sent or when sessions connect.

Configure a webhook URL

"function">curl "keyword">-X POST https://omdaa.com/api/v1/webhooks/set \
  "keyword">-H "Authorization: Bearer YOUR_JWT_TOKEN" \
  "keyword">-H "Content"keyword">-Type: application/json" \
  "keyword">-d '{
  "webhookUrl": "https://your class="keyword">-server.com/webhook",
  "events": ["message.incoming", "message.sent", "session.connected"]
}'

Example events

Incoming message message.incoming
{
  "event": "message.incoming",
  "data": {
    "messageId": "msg_123",
    "from": "966501234567",
    "message": "Hello",
    "timestamp": "2025-01-15T12:00:00Z"
  }
}
Sent message message.sent
{
  "event": "message.sent",
  "data": {
    "messageId": "msg_123",
    "to": "966501234567",
    "status": "sent",
    "timestamp": "2025-01-15T12:00:00Z"
  }
}
Session connected session.connected
{
  "event": "session.connected",
  "data": {
    "sessionId": "sess_123",
    "phoneNumber": "966501234567",
    "connectedAt": "2025-01-15T12:00:00Z"
  }
}

Verifying signatures

Each webhook request includes a signature header which you should verify before trusting the payload.

X-Webhook-Signature: sha256=...

Get Webhook Configuration

To get current webhook configuration:

"function">curl "keyword">-X GET "https://omdaa.com/api/v1/webhooks" \
  "keyword">-H "Authorization: Bearer YOUR_JWT_TOKEN"

Test Webhook

To test webhook connection:

"function">curl "keyword">-X GET "https://omdaa.com/api/v1/webhooks/test" \
  "keyword">-H "Authorization: Bearer YOUR_JWT_TOKEN"

Webhook Statistics

To get webhook statistics:

"function">curl "keyword">-X GET "https://omdaa.com/api/v1/webhooks/stats" \
  "keyword">-H "Authorization: Bearer YOUR_JWT_TOKEN"

Circuit Breaker

Omdaa API uses Circuit Breaker to protect webhooks from repeated failures:

Get Circuit Breaker State

"function">curl "keyword">-X GET "https://omdaa.com/api/v1/webhooks/circuit class="keyword">-breaker" \
  "keyword">-H "Authorization: Bearer YOUR_JWT_TOKEN"

Reset Circuit Breaker

"function">curl "keyword">-X POST "https://omdaa.com/api/v1/webhooks/circuit class="keyword">-breaker/reset" \
  "keyword">-H "Authorization: Bearer YOUR_JWT_TOKEN"

Available Events

message.incoming
Incoming message
message.sent
Message sent
message.delivered
Message delivered
message.read
Message read
session.connected
Session connected
session.disconnected
Session disconnected
group.created
Group created
group.updated
Group updated