Docs
Search
⌃K

User Authentication Methods

This page provides information about the three authentication methods we support: wallet, sms, email.
Ratio user accounts are accessible across a wide variety of applications. You must implement Account Linking so that existing Ratio users can link your application to their account and bypass onboarding

Crypto wallet

post
https://api.ratio.me
/v1/auth/cryptoWallet:start
Start a crypto wallet authentication flow
Request
Response
{
"walletAddress": "0x0000000000000000000000000000000000000000",
"walletNetwork": "ETHEREUM"
}
{
"challenge": "Signing in with Ratio: pUQikKqqBq1brTwt1oHhUJwlOTfshzfMEAsJaH7x1MOdN7QMOooFfj-Aujmi7sb0wJnvYqtmZtlszKdH"
}
cURL
curl --location -g --request POST 'https://api.ratio.me/v1/auth/cryptoWallet:start' \
--header 'ratio-client-id: <YOUR_CLIENT_ID>' \
--header 'ratio-client-secret: <YOUR_CLIENT_SECRET>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
"walletAddress": "<WALLET_ADDRESS>",
"walletNetwork": "<ETHEREUM_OR_POLYGON>"
}'
post
https://api.ratio.me
/v1/auth/cryptoWallet:authenticate
Authenticate a user's crypto wallet
Request
Response
{
"walletAddress": "0x0000000000000000000000000000000000000000",
"walletNetwork": "ETHEREUM",
"signature": "2djd2cFZ9VU2zDWvUGqeHwvbiJZfTt3BMzDctDsEW7vM2QUTgTHjeM2rpFX9ZULeic3KptUh5ehipXDFcK5ecYiX"
}
{
"sessionJwt": "eyJhbG.....",
"userMask": {
"id": "00000000-0000-0000-0000-000000000000",
"createTime": "2022-01-01T00:00:00.000Z",
"updateTime": "2022-01-01T23:59:59.999Z",
"phoneMask": "0000",
"preferredMfaMethod": "OTP_SMS"
}
}
cURL
curl --location -g --request POST 'https://api.ratio.me/v1/auth/cryptoWallet:authenticate' \
--header 'ratio-client-id: <YOUR_CLIENT_ID>' \
--header 'ratio-client-secret: <YOUR_CLIENT_SECRET>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
"walletAddress": "<WALLET_ADDRESS>",
"walletNetwork": "<ETHEREUM_OR_POLYGON>",
"signature": "<SIGNED_CHALLENGE_STRING>"
}'
post
https://api.ratio.me
/v1/auth/cryptoWallet:addToUser
Adds an unverified crypto wallet to a user. A crypto wallet remains unverified until the user authenticates it.
Request
Response
{
"walletAddress": "0x0000000000000000000000000000000000000000",
"walletNetwork": "ETHEREUM",
}
{}
cURL
curl --location -g --request POST 'https://api.ratio.me/v1/auth/cryptoWallet:addToUser' \
--header 'ratio-client-id: <YOUR_CLIENT_ID>' \
--header 'ratio-client-secret: <YOUR_CLIENT_SECRET>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
"walletAddress": "<WALLET_ADDRESS>",
"walletNetwork": "<ETHEREUM_OR_POLYGON>",
}'

SMS OTP

post
https://api.ratio.me
/v1/auth/otp/sms:send
Send an SMS OTP to the user
post
https://api.ratio.me
/v1/auth/otp/sms:authenticate
Authenticate a user with an SMS OTP
Request
Response
{
"phoneNumber": "+14165551234",
}
{
"phoneId": "phone-number-test-01234abc-0000-0000-0000-0123456789",
"phoneMask": "1234"
}
cURL
curl --location --request POST 'https://api.ratio.me/v1/auth/otp/sms:send' \
--header 'Authorization: Bearer eyJ......' \
--header 'ratio-client-id: <YOUR_CLIENT_ID>' \
--header 'ratio-client-secret: <YOUR_CLIENT_SECRET>' \
--header 'Content-Type: application/json' \
--data-raw '{
"phoneNumber": "+14165551234"
}'

Email OTP

post
https://api.ratio.me
/v1/auth/otp/email:send
Send an Email OTP to the user
post
https://api.ratio.me
/v1/auth/otp/email:authenticate
Authenticate a user with an Email OTP
Request
Response
{
"emailAddress": "[email protected]"
}
{
"emailId": "email-test-01234abc-0000-0000-0000-0123456789",
"emailMask": "[email protected]"
}
cURL
curl --location --request POST 'https://api.ratio.me/v1/auth/otp/email:send' \
--header 'ratio-client-id: <YOUR_CLIENT_ID>' \
--header 'ratio-client-secret: <YOUR_CLIENT_SECRET>' \
--header 'Content-Type: application/json' \
--data-raw '{
"emailAddress":"[email protected]"
}'