Create Webhook
Create a new webhook endpoint
POST
/webhooksRequires
Bearer authenticationCreate a new webhook to receive event notifications.
Body Parameters
urlstringrequiredThe URL to send webhook payloads to.
eventsarrayrequiredArray of event types to subscribe to.
secretstringOptional secret for signing webhook payloads.
POST
/webhookscurl -X POST "https://api.vastal.agency/v1/webhooks" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/webhook", "events": ["row.created", "row.updated", "row.deleted"] }'
const response = await fetch( 'https://api.vastal.agency/v1/webhooks', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ url: 'https://example.com/webhook', events: ['row.created', 'row.updated', 'row.deleted'] }) } );
201Created
{ "success": true, "data": { "id": "whk_xyz789", "url": "https://example.com/webhook", "events": ["row.created", "row.updated", "row.deleted"], "secret": "whsec_...", "active": true } }