Create a webhook endpoint
curl --request POST \
--url https://api.compute.anonalabs.com/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "lifecycle",
"url": "https://example.com/anona/webhooks",
"events": [
"sandbox.lifecycle.created",
"sandbox.lifecycle.killed"
]
}
'import requests
url = "https://api.compute.anonalabs.com/v1/webhooks"
payload = {
"name": "lifecycle",
"url": "https://example.com/anona/webhooks",
"events": ["sandbox.lifecycle.created", "sandbox.lifecycle.killed"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'lifecycle',
url: 'https://example.com/anona/webhooks',
events: ['sandbox.lifecycle.created', 'sandbox.lifecycle.killed']
})
};
fetch('https://api.compute.anonalabs.com/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"webhook": {
"id": "<string>",
"name": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"enabled": true,
"secretHint": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"previousSecretValidUntil": "2023-11-07T05:31:56Z",
"lastDeliveryAt": "2023-11-07T05:31:56Z",
"lastDeliveryStatus": "<string>",
"failingDeliveries": 123,
"deadDeliveries": 123
},
"secret": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}Webhooks and telemetry
Create a webhook endpoint
Returns the signing secret (whsec_...) once. URLs must be https with a public host.
POST
/
v1
/
webhooks
Create a webhook endpoint
curl --request POST \
--url https://api.compute.anonalabs.com/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "lifecycle",
"url": "https://example.com/anona/webhooks",
"events": [
"sandbox.lifecycle.created",
"sandbox.lifecycle.killed"
]
}
'import requests
url = "https://api.compute.anonalabs.com/v1/webhooks"
payload = {
"name": "lifecycle",
"url": "https://example.com/anona/webhooks",
"events": ["sandbox.lifecycle.created", "sandbox.lifecycle.killed"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'lifecycle',
url: 'https://example.com/anona/webhooks',
events: ['sandbox.lifecycle.created', 'sandbox.lifecycle.killed']
})
};
fetch('https://api.compute.anonalabs.com/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"webhook": {
"id": "<string>",
"name": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"enabled": true,
"secretHint": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"previousSecretValidUntil": "2023-11-07T05:31:56Z",
"lastDeliveryAt": "2023-11-07T05:31:56Z",
"lastDeliveryStatus": "<string>",
"failingDeliveries": 123,
"deadDeliveries": 123
},
"secret": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}Authorizations
ApiKeyAuthBearerAuth
An Anona Compute API key (e2b_ followed by lowercase hex).
Body
application/json