Contacts API
Contacts are the people you do business with. They can have multiple leads, multiple memory notes, and an AI-generated profile.
Resource
Auth: Bearer JWT or X-Api-Key. Tenant scope required (sent automatically with the JWT, or via X-Tenant-ID header for API-key callers).
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | `/api/v1/contacts` | List contacts (cursor-paginated) |
| POST | `/api/v1/contacts` | Create |
| GET | `/api/v1/contacts/:id` | Get one |
| PATCH | `/api/v1/contacts/:id` | Update |
| DELETE | `/api/v1/contacts/:id` | Delete |
| POST | `/api/v1/contacts/import` | Bulk import (CSV / JSON) |
| POST | `/api/v1/contacts/export` | Bulk export |
| POST | `/api/v1/contacts/merge` | Merge duplicates |
| GET | `/api/v1/contacts/:id/memory` | List AI memory notes |
| POST | `/api/v1/contacts/:id/memory` | Add memory note |
| DELETE | `/api/v1/contacts/:id/memory/:noteId` | Remove note |
| GET | `/api/v1/contacts/:id/profile` | AI profile |
| POST | `/api/v1/contacts/:id/profile/refresh` | Recompute profile |
Schema
{
"id": "ctc_01H...",
"tenantId": "tnt_01H...",
"name": "Jane Doe",
"email": "jane@example.com",
"phone": "+852 4748 1911",
"company": "Acme Lighting",
"title": "Procurement Director",
"country": "US",
"score": 78,
"tags": [{ "id": "tag_...", "name": "VIP", "color": "#10B981" }],
"owner": { "id": "usr_...", "name": "Sarah", "avatar": null },
"createdAt": "2026-04-01T08:00:00Z",
"updatedAt": "2026-05-04T17:21:00Z"
}Examples
curl https://api.anvilhk.com/api/v1/contacts?limit=50 \
-H "Authorization: Bearer $ANVIL_KEY" \
-H "X-Tenant-ID: $TENANT"Every response uses the standard envelope:
{
"success": true,
"data": { /* resource or array */ },
"meta": { "total": 100, "cursor": "...", "hasMore": true },
"error": { "code": "ERROR_CODE", "message": "Human readable" }
}error is omitted on success; meta is omitted when not paginating.
Rate Limits
Subject to the standard 200 req/min/tenant authenticated limit. See [Rate Limits](/docs/api-reference/rate-limits) for full details and the per-endpoint overrides.