Skip to main content
PATCH
/
api
/
v1
/
webhooks
curl -X PATCH https://api.jasni.ai/api/v1/webhooks \
  -H "Authorization: Bearer jsk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "url": "https://new-server.com/webhooks"
  }'
{
  "success": true,
  "data": {
    "webhook": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "url": "https://new-server.com/webhooks",
      "events": ["email.received", "email.sent"],
      "active": true,
      "description": "Production webhook",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T14:20:00Z"
    }
  }
}

Request Body

id
string
required
Webhook ID to update
url
string
New webhook endpoint URL
events
array
New events to subscribe to. Must include at least one event.
active
boolean
Enable or disable the webhook
description
string
New description

Response

success
boolean
Indicates if the update was successful
data
object
curl -X PATCH https://api.jasni.ai/api/v1/webhooks \
  -H "Authorization: Bearer jsk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "url": "https://new-server.com/webhooks"
  }'
{
  "success": true,
  "data": {
    "webhook": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "url": "https://new-server.com/webhooks",
      "events": ["email.received", "email.sent"],
      "active": true,
      "description": "Production webhook",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T14:20:00Z"
    }
  }
}

Update Examples

Change Webhook URL

await updateWebhook({
  id: 'webhook-id',
  url: 'https://new-endpoint.com/webhook',
});

Add New Events

await updateWebhook({
  id: 'webhook-id',
  events: ['email.received', 'email.sent', 'email.bounced'],
});

Temporarily Disable

// Disable during maintenance
await updateWebhook({
  id: 'webhook-id',
  active: false,
});

// Re-enable after maintenance
await updateWebhook({
  id: 'webhook-id',
  active: true,
});

Update Description

await updateWebhook({
  id: 'webhook-id',
  description: 'Updated: Production webhook for AI agent',
});

Notes

  • At least one field (besides id) must be provided to update
  • The webhook secret cannot be changed - delete and recreate if needed
  • Changes take effect immediately