> ## 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 Department Information

> Get information about a specific department using the department ID.
At least one of the following permissions is required:
* `view-livechat-departments`
* `view-l-room`

### Changelog
| Version      | Description |
| ---------------- | ------------|
|2.2.0             | Added `includeAgents` query parameter|
|0.42.0            | Added       |

## OpenAPI

````json GET /api/v1/livechat/department/{_id}
{
  "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/department/{_id}": {
      "get": {
        "summary": "Get Department Information",
        "description": "Get information about a specific department using the department ID.\nAt least one of the following permissions is required:\n* `view-livechat-departments`\n* `view-l-room`\n\n### Changelog\n| Version      | Description |\n| ---------------- | ------------|\n|2.2.0             | Added `includeAgents` query parameter|\n|0.42.0            | Added       |",
        "operationId": "get-api-v1-livechat-department-:_id",
        "parameters": [
          {
            "$ref": "#/components/parameters/AuthToken"
          },
          {
            "$ref": "#/components/parameters/UserId"
          },
          {
            "name": "includeAgents",
            "in": "query",
            "description": "If agents should be included in the result. By default, the value is true and the list of agents is returned. The agents field will only be returned if the user has the `view-livechat-departments` permission.",
            "schema": {
              "type": "boolean"
            },
            "example": "true"
          },
          {
            "name": "_id",
            "in": "path",
            "description": "The department ID.",
            "required": "true",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "department": {
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "numAgents": {
                          "type": "integer"
                        },
                        "showOnRegistration": {
                          "type": "boolean"
                        },
                        "_updatedAt": {
                          "type": "string"
                        }
                      }
                    },
                    "agents": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "departmentId": {
                            "type": "string"
                          },
                          "username": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer"
                          },
                          "order": {
                            "type": "integer"
                          },
                          "_updatedAt": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "success": {
                      "type": "boolean"
                    }
                  }
                },
                "examples": {
                  "Success Example": {
                    "value": {
                      "department": {
                        "_id": "iTfLCX3qqwKgf5uqg",
                        "enabled": "false",
                        "name": "new from api",
                        "description": "creating a department",
                        "numAgents": "1",
                        "showOnRegistration": "true",
                        "_updatedAt": "2016-12-13T17:22:19.109Z"
                      },
                      "agents": [
                        {
                          "_id": "DDjZbhTF74n3NBuWK",
                          "agentId": "SQafHvoFPuB57NmBD",
                          "departmentId": "iTfLCX3qqwKgf5uqg",
                          "username": "john.doe",
                          "count": "0",
                          "order": "0",
                          "_updatedAt": "2016-12-13T17:22:19.169Z"
                        }
                      ],
                      "success": "true"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/authorizationError"
          },
          "403": {
            "$ref": "#/components/responses/permissionError"
          }
        },
        "tags": [
          "Omnichannel Departments"
        ]
      }
    }
  },
  "components": {
    "parameters": {
      "AuthToken": {
        "name": "X-Auth-Token",
        "in": "header",
        "description": "The `authToken` of the authenticated user.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f"
      },
      "UserId": {
        "name": "X-User-Id",
        "in": "header",
        "description": "The `userId` of the authenticated user.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "rbAXPnMktTFbNpwtJ"
      }
    },
    "responses": {
      "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"
                }
              }
            }
          }
        }
      }
    }
  }
}
````

