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

# POST /metrics/current/{InstanceId}

`POST /metrics/current/{InstanceId}`

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

For a description of each metric, see [Real-time Metrics Definitions](https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html) in the _Amazon Connect Administrator Guide_.

## Path parameters

- `InstanceId` string, required

## Query parameters

- `MaxResults` string
- `NextToken` string

## Request body

- object
  - `Filters` object, required — Contains the filter to apply when retrieving metrics.
    - `Queues` QueueId[] — The queues to use to filter the metrics. You should specify at least one queue, and can specify up to 100 queues per request. The <code>GetCurrentMetricsData</code> API in particular requires a queue when you include a <code>Filter</code> in your request.
    - `Channels` Channel[] — The channel to use to filter the metrics.
    - `RoutingProfiles` RoutingProfileId[] — A list of up to 100 routing profile IDs or ARNs.
  - `Groupings` Grouping[] — <p>The grouping applied to the metrics returned. For example, when grouped by <code>QUEUE</code>, the metrics returned apply to each queue rather than aggregated for all queues. </p> <ul> <li> <p>If you group by <code>CHANNEL</code>, you should include a Channels filter. VOICE, CHAT, and TASK channels are supported.</p> </li> <li> <p>If you group by <code>ROUTING_PROFILE</code>, you must include either a queue or routing profile filter. In addition, a routing profile filter is required for metrics <code>CONTACTS_SCHEDULED</code>, <code>CONTACTS_IN_QUEUE</code>, and <code> OLDEST_CONTACT_AGE</code>.</p> </li> <li> <p>If no <code>Grouping</code> is included in the request, a summary of metrics is returned.</p> </li> </ul>
  - `CurrentMetrics` CurrentMetric[], required — <p>The metrics to retrieve. Specify the name and unit for each metric. The following metrics are available. For a description of all the metrics, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html">Real-time Metrics Definitions</a> in the <i>Amazon Connect Administrator Guide</i>.</p> <dl> <dt>AGENTS_AFTER_CONTACT_WORK</dt> <dd> <p>Unit: COUNT</p> <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#aftercallwork-real-time">ACW</a> </p> </dd> <dt>AGENTS_AVAILABLE</dt> <dd> <p>Unit: COUNT</p> <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#available-real-time">Available</a> </p> </dd> <dt>AGENTS_ERROR</dt> <dd> <p>Unit: COUNT</p> <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#error-real-time">Error</a> </p> </dd> <dt>AGENTS_NON_PRODUCTIVE</dt> <dd> <p>Unit: COUNT</p> <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#non-productive-time-real-time">NPT (Non-Productive Time)</a> </p> </dd> <dt>AGENTS_ON_CALL</dt> <dd> <p>Unit: COUNT</p> <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#on-call-real-time">On contact</a> </p> </dd> <dt>AGENTS_ON_CONTACT</dt> <dd> <p>Unit: COUNT</p> <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#on-call-real-time">On contact</a> </p> </dd> <dt>AGENTS_ONLINE</dt> <dd> <p>Unit: COUNT</p> <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#online-real-time">Online</a> </p> </dd> <dt>AGENTS_STAFFED</dt> <dd> <p>Unit: COUNT</p> <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#staffed-real-time">Staffed</a> </p> </dd> <dt>CONTACTS_IN_QUEUE</dt> <dd> <p>Unit: COUNT</p> <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#in-queue-real-time">In queue</a> </p> </dd> <dt>CONTACTS_SCHEDULED</dt> <dd> <p>Unit: COUNT</p> <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#scheduled-real-time">Scheduled</a> </p> </dd> <dt>OLDEST_CONTACT_AGE</dt> <dd> <p>Unit: SECONDS</p> <p>When you use groupings, Unit says SECONDS and the Value is returned in SECONDS. </p> <p>When you do not use groupings, Unit says SECONDS but the Value is returned in MILLISECONDS. For example, if you get a response like this:</p> <p> <code>{ "Metric": { "Name": "OLDEST_CONTACT_AGE", "Unit": "SECONDS" }, "Value": 24113.0 </code>}</p> <p>The actual OLDEST_CONTACT_AGE is 24 seconds.</p> <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#oldest-real-time">Oldest</a> </p> </dd> <dt>SLOTS_ACTIVE</dt> <dd> <p>Unit: COUNT</p> <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#active-real-time">Active</a> </p> </dd> <dt>SLOTS_AVAILABLE</dt> <dd> <p>Unit: COUNT</p> <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#availability-real-time">Availability</a> </p> </dd> </dl>
    - `Name` 'AGENTS_ONLINE' | 'AGENTS_AVAILABLE' | 'AGENTS_ON_CALL' | 'AGENTS_NON_PRODUCTIVE' | 'AGENTS_AFTER_CONTACT_WORK' | 'AGENTS_ERROR' | 'AGENTS_STAFFED' | 'CONTACTS_IN_QUEUE' | 'OLDEST_CONTACT_AGE' | 'CONTACTS_SCHEDULED' | 'AGENTS_ON_CONTACT' | 'SLOTS_ACTIVE' | 'SLOTS_AVAILABLE' — The name of the metric.
    - `Unit` 'SECONDS' | 'COUNT' | 'PERCENT' — The unit for the metric.
  - `NextToken` string — <p>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.</p> <p>The token expires after 5 minutes from the time it is created. Subsequent requests that use the token must use the same request parameters as the request that generated the token.</p>
  - `MaxResults` integer — The maximum number of results to return per page.
  - `SortCriteria` CurrentMetricSortCriteria[] — <p>The way to sort the resulting response based on metrics. You can enter one sort criteria. By default resources are sorted based on <code>AGENTS_ONLINE</code>, <code>DESCENDING</code>. The metric collection is sorted based on the input metrics.</p> <p>Note the following:</p> <ul> <li> <p>Sorting on <code>SLOTS_ACTIVE</code> and <code>SLOTS_AVAILABLE</code> is not supported.</p> </li> </ul>
    - `SortByMetric` 'AGENTS_ONLINE' | 'AGENTS_AVAILABLE' | 'AGENTS_ON_CALL' | 'AGENTS_NON_PRODUCTIVE' | 'AGENTS_AFTER_CONTACT_WORK' | 'AGENTS_ERROR' | 'AGENTS_STAFFED' | 'CONTACTS_IN_QUEUE' | 'OLDEST_CONTACT_AGE' | 'CONTACTS_SCHEDULED' | 'AGENTS_ON_CONTACT' | 'SLOTS_ACTIVE' | 'SLOTS_AVAILABLE' — The current metric names.
    - `SortOrder` 'ASCENDING' | 'DESCENDING' — The way to sort.

## Response `200`

Success

- GetCurrentMetricDataResponse
  - `NextToken` string — <p>If there are additional results, this is the token for the next set of results.</p> <p>The token expires after 5 minutes from the time it is created. Subsequent requests that use the token must use the same request parameters as the request that generated the token.</p>
  - `MetricResults` CurrentMetricResult[] — Information about the real-time metrics.
    - `Dimensions` object — The dimensions for the metrics.
      - `Queue` object — Information about the queue for which metrics are returned.
        - `Id` string — The identifier of the queue.
        - `Arn` string — The Amazon Resource Name (ARN) of the queue.
      - `Channel` 'VOICE' | 'CHAT' | 'TASK' — The channel used for grouping and filters.
      - `RoutingProfile` RoutingProfileReference — Information about the routing profile assigned to the user.
        - `Id` string — The identifier of the routing profile.
        - `Arn` string — The Amazon Resource Name (ARN) of the routing profile.
    - `Collections` CurrentMetricData[] — The set of metrics.
      - `Metric` object — Information about the metric.
        - `Name` 'AGENTS_ONLINE' | 'AGENTS_AVAILABLE' | 'AGENTS_ON_CALL' | 'AGENTS_NON_PRODUCTIVE' | 'AGENTS_AFTER_CONTACT_WORK' | 'AGENTS_ERROR' | 'AGENTS_STAFFED' | 'CONTACTS_IN_QUEUE' | 'OLDEST_CONTACT_AGE' | 'CONTACTS_SCHEDULED' | 'AGENTS_ON_CONTACT' | 'SLOTS_ACTIVE' | 'SLOTS_AVAILABLE' — The name of the metric.
        - `Unit` 'SECONDS' | 'COUNT' | 'PERCENT' — The unit for the metric.
      - `Value` number, double — The value of the metric.
  - `DataSnapshotTime` string, date-time — The time at which the metrics were retrieved and cached for pagination.
  - `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)
