> ## 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 Departments by ID > Get a list of departments by department IDs. At least one of the following permissions is required: * `view-livechat-departments` * `view-l-room` ## OpenAPI ````json GET /api/v1/livechat/department.listByIds { "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.listByIds": { "get": { "summary": "Get Departments by ID", "description": "Get a list of departments by department IDs. At least one of the following permissions is required:\n * `view-livechat-departments`\n * `view-l-room`", "operationId": "get-api-v1-livechat-department.listByIds", "parameters": [ { "$ref": "#/components/parameters/AuthToken" }, { "$ref": "#/components/parameters/UserId" }, { "name": "ids", "in": "query", "description": "The department ID.", "required": "true", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "departments": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string" }, "enabled": { "type": "boolean" }, "name": { "type": "string" }, "description": { "type": "string" }, "showOnRegistration": { "type": "boolean" }, "showOnOfflineForm": { "type": "boolean" }, "requestTagBeforeClosingChat": { "type": "boolean" }, "email": { "type": "string" }, "chatClosingTags": { "type": "array", "items": { "type": "object" } }, "offlineMessageChannelName": { "type": "string" }, "abandonedRoomsCloseCustomMessage": { "type": "string" }, "waitingQueueMessage": { "type": "string" }, "departmentsAllowedToForward": { "type": "string" }, "_updatedAt": { "type": "string" }, "numAgents": { "type": "integer" }, "ancestors": { "type": "array", "items": { "type": "string" } }, "maxNumberSimultaneousChat": { "type": "string" }, "type": { "type": "string" }, "visitorInactivityTimeoutInSeconds": { "type": "string" }, "parentId": { "type": "string" } } } }, "success": { "type": "boolean" } } }, "examples": { "Success Example": { "value": { "departments": [ { "_id": "4LCeYmCHHnQ3EDBgf", "enabled": "true", "name": "Chatbot Sales", "description": "", "showOnRegistration": "false", "showOnOfflineForm": "false", "requestTagBeforeClosingChat": "false", "email": "chatbotSales@g.c", "chatClosingTags": [], "offlineMessageChannelName": "", "abandonedRoomsCloseCustomMessage": "", "waitingQueueMessage": "", "departmentsAllowedToForward": "", "_updatedAt": "2021-07-15T15:11:16.856Z", "numAgents": "4", "ancestors": [] }, { "_id": "CAJioQNAvLnYWTy8i", "enabled": "true", "name": "Support", "description": "", "showOnRegistration": "true", "showOnOfflineForm": "true", "requestTagBeforeClosingChat": "false", "email": "mary@rocket.chat", "maxNumberSimultaneousChat": "", "waitingQueueMessage": "", "type": "d", "numAgents": "28", "_updatedAt": "2021-07-21T23:54:35.574Z", "ancestors": [ "sriw2wmP2Zz2pPrre" ], "chatClosingTags": [], "abandonedRoomsCloseCustomMessage": "", "departmentsAllowedToForward": "", "offlineMessageChannelName": "", "visitorInactivityTimeoutInSeconds": "10", "parentId": "sriw2wmP2Zz2pPrre" }, { "_id": "mHcx4rbi7htAmCCR5", "enabled": "true", "name": "Chatbot Support", "description": "", "showOnRegistration": "false", "showOnOfflineForm": "false", "requestTagBeforeClosingChat": "false", "email": "chatbotSupport@g.c", "chatClosingTags": [], "offlineMessageChannelName": "", "abandonedRoomsCloseCustomMessage": "", "waitingQueueMessage": "", "departmentsAllowedToForward": "", "_updatedAt": "2021-06-28T22:10:01.371Z", "numAgents": "3", "ancestors": [ "sriw2wmP2Zz2pPrre" ], "parentId": "sriw2wmP2Zz2pPrre" } ], "success": "true" } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" } } }, "examples": { "Example 1": { "value": { "success": "false", "error": "The 'ids' param is required" } }, "Example 2": { "value": { "success": "false", "error": "The 'ids' param must be an array" } } } } } }, "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" } } } } } } } } } ````