Update primary email

POST /api/profile/primary-email

Update primary email for the user, a verification record is required for checking sensitive permissions, and a new identifier verification record is required for the new email ownership verification.

application/json

Body Required

  • email string(regex) Required

    The new email for the user.

    Format should match the following pattern: /^\S+@\S+\.\S+$/.

  • verificationRecordId string Required

    The verification record ID for checking sensitive permissions.

  • The identifier verification record ID for the new email ownership verification.

Responses

  • The primary email was updated successfully.

  • The new verification record is invalid.

  • Unauthorized

  • Permission denied, the verification record is invalid.

POST /api/profile/primary-email
curl \
 -X POST https://[tenant_id].logto.app/api/profile/primary-email \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"email":"string","verificationRecordId":"string","newIdentifierVerificationRecordId":"string"}'
Request examples
{
  "email": "string",
  "verificationRecordId": "string",
  "newIdentifierVerificationRecordId": "string"
}