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

# Agent Activity API

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

Use this API to get agent status in real-time or changes stacked every 30 seconds.

| **Field**         | **Details**                                                                                                                     |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **Method**        | GET                                                                                                                             |
| **Endpoint**      | `https://{{host}}/agentassist/api/public/analytics/account/{{AccountID}}/agentactivity`                                         |
| **Content-Type**  | `application/json`                                                                                                              |
| **Authorization** | `auth: {{JWT}}` See [How to generate the JWT Token](/ai-for-service/apis/automation/api-introduction#generating-the-jwt-token). |
| **API Scope**     | WFM Integration                                                                                                                 |

## Path Parameters

| **Parameter** | **Description**                                      | **Type**         |
| ------------- | ---------------------------------------------------- | ---------------- |
| `host`        | Environment URL. Example: `https://platform.kore.ai` | string, required |
| `AccountId`   | Unique identifier associated with the account.       | string, required |

## Sample Request

```bash theme={null}
curl --location 'https://{{host}}/agentassist/api/public/analytics/account/636f5b36bcf8a8c7101exxxx/agentactivity?fromTimeStamp=2023-04-02T09%3A45%3A00Z&toTimeStamp=2023-04-06T10%3A00%3A00Z' \
--header 'auth: <token>' \
--header 'Content-Type: application/json' \
--header 'iId: {{streamId}}' 
```

## Header Parameters

| **Header**     | **Description**                                      | **Optional/Required** |
| -------------- | ---------------------------------------------------- | --------------------- |
| `content-type` | Request body format (application/json;charset=UTF-8) | Required              |
| `auth`         | JWT authentication token                             | Required              |
| `iId`          | Stream or application id                             | Required              |

## Sample Response

```
{
"accountId":"63fb9a0f90425b644d3exxxx",
 	"AgentUpdates": [
{
 	"AgentId":"a-59bb17e-0cae-46b0-8d80-a8a8ac34xxxx",
"EventTime":"10/20/2020 2:13:12",
"Activity":"notready",
"ReasonCode":"1"
        }
    ]
}
```

## Response Body Parameters

| **Parameter**             | **Description**                                                                 | **Type** |
| ------------------------- | ------------------------------------------------------------------------------- | -------- |
| `accountId`               | Unique ID associated with the account. For example, `63fb9a0f90425b644d3exxxx`. | String   |
| `agentUpdates`            | List of objects defining updates to agent statuses.                             | Array    |
| `agentUpdates.agentId`    | Unique ID of the agent. For example, `a-59bb17e-0cae-46b0-8d80-a8a8ac34xxxx`.   | String   |
| `agentUpdates.eventTime`  | Timestamp of the event in `MM/DD/YYYY HH:MM:SS` format.                         | String   |
| `agentUpdates.activity`   | Agent's activity status at the time of the event. For example, `"notready"`.    | String   |
| `agentUpdates.reasonCode` | Code representing the reason for the agent's status change. For example, `"1"`. | String   |
