daimon.email
Api referenceWebhooks

Update Webhook

Update webhook URL, events, status, or inbox scope

Authentication

Account API Key required via Authorization: Bearer {api_key} header.

Path Parameters

idstringpathrequired

Webhook ID (prefix: wh_)

Request Body

All fields are optional - only include fields you want to update.

urlstringbody

New HTTPS URL for webhook delivery

eventsarraybody

Updated array of event types. Must contain at least one event if provided.

statusstringbody

Update webhook status: active or disabled

Setting to active resets failure_count to 0.

inbox_idstring | nullbody

Change inbox scope. Set to null for account-wide, or provide inbox UUID to scope to specific inbox.

curl -X PATCH https://api.daimon.email/v1/webhooks/wh_xyz789 \
  -H "Authorization: Bearer dm_free_7d8a9b0c1d2e3f4g5h6i7j8k9l0m1n2o" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://new-endpoint.your-agent.com/webhook",
    "status": "active"
  }'
import { DaimonClient } from 'daimon-email';

const client = new DaimonClient({
  apiKey: 'dm_free_7d8a9b0c1d2e3f4g5h6i7j8k9l0m1n2o'
});

// Update URL
const webhook = await client.webhooks.update('wh_xyz789', {
  url: 'https://new-endpoint.your-agent.com/webhook'
});

// Re-enable unhealthy webhook
const reactivated = await client.webhooks.update('wh_xyz789', {
  status: 'active'  // Resets failure_count
});

// Add more event types
const updated = await client.webhooks.update('wh_xyz789', {
  events: ['message.received', 'message.bounced', 'message.delivered']
});
from daimon_email import DaimonClient

client = DaimonClient(api_key='dm_free_7d8a9b0c1d2e3f4g5h6i7j8k9l0m1n2o')

# Update URL
webhook = client.webhooks.update('wh_xyz789', {
    'url': 'https://new-endpoint.your-agent.com/webhook'
})

# Re-enable unhealthy webhook
reactivated = client.webhooks.update('wh_xyz789', {
    'status': 'active'  # Resets failure_count
})

# Add more event types
updated = client.webhooks.update('wh_xyz789', {
    'events': ['message.received', 'message.bounced', 'message.delivered']
})

Response

{
  "result": {
    "id": "wh_xyz789",
    "account_id": "acc_def456",
    "inbox_id": "inb_abc123",
    "url": "https://new-endpoint.your-agent.com/webhook",
    "events": ["message.received"],
    "status": "active",
    "last_delivered_at": "2024-03-11T15:30:00Z",
    "failure_count": 0,
    "created_at": "2024-03-11T14:23:45Z",
    "updated_at": "2024-03-11T16:00:00Z"
  },
  "next_steps": [
    "Verify new endpoint is receiving events",
    "Test webhook signature verification at new URL",
    "Monitor failure_count to ensure healthy delivery"
  ]
}

Response Fields

Returns the complete updated webhook object with all fields.

Common Use Cases

Re-enable Unhealthy Webhook

If your webhook went unhealthy due to temporary downtime:

await client.webhooks.update('wh_xyz789', { status: 'active' });
// Resets failure_count to 0 and resumes delivery

Change Event Subscriptions

await client.webhooks.update('wh_xyz789', {
  events: ['message.received', 'message.bounced']
});

Update Endpoint URL

await client.webhooks.update('wh_xyz789', {
  url: 'https://new-server.com/webhook'
});

Error Responses

400error

Invalid request - URL must be HTTPS, events array cannot be empty

401error

Invalid or missing API key

404error

Webhook not found or does not belong to this account

Warning

Important: Changing the webhook URL does not regenerate the secret. Continue using the original secret for signature verification. If you need a new secret, delete and recreate the webhook.