Api

Rekey Participant

POST
/v1/participants/rekey

Renames the participant that the body names by kind and external ID to newExternalId, for example when your user IDs change. The kind stays. The old ID is retired: it keeps naming the same participant in every call, and it never names another participant of the Project and kind. Name the participant by its current external ID. A retry that names the old ID again returns the participant and changes nothing. An unknown or deleted participant returns 404; the call creates no participant. A new ID that another participant has, or that a rename retired, returns 409, and so does a name that is no longer the current ID. A fact keeps the participant reference that it was sent with: a retry of an earlier fact must name the participant as the first request did.

Authorization

WorkspaceApiKey
X-Api-Key<token>

Workspace-owned Better Auth API key of one environment (Sandbox or Live); it authorizes the Projects of that environment in its Workspace. A Project of the other environment returns 403 ENVIRONMENT_MISMATCH. Never expose it in the browser.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/participants/rekey" \  -H "Content-Type: application/json" \  -d '{    "projectId": "string",    "participant": {      "kind": "individual",      "externalId": "string"    },    "newExternalId": "string"  }'
{  "participantId": "string",  "kind": "individual",  "externalId": "string",  "name": "string",  "email": "string",  "billingId": "string",  "success": true}