---
updatedAt: 2026-06-25T13:42:49.000Z
agentTools:
  projectIndex: https://marketing.developer.dotdigital.com/llms.txt
---

# Retrieves message metrics

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Analytics API",
    "description": "Provides methods for retrieving analytics data across the Dotdigital\nomnichannel platform. Covers conversation message analytics, chat analytics\n(including live), message metrics, session analytics, SMS tracking,\nverification, inbound/outbound SMS analytics, and WhatsApp conversation and\ndaily messaging usage reports. All endpoints accept date-range and\naggregation parameters and return time-series data suitable for reporting\ndashboards.",
    "version": "1.1.1"
  },
  "servers": [
    {
      "url": "https://{region}-api.dotdigital.com",
      "variables": {
        "region": {
          "description": "The Dotdigital region id your account belongs to",
          "enum": [
            "r1",
            "r2",
            "r3"
          ],
          "default": "r1"
        }
      }
    }
  ],
  "security": [
    {
      "basicAuth": []
    }
  ],
  "paths": {
    "/cpaas/analytics/messages/metrics": {
      "get": {
        "tags": [
          "Messaging"
        ],
        "summary": "Retrieves message metrics",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "The date time to query from in ISO 8601 format UTC",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "The date time to query up to (but not including) in ISO 8601 format UTC",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "by",
            "in": "query",
            "description": "The time period to aggregate by",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "hour",
                  "day",
                  "month",
                  "year",
                  "alltime",
                  "system",
                  "recipientCountryCode"
                ]
              }
            }
          },
          {
            "name": "system",
            "in": "query",
            "description": "The system that triggered an analytical event",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "api",
                  "broadcast",
                  "chat"
                ]
              }
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "description": "The localtimezone to report the data out for if not specified, UTC is defaulted",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metrics relating to the messages sent for a specific period",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiProfilingAnalytics"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation errors were found"
          },
          "404": {
            "description": "The API Space was not"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiProfilingAnalytics": {
        "required": [
          "date",
          "dateUtc"
        ],
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "The date of the analytics data in ISO 8601 format.",
            "format": "date-time",
            "example": "2025-04-01T00:00:00Z"
          },
          "dateUtc": {
            "type": "string",
            "description": "The UTC date of the analytics data in ISO 8601 format.",
            "format": "date-time",
            "example": "2025-04-01T00:00:00Z"
          },
          "appMessaging": {
            "$ref": "#/components/schemas/ChannelProfiling"
          },
          "whatsApp": {
            "$ref": "#/components/schemas/ChannelProfiling"
          },
          "sms": {
            "$ref": "#/components/schemas/ChannelProfiling"
          }
        },
        "description": "API profiling analytics data, including delivery times for different messaging channels on a specific date.\n"
      },
      "ChannelProfiling": {
        "required": [
          "timeToDelivered"
        ],
        "type": "object",
        "properties": {
          "timeToDelivered": {
            "$ref": "#/components/schemas/TimeToDeliveredMetrics"
          }
        },
        "description": "Profiling data for a specific messaging channel, including delivery time metrics.\n"
      },
      "TimeToDeliveredMetrics": {
        "type": "object",
        "additionalProperties": {
          "$ref": "#/components/schemas/DeliveryTimeMetric"
        },
        "description": "Delivery time metrics, keyed by delivery time thresholds (in seconds).\n",
        "example": {
          "10": {
            "count": 5,
            "value": 4680
          },
          "30": {
            "count": 2,
            "value": 46494
          }
        }
      },
      "DeliveryTimeMetric": {
        "required": [
          "count",
          "value"
        ],
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "description": "Number of messages delivered within the threshold.",
            "example": 5
          },
          "value": {
            "type": "integer",
            "description": "Total time (in milliseconds) for all messages delivered within the threshold.",
            "example": 4680
          }
        },
        "description": "Metric for messages delivered within a specific time threshold.\n"
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "x-readme": {
    "samples-languages": [
      "curl",
      "csharp",
      "java",
      "node",
      "php",
      "python",
      "ruby"
    ],
    "explorer-enabled": true,
    "proxy-enabled": true,
    "samples-enabled": true
  }
}
```

# Sibling pages

* [Retrieves message analytics](https://marketing.developer.dotdigital.com/reference/get_cpaas-analytics-messages.md)