feat: add sdk examples for team, inboxes and agents

This commit is contained in:
Shivam Mishra
2026-02-19 12:54:36 +05:30
parent 5e1109b13e
commit c74bb805f9
20 changed files with 539 additions and 0 deletions
@@ -5,6 +5,25 @@ summary: Add a New Agent
description: Add a new Agent to Account
security:
- userApiKey: []
x-codeSamples:
- lang: python
label: "Add a new agent"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
agent = client.agents.add(
account_id=1,
name="John Doe",
email="john@example.com",
role="agent"
)
print(agent.id, agent.name)
requestBody:
required: true
content:
@@ -5,6 +5,18 @@ summary: Remove an Agent from Account
description: Remove an Agent from Account
security:
- userApiKey: []
x-codeSamples:
- lang: python
label: "Remove an agent"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
client.agents.remove(account_id=1, agent_id=10)
parameters:
- in: path
name: id
@@ -5,6 +5,21 @@ summary: List Agents in Account
description: Get Details of Agents in an Account
security:
- userApiKey: []
x-codeSamples:
- lang: python
label: "List all agents"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
agents = client.agents.list(account_id=1)
for agent in agents:
print(agent.name, agent.role)
responses:
200:
description: Success
@@ -5,6 +5,25 @@ summary: Update Agent in Account
description: Update an Agent in Account
security:
- userApiKey: []
x-codeSamples:
- lang: python
label: "Update an agent"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
agent = client.agents.update(
account_id=1,
agent_id=10,
name="Jane Doe",
role="administrator"
)
print(agent.id, agent.role)
parameters:
- in: path
name: id
@@ -8,6 +8,24 @@ post:
- userApiKey: []
parameters:
- $ref: '#/components/parameters/account_id'
x-codeSamples:
- lang: python
label: "Create an API inbox"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
inbox = client.inboxes.create(
account_id=1,
name="Support Inbox",
channel_type="api"
)
print(inbox.id, inbox.name)
requestBody:
required: true
content:
@@ -8,6 +8,21 @@ get:
- userApiKey: []
parameters:
- $ref: '#/components/parameters/account_id'
x-codeSamples:
- lang: python
label: "List all inboxes"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
inboxes = client.inboxes.list(account_id=1)
for inbox in inboxes:
print(inbox.id, inbox.name)
responses:
'200':
description: Success
@@ -14,6 +14,20 @@ get:
type: number
description: ID of the inbox
required: true
x-codeSamples:
- lang: python
label: "Get an inbox"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
inbox = client.inboxes.get(account_id=1, inbox_id=5)
print(inbox.name, inbox.channel_type)
responses:
'200':
description: Success
@@ -14,6 +14,25 @@ patch:
type: number
description: ID of the inbox
required: true
x-codeSamples:
- lang: python
label: "Update an inbox"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
inbox = client.inboxes.update(
account_id=1,
inbox_id=5,
name="Updated Inbox Name",
enable_auto_assignment=True
)
print(inbox.id, inbox.name)
requestBody:
required: true
content:
@@ -5,6 +5,22 @@ summary: Add a New Agent
description: Add a new Agent to Team
security:
- userApiKey: []
x-codeSamples:
- lang: python
label: "Add agents to team"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
client.teams.agents.add(
account_id=1,
team_id=5,
agent_ids=[10, 11, 12]
)
requestBody:
required: true
content:
@@ -5,6 +5,22 @@ summary: Remove an Agent from Team
description: Remove an Agent from Team
security:
- userApiKey: []
x-codeSamples:
- lang: python
label: "Remove agents from team"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
client.teams.agents.remove(
account_id=1,
team_id=5,
agent_ids=[10]
)
requestBody:
required: true
content:
@@ -5,6 +5,21 @@ summary: List Agents in Team
description: Get Details of Agents in an Team
security:
- userApiKey: []
x-codeSamples:
- lang: python
label: "List agents in team"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
agents = client.teams.agents.list(account_id=1, team_id=5)
for agent in agents:
print(agent.name, agent.email)
parameters:
- $ref: '#/components/parameters/account_id'
- $ref: '#/components/parameters/team_id'
@@ -5,6 +5,23 @@ summary: Update Agents in Team
description: All agents except the one passed in params will be removed
security:
- userApiKey: []
x-codeSamples:
- lang: python
label: "Replace team agents"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
# Replaces all current agents with the ones provided
client.teams.agents.add(
account_id=1,
team_id=5,
agent_ids=[10, 11]
)
requestBody:
required: true
content:
@@ -7,6 +7,25 @@ security:
description: Create a team in the account
parameters:
- $ref: '#/components/parameters/account_id'
x-codeSamples:
- lang: python
label: "Create a team"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
team = client.teams.create(
account_id=1,
name="Support Team",
description="Customer support team",
allow_auto_assign=True
)
print(team.id, team.name)
requestBody:
required: true
content:
@@ -5,6 +5,18 @@ summary: Delete a team
security:
- userApiKey: []
description: Delete a team from the account
x-codeSamples:
- lang: python
label: "Delete a team"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
client.teams.delete(account_id=1, team_id=5)
responses:
'200':
description: Success
+15
View File
@@ -5,6 +5,21 @@ summary: List all teams
security:
- userApiKey: []
description: List all teams available in the current account
x-codeSamples:
- lang: python
label: "List all teams"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
teams = client.teams.list(account_id=1)
for team in teams:
print(team.id, team.name)
responses:
'200':
description: Success
+14
View File
@@ -5,6 +5,20 @@ summary: Get a team details
security:
- userApiKey: []
description: Get the details of a team in the account
x-codeSamples:
- lang: python
label: "Get a team"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
team = client.teams.get(account_id=1, team_id=5)
print(team.name, team.description)
responses:
'200':
description: Success
@@ -5,6 +5,24 @@ summary: Update a team
security:
- userApiKey: []
description: Update a team's attributes
x-codeSamples:
- lang: python
label: "Update a team"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
team = client.teams.update(
account_id=1,
team_id=5,
name="New Team Name"
)
print(team.id, team.name)
requestBody:
required: true
content:
+14
View File
@@ -6,6 +6,20 @@ get:
description: Get the user profile details
security:
- userApiKey: []
x-codeSamples:
- lang: python
label: "Fetch profile"
source: |
from chatwoot import ChatwootClient
client = ChatwootClient(
base_url="https://app.chatwoot.com",
api_token="your-api-token"
)
profile = client.profile.get()
print(profile.name, profile.email)
responses:
'200':
description: Success
+126
View File
@@ -1943,6 +1943,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "List all agents",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nagents = client.agents.list(account_id=1)\n\nfor agent in agents:\n print(agent.name, agent.role)\n"
}
],
"responses": {
"200": {
"description": "Success",
@@ -1982,6 +1989,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Add a new agent",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nagent = client.agents.add(\n account_id=1,\n name=\"John Doe\",\n email=\"john@example.com\",\n role=\"agent\"\n)\n\nprint(agent.id, agent.name)\n"
}
],
"requestBody": {
"required": true,
"content": {
@@ -2034,6 +2048,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Update an agent",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nagent = client.agents.update(\n account_id=1,\n agent_id=10,\n name=\"Jane Doe\",\n role=\"administrator\"\n)\n\nprint(agent.id, agent.role)\n"
}
],
"parameters": [
{
"in": "path",
@@ -2100,6 +2121,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Remove an agent",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nclient.agents.remove(account_id=1, agent_id=10)\n"
}
],
"parameters": [
{
"in": "path",
@@ -5472,6 +5500,13 @@
"$ref": "#/components/parameters/account_id"
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "List all inboxes",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\ninboxes = client.inboxes.list(account_id=1)\n\nfor inbox in inboxes:\n print(inbox.id, inbox.name)\n"
}
],
"responses": {
"200": {
"description": "Success",
@@ -5542,6 +5577,13 @@
"required": true
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Get an inbox",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\ninbox = client.inboxes.get(account_id=1, inbox_id=5)\n\nprint(inbox.name, inbox.channel_type)\n"
}
],
"responses": {
"200": {
"description": "Success",
@@ -5594,6 +5636,13 @@
"$ref": "#/components/parameters/account_id"
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Create an API inbox",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\ninbox = client.inboxes.create(\n account_id=1,\n name=\"Support Inbox\",\n channel_type=\"api\"\n)\n\nprint(inbox.id, inbox.name)\n"
}
],
"requestBody": {
"required": true,
"content": {
@@ -5665,6 +5714,13 @@
"required": true
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Update an inbox",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\ninbox = client.inboxes.update(\n account_id=1,\n inbox_id=5,\n name=\"Updated Inbox Name\",\n enable_auto_assignment=True\n)\n\nprint(inbox.id, inbox.name)\n"
}
],
"requestBody": {
"required": true,
"content": {
@@ -6646,6 +6702,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Fetch profile",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nprofile = client.profile.get()\n\nprint(profile.name, profile.email)\n"
}
],
"responses": {
"200": {
"description": "Success",
@@ -6688,6 +6751,13 @@
}
],
"description": "List all teams available in the current account",
"x-codeSamples": [
{
"lang": "python",
"label": "List all teams",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nteams = client.teams.list(account_id=1)\n\nfor team in teams:\n print(team.id, team.name)\n"
}
],
"responses": {
"200": {
"description": "Success",
@@ -6732,6 +6802,13 @@
"$ref": "#/components/parameters/account_id"
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Create a team",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nteam = client.teams.create(\n account_id=1,\n name=\"Support Team\",\n description=\"Customer support team\",\n allow_auto_assign=True\n)\n\nprint(team.id, team.name)\n"
}
],
"requestBody": {
"required": true,
"content": {
@@ -6787,6 +6864,13 @@
}
],
"description": "Get the details of a team in the account",
"x-codeSamples": [
{
"lang": "python",
"label": "Get a team",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nteam = client.teams.get(account_id=1, team_id=5)\n\nprint(team.name, team.description)\n"
}
],
"responses": {
"200": {
"description": "Success",
@@ -6832,6 +6916,13 @@
}
],
"description": "Update a team's attributes",
"x-codeSamples": [
{
"lang": "python",
"label": "Update a team",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nteam = client.teams.update(\n account_id=1,\n team_id=5,\n name=\"New Team Name\"\n)\n\nprint(team.id, team.name)\n"
}
],
"requestBody": {
"required": true,
"content": {
@@ -6877,6 +6968,13 @@
}
],
"description": "Delete a team from the account",
"x-codeSamples": [
{
"lang": "python",
"label": "Delete a team",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nclient.teams.delete(account_id=1, team_id=5)\n"
}
],
"responses": {
"200": {
"description": "Success"
@@ -6925,6 +7023,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "List agents in team",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nagents = client.teams.agents.list(account_id=1, team_id=5)\n\nfor agent in agents:\n print(agent.name, agent.email)\n"
}
],
"parameters": [
{
"$ref": "#/components/parameters/account_id"
@@ -6982,6 +7087,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Add agents to team",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nclient.teams.agents.add(\n account_id=1,\n team_id=5,\n agent_ids=[10, 11, 12]\n)\n"
}
],
"requestBody": {
"required": true,
"content": {
@@ -7066,6 +7178,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Replace team agents",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\n# Replaces all current agents with the ones provided\nclient.teams.agents.add(\n account_id=1,\n team_id=5,\n agent_ids=[10, 11]\n)\n"
}
],
"requestBody": {
"required": true,
"content": {
@@ -7150,6 +7269,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Remove agents from team",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nclient.teams.agents.remove(\n account_id=1,\n team_id=5,\n agent_ids=[10]\n)\n"
}
],
"requestBody": {
"required": true,
"content": {
+126
View File
@@ -486,6 +486,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "List all agents",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nagents = client.agents.list(account_id=1)\n\nfor agent in agents:\n print(agent.name, agent.role)\n"
}
],
"responses": {
"200": {
"description": "Success",
@@ -525,6 +532,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Add a new agent",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nagent = client.agents.add(\n account_id=1,\n name=\"John Doe\",\n email=\"john@example.com\",\n role=\"agent\"\n)\n\nprint(agent.id, agent.name)\n"
}
],
"requestBody": {
"required": true,
"content": {
@@ -577,6 +591,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Update an agent",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nagent = client.agents.update(\n account_id=1,\n agent_id=10,\n name=\"Jane Doe\",\n role=\"administrator\"\n)\n\nprint(agent.id, agent.role)\n"
}
],
"parameters": [
{
"in": "path",
@@ -643,6 +664,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Remove an agent",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nclient.agents.remove(account_id=1, agent_id=10)\n"
}
],
"parameters": [
{
"in": "path",
@@ -4015,6 +4043,13 @@
"$ref": "#/components/parameters/account_id"
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "List all inboxes",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\ninboxes = client.inboxes.list(account_id=1)\n\nfor inbox in inboxes:\n print(inbox.id, inbox.name)\n"
}
],
"responses": {
"200": {
"description": "Success",
@@ -4085,6 +4120,13 @@
"required": true
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Get an inbox",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\ninbox = client.inboxes.get(account_id=1, inbox_id=5)\n\nprint(inbox.name, inbox.channel_type)\n"
}
],
"responses": {
"200": {
"description": "Success",
@@ -4137,6 +4179,13 @@
"$ref": "#/components/parameters/account_id"
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Create an API inbox",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\ninbox = client.inboxes.create(\n account_id=1,\n name=\"Support Inbox\",\n channel_type=\"api\"\n)\n\nprint(inbox.id, inbox.name)\n"
}
],
"requestBody": {
"required": true,
"content": {
@@ -4208,6 +4257,13 @@
"required": true
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Update an inbox",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\ninbox = client.inboxes.update(\n account_id=1,\n inbox_id=5,\n name=\"Updated Inbox Name\",\n enable_auto_assignment=True\n)\n\nprint(inbox.id, inbox.name)\n"
}
],
"requestBody": {
"required": true,
"content": {
@@ -5189,6 +5245,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Fetch profile",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nprofile = client.profile.get()\n\nprint(profile.name, profile.email)\n"
}
],
"responses": {
"200": {
"description": "Success",
@@ -5231,6 +5294,13 @@
}
],
"description": "List all teams available in the current account",
"x-codeSamples": [
{
"lang": "python",
"label": "List all teams",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nteams = client.teams.list(account_id=1)\n\nfor team in teams:\n print(team.id, team.name)\n"
}
],
"responses": {
"200": {
"description": "Success",
@@ -5275,6 +5345,13 @@
"$ref": "#/components/parameters/account_id"
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Create a team",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nteam = client.teams.create(\n account_id=1,\n name=\"Support Team\",\n description=\"Customer support team\",\n allow_auto_assign=True\n)\n\nprint(team.id, team.name)\n"
}
],
"requestBody": {
"required": true,
"content": {
@@ -5330,6 +5407,13 @@
}
],
"description": "Get the details of a team in the account",
"x-codeSamples": [
{
"lang": "python",
"label": "Get a team",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nteam = client.teams.get(account_id=1, team_id=5)\n\nprint(team.name, team.description)\n"
}
],
"responses": {
"200": {
"description": "Success",
@@ -5375,6 +5459,13 @@
}
],
"description": "Update a team's attributes",
"x-codeSamples": [
{
"lang": "python",
"label": "Update a team",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nteam = client.teams.update(\n account_id=1,\n team_id=5,\n name=\"New Team Name\"\n)\n\nprint(team.id, team.name)\n"
}
],
"requestBody": {
"required": true,
"content": {
@@ -5420,6 +5511,13 @@
}
],
"description": "Delete a team from the account",
"x-codeSamples": [
{
"lang": "python",
"label": "Delete a team",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nclient.teams.delete(account_id=1, team_id=5)\n"
}
],
"responses": {
"200": {
"description": "Success"
@@ -5468,6 +5566,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "List agents in team",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nagents = client.teams.agents.list(account_id=1, team_id=5)\n\nfor agent in agents:\n print(agent.name, agent.email)\n"
}
],
"parameters": [
{
"$ref": "#/components/parameters/account_id"
@@ -5525,6 +5630,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Add agents to team",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nclient.teams.agents.add(\n account_id=1,\n team_id=5,\n agent_ids=[10, 11, 12]\n)\n"
}
],
"requestBody": {
"required": true,
"content": {
@@ -5609,6 +5721,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Replace team agents",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\n# Replaces all current agents with the ones provided\nclient.teams.agents.add(\n account_id=1,\n team_id=5,\n agent_ids=[10, 11]\n)\n"
}
],
"requestBody": {
"required": true,
"content": {
@@ -5693,6 +5812,13 @@
"userApiKey": []
}
],
"x-codeSamples": [
{
"lang": "python",
"label": "Remove agents from team",
"source": "from chatwoot import ChatwootClient\n\nclient = ChatwootClient(\n base_url=\"https://app.chatwoot.com\",\n api_token=\"your-api-token\"\n)\n\nclient.teams.agents.remove(\n account_id=1,\n team_id=5,\n agent_ids=[10]\n)\n"
}
],
"requestBody": {
"required": true,
"content": {