Skip to content
Esc
navigateopen⌘Jpreview
Dashboard

Consume passwordless code

Tries to consume the passed userInputCode+deviceId combo or the linkCode to sign the user in

POST/appid-{appId}/{tenantId}/recipe/signinup/code/consume
Authorization
api-keyAPI key · headerrequired
The core service API token. If you are using a self-hosted core service and you have not generated a token, you can omit the header.
Path parameters
tenantIdstring
The tenant against which the request is made. If left empty, the default tenant will be used.
Header parameters
ridstring
cdi-versionstring
X.Y of the X.Y.Z CDI version.
Request body
application/json
One of:
object
preAuthSessionIdpreAuthSessionIdrequired
A random identifier that can be used to identify the login attempt/device.
linkCodelinkCoderequired
URL-safe string that can be used to authenticate the user, without the deviceId
object
preAuthSessionIdpreAuthSessionIdrequired
A random identifier that can be used to identify the login attempt/device.
deviceIddeviceIdrequired
A random identifier that should be stored on the device that started the sign in process.
userInputCodeuserInputCoderequired
This can be used to authenticate the user when paired with the deviceId
Responses
200Indicates success with the status property
One of:
object
statusstatusOK
Allowed:OK
createdNewUserboolean
Indicates if a new user was created
userauthRecipeUser
Show properties
iduserId
isPrimaryUserboolean
tenantIdstenantId[]
timeJoinedtimeJoined
emailsemail[]
phoneNumbersphoneNumber[]
thirdPartyobject[]
Show properties
Array of object
idthirdPartyId
userIdthirdPartyUserId
loginMethodsobject[]
Show properties
Array of object
tenantIdstenantId[]
recipeUserIduserId
verifiedboolean
timeJoinedtimeJoined
recipeIdrecipeId
Allowed:emailpasswordpasswordlessthirdparty
emailemail
phoneNumberphoneNumber
thirdPartyobject
Show properties
idthirdPartyId
userIdthirdPartyUserId
recipeUserIduserId
consumedDeviceobject
Information about the consumed device
Show properties
preAuthSessionIdpreAuthSessionIdrequired
A random identifier that can be used to identify the login attempt/device.
failedCodeInputAttemptCountnumberrequired
Number of failed code input attempts
emailemail
phoneNumberphoneNumber
object
statusstring
Allowed:INCORRECT_USER_INPUT_CODE_ERROREXPIRED_USER_INPUT_CODE_ERROR
failedCodeInputAttemptCountnumber
Number of failed code input attempts
maximumCodeInputAttemptsnumber
Maximum allowed code input attempts
object
statusstring
Allowed:RESTART_FLOW_ERROR
400error code 400
string
401error code 401
string
404error code 404
string
500error code 500
string
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST "/appid-{appId}/public/recipe/signinup/code/consume" \
  -H "api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "preAuthSessionId": "kFmkPQEAJtACiT2w/K8fndEuNm+XozJXSZSlWEr+iGs=",
  "linkCode": "b10lbT_SnDC4flA6Fn7pE5TtG5k5NfigLef4QMBeGA8"
}'
Response
{
  "status": "OK",
  "createdNewUser": true,
  "user": {
    "id": "fa7a0841-b533-4478-95533-0fde890c3483",
    "isPrimaryUser": true,
    "tenantIds": [
      "customer1"
    ],
    "timeJoined": 1623918032231,
    "emails": [
      "[email protected]"
    ],
    "phoneNumbers": [
      "+14155552671"
    ],
    "thirdParty": [
      {
        "id": "google",
        "userId": 106347997792363870000
      }
    ],
    "loginMethods": [
      {
        "tenantIds": [
          "customer1"
        ],
        "recipeUserId": "fa7a0841-b533-4478-95533-0fde890c3483",
        "verified": true,
        "timeJoined": 1623918032231,
        "recipeId": "emailpassword",
        "email": "[email protected]",
        "phoneNumber": "+14155552671",
        "thirdParty": {
          "id": "google",
          "userId": 106347997792363870000
        }
      }
    ]
  },
  "recipeUserId": "fa7a0841-b533-4478-95533-0fde890c3483",
  "consumedDevice": {
    "preAuthSessionId": "kFmkPQEAJtACiT2w/K8fndEuNm+XozJXSZSlWEr+iGs=",
    "failedCodeInputAttemptCount": 2,
    "email": "[email protected]",
    "phoneNumber": "+14155552671"
  }
}

API reference

API schema and response details