Light Mode
Register Webhook
POST
/webhooks/subscribeLast modified: a month ago
This endpoint allows you to register a new webhook.
:::tip[Note]
- The webhook used is to notify/update/delete an external service when an event has occurred.
- To trigger your webhook to send data, you can choose one event from the List Events endpoint.
:::
:::info[Information]
Read more on Webhooks here.
:::
:::caution[Alert]
• New subscriptions with the same URL will update events / restore old webhooks (if they exist).
• The added URL must accept POST
requests.
• By default, all new webhooks are registered as version 2
. To use version 1
, specify it in your request parameters.
:::
Request
Body Params application/json
No schema defined
Example
{
"name": "Salla Update Customer Event",
"event": "customer.updated",
"url": "https://webhook.site/07254470-c763-4ee3-bef1-ab2480262814",
"version": 2,
"rule": "payment_method = mada OR price < 50",
"headers": [
{
"key": "Your Secret token key name",
"value": "Your Secret token value"
}
]
}
Request samples
Responses
New webhook has been registered successfully(200)
Error Validation(422)
New webhook has been registered successfully
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
No schema defined
Example
Webhook V2
{
"status": 200,
"success": true,
"data": {
"id": 60587520,
"name": "Salla Update Customer Event",
"event": "customer.updated",
"type": "manual",
"url": "https://webhook.site/07254470-c763-4ee3-bef1-ab2480262814",
"version": 2,
"rule": "payment_method = mada OR price < 50",
"headers": {
"Authorization": "abcd1234",
"Accept-Language": "AR"
}
}
}
Last modified: a month ago