Aller au contenu

POST /v1/contacts/{id}/merge-preview

POST
/v1/contacts/{id}/merge-preview
curl --request POST \
--url https://api.asap.cool/v1/contacts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/merge-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "duplicate_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }'
id
required
string format: uuid

Surviving (primary) contact.

Media type application/json

Body of POST /v1/contacts/{id}/merge.

object
duplicate_ids
required

Duplicate contacts to fold into the primary (must not include it).

Array<string>
Example generated
{
"duplicate_ids": [
"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
]
}

Predicted merge effect (nothing mutated).

Media type application/json

Predicted effect of a merge, returned by the dry-run preview endpoint: how many references each duplicate would move onto the primary, computed and then rolled back so nothing is mutated.

object
bookings_reassigned
required

Bookings that would be reassigned to the primary.

integer format: int64
chat_sessions_reassigned
required

Chat sessions that would be reassigned to the primary.

integer format: int64
contacts_tombstoned
required

Duplicate contacts that would be tombstoned.

integer format: int64
duplicate_ids
required

Duplicates that would be folded in.

Array<string>
invoices_reassigned
required

Draft invoices that would be reassigned to the primary.

integer format: int64
primary_id
required

Surviving (primary) contact id.

string format: uuid
Example generated
{
"bookings_reassigned": 1,
"chat_sessions_reassigned": 1,
"contacts_tombstoned": 1,
"duplicate_ids": [
"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
],
"invoices_reassigned": 1,
"primary_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

No active org.

Media type application/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

Missing contacts:write scope.

Media type application/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

Primary not found, cross-org, or not active.

Media type application/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

A duplicate id equals the primary.

Media type application/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}