Replies: 2 comments 3 replies
-
|
Could you please clarify what you are trying to accomplish? |
Beta Was this translation helpful? Give feedback.
-
|
Hello @jjkoh95 You’re not missing a separate “request OTP” endpoint – requesting the OTP and completing the flow are both done via the same self‑service flow endpoints. There is no dedicated “send code” API. For registration with one‑time code, the intended pattern is:
GET /self-service/registration/api
This uses the updateRegistrationFlowWithCodeMethod body. method and traits are required; code is not required in the first step and is only present when the user submits the OTP. updateRegistrationFlow body When the payload is valid, this first call both: sends the OTP (using the courier/email/SMS config), and
Call the same endpoint again with: Here code is set and Kratos will complete the flow if the OTP is valid. updateRegistrationFlow body As for the question around 400 error If you get 400 and the OTP is sent, that typically means:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any API to request OTP?
Currently I'm using
self-service/registrationwith payload below, which returns me 400 status code.Is this expected?
The 400 status seems to be signalling something wrong despite they actually send OTP underneath.
{ "method": "code", "traits": { "phone_number": "+60123456789" } }Beta Was this translation helpful? Give feedback.
All reactions