curl -X POST https://api.waspytech.com/api/v2/contacts \
-H "Authorization: Bearer wspy_tu_key" \
-H "Content-Type: application/json" \
-d '{
"phoneNumber": "+5491126032641",
"name": "María García",
"email": "maria@email.com",
"tags": ["Cliente", "VIP"]
}'
Si ya existe un contacto con ese número, recibís 409 CONTACT_ALREADY_EXISTS.
Por nombre, teléfono o email:
curl "https://api.waspytech.com/api/v2/contacts?search=maria" \
-H "Authorization: Bearer wspy_tu_key"
Por tag:
curl "https://api.waspytech.com/api/v2/contacts?tag=VIP" \
-H "Authorization: Bearer wspy_tu_key"
Enviá solo los campos que querés cambiar:
curl -X PATCH https://api.waspytech.com/api/v2/contacts/CONTACT_ID \
-H "Authorization: Bearer wspy_tu_key" \
-H "Content-Type: application/json" \
-d '{
"name": "María García López",
"tags": ["VIP", "Mayorista"],
"customFields": { "empresa": "Acme Corp", "rubro": "Indumentaria" }
}'
tags reemplaza todos los tags anteriores. customFields hace merge con los existentes.
Sincronizar desde tu CRM
Si necesitás sincronizar contactos desde otro sistema:
- Buscar si ya existe:
GET /contacts?search=+549...
- Si no existe, crear:
POST /contacts
- Si existe, actualizar:
PATCH /contacts/:id
Usá el número de teléfono como identificador único para evitar duplicados.