Activities API
Activities are the timeline events tied to a contact or a lead — emails sent, calls made, notes added, pipeline stage moves.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | `/api/v1/activities` | List (filter by contactId / leadId / type) |
| POST | `/api/v1/activities` | Create |
Schema
{
"id": "act_01H...",
"tenantId": "tnt_01H...",
"userId": "usr_01H...",
"contactId": "ctc_01H...",
"leadId": "lead_01H...",
"type": "email_sent",
"title": "Sent intro email",
"content": "Hey Jane, ...",
"metadata": { "messageId": "msg_..." },
"createdAt": "2026-05-04T17:21:00Z"
}Examples
curl -X POST https://api.anvilhk.com/api/v1/activities \
-H "Authorization: Bearer $ANVIL_KEY" \
-H "X-Tenant-ID: $TENANT" \
-H "Content-Type: application/json" \
-d '{ "type": "note", "title": "Demo scheduled", "leadId": "lead_01H..." }'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.