Create a webhook subscription
curl --request POST \
--url https://www.presolve.com/api/v1/webhook-subscriptions \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: <x-idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "<string>",
"eventTypes": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {
'X-Idempotency-Key': '<x-idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({url: '<string>', eventTypes: ['<string>']})
};
fetch('https://www.presolve.com/api/v1/webhook-subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.presolve.com/api/v1/webhook-subscriptions"
payload = {
"url": "<string>",
"eventTypes": ["<string>"]
}
headers = {
"X-Idempotency-Key": "<x-idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"subscription": {
"id": "<string>",
"url": "<string>",
"eventTypes": [
"<string>"
],
"isActive": true,
"secret": "<string>"
}
}{
"success": false,
"error": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"code": "<string>"
}Events & Webhooks
Create a webhook subscription
URL must be HTTPS on a host in the key’s webhookAllowedHosts allowlist (fail-closed when empty). The signing secret is returned once, inside the subscription object on create (and again only on rotateSecret).
organizationId is not supported on this operation. Its existing credential or organization scope applies.
Requires the webhooks:manage scope. Mutations require an X-Idempotency-Key header (responses are stored for replay; reusing a key with a different request returns 409 IDEMPOTENCY_CONFLICT). Rate tier: write.
POST
/
api
/
v1
/
webhook-subscriptions
Create a webhook subscription
curl --request POST \
--url https://www.presolve.com/api/v1/webhook-subscriptions \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: <x-idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "<string>",
"eventTypes": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {
'X-Idempotency-Key': '<x-idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({url: '<string>', eventTypes: ['<string>']})
};
fetch('https://www.presolve.com/api/v1/webhook-subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.presolve.com/api/v1/webhook-subscriptions"
payload = {
"url": "<string>",
"eventTypes": ["<string>"]
}
headers = {
"X-Idempotency-Key": "<x-idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"subscription": {
"id": "<string>",
"url": "<string>",
"eventTypes": [
"<string>"
],
"isActive": true,
"secret": "<string>"
}
}{
"success": false,
"error": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"code": "<string>"
}Authorizations
Headers
Body
application/json