Register a webhook
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://example.com/webhooks/prudra', events: ['*'], secret: '<string>'})
};
fetch('https://api.prudra.dev/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.prudra.dev/webhooks"
payload = {
"url": "https://example.com/webhooks/prudra",
"events": ["*"],
"secret": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.prudra.dev/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/webhooks/prudra",
"events": [
"*"
],
"secret": "<string>"
}
'{
"id": "wh_abc123",
"url": "https://example.com/webhook",
"events": [
"*"
],
"isActive": true,
"createdAt": "2023-11-07T05:31:56Z",
"secret": "<string>"
}{
"type": "https://api.prudra.dev/problems/payment-limit-reached",
"title": "Plan Limit Reached",
"status": 429,
"detail": "Your plan includes 100 payments per month. You have used 100.",
"limit": 100,
"current": 100,
"upgradeUrl": "https://dashboard.prudra.com/settings/billing"
}Webhooks
Register a webhook
HTTPS endpoint for outbound events. The response may include a secret once
for HMAC verification (X-Prudra-Signature on deliveries).
POST
/
webhooks
Register a webhook
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://example.com/webhooks/prudra', events: ['*'], secret: '<string>'})
};
fetch('https://api.prudra.dev/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.prudra.dev/webhooks"
payload = {
"url": "https://example.com/webhooks/prudra",
"events": ["*"],
"secret": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.prudra.dev/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/webhooks/prudra",
"events": [
"*"
],
"secret": "<string>"
}
'{
"id": "wh_abc123",
"url": "https://example.com/webhook",
"events": [
"*"
],
"isActive": true,
"createdAt": "2023-11-07T05:31:56Z",
"secret": "<string>"
}{
"type": "https://api.prudra.dev/problems/payment-limit-reached",
"title": "Plan Limit Reached",
"status": 429,
"detail": "Your plan includes 100 payments per month. You have used 100.",
"limit": 100,
"current": 100,
"upgradeUrl": "https://dashboard.prudra.com/settings/billing"
}Authorizations
Your Prudra API key. Get one at dashboard.prudra.com/settings/api-keys
Body
application/json

