Create a webhook endpoint
Starts sending your workspace’s events to an https URL: every type by default (["*"], including types added later), or the ones you list. Runs started from the API, the studio and MCP all send events. The answer holds the endpoint’s signing secret, shown only here and when you rotate it. A workspace can have up to 16 endpoints; one more answers 409.
Needs an API key with the generations:write scope.
curl --request POST \
--url https://api.tryleap.ai/v1/webhook_endpoints \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>'})
};
fetch('https://api.tryleap.ai/v1/webhook_endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tryleap.ai/v1/webhook_endpoints"
payload = { "url": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Authorizations
Your workspace API key, leap_.... Create one at https://app.tryleap.ai/go/api, and keep it on your server.
Body
Where Leap POSTs events: an https URL that answers 2xx within 15 seconds.
2048The event types to send. ["*"], the default, sends every type, including types added later.
1 - 4 elements*, generation.succeeded, generation.failed, generation.canceled, batch.completed A note for people, such as which app this is.
500Response
The endpoint, with its signing secret.
An endpoint with its signing secret, as create and rotate_secret return it.
The endpoint's ID, we_....
"webhook_endpoint"Where Leap POSTs events.
Your note, if any.
The event types it gets; ["*"] for every type, including types added later.
Whether deliveries to it are stopped.
Why Leap disabled the endpoint, such as every delivery failing for 72 hours; null when it is on or you turned it off.
When it was created.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$When it last changed.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$The signing secret, whsec_ and base64. Shown only here: keep it in your server's environment.
curl --request POST \
--url https://api.tryleap.ai/v1/webhook_endpoints \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>'})
};
fetch('https://api.tryleap.ai/v1/webhook_endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tryleap.ai/v1/webhook_endpoints"
payload = { "url": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)