Skip to main content

getRole

client.swarm.getRole(swarmId: string, roleId: string): Promise<SwarmRole>

Get a role by ID within a swarm.

Retrieves detailed information about a specific role including its permissions and assigned agents. Use this for displaying role details or managing role assignments.

Parameters​

ParameterTypeRequiredDescription
swarmIdstringYesThe unique identifier of the swarm
roleIdstringYesThe unique identifier of the role

Returns​

Promise<SwarmRole> — A promise that resolves to the SwarmRole object

Example​

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.swarm.getRole('swarmId', 'roleId');
console.log(result);