Update a webhook
Changes any subset of url, secret, events and active. Fields you omit keep their current value; a field you send, including an empty string, replaces it.
curl --request PUT \
--url https://api.vobiz.ai/api/v1/sms/webhooks/{id} \
--header 'Content-Type: application/json' \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"events": [
"message.delivered",
"message.failed"
]
}
'from vobiz import Vobiz
client = Vobiz(api_key="MA_XXXXXXXX", auth_token="YOUR_AUTH_TOKEN")
client.sms.webhooks.update_webhook(
id="2a4c6e8f-1b3d-4f5a-8c7e-9d0b2f4a6c8e",
events=[
"message.delivered",
"message.failed"
],
)
const options = {
method: 'PUT',
headers: {
'X-Auth-ID': '<api-key>',
'X-Auth-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({events: ['message.delivered', 'message.failed']})
};
fetch('https://api.vobiz.ai/api/v1/sms/webhooks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "ok"
}{
"error": "invalid request body"
}{
"error": "missing or invalid credentials"
}{
"error": "subscription not found"
}{
"error": "internal error"
}Authorizations
Your Vobiz account Auth ID (MA_XXXXXXXX).
Your Vobiz account Auth Token.
Path Parameters
The subscription id (UUID) to change.
Body
The fields to change. Send any subset; fields you omit keep their current value.
New HTTPS URL for deliveries. Replaces the current URL as sent, so always send a full valid URL.
"https://example.com/vobiz/webhooks-v2"
New signing secret for X-Webhook-Signature. Deliveries are signed with the new value from this point, so update your verifier at the same time.
"YOUR_NEW_WEBHOOK_SECRET"
New list of event names to deliver, matched exactly. Replaces the whole list; it is not merged with the current events.
A messaging event name you can subscribe to: message.status (delivery state changed), message.delivered (reached the handset), message.failed (could not be delivered), message.received (inbound message) or broadcast.updated (broadcast status or counters changed).
message.status, message.delivered, message.failed, message.received, broadcast.updated ["message.delivered", "message.failed"]
false pauses deliveries and keeps the subscription; true resumes them.
Response
Updated.
Confirmation returned by actions that have no resource to return, such as marking a conversation read or creating or deleting an opt-out.
Always ok when the action succeeded.
"ok"
Was this page helpful?
curl --request PUT \
--url https://api.vobiz.ai/api/v1/sms/webhooks/{id} \
--header 'Content-Type: application/json' \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"events": [
"message.delivered",
"message.failed"
]
}
'from vobiz import Vobiz
client = Vobiz(api_key="MA_XXXXXXXX", auth_token="YOUR_AUTH_TOKEN")
client.sms.webhooks.update_webhook(
id="2a4c6e8f-1b3d-4f5a-8c7e-9d0b2f4a6c8e",
events=[
"message.delivered",
"message.failed"
],
)
const options = {
method: 'PUT',
headers: {
'X-Auth-ID': '<api-key>',
'X-Auth-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({events: ['message.delivered', 'message.failed']})
};
fetch('https://api.vobiz.ai/api/v1/sms/webhooks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "ok"
}{
"error": "invalid request body"
}{
"error": "missing or invalid credentials"
}{
"error": "subscription not found"
}{
"error": "internal error"
}