Contacts
List contacts
Retrieve a paginated list of WhatsApp contacts for your project.
Supports filtering by WhatsApp ID, customer association, and more.
GET
/
{phone_number_id}
/
contacts
List contacts
curl --request GET \
--url https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/contacts \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/contacts"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/contacts', 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.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/contacts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/contacts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/contacts")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"wa_id": "15551234567",
"profile_name": "John Doe",
"display_name": "John (VIP Customer)",
"metadata": {
"customer_tier": "premium",
"tags": [
"vip",
"high-value"
]
},
"created_at": "2024-01-10T08:00:00.000Z",
"updated_at": "2024-01-15T12:34:56.123Z"
},
{
"id": "223e4567-e89b-12d3-a456-426614174001",
"wa_id": "15559876543",
"profile_name": "Jane Smith",
"display_name": null,
"metadata": null,
"created_at": "2024-01-12T10:00:00.000Z",
"updated_at": "2024-01-12T10:00:00.000Z"
}
],
"paging": {
"cursors": {
"after": "eyJ2YWx1ZXMiOlsiMjAyNC0wMS0xMlQxMDowMDowMC4wMDAwMDBaIiwiMjIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjE0MTc0MDAxIl0sImNvbHVtbnMiOlsiY3JlYXRlZF9hdCIsImlkIl19"
}
}
}{
"error": {
"message": "Invalid phone number format",
"type": "OAuthException",
"code": 400,
"error_subcode": 1001,
"fbtrace_id": "AXk7s_8dR4eVHp9Kq2MmNlO"
}
}Authorizations
ApiKeyAuthBearerAuth
Project API key for authentication. This is the recommended authentication method.
Get your API key from the Kapso dashboard under Integrations > API keys.
Path Parameters
WhatsApp Business Phone Number ID
Query Parameters
Filter by WhatsApp ID (phone number)
Filter by associated customer ID
Filter by customer association (true/false)
Maximum number of results per page (default 20, max 100)
Required range:
1 <= x <= 100Cursor for previous page (Base64 encoded)
Cursor for next page (Base64 encoded)
Filter response fields. Use kapso() to include Kapso-specific extensions.
Was this page helpful?
⌘I
List contacts
curl --request GET \
--url https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/contacts \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/contacts"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/contacts', 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.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/contacts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/contacts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/contacts")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"wa_id": "15551234567",
"profile_name": "John Doe",
"display_name": "John (VIP Customer)",
"metadata": {
"customer_tier": "premium",
"tags": [
"vip",
"high-value"
]
},
"created_at": "2024-01-10T08:00:00.000Z",
"updated_at": "2024-01-15T12:34:56.123Z"
},
{
"id": "223e4567-e89b-12d3-a456-426614174001",
"wa_id": "15559876543",
"profile_name": "Jane Smith",
"display_name": null,
"metadata": null,
"created_at": "2024-01-12T10:00:00.000Z",
"updated_at": "2024-01-12T10:00:00.000Z"
}
],
"paging": {
"cursors": {
"after": "eyJ2YWx1ZXMiOlsiMjAyNC0wMS0xMlQxMDowMDowMC4wMDAwMDBaIiwiMjIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjE0MTc0MDAxIl0sImNvbHVtbnMiOlsiY3JlYXRlZF9hdCIsImlkIl19"
}
}
}{
"error": {
"message": "Invalid phone number format",
"type": "OAuthException",
"code": 400,
"error_subcode": 1001,
"fbtrace_id": "AXk7s_8dR4eVHp9Kq2MmNlO"
}
}
