Skip to content
v2.7

Users

Project users from the server: create, search, block, labels and sessions.

Project users from the server: create, search, block, labels and sessions.

Class Users: 53 methods (0 in @owbase/web, 53 in @owbase/node). The examples use the object form of the parameters; replace the values between < and > with your own.

List users

GET /users · method page

SDK: @owbase/node only

Get a list of all the project’s users. You can use the query params to filter your results.

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: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, passwordPwned, labels, impersonator, accessedAt
search string no Search term to filter your list results. Max length: 256 chars.
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Access: API key with the users.read scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.list({
queries: [], // optional
search: '<SEARCH>', // optional
total: false, // optional
});

Create user

POST /users · method page

SDK: @owbase/node only

Create a new user.

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 no User email.
phone string no Phone number. Format this number with a leading ‘+’ and a country code, e.g., +16175551212.
password string no Plain text user password. Must be at least 8 chars.
name string no User name. Max length: 128 chars.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.create({
userId: '<USER_ID>',
email: '[email protected]', // optional
phone: '+12065550100', // optional
password: 'password', // optional
name: '<NAME>', // optional
});

Create user with Argon2 password

POST /users/argon2 · method page

SDK: @owbase/node only

Create a new user. Password provided must be hashed with the Argon2 algorithm. Use the POST /users endpoint to create users with a plain text password.

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 User password hashed using Argon2.
name string no User name. Max length: 128 chars.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.createArgon2User({
userId: '<USER_ID>',
password:
'$argon2id$v=19$m=65536,t=4,p=1$NC8xaW1CVXlIZXFSQi9FRg$0bd4pLo1ytyqvCwl5NSijpm5OIe8J6CjZ1vFemKAg+o',
name: '<NAME>', // optional
});

Create user with bcrypt password

POST /users/bcrypt · method page

SDK: @owbase/node only

Create a new user. Password provided must be hashed with the Bcrypt algorithm. Use the POST /users endpoint to create users with a plain text password.

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 User password hashed using Bcrypt.
name string no User name. Max length: 128 chars.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.createBcryptUser({
userId: '<USER_ID>',
password: '$2y$10$vBiMe4NOvlbYL1iJUNdqkO.QJy17fvslZQ5oiqKq1G4uwyRWvdrXC',
name: '<NAME>', // optional
});

List identities

GET /users/identities · method page

SDK: @owbase/node only

Get identities for all users.

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
search string no Search term to filter your list results. Max length: 256 chars.
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Access: API key with the users.read scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.listIdentities({
queries: [], // optional
search: '<SEARCH>', // optional
total: false, // optional
});

Delete identity

DELETE /users/identities/{identityId} · method page

SDK: @owbase/node only

Delete an identity by its unique ID.

Parameter Type Required Description
identityId string yes Identity ID.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.deleteIdentity({
identityId: '<IDENTITY_ID>',
});

Create user with MD5 password

POST /users/md5 · method page

SDK: @owbase/node only

Create a new user. Password provided must be hashed with the MD5 algorithm. Use the POST /users endpoint to create users with a plain text password.

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 User password hashed using MD5.
name string no User name. Max length: 128 chars.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.createMD5User({
userId: '<USER_ID>',
password: 'password',
name: '<NAME>', // optional
});

Create user with PHPass password

POST /users/phpass · method page

SDK: @owbase/node only

Create a new user. Password provided must be hashed with the PHPass algorithm. Use the POST /users endpoint to create users with a plain text password.

Parameter Type Required Description
userId string yes User ID. Choose a custom ID or pass the string ID.unique()to auto generate it. 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 User password hashed using PHPass.
name string no User name. Max length: 128 chars.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.createPHPassUser({
userId: '<USER_ID>',
password: '$P$BrOEFP1YR5W1yHpvvGuoeVUDPmw9ra/',
name: '<NAME>', // optional
});

Create user with Scrypt password

POST /users/scrypt · method page

SDK: @owbase/node only

Create a new user. Password provided must be hashed with the Scrypt algorithm. Use the POST /users endpoint to create users with a plain text password.

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 User password hashed using Scrypt.
passwordSalt string yes Optional salt used to hash password.
passwordCpu number yes Optional CPU cost used to hash password. Must be a power of two, at most 65536.
passwordMemory number yes Optional memory cost used to hash password. Maximum is 16.
passwordParallel number yes Optional parallelization cost used to hash password. Maximum is 4.
passwordLength number yes Optional hash length used to hash password. Must be between 16 and 128.
name string no User name. Max length: 128 chars.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.createScryptUser({
userId: '<USER_ID>',
password: 'password',
passwordSalt: '<PASSWORD_SALT>',
passwordCpu: 8,
passwordMemory: 14,
passwordParallel: 1,
passwordLength: 64,
name: '<NAME>', // optional
});

Create user with Scrypt modified password

POST /users/scrypt-modified · method page

SDK: @owbase/node only

Create a new user. Password provided must be hashed with the Scrypt Modified algorithm. Use the POST /users endpoint to create users with a plain text password.

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 User password hashed using Scrypt Modified.
passwordSalt string yes Salt used to hash password.
passwordSaltSeparator string yes Salt separator used to hash password.
passwordSignerKey string yes Signer key used to hash password.
name string no User name. Max length: 128 chars.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.createScryptModifiedUser({
userId: '<USER_ID>',
password: 'password',
passwordSalt: '<PASSWORD_SALT>',
passwordSaltSeparator: '<PASSWORD_SALT_SEPARATOR>',
passwordSignerKey: '<PASSWORD_SIGNER_KEY>',
name: '<NAME>', // optional
});

Create user with SHA password

POST /users/sha · method page

SDK: @owbase/node only

Create a new user. Password provided must be hashed with the SHA algorithm. Use the POST /users endpoint to create users with a plain text password.

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 User password hashed using SHA.
passwordVersion PasswordHash no Optional SHA version used to hash password. Allowed values are: ‘sha1’, ‘sha224’, ‘sha256’, ‘sha384’, ‘sha512/224’, ‘sha512/256’, ‘sha512’, ‘sha3-224’, ‘sha3-256’, ‘sha3-384’, ‘sha3-512’ Values: sha1, sha224, sha256, sha384, sha512/224, sha512/256, sha512, sha3-224, sha3-256, sha3-384, sha3-512.
name string no User name. Max length: 128 chars.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users, PasswordHash } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.createSHAUser({
userId: '<USER_ID>',
password: 'password',
passwordVersion: PasswordHash.Sha1, // optional
name: '<NAME>', // optional
});

Get user

GET /users/{userId} · method page

SDK: @owbase/node only

Get a user by its unique ID.

Parameter Type Required Description
userId string yes User ID.

Access: API key with the users.read scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.get({
userId: '<USER_ID>',
});

Delete user

DELETE /users/{userId} · method page

SDK: @owbase/node only

Delete a user by its unique ID, thereby releasing it’s ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the updateStatus endpoint instead.

Parameter Type Required Description
userId string yes User ID.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.delete({
userId: '<USER_ID>',
});

Update email

PATCH /users/{userId}/email · method page

SDK: @owbase/node only

Update the user email by its unique ID.

Parameter Type Required Description
userId string yes User ID.
email string yes User email.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.updateEmail({
userId: '<USER_ID>',
});

Update user impersonator capability

PATCH /users/{userId}/impersonator · method page

SDK: @owbase/node only

Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data. Account endpoints are read-only while impersonating: they report the target’s account, and anything that would change it is refused, so an impersonator cannot alter the target’s credentials or delete their account.

Parameter Type Required Description
userId string yes User ID.
impersonator boolean yes Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.updateImpersonator({
userId: '<USER_ID>',
impersonator: false,
});

Create user JWT

POST /users/{userId}/jwts · method page

SDK: @owbase/node only

Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.

Parameter Type Required Description
userId string yes User ID.
sessionId string no Session ID. Use the string ‘recent()’ to use the most recent session, which is also the default.
duration number no Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.createJWT({
userId: '<USER_ID>',
sessionId: 'recent()', // optional
duration: 0, // optional
});

Update user labels

PUT /users/{userId}/labels · method page

SDK: @owbase/node only

Update the user labels by its unique ID.

Labels can be used to grant access to resources. While teams are a way for user’s to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the Permissions docs for more info.

Parameter Type Required Description
userId string yes User ID.
labels string[] yes Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.updateLabels({
userId: '<USER_ID>',
labels: ['subscriber'],
});

List user memberships

GET /users/{userId}/memberships · method page

SDK: @owbase/node only

Get the user membership list by its unique ID.

Parameter Type Required Description
userId string yes User ID.
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
search string no Search term to filter your list results. Max length: 256 chars.
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Access: API key with the users.read scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.listMemberships({
userId: '<USER_ID>',
queries: [], // optional
search: '<SEARCH>', // optional
total: false, // optional
});

Update MFA

PATCH /users/{userId}/mfa · method page

SDK: @owbase/node only

Enable or disable MFA on a user account.

Parameter Type Required Description
userId string yes User ID.
mfa boolean yes Enable or disable MFA.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.updateMFA({
userId: '<USER_ID>',
mfa: false,
});

Update MFA

PATCH /users/{userId}/mfa · method page

SDK: @owbase/node only

Enable or disable MFA on a user account.

Parameter Type Required Description
userId string yes User ID.
mfa boolean yes Enable or disable MFA.

Access: API key with the users.write scope.

No example of its own: see the one for the method that replaces it.

Delete authenticator

DELETE /users/{userId}/mfa/authenticators/{type} · method page

SDK: @owbase/node only

Delete an authenticator app.

Parameter Type Required Description
userId string yes User ID.
type AuthenticatorType yes Type of authenticator. Values: totp.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users, AuthenticatorType } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.deleteMFAAuthenticator({
userId: '<USER_ID>',
type: AuthenticatorType.Totp,
});

Delete authenticator

DELETE /users/{userId}/mfa/authenticators/{type} · method page

SDK: @owbase/node only

Delete an authenticator app.

Parameter Type Required Description
userId string yes User ID.
type AuthenticatorType yes Type of authenticator. Values: totp.

Access: API key with the users.write scope.

No example of its own: see the one for the method that replaces it.

Get MFA challenge

GET /users/{userId}/mfa/challenges/{challengeId} · method page

SDK: @owbase/node only

Get a custom MFA challenge for a user, including the code to be delivered through your own channel.

Parameter Type Required Description
userId string yes User ID.
challengeId string yes ID of the challenge.

Access: API key with the users.read scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.getMFAChallenge({
userId: '<USER_ID>',
challengeId: '<CHALLENGE_ID>',
});

List factors

GET /users/{userId}/mfa/factors · method page

SDK: @owbase/node only

List the factors available on the account to be used as a MFA challange.

Parameter Type Required Description
userId string yes User ID.

Access: API key with the users.read scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.listMFAFactors({
userId: '<USER_ID>',
});

List factors

GET /users/{userId}/mfa/factors · method page

SDK: @owbase/node only

List the factors available on the account to be used as a MFA challange.

Parameter Type Required Description
userId string yes User ID.

Access: API key with the users.read scope.

No example of its own: see the one for the method that replaces it.

Get MFA recovery codes

GET /users/{userId}/mfa/recovery-codes · method page

SDK: @owbase/node only

Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using createMfaRecoveryCodes method.

Parameter Type Required Description
userId string yes User ID.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.getMFARecoveryCodes({
userId: '<USER_ID>',
});

Get MFA recovery codes

GET /users/{userId}/mfa/recovery-codes · method page

SDK: @owbase/node only

Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using createMfaRecoveryCodes method.

Parameter Type Required Description
userId string yes User ID.

Access: API key with the users.write scope.

No example of its own: see the one for the method that replaces it.

Update MFA recovery codes (regenerate)

PUT /users/{userId}/mfa/recovery-codes · method page

SDK: @owbase/node only

Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using createMfaRecoveryCodes method.

Parameter Type Required Description
userId string yes User ID.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.updateMFARecoveryCodes({
userId: '<USER_ID>',
});

Update MFA recovery codes (regenerate)

PUT /users/{userId}/mfa/recovery-codes · method page

SDK: @owbase/node only

Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using createMfaRecoveryCodes method.

Parameter Type Required Description
userId string yes User ID.

Access: API key with the users.write scope.

No example of its own: see the one for the method that replaces it.

Create MFA recovery codes

PATCH /users/{userId}/mfa/recovery-codes · method page

SDK: @owbase/node only

Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in createMfaChallenge method by client SDK.

Parameter Type Required Description
userId string yes User ID.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.createMFARecoveryCodes({
userId: '<USER_ID>',
});

Create MFA recovery codes

PATCH /users/{userId}/mfa/recovery-codes · method page

SDK: @owbase/node only

Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in createMfaChallenge method by client SDK.

Parameter Type Required Description
userId string yes User ID.

Access: API key with the users.write scope.

No example of its own: see the one for the method that replaces it.

Update name

PATCH /users/{userId}/name · method page

SDK: @owbase/node only

Update the user name by its unique ID.

Parameter Type Required Description
userId string yes User ID.
name string yes User name. Max length: 128 chars.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.updateName({
userId: '<USER_ID>',
name: '<NAME>',
});

List user passkeys

GET /users/{userId}/passkeys · method page

SDK: @owbase/node only

Get the list of verified passkeys registered by a user.

Parameter Type Required Description
userId string yes User ID.
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: API key with the users.read scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.listPasskeys({
userId: '<USER_ID>',
queries: [], // optional
total: false, // optional
});

Get user passkey

GET /users/{userId}/passkeys/{passkeyId} · method page

SDK: @owbase/node only

Get a verified passkey of a user by its unique ID.

Parameter Type Required Description
userId string yes User ID.
passkeyId string yes Passkey ID.

Access: API key with the users.read scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.getPasskey({
userId: '<USER_ID>',
passkeyId: '<PASSKEY_ID>',
});

Update user passkey

PATCH /users/{userId}/passkeys/{passkeyId} · method page

SDK: @owbase/node only

Rename a passkey of a user.

Parameter Type Required Description
userId string yes User ID.
passkeyId string yes Passkey ID.
name string yes Passkey name. Max length: 128 chars.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.updatePasskey({
userId: '<USER_ID>',
passkeyId: '<PASSKEY_ID>',
name: '<NAME>',
});

Delete user passkey

DELETE /users/{userId}/passkeys/{passkeyId} · method page

SDK: @owbase/node only

Delete a passkey from a user, for example when a device is lost. The passkey can no longer be used to sign in.

Parameter Type Required Description
userId string yes User ID.
passkeyId string yes Passkey ID.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.deletePasskey({
userId: '<USER_ID>',
passkeyId: '<PASSKEY_ID>',
});

Update password

PATCH /users/{userId}/password · method page

SDK: @owbase/node only

Update the user password by its unique ID.

Parameter Type Required Description
userId string yes User ID.
password string yes New user password. Must be at least 8 chars.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.updatePassword({
userId: '<USER_ID>',
password: 'password',
});

Update phone

PATCH /users/{userId}/phone · method page

SDK: @owbase/node only

Update the user phone by its unique ID.

Parameter Type Required Description
userId string yes User ID.
number string yes User phone number.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.updatePhone({
userId: '<USER_ID>',
number: '+12065550100',
});

Get user preferences

GET /users/{userId}/prefs · method page

SDK: @owbase/node only

Get the user preferences by its unique ID.

Parameter Type Required Description
userId string yes User ID.

Access: API key with the users.read scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.getPrefs({
userId: '<USER_ID>',
});

Update user preferences

PATCH /users/{userId}/prefs · method page

SDK: @owbase/node only

Update the user preferences by its unique ID. 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
userId string yes User ID.
prefs object yes Prefs key-value JSON object.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.updatePrefs({
userId: '<USER_ID>',
prefs: {},
});

List user sessions

GET /users/{userId}/sessions · method page

SDK: @owbase/node only

Get the user sessions list by its unique ID.

Parameter Type Required Description
userId string yes User ID.
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Access: API key with the users.read scope (also accepts sessions.read).

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.listSessions({
userId: '<USER_ID>',
total: false, // optional
});

Create session

POST /users/{userId}/sessions · method page

SDK: @owbase/node only

Creates a session for a user. Returns an immediately usable session object.

If you want to generate a token for a custom authentication flow, use the POST /users/{userId}/tokens endpoint.

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.

Access: API key with the users.write scope (also accepts sessions.write).

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.createSession({
userId: '<USER_ID>',
});

Delete user sessions

DELETE /users/{userId}/sessions · method page

SDK: @owbase/node only

Delete all user’s sessions by using the user’s unique ID.

Parameter Type Required Description
userId string yes User ID.

Access: API key with the users.write scope (also accepts sessions.write).

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.deleteSessions({
userId: '<USER_ID>',
});

Delete user session

DELETE /users/{userId}/sessions/{sessionId} · method page

SDK: @owbase/node only

Delete a user sessions by its unique ID.

Parameter Type Required Description
userId string yes User ID.
sessionId string yes Session ID.

Access: API key with the users.write scope (also accepts sessions.write).

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.deleteSession({
userId: '<USER_ID>',
sessionId: '<SESSION_ID>',
});

Update user status

PATCH /users/{userId}/status · method page

SDK: @owbase/node only

Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user’s ID reserved.

Parameter Type Required Description
userId string yes User ID.
status boolean yes User Status. To activate the user pass true and to block the user pass false.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.updateStatus({
userId: '<USER_ID>',
status: false,
});

List user targets

GET /users/{userId}/targets · method page

SDK: @owbase/node only

List the messaging targets that are associated with a user.

Parameter Type Required Description
userId string yes User ID.
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, providerId, identifier, providerType
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Access: API key with the users.read scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.listTargets({
userId: '<USER_ID>',
queries: [], // optional
total: false, // optional
});

Create user target

POST /users/{userId}/targets · method page

SDK: @owbase/node only

Create a messaging target.

Parameter Type Required Description
userId string yes User ID.
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.
providerType MessagingProviderType yes The target provider type. Can be one of the following: email, sms or push. Values: email, sms, push.
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.
name string no Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users, MessagingProviderType } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.createTarget({
userId: '<USER_ID>',
targetId: '<TARGET_ID>',
providerType: MessagingProviderType.Email,
identifier: '<IDENTIFIER>',
providerId: '<PROVIDER_ID>', // optional
name: '<NAME>', // optional
});

Get user target

GET /users/{userId}/targets/{targetId} · method page

SDK: @owbase/node only

Get a user’s push notification target by ID.

Parameter Type Required Description
userId string yes User ID.
targetId string yes Target ID.

Access: API key with the users.read scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.getTarget({
userId: '<USER_ID>',
targetId: '<TARGET_ID>',
});

Update user target

PATCH /users/{userId}/targets/{targetId} · method page

SDK: @owbase/node only

Update a messaging target.

Parameter Type Required Description
userId string yes User ID.
targetId string yes Target ID.
identifier string no 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.
name string no Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.updateTarget({
userId: '<USER_ID>',
targetId: '<TARGET_ID>',
identifier: '<IDENTIFIER>', // optional
providerId: '<PROVIDER_ID>', // optional
name: '<NAME>', // optional
});

Delete user target

DELETE /users/{userId}/targets/{targetId} · method page

SDK: @owbase/node only

Delete a messaging target.

Parameter Type Required Description
userId string yes User ID.
targetId string yes Target ID.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.deleteTarget({
userId: '<USER_ID>',
targetId: '<TARGET_ID>',
});

Create token

POST /users/{userId}/tokens · method page

SDK: @owbase/node only

Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the PUT /account/sessions/token endpoint to complete the login process.

Parameter Type Required Description
userId string yes User ID.
length number no Token length in characters. The default length is 6 characters
expire number no Token expiration period in seconds. The default expiration is 15 minutes.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.createToken({
userId: '<USER_ID>',
length: 4, // optional
expire: 60, // optional
});

Update email verification

PATCH /users/{userId}/verification · method page

SDK: @owbase/node only

Update the user email verification status by its unique ID.

Parameter Type Required Description
userId string yes User ID.
emailVerification boolean yes User email verification status.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.updateEmailVerification({
userId: '<USER_ID>',
emailVerification: false,
});

Update phone verification

PATCH /users/{userId}/verification/phone · method page

SDK: @owbase/node only

Update the user phone verification status by its unique ID.

Parameter Type Required Description
userId string yes User ID.
phoneVerification boolean yes User phone verification status.

Access: API key with the users.write scope.

@owbase/node
import { Client, Users } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.updatePhoneVerification({
userId: '<USER_ID>',
phoneVerification: false,
});

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.

Was this page helpful?