Register a webhook endpoint
curl --request POST \
--url https://swapnice-gateway-dev.ceo-cbc.workers.dev/v1/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"url": "<string>",
"enabled_events": []
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({url: '<string>', enabled_events: []})
};
fetch('https://swapnice-gateway-dev.ceo-cbc.workers.dev/v1/webhook-endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://swapnice-gateway-dev.ceo-cbc.workers.dev/v1/webhook-endpoints"
payload = {
"url": "<string>",
"enabled_events": []
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"endpoint": {
"id": "<string>",
"url": "<string>",
"enabled_events": [
"<string>"
],
"status": "active",
"created_at": "2023-11-07T05:31:56Z"
},
"signing_secret": "<string>"
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}Webhooks
Register a webhook endpoint
Create a receiver. The signing secret is shown once.
POST
/
v1
/
webhook-endpoints
Register a webhook endpoint
curl --request POST \
--url https://swapnice-gateway-dev.ceo-cbc.workers.dev/v1/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"url": "<string>",
"enabled_events": []
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({url: '<string>', enabled_events: []})
};
fetch('https://swapnice-gateway-dev.ceo-cbc.workers.dev/v1/webhook-endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://swapnice-gateway-dev.ceo-cbc.workers.dev/v1/webhook-endpoints"
payload = {
"url": "<string>",
"enabled_events": []
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"endpoint": {
"id": "<string>",
"url": "<string>",
"enabled_events": [
"<string>"
],
"status": "active",
"created_at": "2023-11-07T05:31:56Z"
},
"signing_secret": "<string>"
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}Create a receiver. The signing secret is shown once.
Registration is live. Delivery is near-term. See webhooks.
Authorizations
Headers
Body
application/json