POST /v1/actions/add-tag

Ajoute un tag à un contact. Crée le tag s'il n'existe pas.

Ajoute un tag à un contact. Si le tag n'existe pas dans le tenant, il est créé. Le lien contact-tag est idempotent — ajouter un tag déjà attaché ne fait rien.

POST /api/v1/actions/add-tag

Corps de la requête

Champ Type Requis
contact_id UUID l'un des deux
phone string l'un des deux
tag string oui
curl -X POST https://www.qyvo.io/api/v1/actions/add-tag \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -H "Content-Type: application/json" \
  -d '{"phone": "+14155550123", "tag": "vip-2026"}'
const result = await fetch('https://www.qyvo.io/api/v1/actions/add-tag', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.QYVO_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ phone: '+14155550123', tag: 'vip-2026' }),
}).then((r) => r.json());
$result = Http::withToken(env('QYVO_TOKEN'))
    ->post('https://www.qyvo.io/api/v1/actions/add-tag', [
        'phone' => '+14155550123',
        'tag' => 'vip-2026',
    ])
    ->json();
import os, httpx
result = httpx.post(
    'https://www.qyvo.io/api/v1/actions/add-tag',
    headers={'Authorization': f"Bearer {os.environ['QYVO_TOKEN']}"},
    json={'phone': '+14155550123', 'tag': 'vip-2026'},
).json()

Réponse — 200 OK

{
  "id": "01J1Y...",
  "phone": "+14155550123",
  "tag_added": "vip-2026",
  "tags": ["vip-2026", "fr-FR"]
}

Erreurs

Statut Cause
404 Contact not found
422 Ni contact_id ni phone fourni