> ## Documentation Index
> Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Conversation by Agents

> 
<div style="text-align: center; margin: 1rem 0 1rem 0;"><img src="https://raw.githubusercontent.com/RocketChat/Rocket.Chat-Open-API/main/images/Enterprise%20tag.svg" alt="Enterprise" style="display: block; margin: auto;"></div>

View the metrics of omnichannel conversations in your workspace during a selected time range based on the agents in your workspace. <br>

Permission required: `view-livechat-reports`

### Changelog
| Version      | Description |
| ------------ | ------------|
|6.4.0         | Added       |

## OpenAPI

````json GET /api/v1/livechat/analytics/dashboards/conversations-by-agent
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "Omnichannel"
  },
  "servers": [
    {
      "url": "https://apiexplorer.support.rocket.chat"
    }
  ],
  "tags": [
    {
      "name": "Omnichannel Users"
    },
    {
      "name": "Omnichannel Agents"
    },
    {
      "name": "Omnichannel Monitors"
    },
    {
      "name": "Omnichannel Visitors"
    },
    {
      "name": "Omnichannel Contacts"
    },
    {
      "name": "Omnichannel Rooms"
    },
    {
      "name": "Omnichannel Departments"
    },
    {
      "name": "Omnichannel Custom Fields"
    },
    {
      "name": "Omnichannel Business Hours"
    },
    {
      "name": "Omnichannel Priorities"
    },
    {
      "name": "Omnichannel Tags"
    },
    {
      "name": "Omnichannel Units"
    },
    {
      "name": "SLA Policies"
    },
    {
      "name": "Canned Responses"
    },
    {
      "name": "Omnichannel Transcript"
    },
    {
      "name": "Omnichannel Statistics"
    },
    {
      "name": "Omnichannel Agent Stats"
    },
    {
      "name": "Omnichannel Dashboards"
    },
    {
      "name": "Reports"
    },
    {
      "name": "Omnichannel Inquiries"
    },
    {
      "name": "Omnichannel Webhooks"
    },
    {
      "name": "Livechat"
    },
    {
      "name": "Livechat Appearance"
    },
    {
      "name": "Livechat Triggers"
    },
    {
      "name": "Livechat Messages"
    },
    {
      "name": "Livechat Page Visited"
    }
  ],
  "paths": {
    "/api/v1/livechat/analytics/dashboards/conversations-by-agent": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Get Conversation by Agents",
        "description": "\n<div style=\"text-align: center; margin: 1rem 0 1rem 0;\"><img src=\"https://raw.githubusercontent.com/RocketChat/Rocket.Chat-Open-API/main/images/Enterprise%20tag.svg\" alt=\"Enterprise\" style=\"display: block; margin: auto;\"></div>\n\nView the metrics of omnichannel conversations in your workspace during a selected time range based on the agents in your workspace. <br>\n\nPermission required: `view-livechat-reports`\n\n### Changelog\n| Version      | Description |\n| ------------ | ------------|\n|6.4.0         | Added       |",
        "operationId": "get-api-v1-livechat-analytics-dashboards-conversations-by-agent",
        "parameters": [
          {
            "$ref": "#/components/parameters/UserId"
          },
          {
            "$ref": "#/components/parameters/AuthToken"
          },
          {
            "$ref": "#/components/parameters/start"
          },
          {
            "$ref": "#/components/parameters/end"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string"
                          },
                          "value": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "unspecified": {
                      "type": "integer"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  }
                },
                "examples": {
                  "Success Example": {
                    "value": {
                      "total": "51",
                      "data": [
                        {
                          "label": "9iN96PXnDK7XAYESA",
                          "value": "4"
                        },
                        {
                          "label": "Dialog Bot",
                          "value": "1"
                        },
                        {
                          "label": "Jane Kim",
                          "value": "15"
                        },
                        {
                          "label": "Baek Kim",
                          "value": "1"
                        },
                        {
                          "label": "agent5",
                          "value": "5"
                        },
                        {
                          "label": "Rod",
                          "value": "5"
                        },
                        {
                          "label": "User One",
                          "value": "6"
                        },
                        {
                          "label": "oDCQTTquRFJWZtFxY",
                          "value": "1"
                        },
                        {
                          "label": "sDNa65jXv4JaiGKQP",
                          "value": "1"
                        },
                        {
                          "label": "testC",
                          "value": "12"
                        }
                      ],
                      "unspecified": "9",
                      "success": "true"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/startendError"
          },
          "401": {
            "$ref": "#/components/responses/authorizationError"
          },
          "403": {
            "$ref": "#/components/responses/permissionError"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "UserId": {
        "name": "X-User-Id",
        "in": "header",
        "description": "The `userId` of the authenticated user.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "rbAXPnMktTFbNpwtJ"
      },
      "AuthToken": {
        "name": "X-Auth-Token",
        "in": "header",
        "description": "The `authToken` of the authenticated user.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f"
      },
      "start": {
        "name": "start",
        "in": "query",
        "description": "The start date.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "2020-09-10T23:59:22.345Z"
      },
      "end": {
        "name": "end",
        "in": "query",
        "description": "The end date.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "2020-09-09T00:11:22.345Z"
      }
    },
    "responses": {
      "startendError": {
        "description": "Bad Request",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error": {
                  "type": "string"
                },
                "errorType": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "Example 1": {
                "value": {
                  "success": "false",
                  "error": "must have required property 'start' [invalid-params]",
                  "errorType": "invalid-params"
                }
              },
              "Example 2": {
                "value": {
                  "success": "false",
                  "error": "The \"start\" query parameter must be a valid date."
                }
              },
              "Example 3": {
                "value": {
                  "success": "false",
                  "error": "must have required property 'end' [invalid-params]",
                  "errorType": "invalid-params"
                }
              },
              "Example 4": {
                "value": {
                  "success": "false",
                  "error": "The \"end\" query parameter must be a valid date."
                }
              }
            }
          }
        }
      },
      "authorizationError": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "Authorization Error": {
                "value": {
                  "status": "error",
                  "message": "You must be logged in to do this."
                }
              }
            }
          }
        }
      },
      "permissionError": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "Permission Error": {
                "value": {
                  "success": "false",
                  "error": "User does not have the permissions required for this action [error-unauthorized]"
                }
              },
              "Unauthorized": {
                "value": {
                  "success": "false",
                  "error": "unauthorized"
                }
              }
            }
          }
        }
      }
    }
  }
}
````

