List all contacts with pagination
curl --request POST \
--url https://api.wppfy.com/contacts/list \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"limit": 100,
"offset": 0,
"contactScope": "address_book"
}
'import requests
url = "https://api.wppfy.com/contacts/list"
payload = {
"limit": 100,
"offset": 0,
"contactScope": "address_book"
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({limit: 100, offset: 0, contactScope: 'address_book'})
};
fetch('https://api.wppfy.com/contacts/list', 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.wppfy.com/contacts/list",
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([
'limit' => 100,
'offset' => 0,
'contactScope' => 'address_book'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wppfy.com/contacts/list"
payload := strings.NewReader("{\n \"limit\": 100,\n \"offset\": 0,\n \"contactScope\": \"address_book\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<api-key>")
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.wppfy.com/contacts/list")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"limit\": 100,\n \"offset\": 0,\n \"contactScope\": \"address_book\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/contacts/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"limit\": 100,\n \"offset\": 0,\n \"contactScope\": \"address_book\"\n}"
response = http.request(request)
puts response.read_body{
"contacts": [
{
"jid": "5511999999999@s.whatsapp.net",
"contact_name": "John Smith",
"contact_FirstName": "Joao"
}
],
"totalDeviceContacts": 123,
"pagination": {
"totalRecords": 123,
"limit": 123,
"offset": 123,
"hasMore": true,
"nextOffset": 123
}
}{
"error": "No session"
}{
"error": "<string>"
}Contacts
List all contacts with pagination
Returns a paginated list of contacts of the currently connected WhatsApp account.
Use this endpoint (POST) to control limit and offset via the request body.
The contactScope field lets you choose between address book contacts, non-address book contacts, or all known contacts.
The GET /contacts route remains available for those who prefer the full list without pagination.
POST
/
contacts
/
list
List all contacts with pagination
curl --request POST \
--url https://api.wppfy.com/contacts/list \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"limit": 100,
"offset": 0,
"contactScope": "address_book"
}
'import requests
url = "https://api.wppfy.com/contacts/list"
payload = {
"limit": 100,
"offset": 0,
"contactScope": "address_book"
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({limit: 100, offset: 0, contactScope: 'address_book'})
};
fetch('https://api.wppfy.com/contacts/list', 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.wppfy.com/contacts/list",
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([
'limit' => 100,
'offset' => 0,
'contactScope' => 'address_book'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wppfy.com/contacts/list"
payload := strings.NewReader("{\n \"limit\": 100,\n \"offset\": 0,\n \"contactScope\": \"address_book\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<api-key>")
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.wppfy.com/contacts/list")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"limit\": 100,\n \"offset\": 0,\n \"contactScope\": \"address_book\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/contacts/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"limit\": 100,\n \"offset\": 0,\n \"contactScope\": \"address_book\"\n}"
response = http.request(request)
puts response.read_body{
"contacts": [
{
"jid": "5511999999999@s.whatsapp.net",
"contact_name": "John Smith",
"contact_FirstName": "Joao"
}
],
"totalDeviceContacts": 123,
"pagination": {
"totalRecords": 123,
"limit": 123,
"offset": 123,
"hasMore": true,
"nextOffset": 123
}
}{
"error": "No session"
}{
"error": "<string>"
}Authorizations
Body
application/json
Maximum number of results per page (default 100, maximum 1000)
Required range:
1 <= x <= 1000Zero-based offset for pagination
Defines whether the search returns only contacts in the address book, only those outside it, or all known contacts.
Available options:
address_book, outside_address_book, all 