Merge two duplicate entities

View as Markdown

Merge two duplicate entities after duplicate review. The survivor keeps its id, the loser is removed, relationships move to the survivor, optional survivor fields may be patched, and a slug redirect is created by default. Known duplicate fundraise and same-month latest-valuation collisions are resolved before foreign-key repointing. Requires write and delete authority.

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 permanent redirects from the loser's public URL shapes to the survivor's canonical public URL.
deleteModeenumRequired

How to remove the loser after relationships move; default is hard.

loserIdstringRequiredformat: "uuid"
Duplicate entity removed after relationships move.
survivorIdstringRequiredformat: "uuid"
Entity that remains after merge.
survivorobject or nullOptional
Optional survivor field updates applied during merge.

Response

OK
createSlugRedirectboolean
Create permanent redirects from the loser's public URL shapes to the survivor's canonical public URL.
deleteModeenum

How to remove the loser after relationships move; default is hard.

loserIdstringformat: "uuid"
Duplicate entity removed after relationships move.
survivorIdstringformat: "uuid"
Entity that remains after merge.
foreignKeyRowsRepointedinteger or nullOptionalRead-only

Number of child-table rows updated or deleted while consolidating the loser into the survivor (server stamped).

loserUrlstring or nullOptionalRead-only

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

slugRedirectIdinteger or nullOptionalRead-only

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

survivorobject or nullOptional
Optional survivor field updates applied during merge.
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