List contacts
List contacts with their communication channels.
curl --request GET \
--url https://api.zavu.dev/v1/contacts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zavu.dev/v1/contacts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zavu.dev/v1/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.zavu.dev/v1/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 => [
"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/contacts"
req, _ := http.NewRequest("GET", 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.get("https://api.zavu.dev/v1/contacts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "<string>",
"availableChannels": [
"<string>"
],
"verified": true,
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"displayName": "John Doe",
"phoneNumber": "+56912345678",
"primaryPhone": "+56912345678",
"primaryEmail": "john@example.com",
"countryCode": "CL",
"profileName": "John Doe",
"whatsapp": {
"bsuid": "CO.13491208655302741918",
"username": "<string>"
},
"defaultChannel": "sms",
"channels": [
{
"id": "<string>",
"channel": "sms",
"identifier": "+14155551234",
"isPrimary": true,
"verified": true,
"createdAt": "2023-11-07T05:31:56Z",
"countryCode": "US",
"label": "work",
"metrics": {
"successCount": 123,
"failureCount": 123,
"totalAttempts": 123,
"avgDeliveryTimeMs": 123,
"lastSuccessAt": "2023-11-07T05:31:56Z"
},
"lastInboundAt": "2023-11-07T05:31:56Z",
"metadata": {},
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"nextCursor": "<string>"
}{
"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.
Query Parameters
Exact match on the contact's primary phone number, in E.164.
Free-text match over the contact's name (displayName and the WhatsApp profile name), phone numbers and email addresses. Case- and accent-insensitive. A phone number matches on a trailing fragment too, so 5551234 finds +14155551234.
Contacts created automatically from an inbound message have no displayName — they are matched by their identifier until you set one with PATCH /v1/contacts/{contactId}.
Results come back in relevance order rather than newest-first. cursor is opaque in both modes; pass back exactly what the previous response returned, and start a new pagination run when the search term changes.
200Exact WhatsApp business-scoped user ID (e.g. CO.13491208655302741918). Returns the contact that holds it, or an empty list. Combines with phoneNumber and tag as a filter, and cannot be combined with search (400). A value that is not shaped like a BSUID returns 400.
Tag name. Repeatable: ?tag=vip&tag=chile returns contacts carrying every tag given, not any of them — the same rule the dashboard filter applies.
Tags are matched by name, case-insensitively. An unknown tag returns 400 rather than being ignored, because a typo that silently matched every contact would be a worse answer than an error.
x <= 100Opaque cursor from a previous response's nextCursor. Do not construct it.
curl --request GET \
--url https://api.zavu.dev/v1/contacts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zavu.dev/v1/contacts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zavu.dev/v1/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.zavu.dev/v1/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 => [
"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/contacts"
req, _ := http.NewRequest("GET", 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.get("https://api.zavu.dev/v1/contacts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "<string>",
"availableChannels": [
"<string>"
],
"verified": true,
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"displayName": "John Doe",
"phoneNumber": "+56912345678",
"primaryPhone": "+56912345678",
"primaryEmail": "john@example.com",
"countryCode": "CL",
"profileName": "John Doe",
"whatsapp": {
"bsuid": "CO.13491208655302741918",
"username": "<string>"
},
"defaultChannel": "sms",
"channels": [
{
"id": "<string>",
"channel": "sms",
"identifier": "+14155551234",
"isPrimary": true,
"verified": true,
"createdAt": "2023-11-07T05:31:56Z",
"countryCode": "US",
"label": "work",
"metrics": {
"successCount": 123,
"failureCount": 123,
"totalAttempts": 123,
"avgDeliveryTimeMs": 123,
"lastSuccessAt": "2023-11-07T05:31:56Z"
},
"lastInboundAt": "2023-11-07T05:31:56Z",
"metadata": {},
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"nextCursor": "<string>"
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}