POST /v1/actions/search-contacts
Trouve des contacts par sous-chaîne nom/téléphone/email, ou par tag. Renvoie jusqu'à 50 résultats.
Recherche des contacts par requête texte libre (sous-chaîne nom/téléphone/email, insensible à la casse), et/ou filtre par tag et email exact. Renvoie jusqu'à 50 résultats triés par last_message_at DESC.
POST /api/v1/actions/search-contacts
Corps de la requête
| Champ | Type | Requis | Notes |
|---|---|---|---|
query |
string | non | Correspondance par sous-chaîne sur name, phone, email (Postgres ILIKE) |
tag |
string | non | Nom de tag exact |
email |
string | non | Correspondance email exacte |
Tous les filtres sont combinés en AND. Un corps vide renvoie les 50 contacts les plus récemment actifs.
curl -X POST https://www.qyvo.io/api/v1/actions/search-contacts \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"query": "smith", "tag": "vip"}'
const contacts = await fetch('https://www.qyvo.io/api/v1/actions/search-contacts', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.QYVO_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ query: 'smith', tag: 'vip' }),
}).then((r) => r.json());
$contacts = Http::withToken(env('QYVO_TOKEN'))
->post('https://www.qyvo.io/api/v1/actions/search-contacts', [
'query' => 'smith',
'tag' => 'vip',
])
->json();
import os, httpx
contacts = httpx.post(
'https://www.qyvo.io/api/v1/actions/search-contacts',
headers={'Authorization': f"Bearer {os.environ['QYVO_TOKEN']}"},
json={'query': 'smith', 'tag': 'vip'},
).json()
Réponse — 200 OK
[
{
"id": "01J1Y...",
"phone": "+14155550123",
"name": "Jane Smith",
"email": "[email protected]",
"source": "shopify",
"tags": ["vip"],
"last_message_at": "2026-05-07T08:14:23+00:00",
"created_at": "2026-04-15T10:32:00+00:00"
}
]
Le résultat est un tableau plat — [] vide quand rien ne correspond. Voir Pagination pour le pattern d'ensembles de résultats plus grands.
