Equipos, miembros e invitaciones.
Clase Teams: 13 métodos (13 en @owbase/web, 13 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.
Listar equipos
GET /teams · página del método
SDK: @owbase/web y @owbase/node
Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
| 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: name, total, billingPlan |
search |
string |
no | Search term to filter your list results. Max length: 256 chars. |
total |
boolean |
no | When set to false, the total count returned will be 0 and will not be calculated. |
Acceso: clave de API con el alcance teams.read o sesión del usuario (vale lo que permitan los permisos del recurso).
import { Client, Teams } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const teams = new Teams(client);
const result = await teams.list({ queries: [], // optional search: '<SEARCH>', // optional total: false, // optional});
console.log(result);import { Client, Teams } 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 teams = new Teams(client);
const result = await teams.list({ queries: [], // optional search: '<SEARCH>', // optional total: false, // optional});Crear equipo
POST /teams · página del método
SDK: @owbase/web y @owbase/node
Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
teamId |
string |
sí | Team 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 |
sí | Team name. Max length: 128 chars. |
roles |
string[] |
no | Array of strings. Use this param to set the roles in the team for the user who created it. The default role is owner. A role can be any string. Learn more about roles and permissions. Maximum of 100 roles are allowed, each 81 characters long. |
Acceso: clave de API con el alcance teams.write o sesión del usuario (vale lo que permitan los permisos del recurso).
import { Client, Teams } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const teams = new Teams(client);
const result = await teams.create({ teamId: '<TEAM_ID>', name: '<NAME>', roles: [], // optional});
console.log(result);import { Client, Teams } 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 teams = new Teams(client);
const result = await teams.create({ teamId: '<TEAM_ID>', name: '<NAME>', roles: [], // optional});Obtener equipo
GET /teams/{teamId} · página del método
SDK: @owbase/web y @owbase/node
Get a team by its ID. All team members have read access for this resource.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
teamId |
string |
sí | Team ID. |
Acceso: clave de API con el alcance teams.read o sesión del usuario (vale lo que permitan los permisos del recurso).
import { Client, Teams } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const teams = new Teams(client);
const result = await teams.get({ teamId: '<TEAM_ID>',});
console.log(result);import { Client, Teams } 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 teams = new Teams(client);
const result = await teams.get({ teamId: '<TEAM_ID>',});updateName
Sección titulada «updateName»Actualizar nombre
PUT /teams/{teamId} · página del método
SDK: @owbase/web y @owbase/node
Update the team’s name by its unique ID.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
teamId |
string |
sí | Team ID. |
name |
string |
sí | New team name. Max length: 128 chars. |
Acceso: clave de API con el alcance teams.write o sesión del usuario (vale lo que permitan los permisos del recurso).
import { Client, Teams } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const teams = new Teams(client);
const result = await teams.updateName({ teamId: '<TEAM_ID>', name: '<NAME>',});
console.log(result);import { Client, Teams } 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 teams = new Teams(client);
const result = await teams.updateName({ teamId: '<TEAM_ID>', name: '<NAME>',});Eliminar equipo
DELETE /teams/{teamId} · página del método
SDK: @owbase/web y @owbase/node
Delete a team using its ID. Only team members with the owner role can delete the team.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
teamId |
string |
sí | Team ID. |
Acceso: clave de API con el alcance teams.write o sesión del usuario (vale lo que permitan los permisos del recurso).
import { Client, Teams } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const teams = new Teams(client);
const result = await teams.delete({ teamId: '<TEAM_ID>',});
console.log(result);import { Client, Teams } 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 teams = new Teams(client);
const result = await teams.delete({ teamId: '<TEAM_ID>',});listMemberships
Sección titulada «listMemberships»Listar membresías del equipo
GET /teams/{teamId}/memberships · página del método
SDK: @owbase/web y @owbase/node
Use this endpoint to list a team’s members using the team’s ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
teamId |
string |
sí | Team ID. |
queries |
string[] |
no | Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles |
search |
string |
no | Search term to filter your list results. Max length: 256 chars. |
total |
boolean |
no | When set to false, the total count returned will be 0 and will not be calculated. |
Acceso: clave de API con el alcance teams.read o sesión del usuario (vale lo que permitan los permisos del recurso).
import { Client, Teams } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const teams = new Teams(client);
const result = await teams.listMemberships({ teamId: '<TEAM_ID>', queries: [], // optional search: '<SEARCH>', // optional total: false, // optional});
console.log(result);import { Client, Teams } 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 teams = new Teams(client);
const result = await teams.listMemberships({ teamId: '<TEAM_ID>', queries: [], // optional search: '<SEARCH>', // optional total: false, // optional});createMembership
Sección titulada «createMembership»Crear membresía del equipo
POST /teams/{teamId}/memberships · página del método
SDK: @owbase/web y @owbase/node
Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Owbase will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn’t exist. If initiated from a Server SDK, the new member will be added automatically to the team.
You only need to provide one of a user ID, email, or phone number. Owbase will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
Use the url parameter to redirect the user from the invitation email to your app. After the user is redirected, use the Update Team Membership Status endpoint to allow the user to accept the invitation to the team.
Please note that to avoid a Redirect Attack Owbase will accept the only redirect URLs under the domains you have added as a platform on the Owbase Console.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
teamId |
string |
sí | Team ID. |
roles |
string[] |
sí | Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about roles and permissions. Maximum of 100 roles are allowed, each 81 characters long. |
email |
string |
no | Email of the new team member. |
userId |
string |
no | ID of the user to be added to a team. |
phone |
string |
no | Phone number. Format this number with a leading ‘+’ and a country code, e.g., +16175551212. |
url |
string |
no | URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API. |
name |
string |
no | Name of the new team member. Max length: 128 chars. |
membershipId |
string |
no | Membership 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. |
Acceso: clave de API con el alcance teams.write o sesión del usuario (vale lo que permitan los permisos del recurso).
import { Client, Teams } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const teams = new Teams(client);
const result = await teams.createMembership({ teamId: '<TEAM_ID>', roles: ['editor'], userId: '<USER_ID>', // optional phone: '+12065550100', // optional url: 'https://example.com', // optional name: '<NAME>', // optional membershipId: '<MEMBERSHIP_ID>', // optional});
console.log(result);import { Client, Teams } 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 teams = new Teams(client);
const result = await teams.createMembership({ teamId: '<TEAM_ID>', roles: ['editor'], userId: '<USER_ID>', // optional phone: '+12065550100', // optional url: 'https://example.com', // optional name: '<NAME>', // optional membershipId: '<MEMBERSHIP_ID>', // optional});getMembership
Sección titulada «getMembership»Obtener membresía del equipo
GET /teams/{teamId}/memberships/{membershipId} · página del método
SDK: @owbase/web y @owbase/node
Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
teamId |
string |
sí | Team ID. |
membershipId |
string |
sí | Membership ID. |
Acceso: clave de API con el alcance teams.read o sesión del usuario (vale lo que permitan los permisos del recurso).
import { Client, Teams } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const teams = new Teams(client);
const result = await teams.getMembership({ teamId: '<TEAM_ID>', membershipId: '<MEMBERSHIP_ID>',});
console.log(result);import { Client, Teams } 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 teams = new Teams(client);
const result = await teams.getMembership({ teamId: '<TEAM_ID>', membershipId: '<MEMBERSHIP_ID>',});updateMembership
Sección titulada «updateMembership»Actualizar membresía del equipo
PATCH /teams/{teamId}/memberships/{membershipId} · página del método
SDK: @owbase/web y @owbase/node
Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about roles and permissions.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
teamId |
string |
sí | Team ID. |
membershipId |
string |
sí | Membership ID. |
roles |
string[] |
sí | An array of strings. Use this param to set the user’s roles in the team. A role can be any string. Learn more about roles and permissions. Maximum of 100 roles are allowed, each 81 characters long. |
Acceso: clave de API con el alcance teams.write o sesión del usuario (vale lo que permitan los permisos del recurso).
import { Client, Teams } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const teams = new Teams(client);
const result = await teams.updateMembership({ teamId: '<TEAM_ID>', membershipId: '<MEMBERSHIP_ID>', roles: ['editor'],});
console.log(result);import { Client, Teams } 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 teams = new Teams(client);
const result = await teams.updateMembership({ teamId: '<TEAM_ID>', membershipId: '<MEMBERSHIP_ID>', roles: ['editor'],});deleteMembership
Sección titulada «deleteMembership»Eliminar membresía del equipo
DELETE /teams/{teamId}/memberships/{membershipId} · página del método
SDK: @owbase/web y @owbase/node
This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
teamId |
string |
sí | Team ID. |
membershipId |
string |
sí | Membership ID. |
Acceso: clave de API con el alcance teams.write o sesión del usuario (vale lo que permitan los permisos del recurso).
import { Client, Teams } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const teams = new Teams(client);
const result = await teams.deleteMembership({ teamId: '<TEAM_ID>', membershipId: '<MEMBERSHIP_ID>',});
console.log(result);import { Client, Teams } 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 teams = new Teams(client);
const result = await teams.deleteMembership({ teamId: '<TEAM_ID>', membershipId: '<MEMBERSHIP_ID>',});updateMembershipStatus
Sección titulada «updateMembershipStatus»Actualizar estado de la membresía del equipo
PATCH /teams/{teamId}/memberships/{membershipId}/status · página del método
SDK: @owbase/web y @owbase/node
Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
If the request is successful, a session for the user is automatically created.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
teamId |
string |
sí | Team ID. |
membershipId |
string |
sí | Membership ID. |
userId |
string |
sí | User ID. |
secret |
string |
sí | Secret key. |
Acceso: sin clave ni sesión: basta el ID del proyecto.
import { Client, Teams } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const teams = new Teams(client);
const result = await teams.updateMembershipStatus({ teamId: '<TEAM_ID>', membershipId: '<MEMBERSHIP_ID>', userId: '<USER_ID>', secret: '<SECRET>',});
console.log(result);import { Client, Teams } 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 teams = new Teams(client);
const result = await teams.updateMembershipStatus({ teamId: '<TEAM_ID>', membershipId: '<MEMBERSHIP_ID>', userId: '<USER_ID>', secret: '<SECRET>',});getPrefs
Sección titulada «getPrefs»Obtener preferencias del equipo
GET /teams/{teamId}/prefs · página del método
SDK: @owbase/web y @owbase/node
Get the team’s shared preferences by its unique ID. If a preference doesn’t need to be shared by all team members, prefer storing them in user preferences.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
teamId |
string |
sí | Team ID. |
Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).
import { Client, Teams } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const teams = new Teams(client);
const result = await teams.getPrefs({ teamId: '<TEAM_ID>',});
console.log(result);import { Client, Teams } 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 teams = new Teams(client);
const result = await teams.getPrefs({ teamId: '<TEAM_ID>',});updatePrefs
Sección titulada «updatePrefs»Actualizar preferencias del equipo
PUT /teams/{teamId}/prefs · página del método
SDK: @owbase/web y @owbase/node
Update the team’s preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
teamId |
string |
sí | Team ID. |
prefs |
object |
sí | Prefs key-value JSON object. |
Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).
import { Client, Teams } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const teams = new Teams(client);
const result = await teams.updatePrefs({ teamId: '<TEAM_ID>', prefs: {},});
console.log(result);import { Client, Teams } 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 teams = new Teams(client);
const result = await teams.updatePrefs({ teamId: '<TEAM_ID>', prefs: {},});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.