Skip to main content

Crear un contacto

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.

Buscar contactos

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"

Actualizar un contacto

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:
  1. Buscar si ya existe: GET /contacts?search=+549...
  2. Si no existe, crear: POST /contacts
  3. Si existe, actualizar: PATCH /contacts/:id
Usá el número de teléfono como identificador único para evitar duplicados.