Context
Contacts
The people a user works with, across email, phone and chat, with relationships and external ids.
/contactsList contacts
Returns the user's contacts, filtered by `status`, `scope`, `source` or `tags`, or searched by name and email. With an account key and no `X-User-Email`, pass `userId`.
Query parameters
Responses
trueworkpersonalotherworkmobilehomeothermanualteammateteammate_archivedimportedemailimportcrmatshrisvoiceonboardingcalendarothernulluserteammanualnullRequest
curl 'https://api.agnt.ai/contacts' \
-H "Authorization: Bearer ak_live_..." \
-H "X-User-Email: [email protected]"Response
{
"ok": true,
"contacts": [
{
"id": "6660c4a1f2e3b7d8a9c01234",
"user": "user",
"name": "Ava",
"email": "[email protected]",
"company": {
"id": "6660c4a1f2e3b7d8a9c01234",
"name": "Ava",
"slug": "slug",
"domain": "harborview.co"
},
"title": "Send Brightline the contract renewal"
}
]
}/contactsCreate a contact
Creates a contact for the user. When the email address belongs to a user of your app, `consumer` links the contact to that user.
Request body
mobileworkhomeotherpersonalworkotheruserteamResponses
trueworkpersonalotherworkmobilehomeothermanualteammateteammate_archivedimportedemailimportcrmatshrisvoiceonboardingcalendarothernulluserteammanualnullRequest
curl 'https://api.agnt.ai/contacts' \
-X POST \
-H "Authorization: Bearer ak_live_..." \
-H "X-User-Email: [email protected]" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]"
}'Response
{
"ok": true,
"contact": {
"id": "6660c4a1f2e3b7d8a9c01234",
"user": "user",
"name": "Ava",
"email": "[email protected]",
"company": {
"id": "6660c4a1f2e3b7d8a9c01234",
"name": "Ava",
"slug": "slug",
"domain": "harborview.co"
},
"title": "Send Brightline the contract renewal"
}
}/contacts/{contactId}Retrieve a contact
Retrieves one of the user's contacts with its relationships.
Path parameters
Responses
trueworkpersonalotherworkmobilehomeothermanualteammateteammate_archivedimportedemailimportcrmatshrisvoiceonboardingcalendarothernulluserteammanualnullRequest
curl 'https://api.agnt.ai/contacts/<contactId>' \
-H "Authorization: Bearer ak_live_..." \
-H "X-User-Email: [email protected]"Response
{
"ok": true,
"contact": {
"id": "6660c4a1f2e3b7d8a9c01234",
"user": "user",
"name": "Ava",
"email": "[email protected]",
"company": {
"id": "6660c4a1f2e3b7d8a9c01234",
"name": "Ava",
"slug": "slug",
"domain": "harborview.co"
},
"title": "Send Brightline the contract renewal",
"outgoingRelationships": [],
"incomingRelationships": []
}
}/contacts/{contactId}Update a contact
Updates a contact. Only the fields you send change.
Path parameters
Request body
mobileworkhomeotherpersonalworkotheruserteamResponses
trueworkpersonalotherworkmobilehomeothermanualteammateteammate_archivedimportedemailimportcrmatshrisvoiceonboardingcalendarothernulluserteammanualnullRequest
curl 'https://api.agnt.ai/contacts/<contactId>' \
-X PUT \
-H "Authorization: Bearer ak_live_..." \
-H "X-User-Email: [email protected]" \
-H "Content-Type: application/json" \
-d '{
"name": "Ava",
"preferredName": "Ava",
"phones": [
{
"number": "+14155550142"
}
],
"company": "company"
}'Response
{
"ok": true,
"contact": {
"id": "6660c4a1f2e3b7d8a9c01234",
"user": "user",
"name": "Ava",
"email": "[email protected]",
"company": {
"id": "6660c4a1f2e3b7d8a9c01234",
"name": "Ava",
"slug": "slug",
"domain": "harborview.co"
},
"title": "Send Brightline the contract renewal"
}
}/contacts/{contactId}Delete a contact
Deletes a contact.
Path parameters
Responses
trueRequest
curl 'https://api.agnt.ai/contacts/<contactId>' \
-X DELETE \
-H "Authorization: Bearer ak_live_..." \
-H "X-User-Email: [email protected]"Response
{
"ok": true,
"contact": {
"id": "6660c4a1f2e3b7d8a9c01234"
}
}/contacts/bulk-importImport contacts
Creates or updates up to 1,000 contacts in one call, matched to existing contacts by email. Rows with no email, or with an address already in the batch, are skipped and listed in `errors`.
Request body
mobileworkhomeotherpersonalworkotherResponses
trueRequest
curl 'https://api.agnt.ai/contacts/bulk-import' \
-X POST \
-H "Authorization: Bearer ak_live_..." \
-H "X-User-Email: [email protected]" \
-H "Content-Type: application/json" \
-d '{
"contacts": [
{
"email": "[email protected]"
}
]
}'Response
{
"ok": true,
"bulkImport": {
"success": true,
"total": 42,
"created": 1,
"updated": 1,
"skipped": 1,
"errors": [
{
"error": "error"
}
]
}
}/contacts/{contactId}/mergeMerge contacts
Merges `mergeContactId` into this contact. Fields are combined, tasks and relationships move to this contact, and the other contact is deleted. `preferredEmail` sets the primary address.
Path parameters
Request body
Responses
trueworkpersonalotherworkmobilehomeothermanualteammateteammate_archivedimportedemailimportcrmatshrisvoiceonboardingcalendarothernulluserteammanualnullRequest
curl 'https://api.agnt.ai/contacts/<contactId>/merge' \
-X POST \
-H "Authorization: Bearer ak_live_..." \
-H "X-User-Email: [email protected]" \
-H "Content-Type: application/json" \
-d '{
"mergeContactId": "6660c4a1f2e3b7d8a9c01234"
}'Response
{
"ok": true,
"contact": {
"id": "6660c4a1f2e3b7d8a9c01234",
"user": "user",
"name": "Ava",
"email": "[email protected]",
"company": {
"id": "6660c4a1f2e3b7d8a9c01234",
"name": "Ava",
"slug": "slug",
"domain": "harborview.co"
},
"title": "Send Brightline the contract renewal",
"merged": true,
"mergedContactId": "6660c4a1f2e3b7d8a9c01234"
}
}