Update primary phone

POST /api/my-account/primary-phone

Update primary phone for the user, a logto-verification-id in header is required for checking sensitive permissions, and a new identifier verification record is required for the new phone ownership verification.

application/json

Body Required

  • phone string(regex) Required

    The new phone for the user.

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

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

Responses

  • The primary phone was updated successfully.

  • The new verification record is invalid.

  • Unauthorized

  • Permission denied, the verification record is invalid.

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