Skip to content

Inboxes

List and retrieve inbox configuration.

InboxesResource

InboxesResource(http)

Bases: BaseResource

Synchronous inboxes resource.

Initialize inboxes resource with nested agents resource.

list

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

List all inboxes in the account.

Parameters:

Name Type Description Default
account_id int

The account ID

required

Returns:

Type Description
list[Inbox]

List of Inbox objects

Raises:

Type Description
ChatwootAuthError

If authentication fails

ChatwootPermissionError

If user doesn't have access

Examples:

>>> inboxes = client.inboxes.list(account_id=1)
>>> for inbox in inboxes:
...     print(inbox.name)

get

get(account_id: int, inbox_id: int) -> Inbox

Get inbox details.

Parameters:

Name Type Description Default
account_id int

The account ID

required
inbox_id int

The inbox ID

required

Returns:

Type Description
Inbox

Inbox object

Raises:

Type Description
ChatwootNotFoundError

If inbox not found

ChatwootAuthError

If authentication fails

Examples:

>>> inbox = client.inboxes.get(account_id=1, inbox_id=5)
>>> print(inbox.name)

create

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

Create a new inbox.

Parameters:

Name Type Description Default
account_id int

The account ID

required
name str

Inbox name

required
channel_type str

Type of channel (e.g., 'api', 'web_widget')

required
**kwargs Any

Additional inbox attributes

{}

Returns:

Type Description
Inbox

Created Inbox object

Raises:

Type Description
ChatwootValidationError

If validation fails

ChatwootAuthError

If authentication fails

Examples:

>>> inbox = client.inboxes.create(
...     account_id=1,
...     name="Support Inbox",
...     channel_type="api"
... )

update

update(
    account_id: int, inbox_id: int, **kwargs: Any
) -> Inbox

Update inbox.

Parameters:

Name Type Description Default
account_id int

The account ID

required
inbox_id int

The inbox ID

required
**kwargs Any

Inbox attributes to update

{}

Returns:

Type Description
Inbox

Updated Inbox object

Raises:

Type Description
ChatwootNotFoundError

If inbox not found

ChatwootValidationError

If validation fails

Examples:

>>> inbox = client.inboxes.update(
...     account_id=1,
...     inbox_id=5,
...     name="New Name",
...     enable_auto_assignment=True
... )

get_agent_bot

get_agent_bot(
    account_id: int, inbox_id: int
) -> dict | None

Get the agent bot assigned to an inbox.

Parameters:

Name Type Description Default
account_id int

The account ID

required
inbox_id int

The inbox ID

required

Returns:

Type Description
dict | None

Agent bot dict, or None if no bot is assigned

Examples:

>>> bot = client.inboxes.get_agent_bot(account_id=1, inbox_id=5)
>>> if bot:
...     print(bot["id"], bot["name"])

set_agent_bot

set_agent_bot(
    account_id: int, inbox_id: int, agent_bot_id: int | None
) -> None

Assign or remove an agent bot from an inbox.

Parameters:

Name Type Description Default
account_id int

The account ID

required
inbox_id int

The inbox ID

required
agent_bot_id int | None

Bot ID to assign, or None to remove the bot

required

Examples:

>>> client.inboxes.set_agent_bot(account_id=1, inbox_id=5, agent_bot_id=2)
>>> # Remove bot:
>>> client.inboxes.set_agent_bot(account_id=1, inbox_id=5, agent_bot_id=None)

AsyncInboxesResource

AsyncInboxesResource(http)

Bases: AsyncBaseResource

Asynchronous inboxes resource.

Initialize async inboxes resource with nested agents resource.

list async

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

List all inboxes in the account (async).

Parameters:

Name Type Description Default
account_id int

The account ID

required

Returns:

Type Description
list[Inbox]

List of Inbox objects

get async

get(account_id: int, inbox_id: int) -> Inbox

Get inbox details (async).

Parameters:

Name Type Description Default
account_id int

The account ID

required
inbox_id int

The inbox ID

required

Returns:

Type Description
Inbox

Inbox object

create async

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

Create a new inbox (async).

Parameters:

Name Type Description Default
account_id int

The account ID

required
name str

Inbox name

required
channel_type str

Type of channel

required
**kwargs Any

Additional inbox attributes

{}

Returns:

Type Description
Inbox

Created Inbox object

update async

update(
    account_id: int, inbox_id: int, **kwargs: Any
) -> Inbox

Update inbox (async).

Parameters:

Name Type Description Default
account_id int

The account ID

required
inbox_id int

The inbox ID

required
**kwargs Any

Inbox attributes to update

{}

Returns:

Type Description
Inbox

Updated Inbox object

get_agent_bot async

get_agent_bot(
    account_id: int, inbox_id: int
) -> dict | None

Get the agent bot assigned to an inbox (async).

Parameters:

Name Type Description Default
account_id int

The account ID

required
inbox_id int

The inbox ID

required

Returns:

Type Description
dict | None

Agent bot dict, or None if no bot is assigned

set_agent_bot async

set_agent_bot(
    account_id: int, inbox_id: int, agent_bot_id: int | None
) -> None

Assign or remove an agent bot from an inbox (async).

Parameters:

Name Type Description Default
account_id int

The account ID

required
inbox_id int

The inbox ID

required
agent_bot_id int | None

Bot ID to assign, or None to remove the bot

required