LiveRecoverVYG Developer Docs
CDP REST APIAPI Reference

Merge Profiles

Merge one profile into another — the loser becomes an alias of the winner.

POST /cdp/profiles/merge explicitly merges the loser profile into the winner: the loser is deleted and its id becomes an alias of the winner. BOTH profiles are fetched in-scope BEFORE any write, so a merge never relies on post-filtering — either id missing aborts with 404 and zero writes. A self-merge (winnerId === loserId) and an already-merged loser are idempotent no-ops; a loser already merged into a DIFFERENT profile is a 409.

Every write is bound to your brand's shop scope. See Tenant Isolation & Scope.

Query parameters

ParameterTypeRequiredDefaultDescription
winnerIdstringYesBody field — the surviving profile id.
loserIdstringYesBody field — the profile id merged into the winner (its id becomes an alias).

Response

The 200 response body:

FieldTypeDescription
winnerIdstring
loserIdstring
status'merged' | 'noop'
reason'self' | 'already_merged'
aliasedLoserIdstring
scopestringYour brand's resolved shop domain.

Errors

All errors share the standard envelope { "error": string, "error_description": string }.

StatusCodeWhen
400bad_requestThe body is not valid JSON, or a required id is missing.
401unauthorizedMissing or invalid API credential.
403forbiddenNo connected Shopify integration resolves a scope for the brand.
404not_foundThe winner or loser is missing or out-of-scope for the brand.
409conflictThe loser is already merged into a different profile.
405method_not_allowedThe request used a method other than POST.
500internal_errorAn unexpected error prevented the merge.

On this page