POST
/
users
/
{userID}
/
challenges
Create a challenge for a user
curl --request POST \
  --url https://backendapi.corbado.io/v2/users/{userID}/challenges \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "challengeType": "email_otp",
  "identifierValue": "jane@doe.com",
  "challengeMetadata": {
    "city": "Munich"
  },
  "lifetimeSeconds": 300,
  "clientInformation": {
    "remoteAddress": "::ffff:172.18.0.1",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36",
    "clientEnvHandle": "<string>",
    "javascriptFingerprint": "<string>",
    "javaScriptHighEntropy": {
      "platform": "<string>",
      "platformVersion": "<string>",
      "mobile": true
    },
    "bluetoothAvailable": true,
    "passwordManagerAvailable": true,
    "userVerifyingPlatformAuthenticatorAvailable": true,
    "conditionalMediationAvailable": true,
    "privateMode": true,
    "parsedDeviceInfo": {
      "browserName": "<string>",
      "browserVersion": "<string>",
      "osName": "<string>",
      "osVersion": "<string>"
    },
    "nativeMeta": {
      "build": "<string>",
      "deviceOwnerAuth": "<string>",
      "isPlatformAuthenticatorAPISupported": true,
      "isBluetoothAvailable": true,
      "isBluetoothOn": true,
      "googlePlayServices": true,
      "deviceSecure": true
    }
  }
}'
{
  "challengeID": "<string>",
  "type": "email_otp",
  "identifierValue": "<string>",
  "value": "<string>",
  "expires": 123,
  "status": "pending"
}

Authorizations

Authorization
string
header
required

Basic authentication is used to authenticate requests to the Backend API. The username is the project ID and the password is the API secret.

The project ID and API secret can be found in the Developer Panel.

Path Parameters

userID
string
required

Unique identifier of the user. Format: usr-<number>.

Example:

"usr-4693224802260150919"

Body

application/json
challengeType
enum<string>
required
Available options:
email_otp,
email_link,
sms_otp
identifierValue
string
required
Example:

"jane@doe.com"

clientInformation
object
required
challengeMetadata
object
Example:
{ "city": "Munich" }
lifetimeSeconds
integer
Example:

300

Response

Challenge has been created.

challengeID
string
required
type
enum<string>
required
Available options:
email_otp,
email_link,
sms_otp
identifierValue
string
required
value
string
required
expires
integer
required
status
enum<string>
required
Available options:
pending,
completed,
expired