# Anypoint MQ Statistics API Retrieve usage statistics for Anypoint MQ queues, exchanges, and environments. - **Version:** 1.0.0 - **Category:** Messaging - **OpenAPI Spec:** [api.yaml](https://dev-portal.mulesoft.com/apis/anypoint-mq-stats/api.yaml) ## Servers - `https://anypoint.mulesoft.com/mq/stats/api/{version}` - `https://{region}.anypoint.mulesoft.com/mq/stats/api/{version}` - `https://{region}.platform.mulesoft.com/mq/stats/api/{version}` ## Operations (5) ### GET /organizations/{organizationId} **Operation ID:** `getOrganizationsByOrganizationid` MQ Usage Metrics by date for an organization, across all environments. <br> You can use this API to see number of api requests made, number of messages received, number of billable units that depends on the number of messages delivered to subscribers of a queue, and message byte count sent & received by an organization. <br> If you are using connected app, "Read MQ Stats" scope is needed. <br> For query timeframes and retention refer to [MQ Stats documentation](https://docs.mulesoft.com/mq/mq-apis#usage-limits). <br> Note: This API has a limit of 10 requests per minute. **Parameters:** | `startDate` | query | Start date of the desired time window. MQ usage data is retained for up to 2 years depending on the granularity of the data requested. | required | | `endDate` | query | End date of the desired time window. | required | | `period` | query | The granularity of data points. It can take values : 1hour, 1day, 1month. | required | | `organizationId` | query | The organization ID to identify the target resource. | required | ### GET /organizations/{organizationId}/environments/{environmentId} **Operation ID:** `getOrganizationsByOrganizationidEnvironmentsByEnvironmentid` MQ usage metrics by date for an organization, for a particular envrionment. <br> You can use this API to see number of api requests made, number of messages received, number of billable units that depends on the number of messages delivered to subscribers of a queue, and message byte count sent & received by an organization, filtered by an environment. <br> If you are using connected app, "Read MQ Stats" scope is needed. <br> For query timeframes and retention refer to [MQ Stats documentation](https://docs.mulesoft.com/mq/mq-apis#usage-limits). <br> Note: This API has a limit of 10 requests per minute. **Parameters:** | `startDate` | query | Start date of the desired time window. MQ usage data is retained for up to 2 years depending on the granularity of the data requested. | required | | `endDate` | query | End date of the desired time window. | required | | `period` | query | The granularity of data points. It can take values : 1hour, 1day, 1month. | required | | `organizationId` | query | The organization ID to identify the target resource. | required | | `environmentId` | query | The environment ID to identify the target resource. | required | ### GET /organizations/{organizationId}/environments/{environmentId}/regions/{regionId}/queues **Operation ID:** `getOrganizationsByOrganizationidEnvironmentsByEnvironmentidRegionsByRegionidQueues` Realtime Stats for queues. <br> Use this API to get current up-to-the-minute information about the number of visible and in-flight messages in a queue. <br> If you are using connected app, "View Destinations" or "Administer destinations" scope is needed. <br> Note: This API has a limit of 100 requests per minute. **Parameters:** | `destinationIds` | query | Comma-separated list of destination IDs. | required | | `organizationId` | query | The organization ID to identify the target resource. | required | | `environmentId` | query | The environment ID to identify the target resource. | required | | `regionId` | query | The region ID to identify the target resource. | required | ### GET /organizations/{organizationId}/environments/{environmentId}/regions/{regionId}/queues/{queueId} **Operation ID:** `getOrganizationsByOrganizationidEnvironmentsByEnvironmentidRegionsByRegionidQueuesByQueueid` Historic stats for a queue. <br> Use this API to get historic stats for a queue, up to 15 months old. <br> This stats is not real time and expect up to 10 minutes latency before data is published. <br> To keep the volume of data under control, historic data is retained at reduced levels of granularity. <br> Second level data points are retained for 3 hours, one minute data points are available for past 15 days, five minute data points up to 63 days and one hour data points for up to 15 months. <br> If you are using connected app, "View Destinations" or "Administer destinations" scope is needed. <br> Note: This API has a limit of 100 requests per minute. **Parameters:** | `startDate` | query | Start date of the desired time window. Note that the earliest start date one can specify is 3 months before the current time for 1hour granularity, 12 months for 1day granularity, 24 months for 1month granularity. | required | | `endDate` | query | End date of the desired time window. | required | | `period` | query | The time granularity of metrics, expressed in seconds. | required | | `organizationId` | query | The organization ID to identify the target resource. | required | | `environmentId` | query | The environment ID to identify the target resource. | required | | `regionId` | query | The region ID to identify the target resource. | required | | `queueId` | query | Identifier of a destination. | required | ### GET /organizations/{organizationId}/environments/{environmentId}/regions/{regionId}/exchanges/{exchangeId} **Operation ID:** `getOrganizationsByOrganizationidEnvironmentsByEnvironmentidRegionsByRegionidExchangesByExchangeid` Historic Stats for Exchange. <br> Use this API to get historic stats for an exchange, up to 15 months old. <br> This stats is not real time and expect up to 10 minutes latency before data is published. <br> To keep the volume of data under control, historic data is retained at reduced levels of granularity. <br> Second level data points are retained for 3 hours, one minute data points are available for past 15 days, five minute data points up to 63 days and one hour data points for up to 15 months. <br> If you are using connected app, "View Destinations" or "Administer destinations" scope is needed. <br> Note: This API has a limit of 100 requests per minute. **Parameters:** | `startDate` | query | Start date of the desired time window. Note that the earliest start date one can specify is 3 months before the current time for 1hour granularity, 12 months for 1day granularity, 24 months for 1month granularity. | required | | `endDate` | query | End date of the desired time window. | required | | `period` | query | The time granularity of metrics, expressed in seconds. | required | | `organizationId` | query | The organization ID to identify the target resource. | required | | `environmentId` | query | The environment ID to identify the target resource. | required | | `regionId` | query | The region ID to identify the target resource. | required | | `exchangeId` | query | Identifier of a destination. | required |