Skip to content
v2.7

Teams

Teams, members and invitations.

Teams, members and invitations.

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

List teams

GET /teams · method page

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

Parameter Type Required Description
queries string[] no Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, 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.

Access: API key with the teams.read scope or user session (the resource’s permissions apply).

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

Create team

POST /teams · method page

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

Parameter Type Required Description
teamId string yes 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 yes 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.

Access: API key with the teams.write scope or user session (the resource’s permissions apply).

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

Get team

GET /teams/{teamId} · method page

SDK: @owbase/web and @owbase/node

Get a team by its ID. All team members have read access for this resource.

Parameter Type Required Description
teamId string yes Team ID.

Access: API key with the teams.read scope or user session (the resource’s permissions apply).

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

Update name

PUT /teams/{teamId} · method page

SDK: @owbase/web and @owbase/node

Update the team’s name by its unique ID.

Parameter Type Required Description
teamId string yes Team ID.
name string yes New team name. Max length: 128 chars.

Access: API key with the teams.write scope or user session (the resource’s permissions apply).

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

Delete team

DELETE /teams/{teamId} · method page

SDK: @owbase/web and @owbase/node

Delete a team using its ID. Only team members with the owner role can delete the team.

Parameter Type Required Description
teamId string yes Team ID.

Access: API key with the teams.write scope or user session (the resource’s permissions apply).

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

List team memberships

GET /teams/{teamId}/memberships · method page

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

Parameter Type Required Description
teamId string yes 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.

Access: API key with the teams.read scope or user session (the resource’s permissions apply).

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

Create team membership

POST /teams/{teamId}/memberships · method page

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

Parameter Type Required Description
teamId string yes Team ID.
roles string[] yes 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.

Access: API key with the teams.write scope or user session (the resource’s permissions apply).

@owbase/web
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'],
email: '[email protected]', // optional
userId: '<USER_ID>', // optional
phone: '+12065550100', // optional
url: 'https://example.com', // optional
name: '<NAME>', // optional
membershipId: '<MEMBERSHIP_ID>', // optional
});
console.log(result);
@owbase/node
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'],
email: '[email protected]', // optional
userId: '<USER_ID>', // optional
phone: '+12065550100', // optional
url: 'https://example.com', // optional
name: '<NAME>', // optional
membershipId: '<MEMBERSHIP_ID>', // optional
});

Get team membership

GET /teams/{teamId}/memberships/{membershipId} · method page

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

Parameter Type Required Description
teamId string yes Team ID.
membershipId string yes Membership ID.

Access: API key with the teams.read scope or user session (the resource’s permissions apply).

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

Update team membership

PATCH /teams/{teamId}/memberships/{membershipId} · method page

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

Parameter Type Required Description
teamId string yes Team ID.
membershipId string yes Membership ID.
roles string[] yes 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.

Access: API key with the teams.write scope or user session (the resource’s permissions apply).

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

Delete team membership

DELETE /teams/{teamId}/memberships/{membershipId} · method page

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

Parameter Type Required Description
teamId string yes Team ID.
membershipId string yes Membership ID.

Access: API key with the teams.write scope or user session (the resource’s permissions apply).

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

Update team membership status

PATCH /teams/{teamId}/memberships/{membershipId}/status · method page

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

Parameter Type Required Description
teamId string yes Team ID.
membershipId string yes Membership ID.
userId string yes User ID.
secret string yes Secret key.

Access: no key or session: the project ID is enough.

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

Get team preferences

GET /teams/{teamId}/prefs · method page

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

Parameter Type Required Description
teamId string yes Team ID.

Access: user session (the resource’s permissions apply).

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

Update team preferences

PUT /teams/{teamId}/prefs · method page

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

Parameter Type Required Description
teamId string yes Team ID.
prefs object yes Prefs key-value JSON object.

Access: user session (the resource’s permissions apply).

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

The descriptions on this page come from the server API specification (BSD-3-Clause license), and the examples come from the SDK generator (MIT license). The full notices are in the NOTICE file of the @owbase/web and @owbase/node packages.

Was this page helpful?