Contacts

Manage the contacts VyaparPing has on file for your account.

GET/api/v1/contactsscope: contacts:read

List contacts, newest first. Paginated (see Pagination). Optional filters: ?search= (matches name or phone) and ?tag=<tagId>.

Response
{
  "data": [
    {
      "id": "…", "phone": "+14155550123", "name": "Jane Doe",
      "email": null, "company": "Acme", "avatar_url": null,
      "tags": [{ "id": "…", "name": "vip", "color": "#3b82f6" }],
      "created_at": "…", "updated_at": "…"
    }
  ],
  "meta": { "next_cursor": "…" }
}
POST/api/v1/contactsscope: contacts:write

Create a contact. phone (E.164) is required; name, email, company, and tags (an array of tag names, created if missing) are optional.

Find-or-create by phone: an existing match returns 200 with the existing contact; a new contact returns 201. The response body is the serialized contact (same shape as the list rows above).

Create
curl -X POST https://app.vyaparping.com/api/v1/contacts \
  -H "Authorization: Bearer vp_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{ "phone": "+14155550123", "name": "Jane Doe", "tags": ["vip"] }'

Read or update one

GET/api/v1/contacts/{id}scope: contacts:read
PATCH/api/v1/contacts/{id}scope: contacts:write

PATCH updates only the fields you send (name, email, company); pass tags (an array of tag names) to replace the contact's tags. A contact belonging to another account returns 404 — never 403, so a probe can't learn whether it exists elsewhere.