POST /api/v1/webhooks — Create Webhook
Register a new webhook endpoint to receive real-time event notifications from the Sadq platform. Specify the events to subscribe to and the target URL.
Authentication
SadqAuthorize
Request Headers
- Authorization (required)
- Bearer {token}
- Content-Type (required)
- application/json
Request Body
Content-Type: application/json
- webhookUrl (string, required)
- webhook URL Generated From Your Side
- isDefault (string, required)
- Indicates whether the webhook should be set as the default option.
- headerToken (string, optional)
- Optional authentication token to include in webhook request headers.
{
"webhookUrl": "https://example.com/webhook1",
"headerToken": "Bearer secret_token_12345",
"isDefault": true
}Webhook Callback Payload
When a webhook event is triggered, Sadq will send a POST request with the following JSON body:
{
"RequestId": "7bdc3c37-15e7-4c2b-9658-cd3c52c42457",
"Status": 1,
"Files": [
{
"FileName": "828f5487-ebe7-44fd-a2d7-1832a5ed5415.pdf",
"File": "Base64File"
}
],
"ReferencNumber": "Req-staging-2025-8266",
"Fields": [],
"Signatory": [
{
"Id": "5f7c322b-f2cf-460a-99e3-ad5becc96719",
"Status": "SIGNED",
"FullName": "Test New User",
"FullNameAr": "مستخدم جديد",
"NationalId": "2034485954",
"SignOrder": 0,
"Email": "test@sadq.sa",
"PhoneNumber": "",
"AuthenticationType": "WITHOUTVALIDATION",
"Gender": "MALE",
"Nationlity": "",
"RejectReason": null
},
{
"Id": "fc98e99a-7b12-493b-8370-024ea56f939d",
"Status": "SIGNED",
"FullName": "Hassan Hansan Hansan",
"FullNameAr": "حسن حسن حسن حسن",
"NationalId": "",
"SignOrder": 0,
"Email": "hasan@sadq.sa",
"PhoneNumber": "+962785789646",
"AuthenticationType": "SADQLOGIN",
"Gender": "MALE",
"Nationlity": "Jordan",
"RejectReason": null
}
]
}Responses
HTTP 200 — Webhook created
{
"data": {
"id": "9938ba0f-2842-4936-8ba4-ffb230cc783e",
"webhookUrl": "https://webhook.site/23bb9da3-aa27-43f5-ab27-5c85ace2995a",
"accountId": "c0f63b10-f2e5-44e7-93b3-c78189ce392b",
"isDefault": true,
"headerToken": ""
},
"errorCode": 0,
"message": null,
"returnUrl": "/dashboard",
"stateValidationErrors": null,
"signature": ""
}