47 lines
1.0 KiB
YAML
47 lines
1.0 KiB
YAML
tags:
|
|
- Agents
|
|
operationId: add-new-agent-to-account
|
|
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:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/agent_create_payload'
|
|
responses:
|
|
'200':
|
|
description: Success
|
|
content:
|
|
application/json:
|
|
schema:
|
|
description: 'Newly Created Agent'
|
|
$ref: '#/components/schemas/agent'
|
|
'403':
|
|
description: Access denied
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/bad_request_error'
|