Activate a sender channel
Switch on the account connected to this sender for one channel, so it sends and receives. This is the same switch as Activate on the dashboard’s Accounts screen, with the same price and the same limits.
A newly connected account that your plan already includes (nothing charged now, nothing added to the monthly bill) is switched on by itself as soon as it can carry messages. One that would cost money starts inactive: every send on it is refused and it is not listed in the sender’s channels until you activate it here or from Accounts, after seeing the price. A connection you switched off stays off.
Billing. Activating is billed as a channel connection. On a paid plan that is one full month charged from the balance at once, and the same amount every month while the connection stays active; the response states both as chargedCents and monthlyCents. The first connections a plan includes cost nothing, and so does re-activating a connection whose current month is already paid. A WhatsApp Business Account is never charged from the balance for its month: one beyond the ones the plan includes is billed on the subscription instead. The exception is a WhatsApp account switched off for non-payment, which settles its past-due fee from the balance when re-activated.
Calling this on a channel that is already active changes nothing and charges nothing. Not available with test-mode keys.
curl --request POST \
--url https://api.zavu.dev/v1/senders/{senderId}/channels/{channel}/activate \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zavu.dev/v1/senders/{senderId}/channels/{channel}/activate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zavu.dev/v1/senders/{senderId}/channels/{channel}/activate', 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}/channels/{channel}/activate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zavu.dev/v1/senders/{senderId}/channels/{channel}/activate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.zavu.dev/v1/senders/{senderId}/channels/{channel}/activate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/senders/{senderId}/channels/{channel}/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"sender": {
"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"
},
"channel": "whatsapp",
"activated": true,
"chargedCents": 123,
"monthlyCents": 123
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "insufficient_balance",
"message": "Not enough balance to activate this connection. Add funds and try again."
}{
"code": "plan_limit_reached",
"message": "Your plan has no room for another active connection. Deactivate one or upgrade."
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "connection_not_ready",
"message": "The telegram connection is not ready to carry messages yet. Finish connecting it before activating."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The channel to switch.
A channel whose connection has an on/off switch. sms, sms_oneway and voice are billed per message and per phone number, are always on, and have nothing to activate.
whatsapp, telegram, instagram, messenger, email Response
The channel is active.
The sender after the change. channels includes the channel once it is active.
Show child attributes
Show child attributes
A channel whose connection has an on/off switch. sms, sms_oneway and voice are billed per message and per phone number, are always on, and have nothing to activate.
whatsapp, telegram, instagram, messenger, email True when this call switched the channel on. False when it was already active; nothing was charged.
Cents taken from the balance by this call. Zero when the channel was already active, its month is already paid, or the plan includes it.
Cents this connection adds to each month while it stays active. Zero when the plan includes it.
curl --request POST \
--url https://api.zavu.dev/v1/senders/{senderId}/channels/{channel}/activate \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zavu.dev/v1/senders/{senderId}/channels/{channel}/activate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zavu.dev/v1/senders/{senderId}/channels/{channel}/activate', 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}/channels/{channel}/activate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zavu.dev/v1/senders/{senderId}/channels/{channel}/activate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.zavu.dev/v1/senders/{senderId}/channels/{channel}/activate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/senders/{senderId}/channels/{channel}/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"sender": {
"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"
},
"channel": "whatsapp",
"activated": true,
"chargedCents": 123,
"monthlyCents": 123
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "insufficient_balance",
"message": "Not enough balance to activate this connection. Add funds and try again."
}{
"code": "plan_limit_reached",
"message": "Your plan has no room for another active connection. Deactivate one or upgrade."
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "connection_not_ready",
"message": "The telegram connection is not ready to carry messages yet. Finish connecting it before activating."
}