Confirm an identifier change
const url = 'https://your-tenant-host/v1/id/change-identifier/confirm';const options = { method: 'POST', headers: { cookie: 'ek.session_token=<ek.session_token>', 'x-edgekit-site-id': 'site_example', 'Content-Type': 'application/json' }, body: '{"newEmail":"new-address@example.com","otp":"482913"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://your-tenant-host/v1/id/change-identifier/confirm \ --header 'Content-Type: application/json' \ --header 'x-edgekit-site-id: site_example' \ --cookie ek.session_token=<ek.session_token> \ --data '{ "newEmail": "new-address@example.com", "otp": "482913" }'Step two of verify-then-swap. The address and its hash move together, every session is revoked, and the session cookies are cleared. A collision with a live user is refused and never merged. Not retryable after success: the code is spent and the session revoked.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”The site this request is for, within this tenant. Every official EdgeKit SDK sets it from the client you configured; set it yourself only when calling this API directly.
Example
site_exampleThe site this request is for, within this tenant. Every official EdgeKit SDK sets it from the client you configured; set it yourself only when calling this API directly.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Example
new-address@example.comExample
482913Responses
Section titled “Responses”The identifier changed and the session was revoked.
object
Example
{ "success": true}Invalid request.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Missing or invalid credential.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Not allowed.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Resource not found.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Conflicts with an existing record.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Request validation failed.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Too many requests. Retry-After says when to retry.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Unexpected error.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}With Retry-After, briefly unavailable; without it, not configured.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}