Ir al contenido
v2.7

Account

Cuenta del usuario con sesión iniciada: registro, sesiones, verificación del correo, recuperación de contraseña, MFA y preferencias.

Cuenta del usuario con sesión iniciada: registro, sesiones, verificación del correo, recuperación de contraseña, MFA y preferencias.

Clase Account: 71 métodos (71 en @owbase/web, 66 en @owbase/node). Las descripciones de los métodos están en inglés. Los ejemplos usan la forma de objeto de los parámetros; cambia los valores entre < y > por los tuyos.

Obtener cuenta

GET /account · página del método

SDK: @owbase/web y @owbase/node

Get the currently logged in user.

Sin parámetros.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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();

Crear cuenta

POST /account · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
userId string sí 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 sí User email.
password string sí New user password. Must be between 8 and 256 chars.
name string no User name. Max length: 128 chars.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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
});

Actualizar correo electrónico

PATCH /account/email · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
email string sí User email.
password string sí User password. Must be at least 8 chars.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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',
});

Listar identidades

GET /account/identities · página del método

SDK: @owbase/web y @owbase/node

Get the list of identities for the currently logged in user.

Parámetro Tipo Obligatorio Descripción
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.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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
});

Eliminar identidad

DELETE /account/identities/{identityId} · página del método

SDK: @owbase/web y @owbase/node

Delete an identity by its unique ID.

Parámetro Tipo Obligatorio Descripción
identityId string sí Identity ID.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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>',
});

Crear JWT

POST /account/jwts · página del método

SDK: solo @owbase/web

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.

Parámetro Tipo Obligatorio Descripción
duration number no Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);

Listar membresías de la cuenta

GET /account/memberships · página del método

SDK: @owbase/web y @owbase/node

Get the team memberships of the currently logged in user.

Parámetro Tipo Obligatorio Descripción
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.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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
});

Actualizar MFA

PATCH /account/mfa · página del método

SDK: @owbase/web y @owbase/node

Enable or disable MFA on an account.

Parámetro Tipo Obligatorio Descripción
mfa boolean sí Enable or disable MFA.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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,
});

Crear autenticador

POST /account/mfa/authenticators/{type} · página del método

SDK: @owbase/web y @owbase/node

Add an authenticator app to be used as an MFA factor. Verify the authenticator using the verify authenticator method.

Parámetro Tipo Obligatorio Descripción
type AuthenticatorType sí Type of authenticator. Must be totp Valores: totp.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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,
});

Crear autenticador

POST /account/mfa/authenticators/{type} · página del método

SDK: @owbase/web y @owbase/node

Add an authenticator app to be used as an MFA factor. Verify the authenticator using the verify authenticator method.

Parámetro Tipo Obligatorio Descripción
type AuthenticatorType sí Type of authenticator. Must be totp Valores: totp.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

Sin ejemplo propio: consulta el del método que lo reemplaza.

Actualizar autenticador (confirmación)

PUT /account/mfa/authenticators/{type} · página del método

SDK: @owbase/web y @owbase/node

Verify an authenticator app after adding it using the add authenticator method.

Parámetro Tipo Obligatorio Descripción
type AuthenticatorType sí Type of authenticator. Valores: totp.
otp string sí Valid verification token.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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>',
});

Actualizar autenticador (confirmación)

PUT /account/mfa/authenticators/{type} · página del método

SDK: @owbase/web y @owbase/node

Verify an authenticator app after adding it using the add authenticator method.

Parámetro Tipo Obligatorio Descripción
type AuthenticatorType sí Type of authenticator. Valores: totp.
otp string sí Valid verification token.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

Sin ejemplo propio: consulta el del método que lo reemplaza.

Eliminar autenticador

DELETE /account/mfa/authenticators/{type} · página del método

SDK: @owbase/web y @owbase/node

Delete an authenticator for a user by ID.

Parámetro Tipo Obligatorio Descripción
type AuthenticatorType sí Type of authenticator. Valores: totp.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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,
});

Eliminar autenticador

DELETE /account/mfa/authenticators/{type} · página del método

SDK: @owbase/web y @owbase/node

Delete an authenticator for a user by ID.

Parámetro Tipo Obligatorio Descripción
type AuthenticatorType sí Type of authenticator. Valores: totp.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

Sin ejemplo propio: consulta el del método que lo reemplaza.

Crear desafío MFA

POST /account/mfa/challenges · página del método

SDK: @owbase/web y @owbase/node

Begin the process of MFA verification after sign-in. Finish the flow with updateMfaChallenge method.

Parámetro Tipo Obligatorio Descripción
factor AuthenticationFactor sí Factor used for verification. Must be one of following: email, phone, totp, recoveryCode, custom. Valores: email, phone, totp, recoverycode, custom.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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,
});

Crear desafío MFA

POST /account/mfa/challenges · página del método

SDK: @owbase/web y @owbase/node

Begin the process of MFA verification after sign-in. Finish the flow with updateMfaChallenge method.

Parámetro Tipo Obligatorio Descripción
factor AuthenticationFactor sí Factor used for verification. Must be one of following: email, phone, totp, recoveryCode, custom. Valores: email, phone, totp, recoverycode, custom.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

Sin ejemplo propio: consulta el del método que lo reemplaza.

Actualizar desafío MFA (confirmación)

PUT /account/mfa/challenges · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
challengeId string sí ID of the challenge.
otp string sí Valid verification token.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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>',
});

Actualizar desafío MFA (confirmación)

PUT /account/mfa/challenges · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
challengeId string sí ID of the challenge.
otp string sí Valid verification token.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

Sin ejemplo propio: consulta el del método que lo reemplaza.

Listar factores

GET /account/mfa/factors · página del método

SDK: @owbase/web y @owbase/node

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

Sin parámetros.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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();

Listar factores

GET /account/mfa/factors · página del método

SDK: @owbase/web y @owbase/node

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

Sin parámetros.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

Sin ejemplo propio: consulta el del método que lo reemplaza.

Listar códigos de recuperación MFA

GET /account/mfa/recovery-codes · página del método

SDK: @owbase/web y @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.

Sin parámetros.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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();

Listar códigos de recuperación MFA

GET /account/mfa/recovery-codes · página del método

SDK: @owbase/web y @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.

Sin parámetros.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

Sin ejemplo propio: consulta el del método que lo reemplaza.

Crear códigos de recuperación MFA

POST /account/mfa/recovery-codes · página del método

SDK: @owbase/web y @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.

Sin parámetros.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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();

Crear códigos de recuperación MFA

POST /account/mfa/recovery-codes · página del método

SDK: @owbase/web y @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.

Sin parámetros.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

Sin ejemplo propio: consulta el del método que lo reemplaza.

Actualizar códigos de recuperación MFA (regenerar)

PATCH /account/mfa/recovery-codes · página del método

SDK: @owbase/web y @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.

Sin parámetros.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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();

Actualizar códigos de recuperación MFA (regenerar)

PATCH /account/mfa/recovery-codes · página del método

SDK: @owbase/web y @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.

Sin parámetros.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

Sin ejemplo propio: consulta el del método que lo reemplaza.

Actualizar nombre

PATCH /account/name · página del método

SDK: @owbase/web y @owbase/node

Update currently logged in user account name.

Parámetro Tipo Obligatorio Descripción
name string sí User name. Max length: 128 chars.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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>',
});

Listar passkeys

GET /account/passkeys · página del método

SDK: @owbase/web y @owbase/node

Get the list of verified passkeys registered by the currently logged in user.

Parámetro Tipo Obligatorio Descripción
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.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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
});

Crear passkey

POST /account/passkeys · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
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.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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
});

Obtener passkey

GET /account/passkeys/{passkeyId} · página del método

SDK: @owbase/web y @owbase/node

Get a verified passkey of the currently logged in user by its unique ID.

Parámetro Tipo Obligatorio Descripción
passkeyId string sí Passkey ID.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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>',
});

Actualizar passkey

PATCH /account/passkeys/{passkeyId} · página del método

SDK: @owbase/web y @owbase/node

Rename a passkey of the currently logged in user.

Parámetro Tipo Obligatorio Descripción
passkeyId string sí Passkey ID.
name string sí Passkey name. Max length: 128 chars.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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>',
});

Eliminar passkey

DELETE /account/passkeys/{passkeyId} · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
passkeyId string sí Passkey ID.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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>',
});

Actualizar verificación de passkey

PUT /account/passkeys/{passkeyId}/verification · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
passkeyId string sí Passkey ID.
credential object sí Registration credential returned by the authenticator, in the JSON form produced by PublicKeyCredential.toJSON().

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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: {},
});

Actualizar contraseña

PATCH /account/password · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
password string sí New user password. Must be at least 8 chars.
oldPassword string no Current user password. Max length: 256 chars.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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
});

Actualizar teléfono

PATCH /account/phone · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
phone string sí Phone number. Format this number with a leading ‘+’ and a country code, e.g., +16175551212.
password string sí User password. Must be at least 8 chars.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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',
});

Obtener preferencias de la cuenta

GET /account/prefs · página del método

SDK: @owbase/web y @owbase/node

Get the preferences as a key-value object for the currently logged in user.

Sin parámetros.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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();

Actualizar preferencias

PATCH /account/prefs · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
prefs object sí Prefs key-value JSON object.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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,
},
});

Crear recuperación de contraseña

POST /account/recovery · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
email string sí User email.
url string sí 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.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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',
});

Actualizar recuperación de contraseña (confirmación)

PUT /account/recovery · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
userId string sí User ID.
secret string sí Valid reset token.
password string sí New user password. Must be between 8 and 256 chars.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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',
});

Crear recuperación de contraseña (OTP)

POST /account/recovery/otp · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
email string sí 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.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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
});

Actualizar recuperación de contraseña (OTP)

PUT /account/recovery/otp · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
userId string sí User ID.
secret string sí Valid recovery OTP code.
password string sí New user password. Must be between 8 and 256 chars.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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',
});

Listar sesiones

GET /account/sessions · página del método

SDK: @owbase/web y @owbase/node

Get the list of active sessions across different devices for the currently logged in user.

Parámetro Tipo Obligatorio Descripción
total boolean no When set to false, the total count returned will be 0 and will not be calculated.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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
});

Eliminar sesiones

DELETE /account/sessions · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
current boolean no Delete the current session too. Use false to sign out of every other session while staying signed in on this one.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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
});

Crear sesión anónima

POST /account/sessions/anonymous · página del método

SDK: @owbase/web y @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.

Sin parámetros.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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();

Crear sesión con correo y contraseña

POST /account/sessions/email · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
email string sí User email.
password string sí 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.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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
});

Crear sesión con token de ID

POST /account/sessions/id-token · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
provider IdTokenProvider sí OAuth2 provider that issued the ID token. Currently, supported providers are: apple, google. Valores: apple, google.
idToken string sí 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.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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
});

Actualizar sesión por URL mágica

PUT /account/sessions/magic-url · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
userId string sí 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 sí Valid verification token.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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>',
});

Crear sesión OAuth2

GET /account/sessions/oauth2/{provider} · página del método

SDK: solo @owbase/web

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.

Parámetro Tipo Obligatorio Descripción
provider OAuthProvider sí 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. Valores: 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.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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
});

Actualizar sesión por teléfono

PUT /account/sessions/phone · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
userId string sí 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 sí Valid verification token.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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>',
});

Crear sesión

POST /account/sessions/token · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
userId string sí 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 sí Secret of a token generated by login methods. For example, the createMagicURLToken or createPhoneToken methods.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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>',
});

Obtener sesión

GET /account/sessions/{sessionId} · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
sessionId string sí Session ID. Use the string ‘current’ to get the current device session.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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>',
});

Actualizar sesión

PATCH /account/sessions/{sessionId} · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
sessionId string sí Session ID. Use the string ‘current’ to update the current device session.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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>',
});

Eliminar sesión

DELETE /account/sessions/{sessionId} · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
sessionId string sí Session ID. Use the string ‘current’ to delete the current device session.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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>',
});

Actualizar estado

PATCH /account/status · página del método

SDK: @owbase/web y @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.

Sin parámetros.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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();

Crear destino push

POST /account/targets/push · página del método

SDK: solo @owbase/web

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.

Parámetro Tipo Obligatorio Descripción
targetId string sí 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 sí 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.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);

Actualizar destino push

PUT /account/targets/{targetId}/push · página del método

SDK: solo @owbase/web

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.

Parámetro Tipo Obligatorio Descripción
targetId string sí Target ID.
identifier string sí 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.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);

Eliminar destino push

DELETE /account/targets/{targetId}/push · página del método

SDK: solo @owbase/web

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.

Parámetro Tipo Obligatorio Descripción
targetId string sí Target ID.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);

Crear token por correo (OTP)

POST /account/tokens/email · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
userId string sí 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 sí 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.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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
});

Crear token de URL mágica

POST /account/tokens/magic-url · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
userId string sí 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 sí 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.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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
});

Crear token OAuth2

GET /account/tokens/oauth2/{provider} · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
provider OAuthProvider sí 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. Valores: 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.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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
});
@owbase/node
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
});

Crear token de passkey

POST /account/tokens/passkey · página del método

SDK: @owbase/web y @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.

Sin parámetros.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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();

Actualizar token de passkey

PUT /account/tokens/passkey · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
challengeId string sí Challenge ID returned by createPasskeyToken.
credential object sí Authentication credential returned by the authenticator, in the JSON form produced by PublicKeyCredential.toJSON().

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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: {},
});

Crear token por teléfono

POST /account/tokens/phone · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
userId string sí 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 sí Phone number. Format this number with a leading ‘+’ and a country code, e.g., +16175551212.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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',
});

Crear verificación del correo

POST /account/verifications/email · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
url string sí 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.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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',
});

Crear verificación del correo

POST /account/verifications/email · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
url string sí 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.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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',
});

Actualizar verificación del correo (confirmación)

PUT /account/verifications/email · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
userId string sí User ID.
secret string sí Valid verification token.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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>',
});

Actualizar verificación del correo (confirmación)

PUT /account/verifications/email · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
userId string sí User ID.
secret string sí Valid verification token.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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>',
});

Crear verificación del correo (OTP)

POST /account/verifications/email/otp · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
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.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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
});

Actualizar verificación del correo (OTP)

PUT /account/verifications/email/otp · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
userId string sí User ID.
secret string sí Valid verification OTP code.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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>',
});

Crear verificación del teléfono

POST /account/verifications/phone · página del método

SDK: @owbase/web y @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.

Sin parámetros.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
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);
@owbase/node
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();

Actualizar verificación del teléfono (confirmación)

PUT /account/verifications/phone · página del método

SDK: @owbase/web y @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.

Parámetro Tipo Obligatorio Descripción
userId string sí User ID.
secret string sí Valid verification token.

Acceso: sin clave ni sesión: basta el ID del proyecto.

@owbase/web
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);
@owbase/node
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>',
});

Las descripciones de esta página vienen de la especificación de la API del servidor (licencia BSD-3-Clause), en inglés, y los ejemplos vienen del generador de SDKs (licencia MIT). Los avisos completos están en el archivo NOTICE de los paquetes @owbase/web y @owbase/node.

¿Te ayudó esta página?