Skip to main content
PATCH
/
user-webhooks
/
{id}
Update a webhook
curl --request PATCH \
  --url https://api.dialnexa.com/v1/user-webhooks/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "<string>",
  "events": [
    "<string>"
  ],
  "secret": "<string>",
  "is_active": true
}
'
{
  "id": "wh_abc123",
  "url": "https://yourapp.com/webhooks/dialnexa",
  "events": [
    "call.completed",
    "call.failed"
  ],
  "is_active": true,
  "created_at": "2024-03-01T10:00:00.000Z"
}
Updates a registered webhook subscription. You can change the delivery url, add or remove events, rotate the signing secret, or toggle is_active to temporarily pause delivery. Only the fields you include are updated, omitted fields keep their current values. The subscription’s id does not change, so consumers can continue to reference the same webhook ID after the update.

When to use this

  • URL change: your consumer service moved to a new host or path.
  • Adding events: you started building a feature that needs an additional event type and want it delivered to the existing endpoint.
  • Removing events: your consumer no longer cares about a particular event and you want to stop the unnecessary deliveries.
  • Secret rotation: your signing secret leaked, expired, or you are on a periodic rotation cadence.
  • Temporary pause: you want to stop receiving events without losing the subscription. Set is_active to false, then back to true later. If you do not plan to re-enable, use Delete Webhook instead.

Rotating the signing secret

When you pass a new secret value, DialNexa starts signing with the new secret on the very next delivery. There is no overlap period during which both the old and new secrets are accepted. To rotate safely:
  1. Update your consumer service to accept both the old and new secret during a transition window.
  2. Send the new secret to DialNexa through this endpoint.
  3. Confirm new deliveries are being verified with the new secret.
  4. Remove the old secret from your consumer service.
See Webhook secrets for the verification format and helper code.

Path parameters

ParameterDescription
idThe webhook ID, for example whk_c9v3nz8rq4pm.

Body parameters

FieldDescription
urlNew delivery URL.
eventsFull new list of subscribed event types. Replaces the existing list.
secretNew signing secret. Rotation takes effect immediately.
is_activeToggle the subscription on or off.

Errors

  • 404 Not Found is returned when the webhook does not exist.
  • 400 Bad Request is returned when the URL is malformed or an event type is unknown.

Request

curl -X PATCH "https://api.dialnexa.com/v1/user-webhooks/whk_c9v3nz8rq4pm" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"events": ["call.completed", "call.failed", "campaign.completed"]}'

Response

{
  "id": "whk_c9v3nz8rq4pm",
  "url": "https://yourapp.com/webhooks/dialnexa",
  "events": ["call.completed", "call.failed", "campaign.completed"],
  "is_active": true,
  "created_at": "2024-04-01T08:00:00.000Z"
}

Authorizations

Authorization
string
header
required

Pass your API key as a Bearer token in the Authorization header.

Path Parameters

id
string
required

Body

application/json
url
string<uri>
events
string[]
secret
string
is_active
boolean

Response

Success.

id
string
Example:

"wh_abc123"

url
string
Example:

"https://yourapp.com/webhooks/dialnexa"

events
string[]
Example:
["call.completed", "call.failed"]
is_active
boolean
Example:

true

created_at
string<date-time>
Example:

"2024-03-01T10:00:00.000Z"