Phonebooks
The Phonebooks API allows you to create, retrieve, update, and manage phonebooks. Each phonebook is assigned a unique ID, making it easy to edit, update, or delete specific phonebooks as needed.
Fetch Phonebooks
This endpoint returns a list of all the phonebooks available on your account
Endpoint :
https://BASE_URL/api/phonebooks?api_key=YourAPIKey
Request Type : GET
Sample Response - 200 OK
{
"content": [
{
"id": "685d93b4de16be3f54be8ccb",
"name": "Hosh",
"total_number_of_contacts": 3,
"date_created": "2025-06-26 18:38:44"
},
{
"id": "68270c5898b6a5420fb7a0a0",
"name": "Whichhhh",
"total_number_of_contacts": 6,
"date_created": "2025-05-16 09:58:48"
},
{
"id": "6825ca68b648694684de92be",
"name": "Chuma",
"total_number_of_contacts": 1,
"date_created": "2025-05-15 11:05:12"
},
{
"id": "6821eb366a25331e3c159362",
"name": "12 contacts",
"total_number_of_contacts": 12,
"date_created": "2025-05-12 12:36:06"
},
{
"id": "6821e79df3a8b13ef0f66a50",
"name": "Baggers",
"total_number_of_contacts": 0,
"date_created": "2025-05-12 12:20:45"
},
{
"id": "6821dabef3a8b13ef0f61e41",
"name": "Ten Contacts",
"total_number_of_contacts": 10,
"date_created": "2025-05-12 11:25:50"
},
{
"id": "67b5ebe3a99a9240a6218bc2",
"name": "Linker",
"total_number_of_contacts": 5,
"date_created": "2025-04-02 08:29:30"
},
{
"id": "67b5e2428870dd46b8310f7a",
"name": "Idempotency Test",
"total_number_of_contacts": 6,
"date_created": "2025-02-19 13:53:06"
},
{
"id": "67ab527f91deac68404f8dd8",
"name": "Taggo",
"total_number_of_contacts": 1,
"date_created": "2025-02-11 13:37:03"
},
{
"id": "67ab524091deac68404f8b18",
"name": "Testing Tag",
"total_number_of_contacts": 2,
"date_created": "2025-02-11 13:36:00"
},
{
"id": "67a358d8d1d14d51eaad5b52",
"name": "Queeness",
"total_number_of_contacts": 2,
"date_created": "2025-02-05 12:26:00"
},
{
"id": "67921db0a6c2f16317365fe0",
"name": "Greatness",
"total_number_of_contacts": 2,
"date_created": "2025-01-23 10:45:04"
}
],
"pageable": {
"sort": {
"empty": false,
"sorted": true,
"unsorted": false
},
"offset": 0,
"pageNumber": 0,
"pageSize": 15,
"paged": true,
"unpaged": false
},
"totalPages": 1,
"last": true,
"totalElements": 12,
"sort": {
"empty": false,
"sorted": true,
"unsorted": false
},
"size": 15,
"number": 0,
"first": true,
"numberOfElements": 12,
"empty": false
}
Create a Phonebook
This endpoint creates a phonebook tied to your account
Endpoint :
https://BASE_URL/api/phonebooks
Request Type : POST
`
Request Body Params :
Options | Required | Description |
---|---|---|
api_key | yes | string Your API key (It can be found on your Termii dashboard). |
phonebook_name | yes | string The name of the phonebook |
description | no | string A description of the contacts stored in the phonebook |
{
"api_key": "Your API Key",
"phonebook_name":"Phone test",
"description":"Phonebook for test"
}
var data = {
"api_key": "Your API Key",
"phonebook_name":"Phone test",
"description":"Phonebook for test"
};
var data = JSON.stringify(data);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "http://termii.com/api/phonebooks");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
var request = require('request');
var data = {
"api_key": "Your API Key",
"phonebook_name":"Students",
"description":"Phonebook for students"
};
var options = {
'method': 'POST',
'url': 'http://termii.com/api/phonebooks',
'headers': {
'Content-Type': ['application/json', 'application/json']
},
body: JSON.stringify(data)
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
url = "https://BASE_URL/api/phonebooks"
payload = {
"api_key": "Your API Key",
"phonebook_name":"Phone test",
"description":"Phonebook for test"
}
headers = {
'Content-Type': 'application/json',
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)
RestClient restClient = new RestClient("http://termii.com/api/phonebooks");
//Creating Json object
JObject objectBody = new JObject();
objectBody.Add("api_key","Your API Key");
objectBody.Add("phone_book", "Phone test");
objectBody.Add( "description", "Phonebook for test");
RestRequest restRequest = new RestRequest(Method.POST);
restRequest.AddHeader("Content-Type", "application/json");
restRequest.AddParameter("application/json", objectBody, ParameterType.RequestBody);
IRestResponse restResponse = restClient.Execute(restRequest);
Console.WriteLine(restResponse.Content);
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("http://termii.com/api/phonebooks")
.header("Content-Type", "application/json")
.body("{\r\n \"api_key\": \"Your API Key\",\r\n \"phone_book\": \"Phone Test \",\r\n \"description\": \"Phonebook for test\"\r\n }")
.asString();
$curl = curl_init();
$data = array("api_key" => "Your API key","phone_book" => "Phone Test","description"=>"Phonebook for test" );
$post_data = json_encode($data);
curl_setopt_array($curl, array(
CURLOPT_URL => "http://termii.com/api/phonebooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $post_data,
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Sample Response - 201 OK
{
"message": "Phonebook created successfully",
"status": "success"
}
Update Phonebook
This endpoint updates details of an existing phonebook.
Endpoint :
https://BASE_URL/api/phonebooks/{phonebook_id}
Request Type : PATCH
`
Request Body Params :
Options | Required | Description |
---|---|---|
api_key | yes | string Your API key (It can be found on your Termii dashboard). |
phonebook_name | yes | string The name of the phonebook |
description | yes | string The description of the phonebook |
{
"api_key": "Your API Key",
"phonebook_name":"Phone test",
"description":"Phonebook for test"
}
var data = {
"api_key": "Your API Key",
"phonebook_name":"Phone test",
"description":"Phonebook for test"
};
var data = JSON.stringify(data);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("PATCH", "http://termii.com/api/phonebooks/{phonebook_id}");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
var request = require('request');
var data = {
"api_key": "Your API Key",
"phonebook_name":"Phone test",
"description":"Phonebook for test"
};
var options = {
'method': 'PATCH',
'url': 'http://termii.com/api/phonebooks/{phonebook_id}',
'headers': {
'Content-Type': ['application/json', 'application/json']
},
body: JSON.stringify(data)
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
url = "https://BASE_URL/api/phonebooks/{phonebook_id}"
payload = {
"api_key": "Your API Key",
"phonebook_name":"Phone test",
"description":"Phonebook for test"
}
headers = {
'Content-Type': 'application/json',
}
response = requests.request("PATCH", url, headers=headers, json=payload)
print(response.text)
RestClient restClient = new RestClient("http://termii.com/api/phonebooks/{phonebook_id}");
//Creating Json object
JObject objectBody = new JObject();
objectBody.Add("api_key","Your API Key");
objectBody.Add("phone_book", "Phone test");
objectBody.Add( "description", "Phonebook for test");
RestRequest restRequest = new RestRequest(Method.PATCH);
restRequest.AddHeader("Content-Type", "application/json");
restRequest.AddParameter("application/json", objectBody, ParameterType.RequestBody);
IRestResponse restResponse = restClient.Execute(restRequest);
Console.WriteLine(restResponse.Content);
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.patch("http://termii.com/api/phonebooks/{phonebook_id}")
.header("Content-Type", "application/json")
.body("{\r\n \"api_key\": \"Your API Key\",\r\n \"phone_book\": \"Phone Test \",\r\n \"description\": \"Phonebook for test\"\r\n }")
.asString();
$curl = curl_init();
$data = array("api_key" => "Your API key", "phone_book" => "Phone Test", "description"=>"Phonebook for test" );
$post_data = json_encode($data);
curl_setopt_array($curl, array(
CURLOPT_URL => "http://termii.com/api/phonebooks/{phonebook_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => $post_data,
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Sample Response - 200 OK
{
"id": "689378fee815861851074048",
"applicationId": 33217,
"uuid": "26fbaf46-5191-4e69-8665-c5e36bb802a0",
"createdAt": "06-08-2025 16:03",
"updatedAt": "06-08-2025 16:03",
"name": "Queen",
"description": "Phonebook",
"temp": false,
"numberOfContacts": 0,
"numberOfCampaigns": 0
}
Delete phonebook
This endpoint deletes an existing phonebook created on your account
Endpoint :
https://BASE_URL/api/phonebooks/{phonebook_id}?api_key=YourAPIKey
Request Type : DELETE
Sample Response - 200 OK
{
"message": "Deleted Successfully"
}