Account
Signed-in user account: sign-up, sessions, email verification, password recovery, MFA and preferences.
Signed-in user account: sign-up, sessions, email verification, password recovery, MFA and preferences.
Class Account: 71 methods (71 in @owbase/web, 66 in @owbase/node). The examples use the object form of the parameters; replace the values between < and > with your own.
Get account
GET /account · method page
SDK: @owbase/web and @owbase/node
Get the currently logged in user.
No parameters.
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.get();
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.get();create
Section titled “create”Create account
POST /account · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the /account/verfication route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new account session.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId |
string |
yes | User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars. |
email |
string |
yes | User email. |
password |
string |
yes | New user password. Must be between 8 and 256 chars. |
name |
string |
no | User name. Max length: 128 chars. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.create({ userId: '<USER_ID>', password: 'password', name: '<NAME>', // optional});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.create({ userId: '<USER_ID>', password: 'password', name: '<NAME>', // optional});updateEmail
Section titled “updateEmail”Update email
PATCH /account/email · method page
SDK: @owbase/web and @owbase/node
Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
| Parameter | Type | Required | Description |
|---|---|---|---|
email |
string |
yes | User email. |
password |
string |
yes | User password. Must be at least 8 chars. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updateEmail({ password: 'password',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updateEmail({ password: 'password',});listIdentities
Section titled “listIdentities”List identities
GET /account/identities · method page
SDK: @owbase/web and @owbase/node
Get the list of identities for the currently logged in user.
| Parameter | Type | Required | Description |
|---|---|---|---|
queries |
string[] |
no | Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry |
total |
boolean |
no | When set to false, the total count returned will be 0 and will not be calculated. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.listIdentities({ queries: [], // optional total: false, // optional});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.listIdentities({ queries: [], // optional total: false, // optional});deleteIdentity
Section titled “deleteIdentity”Delete identity
DELETE /account/identities/{identityId} · method page
SDK: @owbase/web and @owbase/node
Delete an identity by its unique ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
identityId |
string |
yes | Identity ID. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.deleteIdentity({ identityId: '<IDENTITY_ID>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.deleteIdentity({ identityId: '<IDENTITY_ID>',});createJWT
Section titled “createJWT”Create JWT
POST /account/jwts · method page
SDK: @owbase/web only
Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Owbase server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.
| Parameter | Type | Required | Description |
|---|---|---|---|
duration |
number |
no | Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createJWT({ duration: 0, // optional});
console.log(result);listMemberships
Section titled “listMemberships”List account memberships
GET /account/memberships · method page
SDK: @owbase/web and @owbase/node
Get the team memberships of the currently logged in user.
| Parameter | Type | Required | Description |
|---|---|---|---|
queries |
string[] |
no | Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles |
total |
boolean |
no | When set to false, the total count returned will be 0 and will not be calculated. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.listMemberships({ queries: [], // optional total: false, // optional});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.listMemberships({ queries: [], // optional total: false, // optional});updateMFA
Section titled “updateMFA”Update MFA
PATCH /account/mfa · method page
SDK: @owbase/web and @owbase/node
Enable or disable MFA on an account.
| Parameter | Type | Required | Description |
|---|---|---|---|
mfa |
boolean |
yes | Enable or disable MFA. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updateMFA({ mfa: false,});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updateMFA({ mfa: false,});createMFAAuthenticator
Section titled “createMFAAuthenticator”Create authenticator
POST /account/mfa/authenticators/{type} · method page
SDK: @owbase/web and @owbase/node
Add an authenticator app to be used as an MFA factor. Verify the authenticator using the verify authenticator method.
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
AuthenticatorType |
yes | Type of authenticator. Must be totp Values: totp. |
Access: user session (the resource’s permissions apply).
import { Client, Account, AuthenticatorType } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createMFAAuthenticator({ type: AuthenticatorType.Totp,});
console.log(result);import { Client, Account, AuthenticatorType } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createMFAAuthenticator({ type: AuthenticatorType.Totp,});createMfaAuthenticator
Section titled “createMfaAuthenticator”Create authenticator
POST /account/mfa/authenticators/{type} · method page
SDK: @owbase/web and @owbase/node
Add an authenticator app to be used as an MFA factor. Verify the authenticator using the verify authenticator method.
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
AuthenticatorType |
yes | Type of authenticator. Must be totp Values: totp. |
Access: user session (the resource’s permissions apply).
No example of its own: see the one for the method that replaces it.
updateMFAAuthenticator
Section titled “updateMFAAuthenticator”Update authenticator (confirmation)
PUT /account/mfa/authenticators/{type} · method page
SDK: @owbase/web and @owbase/node
Verify an authenticator app after adding it using the add authenticator method.
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
AuthenticatorType |
yes | Type of authenticator. Values: totp. |
otp |
string |
yes | Valid verification token. |
Access: user session (the resource’s permissions apply).
import { Client, Account, AuthenticatorType } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updateMFAAuthenticator({ type: AuthenticatorType.Totp, otp: '<OTP>',});
console.log(result);import { Client, Account, AuthenticatorType } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updateMFAAuthenticator({ type: AuthenticatorType.Totp, otp: '<OTP>',});updateMfaAuthenticator
Section titled “updateMfaAuthenticator”Update authenticator (confirmation)
PUT /account/mfa/authenticators/{type} · method page
SDK: @owbase/web and @owbase/node
Verify an authenticator app after adding it using the add authenticator method.
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
AuthenticatorType |
yes | Type of authenticator. Values: totp. |
otp |
string |
yes | Valid verification token. |
Access: user session (the resource’s permissions apply).
No example of its own: see the one for the method that replaces it.
deleteMFAAuthenticator
Section titled “deleteMFAAuthenticator”Delete authenticator
DELETE /account/mfa/authenticators/{type} · method page
SDK: @owbase/web and @owbase/node
Delete an authenticator for a user by ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
AuthenticatorType |
yes | Type of authenticator. Values: totp. |
Access: user session (the resource’s permissions apply).
import { Client, Account, AuthenticatorType } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.deleteMFAAuthenticator({ type: AuthenticatorType.Totp,});
console.log(result);import { Client, Account, AuthenticatorType } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.deleteMFAAuthenticator({ type: AuthenticatorType.Totp,});deleteMfaAuthenticator
Section titled “deleteMfaAuthenticator”Delete authenticator
DELETE /account/mfa/authenticators/{type} · method page
SDK: @owbase/web and @owbase/node
Delete an authenticator for a user by ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
AuthenticatorType |
yes | Type of authenticator. Values: totp. |
Access: user session (the resource’s permissions apply).
No example of its own: see the one for the method that replaces it.
createMFAChallenge
Section titled “createMFAChallenge”Create MFA challenge
POST /account/mfa/challenges · method page
SDK: @owbase/web and @owbase/node
Begin the process of MFA verification after sign-in. Finish the flow with updateMfaChallenge method.
| Parameter | Type | Required | Description |
|---|---|---|---|
factor |
AuthenticationFactor |
yes | Factor used for verification. Must be one of following: email, phone, totp, recoveryCode, custom. Values: email, phone, totp, recoverycode, custom. |
Access: user session (the resource’s permissions apply).
import { Client, Account, AuthenticationFactor } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createMFAChallenge({ factor: AuthenticationFactor.Email,});
console.log(result);import { Client, Account, AuthenticationFactor } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createMFAChallenge({ factor: AuthenticationFactor.Email,});createMfaChallenge
Section titled “createMfaChallenge”Create MFA challenge
POST /account/mfa/challenges · method page
SDK: @owbase/web and @owbase/node
Begin the process of MFA verification after sign-in. Finish the flow with updateMfaChallenge method.
| Parameter | Type | Required | Description |
|---|---|---|---|
factor |
AuthenticationFactor |
yes | Factor used for verification. Must be one of following: email, phone, totp, recoveryCode, custom. Values: email, phone, totp, recoverycode, custom. |
Access: user session (the resource’s permissions apply).
No example of its own: see the one for the method that replaces it.
updateMFAChallenge
Section titled “updateMFAChallenge”Update MFA challenge (confirmation)
PUT /account/mfa/challenges · method page
SDK: @owbase/web and @owbase/node
Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use createMfaChallenge method.
| Parameter | Type | Required | Description |
|---|---|---|---|
challengeId |
string |
yes | ID of the challenge. |
otp |
string |
yes | Valid verification token. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updateMFAChallenge({ challengeId: '<CHALLENGE_ID>', otp: '<OTP>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updateMFAChallenge({ challengeId: '<CHALLENGE_ID>', otp: '<OTP>',});updateMfaChallenge
Section titled “updateMfaChallenge”Update MFA challenge (confirmation)
PUT /account/mfa/challenges · method page
SDK: @owbase/web and @owbase/node
Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use createMfaChallenge method.
| Parameter | Type | Required | Description |
|---|---|---|---|
challengeId |
string |
yes | ID of the challenge. |
otp |
string |
yes | Valid verification token. |
Access: user session (the resource’s permissions apply).
No example of its own: see the one for the method that replaces it.
listMFAFactors
Section titled “listMFAFactors”List factors
GET /account/mfa/factors · method page
SDK: @owbase/web and @owbase/node
List the factors available on the account to be used as a MFA challange.
No parameters.
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.listMFAFactors();
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.listMFAFactors();listMfaFactors
Section titled “listMfaFactors”List factors
GET /account/mfa/factors · method page
SDK: @owbase/web and @owbase/node
List the factors available on the account to be used as a MFA challange.
No parameters.
Access: user session (the resource’s permissions apply).
No example of its own: see the one for the method that replaces it.
getMFARecoveryCodes
Section titled “getMFARecoveryCodes”List MFA recovery codes
GET /account/mfa/recovery-codes · method page
SDK: @owbase/web and @owbase/node
Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using createMfaRecoveryCodes method. An OTP challenge is required to read recovery codes.
No parameters.
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.getMFARecoveryCodes();
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.getMFARecoveryCodes();getMfaRecoveryCodes
Section titled “getMfaRecoveryCodes”List MFA recovery codes
GET /account/mfa/recovery-codes · method page
SDK: @owbase/web and @owbase/node
Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using createMfaRecoveryCodes method. An OTP challenge is required to read recovery codes.
No parameters.
Access: user session (the resource’s permissions apply).
No example of its own: see the one for the method that replaces it.
createMFARecoveryCodes
Section titled “createMFARecoveryCodes”Create MFA recovery codes
POST /account/mfa/recovery-codes · method page
SDK: @owbase/web and @owbase/node
Generate recovery codes as backup for MFA flow. It’s recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in createMfaChallenge method.
No parameters.
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createMFARecoveryCodes();
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createMFARecoveryCodes();createMfaRecoveryCodes
Section titled “createMfaRecoveryCodes”Create MFA recovery codes
POST /account/mfa/recovery-codes · method page
SDK: @owbase/web and @owbase/node
Generate recovery codes as backup for MFA flow. It’s recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in createMfaChallenge method.
No parameters.
Access: user session (the resource’s permissions apply).
No example of its own: see the one for the method that replaces it.
updateMFARecoveryCodes
Section titled “updateMFARecoveryCodes”Update MFA recovery codes (regenerate)
PATCH /account/mfa/recovery-codes · method page
SDK: @owbase/web and @owbase/node
Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using createMfaRecoveryCodes method. An OTP challenge is required to regenreate recovery codes.
No parameters.
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updateMFARecoveryCodes();
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updateMFARecoveryCodes();updateMfaRecoveryCodes
Section titled “updateMfaRecoveryCodes”Update MFA recovery codes (regenerate)
PATCH /account/mfa/recovery-codes · method page
SDK: @owbase/web and @owbase/node
Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using createMfaRecoveryCodes method. An OTP challenge is required to regenreate recovery codes.
No parameters.
Access: user session (the resource’s permissions apply).
No example of its own: see the one for the method that replaces it.
updateName
Section titled “updateName”Update name
PATCH /account/name · method page
SDK: @owbase/web and @owbase/node
Update currently logged in user account name.
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string |
yes | User name. Max length: 128 chars. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updateName({ name: '<NAME>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updateName({ name: '<NAME>',});listPasskeys
Section titled “listPasskeys”List passkeys
GET /account/passkeys · method page
SDK: @owbase/web and @owbase/node
Get the list of verified passkeys registered by the currently logged in user.
| Parameter | Type | Required | Description |
|---|---|---|---|
queries |
string[] |
no | Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter and order on the following attributes: $id, $createdAt, $updatedAt, name, accessedAt |
total |
boolean |
no | When set to false, the total count returned will be 0 and will not be calculated. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.listPasskeys({ queries: [], // optional total: false, // optional});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.listPasskeys({ queries: [], // optional total: false, // optional});createPasskey
Section titled “createPasskey”Create passkey
POST /account/passkeys · method page
SDK: @owbase/web and @owbase/node
Start registering a passkey for the currently logged in user. The session must have signed in or completed an MFA challenge within the last 10 minutes. Pass the returned publicKey options to navigator.credentials.create(), then complete the registration with Update passkey verification. The passkey stays pending until verified, and the challenge expires after 5 minutes.
| Parameter | Type | Required | Description |
|---|---|---|---|
passkeyId |
string |
no | Passkey ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars. |
name |
string |
no | Passkey name, shown when listing passkeys. Max length: 128 chars. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createPasskey({ passkeyId: '<PASSKEY_ID>', // optional name: '<NAME>', // optional});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createPasskey({ passkeyId: '<PASSKEY_ID>', // optional name: '<NAME>', // optional});getPasskey
Section titled “getPasskey”Get passkey
GET /account/passkeys/{passkeyId} · method page
SDK: @owbase/web and @owbase/node
Get a verified passkey of the currently logged in user by its unique ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
passkeyId |
string |
yes | Passkey ID. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.getPasskey({ passkeyId: '<PASSKEY_ID>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.getPasskey({ passkeyId: '<PASSKEY_ID>',});updatePasskey
Section titled “updatePasskey”Update passkey
PATCH /account/passkeys/{passkeyId} · method page
SDK: @owbase/web and @owbase/node
Rename a passkey of the currently logged in user.
| Parameter | Type | Required | Description |
|---|---|---|---|
passkeyId |
string |
yes | Passkey ID. |
name |
string |
yes | Passkey name. Max length: 128 chars. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updatePasskey({ passkeyId: '<PASSKEY_ID>', name: '<NAME>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updatePasskey({ passkeyId: '<PASSKEY_ID>', name: '<NAME>',});deletePasskey
Section titled “deletePasskey”Delete passkey
DELETE /account/passkeys/{passkeyId} · method page
SDK: @owbase/web and @owbase/node
Delete a passkey from the currently logged in user. The passkey can no longer be used to sign in, although it may remain stored on the user’s device. The session must have signed in or completed an MFA challenge within the last 10 minutes.
| Parameter | Type | Required | Description |
|---|---|---|---|
passkeyId |
string |
yes | Passkey ID. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.deletePasskey({ passkeyId: '<PASSKEY_ID>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.deletePasskey({ passkeyId: '<PASSKEY_ID>',});updatePasskeyVerification
Section titled “updatePasskeyVerification”Update passkey verification
PUT /account/passkeys/{passkeyId}/verification · method page
SDK: @owbase/web and @owbase/node
Complete a passkey registration started with Create passkey. Pass the JSON form of the credential returned by navigator.credentials.create(), for example credential.toJSON(). Each registration can be verified once; a failed attempt requires starting it again.
| Parameter | Type | Required | Description |
|---|---|---|---|
passkeyId |
string |
yes | Passkey ID. |
credential |
object |
yes | Registration credential returned by the authenticator, in the JSON form produced by PublicKeyCredential.toJSON(). |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updatePasskeyVerification({ passkeyId: '<PASSKEY_ID>', credential: {},});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updatePasskeyVerification({ passkeyId: '<PASSKEY_ID>', credential: {},});updatePassword
Section titled “updatePassword”Update password
PATCH /account/password · method page
SDK: @owbase/web and @owbase/node
Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.
| Parameter | Type | Required | Description |
|---|---|---|---|
password |
string |
yes | New user password. Must be at least 8 chars. |
oldPassword |
string |
no | Current user password. Max length: 256 chars. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updatePassword({ password: 'password', oldPassword: 'password', // optional});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updatePassword({ password: 'password', oldPassword: 'password', // optional});updatePhone
Section titled “updatePhone”Update phone
PATCH /account/phone · method page
SDK: @owbase/web and @owbase/node
Update the currently logged in user’s phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the POST /account/verification/phone endpoint to send a confirmation SMS.
| Parameter | Type | Required | Description |
|---|---|---|---|
phone |
string |
yes | Phone number. Format this number with a leading ‘+’ and a country code, e.g., +16175551212. |
password |
string |
yes | User password. Must be at least 8 chars. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updatePhone({ phone: '+12065550100', password: 'password',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updatePhone({ phone: '+12065550100', password: 'password',});getPrefs
Section titled “getPrefs”Get account preferences
GET /account/prefs · method page
SDK: @owbase/web and @owbase/node
Get the preferences as a key-value object for the currently logged in user.
No parameters.
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.getPrefs();
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.getPrefs();updatePrefs
Section titled “updatePrefs”Update preferences
PATCH /account/prefs · method page
SDK: @owbase/web and @owbase/node
Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.
| Parameter | Type | Required | Description |
|---|---|---|---|
prefs |
object |
yes | Prefs key-value JSON object. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updatePrefs({ prefs: { language: 'en', timezone: 'UTC', darkTheme: true, },});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updatePrefs({ prefs: { language: 'en', timezone: 'UTC', darkTheme: true, },});createRecovery
Section titled “createRecovery”Create password recovery
POST /account/recovery · method page
SDK: @owbase/web and @owbase/node
Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the PUT /account/recovery endpoint to complete the process. The verification link sent to the user’s email address is valid for 1 hour.
| Parameter | Type | Required | Description |
|---|---|---|---|
email |
string |
yes | User email. |
url |
string |
yes | URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createRecovery({ url: 'https://example.com',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createRecovery({ url: 'https://example.com',});updateRecovery
Section titled “updateRecovery”Update password recovery (confirmation)
PUT /account/recovery · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to complete the user account password reset. Both the userId and secret arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the POST /account/recovery endpoint.
Please note that in order to avoid a Redirect Attack the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
The new password must satisfy the project’s enabled password policies, including custom deny lists. Dictionary entries match the entire password case-sensitively; personal-data terms match substrings case-insensitively. Personal-data validation runs after token verification against the recovered user’s ID, name, email, and phone, closing the previous recovery gap for profile-based checks. A rejected password leaves the existing credentials unchanged and the recovery token usable.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId |
string |
yes | User ID. |
secret |
string |
yes | Valid reset token. |
password |
string |
yes | New user password. Must be between 8 and 256 chars. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updateRecovery({ userId: '<USER_ID>', secret: '<SECRET>', password: 'password',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updateRecovery({ userId: '<USER_ID>', secret: '<SECRET>', password: 'password',});createRecoveryOTP
Section titled “createRecoveryOTP”Create password recovery (OTP)
POST /account/recovery/otp · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to send a 6-digit password recovery code to the user’s email address. Unlike createRecovery, this method requires no redirect URL, which makes it suitable for mobile and desktop apps that cannot host a recovery page. Learn more about how to complete the recovery process. The code sent to the user’s email address is valid for 15 minutes.
Enable the phrase parameter to include a randomly generated security phrase in both the email and the response. Showing that phrase in your app lets the user confirm the email genuinely came from your request, which helps protect against phishing.
| Parameter | Type | Required | Description |
|---|---|---|---|
email |
string |
yes | User email. |
phrase |
boolean |
no | Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createRecoveryOTP({ phrase: false, // optional});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createRecoveryOTP({ phrase: false, // optional});updateRecoveryOTP
Section titled “updateRecoveryOTP”Update password recovery (OTP)
PUT /account/recovery/otp · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to complete the user password recovery process using the 6-digit code that was emailed by createRecoveryOTP. Pass the userId of the user along with the secret code from the email and the new password to set. If confirmed, this route will return a 200 status code, the code is consumed and the user’s password is updated.
The new password must satisfy the project’s enabled password policies, including custom deny lists. Dictionary entries match the entire password case-sensitively; personal-data terms match substrings case-insensitively. Personal-data validation runs after token verification against the recovered user’s ID, name, email, and phone, closing the previous recovery gap for profile-based checks. A rejected password leaves the existing credentials unchanged and the recovery token usable.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId |
string |
yes | User ID. |
secret |
string |
yes | Valid recovery OTP code. |
password |
string |
yes | New user password. Must be between 8 and 256 chars. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updateRecoveryOTP({ userId: '<USER_ID>', secret: '<SECRET>', password: 'password',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updateRecoveryOTP({ userId: '<USER_ID>', secret: '<SECRET>', password: 'password',});listSessions
Section titled “listSessions”List sessions
GET /account/sessions · method page
SDK: @owbase/web and @owbase/node
Get the list of active sessions across different devices for the currently logged in user.
| Parameter | Type | Required | Description |
|---|---|---|---|
total |
boolean |
no | When set to false, the total count returned will be 0 and will not be calculated. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.listSessions({ total: false, // optional});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.listSessions({ total: false, // optional});deleteSessions
Section titled “deleteSessions”Delete sessions
DELETE /account/sessions · method page
SDK: @owbase/web and @owbase/node
Delete all sessions from the user account and remove any sessions cookies from the end client. Pass current as false to keep the session making the request and sign out of every other session.
| Parameter | Type | Required | Description |
|---|---|---|---|
current |
boolean |
no | Delete the current session too. Use false to sign out of every other session while staying signed in on this one. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.deleteSessions({ current: false, // optional});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.deleteSessions({ current: false, // optional});createAnonymousSession
Section titled “createAnonymousSession”Create anonymous session
POST /account/sessions/anonymous · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its email and password or create an OAuth2 session.
No parameters.
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createAnonymousSession();
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createAnonymousSession();createEmailPasswordSession
Section titled “createEmailPasswordSession”Create email password session
POST /account/sessions/email · method page
SDK: @owbase/web and @owbase/node
Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user. Use the optional duration parameter to create a shorter session, for example when the user doesn’t choose “remember me”. It must be at least 60 seconds and cannot exceed the project maximum session length.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
| Parameter | Type | Required | Description |
|---|---|---|---|
email |
string |
yes | User email. |
password |
string |
yes | User password. Must be at least 8 chars. |
duration |
number |
no | Session length in seconds. Minimum is 60 seconds, and it cannot exceed the project maximum session length. Defaults to the project maximum session length. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createEmailPasswordSession({ password: 'password', duration: 60, // optional});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createEmailPasswordSession({ password: 'password', duration: 60, // optional});createIdTokenSession
Section titled “createIdTokenSession”Create ID token session
POST /account/sessions/id-token · method page
SDK: @owbase/web and @owbase/node
Allow the user to login to their account using an OpenID Connect ID token obtained natively from the OAuth2 provider, for example via Google Credential Manager on Android or Sign in with Apple on iOS. No browser or redirect is involved: the ID token is verified against the provider’s published signing keys and a session is created in a single request.
Native sign-in is switched on per provider with its nativeEnabled setting. It is independent of the browser-based flow’s enabled setting, which has no effect on this endpoint. The token’s audience must match the provider’s configured client ID or one of its native client IDs; tokens issued for any other client ID are rejected. For Sign in with Apple, register your app’s bundle ID as a native client ID. For Google, the web client ID used by Credential Manager is usually the configured client ID; add your Android and iOS client IDs as native client IDs if your app requests tokens for them.
Pass the raw nonce used when requesting the ID token so it can be validated against the token’s nonce claim. When signing in with Apple, the nonce is required: hash it with SHA-256 before passing it to the Apple SDK, and send the raw value here - Apple tokens requested without a nonce are rejected. For Google the nonce is optional: it is validated whenever the token carries one, and ignored when the provider issued the token without one. Apple only returns the user’s name on the first authorization, and never inside the ID token - capture it on the client and pass it via the name parameter.
If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the verified email received from the provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.
This flow does not return provider refresh tokens. You may pass an access token the provider handed your client, along with its lifetime, to store it on the session - but Owbase cannot renew it once it expires. If your app needs long-lived access to provider APIs, use the browser-based OAuth2 flow instead.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
| Parameter | Type | Required | Description |
|---|---|---|---|
provider |
IdTokenProvider |
yes | OAuth2 provider that issued the ID token. Currently, supported providers are: apple, google. Values: apple, google. |
idToken |
string |
yes | OpenID Connect ID token (JWT) obtained natively from the provider, for example via Google Credential Manager or Sign in with Apple. |
nonce |
string |
no | Raw nonce used when requesting the ID token. Required for Apple, and whenever the token carries a nonce claim, which must match it. Ignored when the provider issued the token without a nonce. |
accessToken |
string |
no | Provider access token to store alongside the session for calling provider APIs. Never used for authentication. |
accessTokenExpiry |
number |
no | Seconds until the provider access token expires, as reported by the provider. Stored so clients can tell when the stored token goes stale. |
name |
string |
no | User name. Only used when creating a new user and the ID token has no name claim, such as on the first Sign in with Apple authorization. |
Access: no key or session: the project ID is enough.
import { Client, Account, IdTokenProvider } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createIdTokenSession({ provider: IdTokenProvider.Apple, idToken: '<ID_TOKEN>', nonce: '<NONCE>', // optional accessToken: '<ACCESS_TOKEN>', // optional accessTokenExpiry: 0, // optional name: '<NAME>', // optional});
console.log(result);import { Client, Account, IdTokenProvider } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createIdTokenSession({ provider: IdTokenProvider.Apple, idToken: '<ID_TOKEN>', nonce: '<NONCE>', // optional accessToken: '<ACCESS_TOKEN>', // optional accessTokenExpiry: 0, // optional name: '<NAME>', // optional});updateMagicURLSession
Section titled “updateMagicURLSession”Update magic URL session
PUT /account/sessions/magic-url · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to create a session from token. Provide the userId and secret parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId |
string |
yes | User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars. |
secret |
string |
yes | Valid verification token. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updateMagicURLSession({ userId: '<USER_ID>', secret: '<SECRET>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updateMagicURLSession({ userId: '<USER_ID>', secret: '<SECRET>',});createOAuth2Session
Section titled “createOAuth2Session”Create OAuth2 session
GET /account/sessions/oauth2/{provider} · method page
SDK: @owbase/web only
Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Owbase console first. Use the success and failure arguments to provide a redirect URL’s back to your app when login is completed.
If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
| Parameter | Type | Required | Description |
|---|---|---|---|
provider |
OAuthProvider |
yes | OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, kakao, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tiktok, tradeshift, tradeshiftBox, twitch, webflow, wordpress, x, yahoo, yammer, yandex, zoho, zoom. Values: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, kakao, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tiktok, tradeshift, tradeshiftBox, twitch, webflow, wordpress, x, yahoo, yammer, yandex, zoho, zoom. |
success |
string |
no | URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project’s platform list are allowed. This requirement helps to prevent an open redirect attack against your project API. |
failure |
string |
no | URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project’s platform list are allowed. This requirement helps to prevent an open redirect attack against your project API. |
scopes |
string[] |
no | A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. |
state |
string |
no | An opaque value your app generates and keeps, for example in a cookie. It is returned unchanged as the state query parameter on the success and failure URLs, so your app can check that the sign-in it receives is one it started. Printable ASCII only (RFC 6749 Appendix A.5). Max length: 256 chars. |
Access: no key or session: the project ID is enough.
import { Client, Account, OAuthProvider } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
account.createOAuth2Session({ provider: OAuthProvider.Amazon, success: 'https://example.com', // optional failure: 'https://example.com', // optional scopes: [], // optional state: '<STATE>', // optional});updatePhoneSession
Section titled “updatePhoneSession”Update phone session
PUT /account/sessions/phone · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to create a session from token. Provide the userId and secret parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId |
string |
yes | User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars. |
secret |
string |
yes | Valid verification token. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updatePhoneSession({ userId: '<USER_ID>', secret: '<SECRET>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updatePhoneSession({ userId: '<USER_ID>', secret: '<SECRET>',});createSession
Section titled “createSession”Create session
POST /account/sessions/token · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to create a session from token. Provide the userId and secret parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId |
string |
yes | User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars. |
secret |
string |
yes | Secret of a token generated by login methods. For example, the createMagicURLToken or createPhoneToken methods. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createSession({ userId: '<USER_ID>', secret: '<SECRET>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createSession({ userId: '<USER_ID>', secret: '<SECRET>',});getSession
Section titled “getSession”Get session
GET /account/sessions/{sessionId} · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to get a logged in user’s session using a Session ID. Inputting ‘current’ will return the current session being used.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId |
string |
yes | Session ID. Use the string ‘current’ to get the current device session. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.getSession({ sessionId: '<SESSION_ID>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.getSession({ sessionId: '<SESSION_ID>',});updateSession
Section titled “updateSession”Update session
PATCH /account/sessions/{sessionId} · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to extend a session’s length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId |
string |
yes | Session ID. Use the string ‘current’ to update the current device session. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updateSession({ sessionId: '<SESSION_ID>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updateSession({ sessionId: '<SESSION_ID>',});deleteSession
Section titled “deleteSession”Delete session
DELETE /account/sessions/{sessionId} · method page
SDK: @owbase/web and @owbase/node
Logout the user. Use ‘current’ as the session ID to logout on this device, use a session ID to logout on another device. If you’re looking to logout the user on all devices, use Delete Sessions instead.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId |
string |
yes | Session ID. Use the string ‘current’ to delete the current device session. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.deleteSession({ sessionId: '<SESSION_ID>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.deleteSession({ sessionId: '<SESSION_ID>',});updateStatus
Section titled “updateStatus”Update status
PATCH /account/status · method page
SDK: @owbase/web and @owbase/node
Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.
No parameters.
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updateStatus();
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updateStatus();createPushTarget
Section titled “createPushTarget”Create push target
POST /account/targets/push · method page
SDK: @owbase/web only
Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model. A session holds one push target per provider, so if one already exists this endpoint updates and returns that target instead of creating a second one, and a device that rotates its token is never notified twice.
| Parameter | Type | Required | Description |
|---|---|---|---|
targetId |
string |
yes | Target ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars. |
identifier |
string |
yes | The target identifier (token, email, phone etc.) |
providerId |
string |
no | Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used. |
bundleId |
string |
no | App bundle ID of the device registering an APNs token. Without providerId, routes the target to the enabled APNs provider for this bundle ID and environment. |
environment |
string |
no | APNs environment the token belongs to, sandbox or production. Used with bundleId. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createPushTarget({ targetId: '<TARGET_ID>', identifier: '<IDENTIFIER>', providerId: '<PROVIDER_ID>', // optional bundleId: '<BUNDLE_ID>', // optional environment: 'sandbox', // optional});
console.log(result);updatePushTarget
Section titled “updatePushTarget”Update push target
PUT /account/targets/{targetId}/push · method page
SDK: @owbase/web only
Update the currently logged in user’s push notification target. You can modify the target’s identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.
| Parameter | Type | Required | Description |
|---|---|---|---|
targetId |
string |
yes | Target ID. |
identifier |
string |
yes | The target identifier (token, email, phone etc.) |
bundleId |
string |
no | App bundle ID of the device registering an APNs token. Routes an APNs target to the enabled APNs provider for this bundle ID and environment. |
environment |
string |
no | APNs environment the token belongs to, sandbox or production. Used with bundleId. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updatePushTarget({ targetId: '<TARGET_ID>', identifier: '<IDENTIFIER>', bundleId: '<BUNDLE_ID>', // optional environment: 'sandbox', // optional});
console.log(result);deletePushTarget
Section titled “deletePushTarget”Delete push target
DELETE /account/targets/{targetId}/push · method page
SDK: @owbase/web only
Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.
| Parameter | Type | Required | Description |
|---|---|---|---|
targetId |
string |
yes | Target ID. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.deletePushTarget({ targetId: '<TARGET_ID>',});
console.log(result);createEmailToken
Section titled “createEmailToken”Create email token (OTP)
POST /account/tokens/email · method page
SDK: @owbase/web and @owbase/node
Sends the user an email with a secret key for creating a session. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the POST /v1/account/sessions/token endpoint to complete the login process. The secret sent to the user’s email is valid for 15 minutes.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId |
string |
yes | User ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. |
email |
string |
yes | User email. |
phrase |
boolean |
no | Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createEmailToken({ userId: '<USER_ID>', phrase: false, // optional});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createEmailToken({ userId: '<USER_ID>', phrase: false, // optional});createMagicURLToken
Section titled “createMagicURLToken”Create magic URL token
POST /account/tokens/magic-url · method page
SDK: @owbase/web and @owbase/node
Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the POST /v1/account/sessions/token endpoint to complete the login process. The link sent to the user’s email address is valid for 1 hour.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId |
string |
yes | Unique Id. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. |
email |
string |
yes | User email. |
url |
string |
no | URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API. |
phrase |
boolean |
no | Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createMagicURLToken({ userId: '<USER_ID>', url: 'https://example.com', // optional phrase: false, // optional});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createMagicURLToken({ userId: '<USER_ID>', url: 'https://example.com', // optional phrase: false, // optional});createOAuth2Token
Section titled “createOAuth2Token”Create OAuth2 token
GET /account/tokens/oauth2/{provider} · method page
SDK: @owbase/web and @owbase/node
Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Owbase console first. Use the success and failure arguments to provide a redirect URL’s back to your app when login is completed.
If authentication succeeds, userId and secret of a token will be appended to the success URL as query parameters. These can be used to create a new session using the Create session endpoint.
If there is already an active session, the OAuth2 identity is attached to the logged-in account and that session stays active until the token is exchanged for a new one.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
| Parameter | Type | Required | Description |
|---|---|---|---|
provider |
OAuthProvider |
yes | OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, kakao, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tiktok, tradeshift, tradeshiftBox, twitch, webflow, wordpress, x, yahoo, yammer, yandex, zoho, zoom. Values: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, kakao, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tiktok, tradeshift, tradeshiftBox, twitch, webflow, wordpress, x, yahoo, yammer, yandex, zoho, zoom. |
success |
string |
no | URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project’s platform list are allowed. This requirement helps to prevent an open redirect attack against your project API. |
failure |
string |
no | URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project’s platform list are allowed. This requirement helps to prevent an open redirect attack against your project API. |
scopes |
string[] |
no | A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. |
state |
string |
no | An opaque value your app generates and keeps, for example in a cookie. It is returned unchanged as the state query parameter on the success and failure URLs, so your app can check that the sign-in it receives is one it started. Printable ASCII only (RFC 6749 Appendix A.5). Max length: 256 chars. |
Access: no key or session: the project ID is enough.
import { Client, Account, OAuthProvider } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
account.createOAuth2Token({ provider: OAuthProvider.Amazon, success: 'https://example.com', // optional failure: 'https://example.com', // optional scopes: [], // optional state: '<STATE>', // optional});import { Client, Account, OAuthProvider } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createOAuth2Token({ provider: OAuthProvider.Amazon, success: 'https://example.com', // optional failure: 'https://example.com', // optional scopes: [], // optional state: '<STATE>', // optional});createPasskeyToken
Section titled “createPasskeyToken”Create passkey token
POST /account/tokens/passkey · method page
SDK: @owbase/web and @owbase/node
Start signing in with a passkey. No email or user ID is needed: pass the returned publicKey options to navigator.credentials.get() and the user picks one of their passkeys. Then call Update passkey token with the credential to receive a token, and exchange it with Create session. The challenge expires after 5 minutes.
No parameters.
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createPasskeyToken();
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createPasskeyToken();updatePasskeyToken
Section titled “updatePasskeyToken”Update passkey token
PUT /account/tokens/passkey · method page
SDK: @owbase/web and @owbase/node
Complete a passkey sign-in started with Create passkey token. Pass the challenge ID and the JSON form of the credential returned by navigator.credentials.get(), for example credential.toJSON(). The returned token includes its secret and expires after 1 minute: exchange it for a session with Create session. Passkeys require user verification, so the session also satisfies MFA. Each challenge can only be used once.
| Parameter | Type | Required | Description |
|---|---|---|---|
challengeId |
string |
yes | Challenge ID returned by createPasskeyToken. |
credential |
object |
yes | Authentication credential returned by the authenticator, in the JSON form produced by PublicKeyCredential.toJSON(). |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updatePasskeyToken({ challengeId: '<CHALLENGE_ID>', credential: {},});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updatePasskeyToken({ challengeId: '<CHALLENGE_ID>', credential: {},});createPhoneToken
Section titled “createPhoneToken”Create phone token
POST /account/tokens/phone · method page
SDK: @owbase/web and @owbase/node
Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the POST /v1/account/sessions/token endpoint to complete the login process. The secret sent to the user’s phone is valid for 15 minutes.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId |
string |
yes | Unique Id. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can’t start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored. |
phone |
string |
yes | Phone number. Format this number with a leading ‘+’ and a country code, e.g., +16175551212. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createPhoneToken({ userId: '<USER_ID>', phone: '+12065550100',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createPhoneToken({ userId: '<USER_ID>', phone: '+12065550100',});createEmailVerification
Section titled “createEmailVerification”Create email verification
POST /account/verifications/email · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the userId and secret arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the userId and secret parameters. Learn more about how to complete the verification process. The verification link sent to the user’s email address is valid for 7 days.
Please note that in order to avoid a Redirect Attack, the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
| Parameter | Type | Required | Description |
|---|---|---|---|
url |
string |
yes | URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createEmailVerification({ url: 'https://example.com',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createEmailVerification({ url: 'https://example.com',});createVerification
Section titled “createVerification”Create email verification
POST /account/verifications/email · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the userId and secret arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the userId and secret parameters. Learn more about how to complete the verification process. The verification link sent to the user’s email address is valid for 7 days.
Please note that in order to avoid a Redirect Attack, the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
| Parameter | Type | Required | Description |
|---|---|---|---|
url |
string |
yes | URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createVerification({ url: 'https://example.com',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createVerification({ url: 'https://example.com',});updateEmailVerification
Section titled “updateEmailVerification”Update email verification (confirmation)
PUT /account/verifications/email · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to complete the user email verification process. Use both the userId and secret parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId |
string |
yes | User ID. |
secret |
string |
yes | Valid verification token. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updateEmailVerification({ userId: '<USER_ID>', secret: '<SECRET>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updateEmailVerification({ userId: '<USER_ID>', secret: '<SECRET>',});updateVerification
Section titled “updateVerification”Update email verification (confirmation)
PUT /account/verifications/email · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to complete the user email verification process. Use both the userId and secret parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId |
string |
yes | User ID. |
secret |
string |
yes | Valid verification token. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updateVerification({ userId: '<USER_ID>', secret: '<SECRET>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updateVerification({ userId: '<USER_ID>', secret: '<SECRET>',});createEmailVerificationOTP
Section titled “createEmailVerificationOTP”Create email verification (OTP)
POST /account/verifications/email/otp · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to send a 6-digit verification code to the currently logged in user’s email address. Unlike createEmailVerification, this method requires no redirect URL, which makes it suitable for mobile and desktop apps that cannot host a verification page. Learn more about how to complete the verification process. The code sent to the user’s email address is valid for 15 minutes.
Enable the phrase parameter to include a randomly generated security phrase in both the email and the response. Showing that phrase in your app lets the user confirm the email genuinely came from your request, which helps protect against phishing.
| Parameter | Type | Required | Description |
|---|---|---|---|
phrase |
boolean |
no | Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. |
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createEmailVerificationOTP({ phrase: false, // optional});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createEmailVerificationOTP({ phrase: false, // optional});updateEmailVerificationOTP
Section titled “updateEmailVerificationOTP”Update email verification (OTP)
PUT /account/verifications/email/otp · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to complete the user email verification process using the 6-digit code that was emailed by createEmailVerificationOTP. Pass the userId of the user being verified along with the secret code from the email. If confirmed, this route will return a 200 status code and the code is consumed.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId |
string |
yes | User ID. |
secret |
string |
yes | Valid verification OTP code. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updateEmailVerificationOTP({ userId: '<USER_ID>', secret: '<SECRET>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updateEmailVerificationOTP({ userId: '<USER_ID>', secret: '<SECRET>',});createPhoneVerification
Section titled “createPhoneVerification”Create phone verification
POST /account/verifications/phone · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user’s phone number using the accountUpdatePhone endpoint. Learn more about how to complete the verification process. The verification code sent to the user’s phone number is valid for 15 minutes.
No parameters.
Access: user session (the resource’s permissions apply).
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createPhoneVerification();
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createPhoneVerification();updatePhoneVerification
Section titled “updatePhoneVerification”Update phone verification (confirmation)
PUT /account/verifications/phone · method page
SDK: @owbase/web and @owbase/node
Use this endpoint to complete the user phone verification process. Use the userId and secret that were sent to your user’s phone number to verify the user email ownership. If confirmed this route will return a 200 status code.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId |
string |
yes | User ID. |
secret |
string |
yes | Valid verification token. |
Access: no key or session: the project ID is enough.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.updatePhoneVerification({ userId: '<USER_ID>', secret: '<SECRET>',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.updatePhoneVerification({ userId: '<USER_ID>', secret: '<SECRET>',});The descriptions on this page come from the server API specification (BSD-3-Clause license), and the examples come from the SDK generator (MIT license). The full notices are in the NOTICE file of the @owbase/web and @owbase/node packages.