Webhooks API
Subscribe to events, test deliveries, and rotate webhook secrets securely.
Required Scopes
webhooks:manageEndpoints
GET
/webhooksList webhook endpoints.
POST
/webhooksCreate a webhook endpoint.
POST
/webhooks/{webhookId}/testTrigger a test event delivery.
GET
/webhooks/{webhookId}/deliveriesReview delivery attempts and status.
POST
/webhooks/{webhookId}/rotate-secretRotate endpoint signing secret.
DELETE
/webhooks/{webhookId}Delete a webhook endpoint.
Code Examples
Curl
curl -X POST "https://api.servoagent.com/v1/webhooks" \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/servoagent/webhook","events":["run.completed"]}'Python
webhook = client.webhooks.create(
url="https://example.com/servoagent/webhook",
events=["run.completed", "run.failed"],
)
print(webhook.id, webhook.secret)Node.js
const webhook = await client.webhooks.create({
url: 'https://example.com/servoagent/webhook',
events: ['run.completed', 'run.failed'],
})
console.log(webhook.id, webhook.secret)Go
webhook, err := client.Webhooks.Create(ctx, servoagent.WebhookCreateRequest{
URL: "https://example.com/servoagent/webhook",
Events: []string{"run.completed", "run.failed"},
})
if err != nil {
log.Fatal(err)
}
fmt.Println(webhook.ID, webhook.Secret)Ruby
webhook = client.webhooks.create(
url: 'https://example.com/servoagent/webhook',
events: ['run.completed', 'run.failed']
)
puts webhook['id']
puts webhook['secret']Test It Live
Use API Explorer to execute these endpoints and generate request snippets from real inputs.
Open API Explorer