SDK — Teams

The rivano.teams resource lets you organize users into groups, control which agents each group can access, and assign roles within a tenant.

List teams

import Rivano from '@rivano/sdk';

const rivano = new Rivano({ apiKey: 'rv_...' });

const { data, total } = await rivano.teams.list();
for (const team of data) {
  console.log(`${team.id} — ${team.name}`);
}

Create a team

import Rivano from '@rivano/sdk';

const rivano = new Rivano({ apiKey: 'rv_...' });

const team = await rivano.teams.create({ name: 'legal-ai-team' });
console.log('Team created:', team.id);

Manage members

List members

import Rivano from '@rivano/sdk';

const rivano = new Rivano({ apiKey: 'rv_...' });

const members = await rivano.teams.members('team_abc123');
for (const member of members) {
  console.log(`${member.email} [${member.role}]`);
}

Add a member

import Rivano from '@rivano/sdk';

const rivano = new Rivano({ apiKey: 'rv_...' });

await rivano.teams.addMember('team_abc123', {
  email: '[email protected]',
  role: 'member',
});

Remove a member

await rivano.teams.removeMember('team_abc123', '[email protected]');

Member roles

RolePermissions
adminFull access to team resources, can add/remove members
memberRead/write access to agents and traces scoped to this team

Scope agents to a team

By default, a team can see all agents in the tenant. Use setScopes to restrict a team to specific agents:

import Rivano from '@rivano/sdk';

const rivano = new Rivano({ apiKey: 'rv_...' });

// Restrict legal-ai-team to only these two agents
await rivano.teams.setScopes('team_abc123', [
  'contract-summarizer',
  'compliance-checker',
]);

console.log('Team scopes updated');
💡

Pass an empty array to setScopes to give the team access to all agents again (default behavior).

Error handling

ErrorWhen it occurs
SdkAuthErrorInvalid API key
SdkForbiddenErrorInsufficient permissions to manage teams
SdkNotFoundErrorTeam ID does not exist
SdkErrorDuplicate team name or invalid role