---
title: "POST /metrics/userdata/{InstanceId}"
method: POST
path: "/metrics/userdata/{InstanceId}"
---

# POST /metrics/userdata/{InstanceId}

`POST /metrics/userdata/{InstanceId}`

Gets the real-time active user data from the specified Amazon Connect instance.

## Path parameters

- `InstanceId` string, required

## Query parameters

- `MaxResults` string
- `NextToken` string

## Request body

- object
  - `Filters` object, required — A filter for the user data.
    - `Queues` QueueId[] — A list of up to 100 queues or ARNs.
    - `ContactFilter` object — A filter for the user data based on the contact information that is associated to the user. It contains a list of contact states.
      - `ContactStates` ContactState[] — A list of up to 9 <a href="https://docs.aws.amazon.com/connect/latest/adminguide/about-contact-states.html">contact states</a>.
    - `RoutingProfiles` RoutingProfileId[] — A list of up to 100 routing profile IDs or ARNs.
    - `Agents` UserId[] — A list of up to 100 agent IDs or ARNs.
    - `UserHierarchyGroups` HierarchyGroupId[] — A UserHierarchyGroup ID or ARN.
  - `NextToken` string — The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
  - `MaxResults` integer — The maximum number of results to return per page.

## Response `200`

Success

- GetCurrentUserDataResponse
  - `NextToken` string — If there are additional results, this is the token for the next set of results.
  - `UserDataList` UserData[] — A list of the user data that is returned.
    - `User` object — Information about the user for the data that is returned. It contains the <code>resourceId</code> and ARN of the user.
      - `Id` string — The unique identifier for the user.
      - `Arn` string — The Amazon Resource Name (ARN) for the user.
    - `RoutingProfile` object — Information about the routing profile that is assigned to the user.
      - `Id` string — The identifier of the routing profile.
      - `Arn` string — The Amazon Resource Name (ARN) of the routing profile.
    - `HierarchyPath` object — Contains information about the levels of a hierarchy group assigned to a user.
      - `LevelOne` object — Information about level one.
        - `Id` string — The unique identifier for the hierarchy group.
        - `Arn` string — The Amazon Resource Name (ARN) for the hierarchy group.
      - `LevelTwo` object — Information about level two.
        - `Id` string — The unique identifier for the hierarchy group.
        - `Arn` string — The Amazon Resource Name (ARN) for the hierarchy group.
      - `LevelThree` object — Information about level three.
        - `Id` string — The unique identifier for the hierarchy group.
        - `Arn` string — The Amazon Resource Name (ARN) for the hierarchy group.
      - `LevelFour` object — Information about level four.
        - `Id` string — The unique identifier for the hierarchy group.
        - `Arn` string — The Amazon Resource Name (ARN) for the hierarchy group.
      - `LevelFive` object — Information about level five.
        - `Id` string — The unique identifier for the hierarchy group.
        - `Arn` string — The Amazon Resource Name (ARN) for the hierarchy group.
    - `Status` object — The status of the agent that they manually set in their Contact Control Panel (CCP), or that the supervisor manually changes in the real-time metrics report.
      - `StatusStartTimestamp` string, date-time — The start timestamp of the agent's status.
      - `StatusArn` string — The Amazon Resource Name (ARN) of the agent's status.
      - `StatusName` string — The name of the agent status.
    - `AvailableSlotsByChannel` object — A map of available slots by channel. The key is a channel name. The value is an integer: the available number of slots.
    - `MaxSlotsByChannel` object — A map of maximum slots by channel. The key is a channel name. The value is an integer: the maximum number of slots. This is calculated from <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_MediaConcurrency.html">MediaConcurrency</a> of the <code>RoutingProfile</code> assigned to the agent.
    - `ActiveSlotsByChannel` object — A map of active slots by channel. The key is a channel name. The value is an integer: the number of active slots.
    - `Contacts` AgentContactReference[] — A list of contact reference information.
      - `ContactId` string — The identifier of the contact in this instance of Amazon Connect.
      - `Channel` 'VOICE' | 'CHAT' | 'TASK' — The channel of the contact.
      - `InitiationMethod` 'INBOUND' | 'OUTBOUND' | 'TRANSFER' | 'QUEUE_TRANSFER' | 'CALLBACK' | 'API' | 'DISCONNECT' | 'MONITOR' — How the contact was initiated.
      - `AgentContactState` 'INCOMING' | 'PENDING' | 'CONNECTING' | 'CONNECTED' | 'CONNECTED_ONHOLD' | 'MISSED' | 'ERROR' | 'ENDED' | 'REJECTED' — The <a href="https://docs.aws.amazon.com/connect/latest/adminguide/about-contact-states.html">state of the contact</a>.
      - `StateStartTimestamp` string, date-time — The epoch timestamp when the contact state started.
      - `ConnectedToAgentTimestamp` string, date-time — The time at which the contact was connected to an agent.
      - `Queue` QueueReference — Contains information about a queue resource for which metrics are returned.
        - `Id` string — The identifier of the queue.
        - `Arn` string — The Amazon Resource Name (ARN) of the queue.
    - `NextStatus` string — The Next status of the agent.
  - `ApproximateTotalCount` integer — The total count of the result, regardless of the current page size.

## Other responses

- `480` — InvalidRequestException
- `481` — InvalidParameterException
- `482` — InternalServiceException
- `483` — ThrottlingException
- `484` — ResourceNotFoundException

---

[API](https://skmtc.net/aws/apis/connect.md) · [All operations](https://skmtc.net/aws/apis/connect/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/connect/versions/fbcf0a4faed2/schema)
