Skip to content
SoulFire LogoSoulFire

Verify email code

POST
/v1/login/email-code

Verifies an email verification code to complete authentication.

The auth_flow_token must match a pending login flow, and the code must match the one that was sent to the user's email. On success, returns a JWT token. On failure, returns a Failure response with INVALID_CODE reason.

After successful verification, the auth_flow_token is invalidated and cannot be reused.

Request Body

application/json
  1. body

Request message for verifying an email verification code.

authFlowToken*string

The authentication flow token received from the Login RPC response. This token links the code verification to the original login request. Must be a valid UUID string.

Formatuuid
code*string

The six-digit verification code that was sent to the user's email address. Must exactly match the code that was emailed to the user.

Response Body

Response message representing the next step in the authentication flow.

application/json
  1. response

Response message representing the next step in the authentication flow. This is a polymorphic response that indicates what action should be taken next.

authFlowToken*string

A unique token identifying this authentication flow session. This token must be included in subsequent requests (e.g., EmailCodeRequest) to continue the flow. The token is a UUID string and expires after 15 minutes of inactivity.

Formatuuid
emailCode?

Set when the client should prompt the user to enter the email verification code. This is the response after a successful Login RPC call.

success?

Set when authentication is complete and successful. Contains the JWT token for authenticated API access.

failure?

Set when authentication has failed. Contains the reason for the failure.

Example Request
curl -X POST 'http://127.0.0.1:38765/v1/login/email-code' \
  -H 'Content-Type: application/json' \
  -d '{
  "authFlowToken": "",
  "code": ""
}'
Example Response
{
  "authFlowToken": "f7af6c1d-a324-4e10-abb9-7a86eaca85d7",
  "emailCode": {},
  "success": {
    "token": "string"
  },
  "failure": {
    "reason": "INVALID_CODE"
  }
}

Was this page helpful?