Update sender
curl --request PATCH \
--url https://api.zavu.dev/v1/senders/{senderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"enableVoice": true,
"enableSmsOneway": true,
"setAsDefault": true,
"webhookUrl": "<string>",
"webhookEvents": [],
"webhookActive": true,
"emailReceivingEnabled": true,
"emailCatchAllEnabled": true,
"emailAddress": "noreply@yourdomain.com",
"emailDomainId": "<string>",
"emailFromName": "<string>",
"webhookSignatureVersion": "v2"
}
'import requests
url = "https://api.zavu.dev/v1/senders/{senderId}"
payload = {
"name": "<string>",
"enableVoice": True,
"enableSmsOneway": True,
"setAsDefault": True,
"webhookUrl": "<string>",
"webhookEvents": [],
"webhookActive": True,
"emailReceivingEnabled": True,
"emailCatchAllEnabled": True,
"emailAddress": "noreply@yourdomain.com",
"emailDomainId": "<string>",
"emailFromName": "<string>",
"webhookSignatureVersion": "v2"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
enableVoice: true,
enableSmsOneway: true,
setAsDefault: true,
webhookUrl: '<string>',
webhookEvents: [],
webhookActive: true,
emailReceivingEnabled: true,
emailCatchAllEnabled: true,
emailAddress: 'noreply@yourdomain.com',
emailDomainId: '<string>',
emailFromName: '<string>',
webhookSignatureVersion: 'v2'
})
};
fetch('https://api.zavu.dev/v1/senders/{senderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zavu.dev/v1/senders/{senderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'enableVoice' => true,
'enableSmsOneway' => true,
'setAsDefault' => true,
'webhookUrl' => '<string>',
'webhookEvents' => [
],
'webhookActive' => true,
'emailReceivingEnabled' => true,
'emailCatchAllEnabled' => true,
'emailAddress' => 'noreply@yourdomain.com',
'emailDomainId' => '<string>',
'emailFromName' => '<string>',
'webhookSignatureVersion' => 'v2'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zavu.dev/v1/senders/{senderId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"enableVoice\": true,\n \"enableSmsOneway\": true,\n \"setAsDefault\": true,\n \"webhookUrl\": \"<string>\",\n \"webhookEvents\": [],\n \"webhookActive\": true,\n \"emailReceivingEnabled\": true,\n \"emailCatchAllEnabled\": true,\n \"emailAddress\": \"noreply@yourdomain.com\",\n \"emailDomainId\": \"<string>\",\n \"emailFromName\": \"<string>\",\n \"webhookSignatureVersion\": \"v2\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.zavu.dev/v1/senders/{senderId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"enableVoice\": true,\n \"enableSmsOneway\": true,\n \"setAsDefault\": true,\n \"webhookUrl\": \"<string>\",\n \"webhookEvents\": [],\n \"webhookActive\": true,\n \"emailReceivingEnabled\": true,\n \"emailCatchAllEnabled\": true,\n \"emailAddress\": \"noreply@yourdomain.com\",\n \"emailDomainId\": \"<string>\",\n \"emailFromName\": \"<string>\",\n \"webhookSignatureVersion\": \"v2\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/senders/{senderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"enableVoice\": true,\n \"enableSmsOneway\": true,\n \"setAsDefault\": true,\n \"webhookUrl\": \"<string>\",\n \"webhookEvents\": [],\n \"webhookActive\": true,\n \"emailReceivingEnabled\": true,\n \"emailCatchAllEnabled\": true,\n \"emailAddress\": \"noreply@yourdomain.com\",\n \"emailDomainId\": \"<string>\",\n \"emailFromName\": \"<string>\",\n \"webhookSignatureVersion\": \"v2\"\n}"
response = http.request(request)
puts response.read_body{
"id": "sender_12345",
"name": "Primary sender",
"phoneNumber": "+13125551212",
"channels": [
"sms",
"voice"
],
"isDefault": false,
"webhook": {
"url": "https://api.example.com/webhooks/zavu",
"events": [
"message.queued"
],
"active": true,
"signatureVersion": "v2",
"secret": "whsec_abc123..."
},
"whatsapp": {
"phoneNumberId": "<string>",
"displayPhoneNumber": "+14155551234",
"paymentStatus": {
"setupStatus": "COMPLETE",
"methodStatus": "VALID",
"canSendTemplates": true
}
},
"emailAddress": "noreply@yourdomain.com",
"emailReceivingEnabled": false,
"emailCatchAllEnabled": false,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Turn the voice channel on or off. The sender must already have a phone number provisioned for calls; enabling it otherwise returns 400 instead of storing a flag that changes nothing. Confirm with the channels array on the response.
Turn the one-way SMS channel on or off. Enabling needs no number or credential and takes effect immediately (US and Canadian destinations still need an approved 10DLC campaign); disabling removes the channel from the sender. Confirm with the channels array on the response.
HTTPS URL for webhook events. Set to null to remove webhook.
Events to subscribe to.
Type of event that triggers the webhook.
Message lifecycle events:
message.queued: Message created and queued for sending.data.status=queuedmessage.sent: Message accepted by the provider.data.status=sentmessage.delivered: Message delivered to recipient.data.status=deliveredmessage.read: Message was read by the recipient (WhatsApp only).data.status=readmessage.failed: Message failed to send.data.status=failed
Inbound events:
message.inbound: New message received from a contact.data.conversationId, the inbox thread id (deep-link withhttps://dashboard.zavu.dev/{locale}/inbox?conv={conversationId}), is always set: the webhook is sent once the message has been filed in its thread, so the first message of a new thread carries the same id asconversation.new.data.contactIdis the Zavu contact, and unlikedata.fromit does not change when a WhatsApp contact's identifier switches from a business-scoped user ID (BSUID) to a phone number, unless the switch reveals two contacts for one person; they are then merged andcontact.identity_linkednames the one that went away inmergedContactId. On WhatsApp,data.whatsappcarries the contact'sbsuidandusernamewhen known. Reactions carry none of these three. Reactions are delivered asmessage.inboundwithmessageType='reaction'. When the contact replied to (quoted) an earlier message,data.contentcarries the reply context:replyToMessageId,replyToProviderMessageId,replyToFrom,replyToText, andreplyToMessageType.data.providerTimestampis the provider's original receive time in Unix milliseconds (the moment the channel received the message from the contact — WhatsApp, Telegram, Instagram, Messenger;nullfor SMS and email). Compare it against the top-leveltimestamp(when Zavu dispatched the webhook) to detect and ignore delayed deliveries. When the conversation was opened from a Click-to-WhatsApp ad or post,data.referralcarries the ad attribution — includingctwaClid, the identifier Meta's Conversions API needs to credit a conversion back to that ad. WhatsApp only, and only on the first message of the thread: it is absent from every later message, so persist it when it arrives. A message that was held because the allowance was spent (seePOST /v1/messages) is delivered once the team pays, carryingdata.heldAt: when it was held, in Unix milliseconds. It is absent on every other message.message.unsupported: Received a message type that is not supported
Broadcast events:
broadcast.status_changed: Broadcast status changed (pending_review, approved, rejected, sending, completed, cancelled)
Other events:
conversation.new: New conversation started with a contact.datacarriesconversationId(the inbox thread id — deep-link withhttps://dashboard.zavu.dev/{locale}/inbox?conv={conversationId}), thephoneNumberoremailkey,channel,firstMessageId,firstMessageText, andprofileName.contact.identity_linked: A WhatsApp contact known by BSUID was tied to a phone number, a contact known by phone received a BSUID, or a contact changed their number.datacarriescontactId,bsuid,phoneNumberandreason:provider_reported(WhatsApp sent the phone and the BSUID together on an inbound message),contact_shared(the contact shared their phone number in reply to arequest_contact_infomessage),phone_changed(the contact changed their number;previousPhoneNumbercarries the old one, andbsuidisnullwhen WhatsApp never reported one for the contact), orbsuid_changed(WhatsApp reported a new BSUID for the same number).contactIdis the contact that remains if two were merged, andmergedContactIdthe one folded into it.previousBsuidis a BSUID you may have stored that no longer identifies the contact. Sent once per link, not on every message.data.fromonmessage.inboundis the phone only when WhatsApp includes it, so it can still be the BSUID afterwards; key oncontactId.template.status_changed: WhatsApp template approval status changed.datacarriestemplateId,name,previousStatus,currentStatus,rejectionReason, andcategory— the category Meta currently bills the template under. Meta can recategorize a template (typicallyUTILITYtoMARKETING) at approval or long afterwards, which changes what each message costs;categoryis how that reaches you. A recategorization with no status change is delivered as this same event, so comparecategoryagainst what you hold rather than only reacting tocurrentStatus.
Partner events:
invitation.status_changed: A partner invitation's stored status changed: toin_progress,completed,failed,cancelled, or back topendingwhen it is resent from the dashboard. A change to the same status sends nothing, and expiry is not a stored change, so no event is sent when an invitation expires. Delivered to the project webhook (POST /v1/invitations/webhook) of the project that created the invitation; a parent project does not receive its sub-accounts' events.datacarriesinvitationId,clientName,clientEmail,connectionType(whatsapp_wabaormessenger),previousStatus, andcurrentStatus. Oncompletedit also carriessenderId,connectedAccount(channel,id,name) — the WhatsApp number or Facebook Page that was linked — and, for WhatsApp,wabaAccountId. Onfailedit carriesfailureReason; the invitation link stays usable, so a client can retry it.
Voice Agent events:
For every voice event, data carries callId, direction, from, to, status, durationSeconds, endReason, and transcriptAvailable. The terminal events (call.completed, call.failed) additionally carry cost — what the call was billed, in USD, combining telephony and the managed voice pipeline — and currency. They are dispatched after the call is charged, so cost is populated rather than zero. It can still grow afterwards: telephony can be settling on an outbound call, and on an agent that runs a premium model the model's tokens are charged between 30 minutes and 24 hours after the call ends. GET /v1/calls/{callId} holds the reconciled figure.
call.initiated: An outbound call was created and is dialing, or an inbound call was received.data.status=ringingcall.answered: The call was answered and the voice agent is connected.data.status=in_progresscall.completed: The call ended after a conversation.data.status=completed;durationSecondsandendReasondescribe how it ended, andtranscriptAvailableindicates whether a transcript can be fetched.call.failed: The call could not be completed (busy, no answer, canceled, or an error).data.statusis the terminal status andendReasonexplains the cause.
Custom domain events:
domain.verified: A custom email domain passed verification (DKIM, and SPF/DMARC/MAIL FROM if enhanced records are enabled)domain.failed: A custom email domain failed verification or is partially verified
message.queued, message.sent, message.delivered, message.read, message.status, message.failed, message.inbound, message.unsupported, broadcast.status_changed, conversation.new, contact.identity_linked, template.status_changed, invitation.status_changed, call.initiated, call.answered, call.completed, call.failed, domain.verified, domain.failed Whether the webhook is active.
Enable or disable inbound email receiving for this sender. Enabling requires a verified inbound MX record on the domain; the request is ignored otherwise, and emailReceivingEnabled comes back false on the response. Disabling always applies.
Enable or disable domain catch-all. When enabled (with emailReceivingEnabled true), this sender receives email for any address at its domain. Ignored (treated as false) if receiving is not enabled.
Attach or change the sender's email from-address (e.g. noreply@yourdomain.com). The domain must be a verified email domain in your project.
"noreply@yourdomain.com"
ID of the verified email domain to attach. Optional — resolved from emailAddress's domain when omitted.
Display name shown in the recipient's inbox for the email channel.
100Move this webhook between signature schemes. v1 -> v2 directly returns 400; go through v1+v2 first. See https://docs.zavu.dev/guides/receiving-messages/signature-migration
v1, v1+v2, v2 "v2"
Response
Sender updated.
"sender_12345"
"Primary sender"
Phone number in E.164 format. Absent on a sender that has none: an email-only sender, or one created with only enableSmsOneway.
"+13125551212"
Channels this sender can actually send on right now: configured AND activated. Empty means the sender cannot send or receive anything yet: a phoneNumber alone does not enable SMS or voice, and a connected account that is not activated is left out, because every send on it is refused. Check this rather than inferring capability from phoneNumber or emailAddress, and turn a connected channel on with POST /v1/senders/{senderId}/channels/{channel}/activate.
["sms", "voice"]
Whether this sender is the project's default.
Webhook configuration for the sender.
Show child attributes
Show child attributes
WhatsApp Business Account information. Only present if a WABA is connected.
Show child attributes
Show child attributes
From-address for the email channel, if configured.
"noreply@yourdomain.com"
Whether inbound email receiving is enabled for this sender.
Whether catch-all receiving is enabled. When true (and emailReceivingEnabled is true), this sender receives email addressed to any local part at its domain, not just its own address. The original recipient is delivered in the message.inbound webhook's data.to.
curl --request PATCH \
--url https://api.zavu.dev/v1/senders/{senderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"enableVoice": true,
"enableSmsOneway": true,
"setAsDefault": true,
"webhookUrl": "<string>",
"webhookEvents": [],
"webhookActive": true,
"emailReceivingEnabled": true,
"emailCatchAllEnabled": true,
"emailAddress": "noreply@yourdomain.com",
"emailDomainId": "<string>",
"emailFromName": "<string>",
"webhookSignatureVersion": "v2"
}
'import requests
url = "https://api.zavu.dev/v1/senders/{senderId}"
payload = {
"name": "<string>",
"enableVoice": True,
"enableSmsOneway": True,
"setAsDefault": True,
"webhookUrl": "<string>",
"webhookEvents": [],
"webhookActive": True,
"emailReceivingEnabled": True,
"emailCatchAllEnabled": True,
"emailAddress": "noreply@yourdomain.com",
"emailDomainId": "<string>",
"emailFromName": "<string>",
"webhookSignatureVersion": "v2"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
enableVoice: true,
enableSmsOneway: true,
setAsDefault: true,
webhookUrl: '<string>',
webhookEvents: [],
webhookActive: true,
emailReceivingEnabled: true,
emailCatchAllEnabled: true,
emailAddress: 'noreply@yourdomain.com',
emailDomainId: '<string>',
emailFromName: '<string>',
webhookSignatureVersion: 'v2'
})
};
fetch('https://api.zavu.dev/v1/senders/{senderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zavu.dev/v1/senders/{senderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'enableVoice' => true,
'enableSmsOneway' => true,
'setAsDefault' => true,
'webhookUrl' => '<string>',
'webhookEvents' => [
],
'webhookActive' => true,
'emailReceivingEnabled' => true,
'emailCatchAllEnabled' => true,
'emailAddress' => 'noreply@yourdomain.com',
'emailDomainId' => '<string>',
'emailFromName' => '<string>',
'webhookSignatureVersion' => 'v2'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zavu.dev/v1/senders/{senderId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"enableVoice\": true,\n \"enableSmsOneway\": true,\n \"setAsDefault\": true,\n \"webhookUrl\": \"<string>\",\n \"webhookEvents\": [],\n \"webhookActive\": true,\n \"emailReceivingEnabled\": true,\n \"emailCatchAllEnabled\": true,\n \"emailAddress\": \"noreply@yourdomain.com\",\n \"emailDomainId\": \"<string>\",\n \"emailFromName\": \"<string>\",\n \"webhookSignatureVersion\": \"v2\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.zavu.dev/v1/senders/{senderId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"enableVoice\": true,\n \"enableSmsOneway\": true,\n \"setAsDefault\": true,\n \"webhookUrl\": \"<string>\",\n \"webhookEvents\": [],\n \"webhookActive\": true,\n \"emailReceivingEnabled\": true,\n \"emailCatchAllEnabled\": true,\n \"emailAddress\": \"noreply@yourdomain.com\",\n \"emailDomainId\": \"<string>\",\n \"emailFromName\": \"<string>\",\n \"webhookSignatureVersion\": \"v2\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/senders/{senderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"enableVoice\": true,\n \"enableSmsOneway\": true,\n \"setAsDefault\": true,\n \"webhookUrl\": \"<string>\",\n \"webhookEvents\": [],\n \"webhookActive\": true,\n \"emailReceivingEnabled\": true,\n \"emailCatchAllEnabled\": true,\n \"emailAddress\": \"noreply@yourdomain.com\",\n \"emailDomainId\": \"<string>\",\n \"emailFromName\": \"<string>\",\n \"webhookSignatureVersion\": \"v2\"\n}"
response = http.request(request)
puts response.read_body{
"id": "sender_12345",
"name": "Primary sender",
"phoneNumber": "+13125551212",
"channels": [
"sms",
"voice"
],
"isDefault": false,
"webhook": {
"url": "https://api.example.com/webhooks/zavu",
"events": [
"message.queued"
],
"active": true,
"signatureVersion": "v2",
"secret": "whsec_abc123..."
},
"whatsapp": {
"phoneNumberId": "<string>",
"displayPhoneNumber": "+14155551234",
"paymentStatus": {
"setupStatus": "COMPLETE",
"methodStatus": "VALID",
"canSendTemplates": true
}
},
"emailAddress": "noreply@yourdomain.com",
"emailReceivingEnabled": false,
"emailCatchAllEnabled": false,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}