Contacts
A contact is a person who calls or messages you. Each has identities (phone numbers and emails), tags, custom fields and a timeline. An identity is proven when the person reached you from it, and claimed when you added it.
Keys need the contacts:read scope to read and contacts:write to change.
Search contacts
Section titled “Search contacts”q matches a name, or any part of a phone number or email.
curl "https://app.airfone.app/v1/contacts?q=9841&limit=20" \ -H "Authorization: Bearer $AIRFONE_KEY"The result is { "data": [...], "has_more": true, "next_cursor": "..." }. Pass next_cursor back as starting_after for the next page.
Create a contact
Section titled “Create a contact”curl https://app.airfone.app/v1/contacts \ -H "Authorization: Bearer $AIRFONE_KEY" \ -H "Content-Type: application/json" \ -d '{ "display_name": "Sita Sharma", "identities": [{ "kind": "phone", "value": "+9779841000000" }], "tags": ["vip"] }'If a phone or email already belongs to another contact, it is not moved. AirFone raises a merge suggestion instead and returns its id in suggestions_created.
Get, update and delete
Section titled “Get, update and delete”curl https://app.airfone.app/v1/contacts/$ID -H "Authorization: Bearer $AIRFONE_KEY"
curl -X PATCH https://app.airfone.app/v1/contacts/$ID \ -H "Authorization: Bearer $AIRFONE_KEY" \ -H "Content-Type: application/json" \ -d '{ "tags": ["vip", "kathmandu"], "custom_fields": { "plan": "gold" } }'
curl -X DELETE https://app.airfone.app/v1/contacts/$ID -H "Authorization: Bearer $AIRFONE_KEY"Fields you leave out stay as they are. A null custom field removes that key. Deleting erases the contact and its history for good.
Merge two duplicates
Section titled “Merge two duplicates”The contact in the path survives. The one in merge_id is merged into it.
curl -X POST https://app.airfone.app/v1/contacts/$KEEP/merge \ -H "Authorization: Bearer $AIRFONE_KEY" \ -H "Content-Type: application/json" \ -d '{ "merge_id": "'$DUPLICATE'" }'Set keep_merged_name to keep the other contact’s name. Looking up the merged contact later returns merged_into with the surviving id.
Timeline
Section titled “Timeline”Calls, messages and voicemails, newest first. Filter with kinds (comma separated), channel or q.
curl "https://app.airfone.app/v1/contacts/$ID/timeline?kinds=call,message" \ -H "Authorization: Bearer $AIRFONE_KEY"Test keys see only the sandbox workspace’s contacts.