<@U04UQ68083H> what does this error means? ```pro...
# ory-copilot
r
@chilly-king-10285 what does this error means?
Copy code
properties.traits.properties.phone: map[format:tel <http://ory.sh/kratos:map|ory.sh/kratos:map>[credentials:map[code:map[identifier:true via:sms]] recovery:map[via:sms] verification:map[via:sms]] title:Phone number type:string]
b
A message from kapa.ai
This error means that your identity schema is invalid because you have specified
recovery: { via: "sms" }
for the
phone
trait. Ory Kratos currently only supports recovery via email, not SMS. The value for
recovery.via
must be
"email"
, not
"sms"
. This is confirmed by the error message:
Copy code
properties.traits.properties.phone.ory\.sh/kratos.recovery.via: sms ^-- value must be "email"
and by user and maintainer comments in the referenced GitHub issue, which clarify that the schema extension for recovery does not support
"sms"
as a value. If you remove the
recovery: { via: "sms" }
or change it to
recovery: { via: "email" }
, the error will disappear. The documentation may be unclear on this point, but the product currently enforces this restriction for recovery flows [[Setting up identity schema with "Recovery via SMS" throwing error](https://github.com/ory/kratos/issues/4262)]. Summary: You cannot use SMS for account recovery in Ory Kratos; only email is supported for the
recovery.via
field.
r
@chilly-king-10285 how about verification?
b
A message from kapa.ai
Yes, verification via SMS is supported in Ory Kratos. To enable phone number verification, your identity schema should include a phone trait marked with the verification extension using
"via": "sms"
. For example:
Copy code
json {   "phone": {     "type": "string",     "title": "Phone number",     "format": "tel",     "<http://ory.sh/kratos|ory.sh/kratos>": {       "verification": {         "via": "sms"       }     }   } }
You must also configure an SMS channel in your Ory setup to deliver the verification codes via SMS. This is documented in the official guides and confirmed by multiple sources. Make sure your configuration matches the requirements for SMS delivery and that the verification flow is enabled in your project settings [Phone number verification](https://www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation#phone-number-verification) [Customize identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#identity-schema-extensions). Note: - Recovery via SMS is not supported, but verification via SMS is. - If you encounter issues, ensure you are not using deprecated parameters and that your Ory version supports the features you are configuring.
r
@chilly-king-10285, what if I don’t need recovery? can i remove the block?
b
A message from kapa.ai
Yes, if you do not need account recovery, you can remove the entire
"recovery"
block from your identity schema for that trait. The
"recovery"
extension is only required if you want that field to be used for account recovery flows. If you omit it, Ory Kratos will not use that trait for recovery, and you will not be able to recover accounts using that field. This approach is supported by the documentation, which states that you specify which fields are used for recovery by including the
"recovery"
extension in the schema. If you do not include it, that field will not be used for recovery [Customize identity schemas](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#identity-schema-extensions). So, you can safely remove the
"recovery"
block if you do not need recovery functionality for that trait.