curl -X POST https://agentgate.mynewapi.com/v1/webhooks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/webhooks/agentgate",
"events": ["run.completed", "run.failed"],
"description": "Production webhook"
}'
{
"webhook": {
"id": "wh_abc123",
"url": "https://your-app.com/webhooks/agentgate",
"events": ["run.completed", "run.failed"],
"enabled": true,
"description": "Production webhook",
"createdAt": "2024-01-15T10:30:00Z"
},
"secret": "whsec_xxxxxxxxxxxxxxxxxxxxxxxx"
}
Webhooks
Create Webhook
Create a new webhook endpoint
POST
/
v1
/
webhooks
curl -X POST https://agentgate.mynewapi.com/v1/webhooks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/webhooks/agentgate",
"events": ["run.completed", "run.failed"],
"description": "Production webhook"
}'
{
"webhook": {
"id": "wh_abc123",
"url": "https://your-app.com/webhooks/agentgate",
"events": ["run.completed", "run.failed"],
"enabled": true,
"description": "Production webhook",
"createdAt": "2024-01-15T10:30:00Z"
},
"secret": "whsec_xxxxxxxxxxxxxxxxxxxxxxxx"
}
string
required
HTTPS URL to receive webhook events.
array
required
Array of event types to subscribe to.
boolean
default:true
Whether the webhook is active.
string
Human-readable description.
object
Custom headers to include in webhook requests.
object
The created webhook configuration.
string
Webhook secret for signature verification. Only shown once at creation.
Save the webhook secret immediately. It cannot be retrieved later.
curl -X POST https://agentgate.mynewapi.com/v1/webhooks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/webhooks/agentgate",
"events": ["run.completed", "run.failed"],
"description": "Production webhook"
}'
{
"webhook": {
"id": "wh_abc123",
"url": "https://your-app.com/webhooks/agentgate",
"events": ["run.completed", "run.failed"],
"enabled": true,
"description": "Production webhook",
"createdAt": "2024-01-15T10:30:00Z"
},
"secret": "whsec_xxxxxxxxxxxxxxxxxxxxxxxx"
}