{"record":{"id":"3edc82e76cd138b4","repo":"ory/kratos","slug":"the-address-type-for-sending-otp-codes-is-not-supp","errorCode":null,"errorMessage":"The address type for sending OTP codes is not supported.","messagePattern":"The address type for sending OTP codes is not supported\\.","errorType":"error_code","errorClass":"herodot.ErrMisconfiguration","httpStatus":500,"severity":"error","filePath":"identity/credentials_code.go","lineNumber":53,"sourceCode":"\t\treturn nil\n\tdefault:\n\t\treturn errors.Errorf(\"cannot scan %T into CodeChannel\", src)\n\t}\n}\n\nconst (\n\tCodeChannelEmail CodeChannel = AddressTypeEmail\n\tCodeChannelSMS   CodeChannel = AddressTypeSMS\n)\n\nfunc NewCodeChannel(value string) (CodeChannel, error) {\n\tswitch f := stringsx.SwitchExact(value); {\n\tcase f.AddCase(string(CodeChannelEmail)):\n\t\treturn CodeChannelEmail, nil\n\tcase f.AddCase(string(CodeChannelSMS)):\n\t\treturn CodeChannelSMS, nil\n\tdefault:\n\t\treturn \"\", errors.Wrap(ErrInvalidCodeAddressType(), f.ToUnknownCaseErr().Error())\n\t}\n}\n\n// CredentialsCode represents a one time login/registration code\n//\n// swagger:model identityCredentialsCode\ntype CredentialsCode struct {\n\tAddresses []CredentialsCodeAddress `json:\"addresses\"`\n}\n\n// swagger:model identityCredentialsCodeAddress\ntype CredentialsCodeAddress struct {\n\t// The type of the address for this code\n\tChannel CodeChannel `json:\"channel\"`\n\n\t// The address for this code\n\tAddress string `json:\"address\"`\n}","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/ory/kratos/blob/b86338da04a040247a07f46100a86dcfb3875909/identity/credentials_code.go#L35-L71","documentation":"NewCodeChannel received a channel string that matched neither 'email' nor 'sms' in the exact-case switch, so it wrapped ErrInvalidCodeAddressType with the unknown-case error. The input at fault is the configured/requested code delivery channel; only email and SMS code channels exist.","triggerScenarios":"Thrown at identity/credentials_code.go:53 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the code channel to exactly 'email' or 'sms' (case-sensitive)","Check for stray whitespace or alternate spellings in the submitted channel value","Update clients that send custom channel strings to use the supported ones"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b86338da04a040247a07f46100a86dcfb3875909","analyzedAt":"2026-09-07T15:58:15.934Z","contentChangedAt":"2026-09-07T15:58:15.934Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}