Skip to main content
POST
https://agentgate.mynewapi.com
/
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"
}
url
string
required
HTTPS URL to receive webhook events.
events
array
required
Array of event types to subscribe to.
enabled
boolean
default:true
Whether the webhook is active.
description
string
Human-readable description.
headers
object
Custom headers to include in webhook requests.
webhook
object
The created webhook configuration.
secret
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"
}