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

# Fetch Agents using Queues API

<Badge icon="arrow-left" color="gray">[Back to API List](/ai-for-service/apis/quality-ai/api-list)</Badge>

Fetches a list of agents associated with one or more Quality AI queues.

| **Method** | POST |
| - | - |
| **Endpoint** | `https://{{host}}/qualityai/api/v1/public/{{streamId}}/agentsbyqueueids` |
| **Content-Type** | `application/json` |
| **Authorization** | `auth: {{JWT_TOKEN}}` See [How to generate the JWT Token](/ai-for-service/apis/automation/api-introduction#generating-the-jwt-token). |
| **API Scope** | SmartAssist Analytics |

## Path Parameters

| Parameter | Description | Type |
| - | - | - |
| `host` | Environment URL. For example, `https://platform.kore.ai` | String, required |
| `streamId` | Unique identifier of the stream. | String, required |
| `agentsbyqueueids` | Unique identifier of the agentsbyqueueids. | String, required |

## Header Parameters

| Parameter | Description | Type |
| - | - | - |
| `auth` | Authentication token used to authorize the request. | String, required |
| `accountId` | Unique account identifier. | String, required |
| `iid` | Unique Stream identifier. | String, required |

## Sample Request

```bash expandable=true theme={null}
curl --location --request POST 'https://{{host}}/qualityai/api/v1/public/{{streamId}}/agentsbyqueueids' \
--header 'auth: {{JWT_TOKEN}}' \
--header 'Content-Type: application/json' \
--header 'iId: {{streamId}}' \
--header 'accountId: {{accountId}}' \
--data-raw '{
  "customQueueIds": ["RETAIL_L1", "EXPRESS_COLLECTIONS"]
}'
```

## Request Body Parameters

| Field | Type | Description |
| - | - | - |
| `customQueueIds` | Array | List of custom queue IDs for which to retrieve the mapped agents. |

## Sample Response

```json expandable=true theme={null}
{
  "results": [
    {
      "_id": "a-065dbe9-8c49-4b********11a1a690660",
      "agentId": "a-065dbe9-8c4*********6-a11a1a690660",
      "firstName": "",
      "lastName": "",
      "fullName": "UmaQM Prod Supervisor",
      "emailId": "john.doe@example.com",
      "profImage": "no-avatar",
      "userId": "u-482020c0-***********cd3-a1c49a9fa5fa",
      "skills": [],
      "agentGroups": [
        {
          "groupId": "ag-5c218da-7*********ad-454d95c7be6d",
          "role": "agent"
        }
      ],
      "queues": [
        {
          "queueId": "qu-471cda8d-**********f-d70ab60223bd",
          "customQueueId": "b3dc1201-***********8c3-aebecbdbcda8",
          "queueName": "Kore_Inbound_Queue"
        }
      ]
    }
  ],
  "skip": 0,
  "limit": 100,
  "hasMore": false,
  "totalPages": 1,
  "totalResults": 5
}
```

## Response Body Parameters

| Field | Type | Description |
| - | - | - |
| `_id` | String | Unique identifier of the agent record. |
| `agentId` | String | Unique identifier of the agent. |
| `firstName` | String | First name of the agent. |
| `lastName` | String | Last name of the agent. |
| `fullName` | String | Full name of the agent. |
| `emailId` | String | Email address of the agent. |
| `profImage` | String | Profile image identifier of the agent. |
| `userId` | String | Unique identifier of the user associated with the agent. |
| `skills` | Array | Lists the skills assigned to the agent. |
| `agentGroups` | Array | Lists the groups assigned to the agent. |
| `queues` | Array | Lists the queues assigned to the agent. |
| `skip` | Integer | Number of records skipped from the beginning of the result set. |
| `limit` | Integer | Maximum number of records returned in the response. |
| `hasMore` | Boolean | Indicates whether more results are available. |
| `totalPages` | Integer | Total number of pages available for the request. |
| `totalResults` | Integer | Total number of results available. |
