Skip to content

Teams

Manage teams and their agent memberships.

TeamsResource

TeamsResource(http)

Bases: BaseResource

Synchronous teams resource.

Initialize teams resource with nested agents resource.

list

list(account_id: int) -> list[Team]

List all teams in the account.

Parameters:

Name Type Description Default
account_id int

The account ID

required

Returns:

Type Description
list[Team]

List of Team objects

Examples:

>>> teams = client.teams.list(account_id=1)
... for team in teams:
...     print(team.name)

get

get(account_id: int, team_id: int) -> Team

Get team details.

Parameters:

Name Type Description Default
account_id int

The account ID

required
team_id int

The team ID

required

Returns:

Type Description
Team

Team object

Examples:

>>> team = client.teams.get(account_id=1, team_id=5)
... print(team.description)

create

create(account_id: int, name: str, **kwargs: Any) -> Team

Create a new team.

Parameters:

Name Type Description Default
account_id int

The account ID

required
name str

Team name

required
**kwargs Any

Additional team attributes (description, allow_auto_assign)

{}

Returns:

Type Description
Team

Created Team object

Examples:

>>> team = client.teams.create(
...     account_id=1,
...     name="Support Team",
...     description="Customer support team",
...     allow_auto_assign=True
...

update

update(
    account_id: int, team_id: int, **kwargs: Any
) -> Team

Update team.

Parameters:

Name Type Description Default
account_id int

The account ID

required
team_id int

The team ID

required
**kwargs Any

Team attributes to update

{}

Returns:

Type Description
Team

Updated Team object

Examples:

>>> team = client.teams.update(
...     account_id=1,
...     team_id=5,
...     name="New Team Name"
...

delete

delete(account_id: int, team_id: int) -> None

Delete team.

Parameters:

Name Type Description Default
account_id int

The account ID

required
team_id int

The team ID

required

Examples:

>>> client.teams.delete(account_id=1, team_id=5)

TeamAgentsResource

TeamAgentsResource(http: HTTPClient)

Bases: BaseResource

Nested resource for managing team agents.

list

list(account_id: int, team_id: int) -> list[Agent]

List agents in the team.

Parameters:

Name Type Description Default
account_id int

The account ID

required
team_id int

The team ID

required

Returns:

Type Description
list[Agent]

List of Agent objects in the team

Examples:

>>> agents = client.teams.agents.list(account_id=1, team_id=5)

add

add(
    account_id: int, team_id: int, agent_ids: list[int]
) -> None

Add agents to the team.

Parameters:

Name Type Description Default
account_id int

The account ID

required
team_id int

The team ID

required
agent_ids list[int]

List of agent IDs to add

required

Examples:

>>> client.teams.agents.add(
...     account_id=1,
...     team_id=5,
...     agent_ids=[10, 11, 12]
...

remove

remove(
    account_id: int, team_id: int, agent_ids: list[int]
) -> None

Remove agents from the team.

Parameters:

Name Type Description Default
account_id int

The account ID

required
team_id int

The team ID

required
agent_ids list[int]

List of agent IDs to remove

required

Examples:

>>> client.teams.agents.remove(
...     account_id=1,
...     team_id=5,
...     agent_ids=[10]
...

AsyncTeamsResource

AsyncTeamsResource(http)

Bases: AsyncBaseResource

Asynchronous teams resource.

Initialize async teams resource with nested agents resource.

list async

list(account_id: int) -> list[Team]

List all teams in the account (async).

Parameters:

Name Type Description Default
account_id int

The account ID

required

Returns:

Type Description
list[Team]

List of Team objects

get async

get(account_id: int, team_id: int) -> Team

Get team details (async).

Parameters:

Name Type Description Default
account_id int

The account ID

required
team_id int

The team ID

required

Returns:

Type Description
Team

Team object

create async

create(account_id: int, name: str, **kwargs: Any) -> Team

Create a new team (async).

Parameters:

Name Type Description Default
account_id int

The account ID

required
name str

Team name

required
**kwargs Any

Additional team attributes

{}

Returns:

Type Description
Team

Created Team object

update async

update(
    account_id: int, team_id: int, **kwargs: Any
) -> Team

Update team (async).

Parameters:

Name Type Description Default
account_id int

The account ID

required
team_id int

The team ID

required
**kwargs Any

Team attributes to update

{}

Returns:

Type Description
Team

Updated Team object

delete async

delete(account_id: int, team_id: int) -> None

Delete team (async).

Parameters:

Name Type Description Default
account_id int

The account ID

required
team_id int

The team ID

required

AsyncTeamAgentsResource

AsyncTeamAgentsResource(http: AsyncHTTPClient)

Bases: AsyncBaseResource

Async nested resource for managing team agents.

list async

list(account_id: int, team_id: int) -> list[Agent]

List agents in the team (async).

Parameters:

Name Type Description Default
account_id int

The account ID

required
team_id int

The team ID

required

Returns:

Type Description
list[Agent]

List of Agent objects in the team

add async

add(
    account_id: int, team_id: int, agent_ids: list[int]
) -> None

Add agents to the team (async).

Parameters:

Name Type Description Default
account_id int

The account ID

required
team_id int

The team ID

required
agent_ids list[int]

List of agent IDs to add

required

remove async

remove(
    account_id: int, team_id: int, agent_ids: list[int]
) -> None

Remove agents from the team (async).

Parameters:

Name Type Description Default
account_id int

The account ID

required
team_id int

The team ID

required
agent_ids list[int]

List of agent IDs to remove

required