Create and send verification code

POST /api/experience/verification/verification-code

Create a new CodeVerification record and sends the code to the specified identifier. The code verification can be used to verify the given identifier.

application/json

Body Required

  • identifier object Required

    The identifier (email address or phone number) to send the verification code to.

    Additional properties are allowed.

    Hide identifier attributes Show identifier attributes object
    • type string Required

      Values are email or phone.

    • value string Required
  • interactionEvent string Required

    The interaction event for which the verification code will be used. Supported values are SignIn, Register, and ForgotPassword. This determines the template for the verification code.

    Values are SignIn, Register, or ForgotPassword.

Responses

  • 200 application/json

    The verification code has been successfully sent.

    Hide response attribute Show response attribute object
    • verificationId string Required

      The unique ID of the verification record. Required to verify the code.

  • An invalid identifier was provided.

  • Not Found

  • The connector for sending the verification code is not configured.

POST /api/experience/verification/verification-code
curl \
 -X POST https://[tenant_id].logto.app/api/experience/verification/verification-code \
 -H "Content-Type: application/json" \
 -d '{"identifier":{"type":"email","value":"string"},"interactionEvent":"SignIn"}'
Request examples
{
  "identifier": {
    "type": "email",
    "value": "string"
  },
  "interactionEvent": "SignIn"
}
Response examples (200)
{
  "verificationId": "string"
}