List contacts
curl --request GET \
--url https://api-eg.olimi.ai/api/v2/contacts/{customerListId} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api-eg.olimi.ai/api/v2/contacts/{customerListId}"
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-eg.olimi.ai/api/v2/contacts/{customerListId}', 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-eg.olimi.ai/api/v2/contacts/{customerListId}",
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-eg.olimi.ai/api/v2/contacts/{customerListId}"
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-eg.olimi.ai/api/v2/contacts/{customerListId}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eg.olimi.ai/api/v2/contacts/{customerListId}")
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{
"message": "Contacts fetched successfully",
"meta": {
"totalItems": 12,
"itemCount": 10,
"itemsPerPage": 10,
"totalPages": 2,
"currentPage": 1
},
"data": [
{
"id": "b2f7c4e1-8a3d-4c59-9e06-1d5a7f3b8c42",
"customerId": "9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24",
"firstName": "Ahmed",
"lastName": "Hassan",
"phoneNumber": "+201001234567",
"email": "[email protected]",
"gender": "male",
"retries": 0,
"lastCallStatus": "not_called",
"callbackScheduled": false,
"callbackAt": null,
"variantValues": [
{
"id": "4d8e2a6f-1c7b-4e93-a5d0-8f2b6c1e9a37",
"variantId": "7e3c9b15-6a2d-4f8e-b1c4-5d9a3e7f2b60",
"value": "ORD-10492",
"variant": {
"id": "7e3c9b15-6a2d-4f8e-b1c4-5d9a3e7f2b60",
"name": "Order number",
"slug": "order_number"
}
}
],
"createdAt": "2026-09-20T08:14:22.531Z",
"updatedAt": "2026-09-27T11:40:09.118Z"
}
]
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 422,
"message": [
"name must be shorter than or equal to 100 characters"
],
"error": "Unprocessable Entity"
}Contacts
List contacts
Returns the contacts in one customer list, newest first, one page at a time.
GET
/
api
/
v2
/
contacts
/
{customerListId}
List contacts
curl --request GET \
--url https://api-eg.olimi.ai/api/v2/contacts/{customerListId} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api-eg.olimi.ai/api/v2/contacts/{customerListId}"
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-eg.olimi.ai/api/v2/contacts/{customerListId}', 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-eg.olimi.ai/api/v2/contacts/{customerListId}",
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-eg.olimi.ai/api/v2/contacts/{customerListId}"
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-eg.olimi.ai/api/v2/contacts/{customerListId}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eg.olimi.ai/api/v2/contacts/{customerListId}")
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{
"message": "Contacts fetched successfully",
"meta": {
"totalItems": 12,
"itemCount": 10,
"itemsPerPage": 10,
"totalPages": 2,
"currentPage": 1
},
"data": [
{
"id": "b2f7c4e1-8a3d-4c59-9e06-1d5a7f3b8c42",
"customerId": "9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24",
"firstName": "Ahmed",
"lastName": "Hassan",
"phoneNumber": "+201001234567",
"email": "[email protected]",
"gender": "male",
"retries": 0,
"lastCallStatus": "not_called",
"callbackScheduled": false,
"callbackAt": null,
"variantValues": [
{
"id": "4d8e2a6f-1c7b-4e93-a5d0-8f2b6c1e9a37",
"variantId": "7e3c9b15-6a2d-4f8e-b1c4-5d9a3e7f2b60",
"value": "ORD-10492",
"variant": {
"id": "7e3c9b15-6a2d-4f8e-b1c4-5d9a3e7f2b60",
"name": "Order number",
"slug": "order_number"
}
}
],
"createdAt": "2026-09-20T08:14:22.531Z",
"updatedAt": "2026-09-27T11:40:09.118Z"
}
]
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 422,
"message": [
"name must be shorter than or equal to 100 characters"
],
"error": "Unprocessable Entity"
}Each contact has the fields described in Contact fields.
Use
meta.totalPages to know when you’ve fetched every page. A customer list ID that doesn’t exist, or isn’t yours, returns an empty list rather than an error.
How search works
search is split into words. A contact matches if any word matches:
- Name: the word appears in the first or last name, or is spelled similarly. Not case-sensitive.
- Phone number: a word made only of digits, optionally starting with
+, also matches phone numbers that contain it. Numbers are stored in E.164 form (+201001234567), so search with digits as they appear there: no spaces, dashes, brackets or leading0.
phoneNumber, send the number in E.164 form with no spaces, and encode the + as %2B in the URL.Authorizations
Path Parameters
The customer list's id.
Query Parameters
Page number, starting at 1.
Required range:
x >= 1Contacts per page.
Required range:
x >= 1Finds contacts by name or phone number. See How search works.
Only contacts whose number contains this one. Send it in E.164 form with no spaces, for example +201001234567, and encode + as %2B.
Only contacts whose email contains this one. Must be a full email address.