Remove an email address

DELETE /fapi/v1/me/emails/{email_id} · called from the environment's sign-in host

Removes one of the authenticated user's email addresses. The primary address cannot be removed; make another verified address primary first. If the environment requires an email address, the user's last verified address cannot be removed either. Requires the authenticated user's __Host-idp_session cookie; if the cookie is missing, expired, or revoked, returns 401 unauthenticated. A first-party app on another origin can instead send its front API access token (Authorization: DPoP <token> with a DPoP proof; see Front API access token).

The session must have been verified in the last 5 minutes. If the user has a second factor, the session must also have been opened with a second factor (urn:idp:acr:mfa).

Request

Headers:

Header Required Description
Idp-Client yes SDK identifier.
Origin yes Must be exactly https://<sign-in host>.

email_id: the email address identifier returned by GET /fapi/v1/me/emails (lowercase UUID).

No body.

Response

204 No Content.

Errors

Status Code When
401 unauthenticated No valid session cookie.
401 step_up_required Session was not verified in the last 5 minutes or a second factor is required; re-verify with max_age=300 (and if applicable, acr_values) in the WWW-Authenticate header.
403 origin_not_allowed Origin is missing or wrong.
404 not_found No such email address for this user.
409 primary_identifier_required The address is the primary one.
409 last_verified_channel The address is the user's last verified one and the environment requires an email address.

Example

curl -X DELETE https://example.keenauth.app/fapi/v1/me/emails/0190a5c4-1b2c-7d3e-8f40-516273849abc \
  -H "Idp-Client: my-app/1.0.0 (node/22.0.0)" \
  -H "Origin: https://example.keenauth.app" \
  -b cookies.txt

Personal data

This endpoint carries personal data: end-user profile. Personal data in the KeenAuth APIs describes what is stored, how long it is kept and how it is deleted. Do not send special categories of personal data (health, biometric data, religion, political opinions, sexual orientation) in any field.