{
"PhoneNumber": "+11234567890",
"AccountId": "AID-ab12345-2725-45a1-bd5e-526ed19799xx",
"PIN": "1234",
"FirstName": "John",
"LastName": "Doe",
"Email": "john@example.com"
}curl -X POST https://api.telegent.com/v1.0/numbers/voicemail/activate \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"PhoneNumber": "+11234567890",
"AccountId": "AID-ab12345-2725-45a1-bd5e-526ed19799xx",
"PIN": "1234",
"FirstName": "John",
"LastName": "Doe",
"Email": "john@example.com"
}'import requests
url = "https://api.telegent.com/v1.0/numbers/voicemail/activate"
payload = {
"PhoneNumber": "+11234567890",
"AccountId": "AID-ab12345-2725-45a1-bd5e-526ed19799xx",
"PIN": "1234",
"FirstName": "John",
"LastName": "Doe",
"Email": "john@example.com"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
PhoneNumber: '+11234567890',
AccountId: 'AID-ab12345-2725-45a1-bd5e-526ed19799xx',
PIN: '1234',
FirstName: 'John',
LastName: 'Doe',
Email: 'john@example.com'
})
};
fetch('https://api.telegent.com/v1.0/numbers/voicemail/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.telegent.com/v1.0/numbers/voicemail/activate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'PhoneNumber' => '+11234567890',
'AccountId' => 'AID-ab12345-2725-45a1-bd5e-526ed19799xx',
'PIN' => '1234',
'FirstName' => 'John',
'LastName' => 'Doe',
'Email' => 'john@example.com'
]),
CURLOPT_HTTPHEADER => [
"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.telegent.com/v1.0/numbers/voicemail/activate"
payload := strings.NewReader("{\n \"PhoneNumber\": \"+11234567890\",\n \"AccountId\": \"AID-ab12345-2725-45a1-bd5e-526ed19799xx\",\n \"PIN\": \"1234\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Email\": \"john@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.telegent.com/v1.0/numbers/voicemail/activate")
.header("Content-Type", "application/json")
.body("{\n \"PhoneNumber\": \"+11234567890\",\n \"AccountId\": \"AID-ab12345-2725-45a1-bd5e-526ed19799xx\",\n \"PIN\": \"1234\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Email\": \"john@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telegent.com/v1.0/numbers/voicemail/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"PhoneNumber\": \"+11234567890\",\n \"AccountId\": \"AID-ab12345-2725-45a1-bd5e-526ed19799xx\",\n \"PIN\": \"1234\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Email\": \"john@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"PhoneNumber": "+11234567890",
"VoicemailActivated": true,
"Successful": true
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}Activate Voicemail
Prerequisites:
- Required: Bearer token —
POST /v1.0/oauth2/tokens - Required: Provisioned phone number —
POST /v1.0/numbers/provision
Activate voicemail for a phone number. Set a PIN, notification email, and subscriber name. Once activated, unanswered calls to this number will be directed to voicemail.
What this does: Enables voicemail on the number and returns a confirmation. Once activated, unanswered calls are captured as voicemail and a notification is sent to the configured email. The PIN is required to retrieve messages.
Next steps:
- Confirm voicemail is active —
POST /v1.0/numbers/voicemail/info - Update settings —
POST /v1.0/numbers/voicemail/update
{
"PhoneNumber": "+11234567890",
"AccountId": "AID-ab12345-2725-45a1-bd5e-526ed19799xx",
"PIN": "1234",
"FirstName": "John",
"LastName": "Doe",
"Email": "john@example.com"
}curl -X POST https://api.telegent.com/v1.0/numbers/voicemail/activate \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"PhoneNumber": "+11234567890",
"AccountId": "AID-ab12345-2725-45a1-bd5e-526ed19799xx",
"PIN": "1234",
"FirstName": "John",
"LastName": "Doe",
"Email": "john@example.com"
}'import requests
url = "https://api.telegent.com/v1.0/numbers/voicemail/activate"
payload = {
"PhoneNumber": "+11234567890",
"AccountId": "AID-ab12345-2725-45a1-bd5e-526ed19799xx",
"PIN": "1234",
"FirstName": "John",
"LastName": "Doe",
"Email": "john@example.com"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
PhoneNumber: '+11234567890',
AccountId: 'AID-ab12345-2725-45a1-bd5e-526ed19799xx',
PIN: '1234',
FirstName: 'John',
LastName: 'Doe',
Email: 'john@example.com'
})
};
fetch('https://api.telegent.com/v1.0/numbers/voicemail/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.telegent.com/v1.0/numbers/voicemail/activate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'PhoneNumber' => '+11234567890',
'AccountId' => 'AID-ab12345-2725-45a1-bd5e-526ed19799xx',
'PIN' => '1234',
'FirstName' => 'John',
'LastName' => 'Doe',
'Email' => 'john@example.com'
]),
CURLOPT_HTTPHEADER => [
"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.telegent.com/v1.0/numbers/voicemail/activate"
payload := strings.NewReader("{\n \"PhoneNumber\": \"+11234567890\",\n \"AccountId\": \"AID-ab12345-2725-45a1-bd5e-526ed19799xx\",\n \"PIN\": \"1234\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Email\": \"john@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.telegent.com/v1.0/numbers/voicemail/activate")
.header("Content-Type", "application/json")
.body("{\n \"PhoneNumber\": \"+11234567890\",\n \"AccountId\": \"AID-ab12345-2725-45a1-bd5e-526ed19799xx\",\n \"PIN\": \"1234\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Email\": \"john@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telegent.com/v1.0/numbers/voicemail/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"PhoneNumber\": \"+11234567890\",\n \"AccountId\": \"AID-ab12345-2725-45a1-bd5e-526ed19799xx\",\n \"PIN\": \"1234\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Email\": \"john@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"PhoneNumber": "+11234567890",
"VoicemailActivated": true,
"Successful": true
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}Body
The phone number to activate voicemail for (E.164 format)
"+11234567890"
Optional account ID associated with the phone number
"AID-ab12345-2725-45a1-bd5e-526ed19799xx"
Voicemail PIN for the subscriber
"1234"
Subscriber first name
"John"
Subscriber last name
"Doe"
Email address for voicemail notifications
"john@example.com"
Response
Success — returns voicemail activation status
The response is of type object.