99 lines
2.4 KiB
YAML
99 lines
2.4 KiB
YAML
tags:
|
|
- Conversation Assignments
|
|
operationId: assign-a-conversation
|
|
summary: Assign Conversation
|
|
description: Assign a conversation to an agent or a team
|
|
security:
|
|
- userApiKey: []
|
|
- agentBotApiKey: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
assignee_id:
|
|
type: number
|
|
description: Id of the assignee user
|
|
example: 1
|
|
team_id:
|
|
type: number
|
|
description: Id of the team. If the assignee_id is present, this param would be ignored
|
|
example: 1
|
|
x-codeSamples:
|
|
- lang: python
|
|
label: "Assign to an agent"
|
|
source: |
|
|
from chatwoot import ChatwootClient
|
|
|
|
client = ChatwootClient(
|
|
base_url="https://app.chatwoot.com",
|
|
api_token="your-api-token"
|
|
)
|
|
|
|
conversation = client.conversations.assign(
|
|
account_id=1,
|
|
conversation_id=42,
|
|
assignee_id=10
|
|
)
|
|
- lang: python
|
|
label: "Assign to a team"
|
|
source: |
|
|
from chatwoot import ChatwootClient
|
|
|
|
client = ChatwootClient(
|
|
base_url="https://app.chatwoot.com",
|
|
api_token="your-api-token"
|
|
)
|
|
|
|
conversation = client.conversations.update(
|
|
account_id=1,
|
|
conversation_id=42,
|
|
team_id=5
|
|
)
|
|
responses:
|
|
'200':
|
|
description: Success
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/user'
|
|
'401':
|
|
description: Unauthorized
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/bad_request_error'
|
|
'404':
|
|
description: Conversation not found
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/bad_request_error'
|
|
x-codeSamples:
|
|
- lang: Python
|
|
label: Assign to an agent
|
|
source: |
|
|
from chatwoot import ChatwootClient
|
|
|
|
client = ChatwootClient(url="https://app.chatwoot.com", api_key="your-api-key")
|
|
|
|
conversation = client.conversations.assign(
|
|
account_id=1,
|
|
conversation_id=42,
|
|
assignee_id=10
|
|
)
|
|
- lang: Python
|
|
label: Assign to a team
|
|
source: |
|
|
from chatwoot import ChatwootClient
|
|
|
|
client = ChatwootClient(url="https://app.chatwoot.com", api_key="your-api-key")
|
|
|
|
conversation = client.conversations.assign(
|
|
account_id=1,
|
|
conversation_id=42,
|
|
team_id=5
|
|
)
|