Skip to content

Send email verification code

POST
/users/email/verification

Will send an email verification code to the user email as a link

Flow:

  1. Validate request.
    - email and userId are required.
    - email should be a valid email.
  2. Validate user with the userId exists
  3. Validate: if email already verified and is connected with current user, return 400 email already verified
  4. Validate: if email already verified and is connected with another user, return 400 email already registered
  5. Generate requestToken(jwt) with email and userId in the claims.
  6. Send email verification with the requestToken attached in the verification link to the user’s email address.

EmailVerificationSendRequest

object
email
string
ivan+rdh+fl@joingotu.com

No Content

Bad request

object
error
string
some meaningful error message

Unauthorized

object
error
string
some meaningful error message

Forbidden

object
error
string
some meaningful error message

Internal server error

object
error
string
some meaningful error message