chore: Move agent availability to Account level (#3074)

- Move agent availability to the account level
This commit is contained in:
Sojan Jose
2021-10-07 13:21:46 +05:30
committed by GitHub
parent 1c6a539c0a
commit c54aae21ff
84 changed files with 618 additions and 148 deletions

View File

@@ -1103,6 +1103,219 @@
}
}
},
"/api/v1/accounts/{account_id}/agents": {
"get": {
"tags": [
"Agent"
],
"operationId": "get-account-agents",
"summary": "List Agents in Account",
"description": "Get Details of Agents in an Account",
"security": [
{
"userApiKey": [
]
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"description": "Array of all active agents",
"items": {
"$ref": "#/definitions/agent"
}
}
},
"403": {
"description": "Access denied"
}
}
},
"post": {
"tags": [
"Agent"
],
"operationId": "add-new-agent-to-account",
"summary": "Add a New Agent",
"description": "Add a new Agent to Account",
"security": [
{
"userApiKey": [
]
}
],
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Full Name of the agent",
"required": true
},
"email": {
"type": "string",
"description": "Email of the Agent",
"required": true
},
"role": {
"type": "string",
"enum": [
"agent",
"administrator"
],
"description": "Whether its administrator or agent",
"required": true
},
"availability_status": {
"type": "string",
"enum": [
"available",
"busy",
"offline"
],
"description": "The availability status of the agent."
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away."
}
}
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/agent"
}
},
"403": {
"description": "Access denied"
}
}
}
},
"/api/v1/accounts/{account_id}/agents/{id}": {
"patch": {
"tags": [
"Agent"
],
"operationId": "update-agent-in-account",
"summary": "Update Agent in Account",
"description": "Update an Agent in Account",
"security": [
{
"userApiKey": [
]
}
],
"parameters": [
{
"in": "path",
"name": "id",
"schema": {
"type": "integer"
},
"required": true,
"description": "The ID of the agent to be updated."
},
{
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"role": {
"type": "string",
"enum": [
"agent",
"administrator"
],
"description": "Whether its administrator or agent",
"required": true
},
"availability_status": {
"type": "string",
"enum": [
"available",
"busy",
"offline"
],
"description": "The availability status of the agent."
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away."
}
}
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/agent"
}
},
"404": {
"description": "Agent not found"
},
"403": {
"description": "Access denied"
}
}
},
"delete": {
"tags": [
"Agent"
],
"operationId": "delete-agent-from-account",
"summary": "Remove an Agent from Account",
"description": "Remove an Agent from Account",
"security": [
{
"userApiKey": [
]
}
],
"parameters": [
{
"in": "path",
"name": "id",
"schema": {
"type": "integer"
},
"required": true,
"description": "The ID of the agent to be deleted"
}
],
"responses": {
"200": {
"description": "Success"
},
"404": {
"description": "Agent not found"
},
"403": {
"description": "Access denied"
}
}
}
},
"/api/v1/accounts/{account_id}/contacts": {
"get": {
"tags": [
@@ -3432,7 +3645,7 @@
"type": "object",
"properties": {
"id": {
"type": "number"
"type": "integer"
},
"uid": {
"type": "string"
@@ -3450,7 +3663,7 @@
"type": "string"
},
"account_id": {
"type": "number"
"type": "integer"
},
"role": {
"type": "string",
@@ -3462,6 +3675,19 @@
"confirmed": {
"type": "boolean"
},
"availability_status": {
"type": "string",
"enum": [
"available",
"busy",
"offline"
],
"description": "The availability status of the agent computed by Chatwoot."
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away."
},
"custom_attributes": {
"type": "object",
"description": "Available for users who are created through platform APIs and has custom attributes associated."
@@ -4556,6 +4782,7 @@
"name": "Application",
"tags": [
"Account AgentBots",
"Agent",
"Contact",
"Conversation",
"Conversation Assignment",