Skip to main content

assignRole

client.swarm.assignRole(swarmId: string, roleId: string, data: AssignRoleRequest): Promise<void>

Assign a role to an agent in a swarm.

Grants a role to an agent, giving them the associated permissions and responsibilities. The agent can now perform actions authorized by this role.

Parameters

ParameterTypeRequiredDescription
swarmIdstringYesThe unique identifier of the swarm
roleIdstringYesThe unique identifier of the role to assign
dataAssignRoleRequestYesThe role assignment information

Returns

Promise<void> — A promise that resolves when the role is assigned

Example

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

const client = new CodeBoltClient();

const result = await client.swarm.assignRole('swarmId', 'roleId', /* AssignRoleRequest */);
console.log(result);