Merge two duplicate people

View as Markdown
Atomic two-person merge. Run /v1/people/duplicate-check first; supply the survivor and loser ids in one body. The server repoints every person_id foreign key from loser to survivor inside one transaction, optionally PATCHes survivor fields, optionally creates a permanent slug redirect from the loser's URL to the survivor's, then deletes the loser (default deleteMode=hard). Requires admin API key, or BOTH EDIT_PERSON and DELETE_PERSON permissions.

Authentication

AuthorizationBearer

User bearer token: Supabase or Clerk session JWT, Clerk OAuth access token, or Clerk personal API key

OR
X-API-Keystring

Admin API key for system-to-system write operations

Query parameters

sourceTypeenumRequired
Write provenance source type.
sourceDetailstringRequired
Source detail or reviewer reference for the write.
sourceProviderstringOptional

Provider name for provider-native IDs or slugs.

sourceProviderIdstringOptional

Provider-native source ID.

sourceProviderSlugstringOptional

Provider-native source slug.

actorTypeenumOptional

Actor type; inferred as agent when agentChassis and agentModel are supplied, or as employee from an authenticated user JWT session.

Allowed values:
agentChassisstringOptional

Agent chassis token for agent-authored writes.

agentModelstringOptional

Agent model id for agent-authored writes.

Request

This endpoint expects an object.
createSlugRedirectbooleanRequired
Create a permanent slug redirect from the loser's public URL to the survivor's URL before the loser is deleted. Default true. Set false only when no public link to the loser slug needs to be preserved.
deleteModeenumRequired

How to remove the loser after foreign keys are repointed. Defaults to hard delete; merge specifically intends to eliminate the loser record.

loserIdstringRequiredformat: "uuid"

Person whose foreign keys move to [survivorId] and which is then deleted.

survivorIdstringRequiredformat: "uuid"
Person that keeps its id and absorbs the loser's relationships.
survivorobject or nullOptional

Optional partial survivor write applied after foreign keys are repointed. Sent fields overwrite the survivor’s current values; omit a field to leave it unchanged. Explicit null is NOT honored here (use PATCH /v1/people/detail for null-clearing). Use to copy a chosen field from the loser onto the survivor before the loser disappears.

Response

OK
createSlugRedirectboolean
Create a permanent slug redirect from the loser's public URL to the survivor's URL before the loser is deleted. Default true. Set false only when no public link to the loser slug needs to be preserved.
deleteModeenum

How to remove the loser after foreign keys are repointed. Defaults to hard delete; merge specifically intends to eliminate the loser record.

loserIdstringformat: "uuid"

Person whose foreign keys move to [survivorId] and which is then deleted.

survivorIdstringformat: "uuid"
Person that keeps its id and absorbs the loser's relationships.
foreignKeyRowsRepointedinteger or nullOptionalRead-only

Number of foreign-key rows repointed across all child tables (server stamped).

loserUrlstring or nullOptionalRead-only

Public URL of the loser before deletion (server stamped).

slugRedirectIdinteger or nullOptionalRead-only

Redirect row id created during merge, when [createSlugRedirect] is true.

survivorobject or nullOptional

Optional partial survivor write applied after foreign keys are repointed. Sent fields overwrite the survivor’s current values; omit a field to leave it unchanged. Explicit null is NOT honored here (use PATCH /v1/people/detail for null-clearing). Use to copy a chosen field from the loser onto the survivor before the loser disappears.

survivorUrlstring or nullOptionalRead-only

Public URL of the survivor (server stamped).

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
406
Not Acceptable Error
409
Conflict Error
415
Unsupported Media Type Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error