Contacts
A contact is the record for a person or organisation you communicate with: phone numbers, emails, linked channel accounts (contactAccounts — e.g. a specific WhatsApp number or Instagram username), tags, and a status (lead/active/inactive). A single contact can have multiple linked accounts and conversations. The API covers CRUD, lookup/resolution by identifier, duplicate merging, and broadcast opt-in/opt-out management.
Endpoints
| Method | Path | Summary |
|---|---|---|
| GET | /v1/contactsList the company's contacts with pagination, search and status filter. | List the company's contacts with pagination, search and status filter. |
| GET | /v1/contacts/lookupQuick contact lookup by phone, external_id or channel username. | Quick contact lookup by phone, external_id or channel username. |
| GET | /v1/contacts/channel-optionsList channel types available for linking an account to a contact. | List channel types available for linking an account to a contact. |
| POST | /v1/contactsCreate a contact (with phones, emails and linked channel accounts). | Create a contact (with phones, emails and linked channel accounts). |
| POST | /v1/contacts/resolve-identifiersResolve a batch of identifiers (phone/username/external_id) to existing contact ids. | Resolve a batch of identifiers (phone/username/external_id) to existing contact ids. |
| PATCH | /v1/contacts/{contact}Update a contact (fully rewrites related phones/emails/accounts). | Update a contact (fully rewrites related phones/emails/accounts). |
| DELETE | /v1/contacts/{contact}Delete a contact (soft delete). | Delete a contact (soft delete). |
| POST | /v1/contacts/{contact}/mergeMerge a contact into another one (all conversations and accounts move to the target). | Merge a contact into another one (all conversations and accounts move to the target). |
| POST | /v1/contacts/{contact}/tagsSync a contact's tags (full replace of the tag set). | Sync a contact's tags (full replace of the tag set). |
| POST | /v1/contacts/{contact}/opt-outOpt a contact out of broadcasts. | Opt a contact out of broadcasts. |
| POST | /v1/contacts/{contact}/opt-inOpt a contact back into broadcasts (clears opt-out). | Opt a contact back into broadcasts (clears opt-out). |
| GET | /v1/contacts/{contact}/dealsList a contact's deals (requires the deals feature to be enabled). | List a contact's deals (requires the deals feature to be enabled). |
Examples
Create a contact
Request
curl -X POST "https://api.aisar.app/v1/contacts" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"firstName": "John",
"lastName": "Doe",
"phones": [{ "phone": "+77001234567", "type": "mobile" }],
"emailes": [{ "email": "john@example.com", "type": "work" }]
}'Response
{
"data": {
"id": 45,
"company_id": 1,
"firstName": "John",
"lastName": "Doe",
"displayName": "John Doe",
"status": "lead",
"phones": [{ "phone": "+77001234567", "type": "mobile" }],
"emailes": [{ "email": "john@example.com", "type": "work" }],
"contactAccounts": [],
"merged_into_contact_id": null
}
}Look up a contact by phone
Request
curl -X GET "https://api.aisar.app/v1/contacts/lookup?q=%2B77001234567" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"Response
{
"data": [
{
"id": 45,
"displayName": "John Doe",
"status": "lead",
"phones": [{ "phone": "+77001234567", "type": "mobile" }]
}
]
}