Create and send verification code

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://openapi.logto.io/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "Logto API references MCP server": {
    "url": "https://openapi.logto.io/mcp"
  }
}

Close
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. Once the interaction already carries a subject (the subject pinned by a step-up authentication, or an identified user), the identifier may carry only its type: the code is then sent to that user's primary email or phone with the SignIn template by default, the subject is read from the interaction storage, and the request never carries a raw identifier. This variant is only accepted with the SignIn interaction event.

application/json
Body object Required
One of:

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.

  • 400

    An invalid identifier was provided.

  • 403

    A step-up authentication supplied an identifier value (session.step_up.forbidden_identifier), unless the user is establishing that type of identifier as their first factor.

  • 404

    The identifier carried only its type but the interaction carries no subject, or the subject has no primary identifier of that type (session.identifier_not_found).

  • 422

    Unprocessable Content

  • 429

    Too Many Requests

  • 501

    The connector for sending the verification code is not configured.

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