const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: [], label: '<string>'})
};
fetch('https://sandbox.api.enfinitos.com/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.api.enfinitos.com/v1/webhooks"
payload = {
"url": "<string>",
"events": [],
"label": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.enfinitos.com/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [],\n \"label\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.api.enfinitos.com/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [],\n \"label\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.enfinitos.com/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [],\n \"label\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyfalsecurl --request POST \
--url https://sandbox.api.enfinitos.com/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [],
"label": "<string>"
}
'{
"ok": true,
"data": {
"subscription": {
"subscriptionId": "<string>",
"developerId": "<string>",
"url": "<string>",
"events": [
"*"
],
"label": "<string>",
"active": true,
"createdAt": "2023-11-07T05:31:56Z",
"lastDeliveredAt": "2023-11-07T05:31:56Z",
"secretLastRotatedAt": "2023-11-07T05:31:56Z"
},
"signingSecret": "<string>"
},
"contractVersion": "v1.0"
}{
"ok": false,
"error": "AUTH_REQUIRED",
"message": "<string>",
"contractVersion": "v1.0",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": false,
"error": "AUTH_REQUIRED",
"message": "<string>",
"contractVersion": "v1.0",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": false,
"error": "AUTH_REQUIRED",
"message": "<string>",
"contractVersion": "v1.0",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}Create a webhook subscription
Create a webhook subscription. Returns the whsec_… signing secret EXACTLY ONCE (the store keeps only an HMAC). Delivery payloads are signed Enfinitos-Signature: t=<unix-seconds>,v1=<hex-hmac> where the HMAC-SHA256 covers <unix-seconds>.<raw-body>. Delivery is asynchronous and at-least-once: each attempt has a 10-second timeout, failures retry on an exponential backoff with jitter (~30s, 2m, 10m, 1h), and after 5 attempts the delivery is dead_lettered (replayable manually). Make your receiver idempotent and return 2xx quickly. The url must be absolute and https. Requires a key carrying the wildcard * scope.
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: [], label: '<string>'})
};
fetch('https://sandbox.api.enfinitos.com/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.api.enfinitos.com/v1/webhooks"
payload = {
"url": "<string>",
"events": [],
"label": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.enfinitos.com/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [],\n \"label\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.api.enfinitos.com/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [],\n \"label\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.enfinitos.com/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [],\n \"label\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyfalsecurl --request POST \
--url https://sandbox.api.enfinitos.com/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [],
"label": "<string>"
}
'{
"ok": true,
"data": {
"subscription": {
"subscriptionId": "<string>",
"developerId": "<string>",
"url": "<string>",
"events": [
"*"
],
"label": "<string>",
"active": true,
"createdAt": "2023-11-07T05:31:56Z",
"lastDeliveredAt": "2023-11-07T05:31:56Z",
"secretLastRotatedAt": "2023-11-07T05:31:56Z"
},
"signingSecret": "<string>"
},
"contractVersion": "v1.0"
}{
"ok": false,
"error": "AUTH_REQUIRED",
"message": "<string>",
"contractVersion": "v1.0",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": false,
"error": "AUTH_REQUIRED",
"message": "<string>",
"contractVersion": "v1.0",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}{
"ok": false,
"error": "AUTH_REQUIRED",
"message": "<string>",
"contractVersion": "v1.0",
"field": "<string>",
"validationErrors": [
{}
],
"requiredScopes": [
"<string>"
],
"keyScopes": [
"<string>"
]
}Authorizations
API key sent as Authorization: Bearer <api-key>.
Body
HTTPS endpoint that receives delivery POSTs.
Event kinds to subscribe to. Use ["*"] for everything.
1Webhook event taxonomy. Note that some kinds are defined but do not currently fire on the sandbox surface (e.g. right.resumed, right.expired, challenge.withdrawn, proof_pack.sealed, and the key.* kinds); subscribe to them safely for forward-compatibility.
*, right.issued, right.suspended, right.resumed, right.revoked, right.expired, basis.registered, offer.proposed, offer.accepted, offer.rejected, offer.countered, offer.withdrawn, challenge.opened, challenge.resolved, challenge.withdrawn, delivery.observed, proof_pack.sealed, settlement_rule.activated, settlement_rule.superseded, rate_card.activated, rate_card.superseded, dispute.opened, dispute.resolved, dispute.withdrawn, dispute.escalated, dsar_job.completed, dsar_job.failed, finance_period.closed, key.issued, key.revoked, key.rotated 1 - 60