REST endpoints
Contacts
Find, create, update and delete contacts, and set custom attributes the AI and actions can use.
Send your API key in the Authorization: Bearer af_live_… header. See Authentication.
Contacts added through the API count as verified: the AI may use their details and attributes, and actions can use {contact.…} placeholders. See Contacts.
Contact object
idstringexternal_idstring | nullemailstring | nullphonestring | null8801711111111).namestring | nullattributesobject_, up to 41 characters); values are strings (up to 300 characters), numbers or booleans. Up to 40.tagsarrayverifiedbooleanopted_outbooleansourcestringapi, website, whatsapp, lead.created_at, last_seen_at stringList or find contacts
/api/v1/agents/{id}/contactsQuery parameters
emailstringexternal_idstringphonestringpagenumber1.curl "https://anytimereply.com/api/v1/agents/AGENT_ID/[email protected]" -H "Authorization: Bearer af_live_YOUR_KEY"{
"data": [
{
"id": "k1…",
"external_id": "u_42",
"email": "[email protected]",
"phone": "8801711111111",
"name": "Nadia",
"attributes": { "plan": "Pro", "orders": 7 },
"tags": ["vip"],
"verified": true,
"opted_out": false,
"source": "api",
"created_at": "2026-09-01T10:00:00.000Z",
"last_seen_at": "2026-10-19T08:00:00.000Z"
}
],
"page": 1
}Create or update a contact
/api/v1/agents/{id}/contactsMatched by external_id, then email, then phone. An existing contact is updated (new attributes are merged in, tags are added); otherwise a new one is created.
Body
external_idstringexternal_id, email or phone.emailstringphonestringnamestringattributesobjecttagsarraycurl https://anytimereply.com/api/v1/agents/AGENT_ID/contacts \
-H "Authorization: Bearer af_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"external_id": "u_42", "email": "[email protected]", "name": "Nadia", "attributes": {"plan": "Pro", "orders": 7}, "tags": ["vip"]}'Returns { "data": <contact> }. 400 Invalid email or phone when none of the identifiers is usable.
Get a contact
/api/v1/agents/{id}/contacts/{contact_id}Returns the contact plus its 50 most recent conversations:
{
"data": {
"id": "k1…",
"external_id": "u_42",
"email": "[email protected]",
"name": "Nadia",
"attributes": { "plan": "Pro" },
"tags": ["vip"],
"verified": true,
"conversations": [
{ "id": "8b1d…", "channel": "WIDGET", "status": "CLOSED", "created_at": "2026-10-18T10:02:11.000Z", "last_message_at": "2026-10-18T10:09:45.000Z" }
]
}
}Update a contact
/api/v1/agents/{id}/contacts/{contact_id}Body
namestringattributesobjectnull for a key to remove it.tagsarrayopted_outboolean{ "attributes": { "plan": "Business", "trial_ends": null }, "tags": ["vip", "renewed"] }Returns { "data": <contact> }.
Delete a contact
/api/v1/agents/{id}/contacts/{contact_id}Returns { "ok": true }. Conversations stay; they're just no longer linked to the contact.
Errors
| Status | Error |
|---|---|
400 | input: give external_id, email or phone · Invalid email or phone |
404 | Agent not found · Contact not found |