Skip to content

Merge two contacts

POST
/contact/merge
curl --request POST \
--url https://api.aelyst.ai/v1/contact/merge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "contactIds": [ 1 ], "firstName": "Muhammad ", "lastName": "Mahin", "phone": "+60123456789", "email": "test@example.com", "language": "ms", "profilePic": "https://cdn.aelyst.ai/profile_avatar.png", "countryCode": "MY", "custom_fields": [ { "name": "Company Website", "value": "https://example.com" } ] }'

Merge two contacts by their IDs

The contact that is older becomes the “primary contact”.

Media typeapplication/json
object
contactIds

IDs of the two contacts that are to be merged

Array<integer>
unique items
Any of:
object
firstName
required
string
Example
Muhammad
lastName
string
nullable
Example
Mahin
phone
string
nullable
Example
+60123456789
email
string
nullable
Example
test@example.com
language

Following the ISO 639-1 standard.

string
nullable
Example
ms
profilePic
string
nullable
Example
https://cdn.aelyst.ai/profile_avatar.png
countryCode

Following the ISO 3166-1 alpha-2 standard.

string
nullable
Example
MY
custom_fields
Array<object>
nullable
object
name
required
string
Example
Company Website
value

Formatting rules

  • Text: “string” (use quotation marks for the string value)
  • Number: Number (without any quotation marks)
  • Email: “email” (format: user@domain.com)
  • URL: “url” (format: www.website.com, https://www.website.com, website.com, http://website.com)
  • List: “string” (the string value must match one of the list options)
  • Date: “yyyy-mm-dd” (must follow this format)
  • Time: “HH:MM” (must follow 24H format, 1PM => 13:00)
  • Checkbox: “true/false” (must be true for checked, false for unchecked)
string
nullable
Example
https://example.com
Media typeapplication/json
object
contactId

ID of the contact on which the action was performed.

integer
Examplegenerated
{
"contactId": 1
}
Media typeapplication/json
object
code
integer
message
string
Example
{
"code": 400,
"message": "Validation error."
}
Media typeapplication/json
object
code
integer
message
string
Example
{
"code": 401,
"message": "UN_AUTHORIZED"
}
Media typeapplication/json
object
code
integer
message
string
Example
{
"code": 429,
"message": "Too Many Requests"
}
Retry-After
number
Example
1

Number of seconds until you can retry the request

X-RateLimit-Limit
number
Example
10

Number of request allowed for this end point

X-RateLimit-Remaining
number
Example
5

Number of request remaining for this end point

Media typeapplication/json
object
code
integer
message
string
Example
{
"code": 500,
"message": "Unexpected error occurred"
}