metrics

Query message statistics

Changed on

Sends, engagement and attributed revenue for merchant campaigns and flows, by send cohort: a click or order counts toward the hour its message was sent, bucketed in the property's timezone. Shopper sends (campaigns, Autos, Responses) are excluded from every row and total, so source_type: flow means merchant automations; a property with more than 1,000 Shopper campaigns and automations answers 503 service_unavailable rather than totals that include them. Attribution-dependent statistics come back once per attribution model the property has; data.attribution_models flags the default. Billing figures are not served here. A query is not a mutation and takes no Idempotency-Key. At most 3 dimensions and 500 rows; past 500, data.truncated is true and rows holds the first 500 — narrow with filter rather than paging. filter.message_id requires message in group_by (400 otherwise) and narrows rows only; totals cover the other filter clauses. Only these groupings are served in the property's timezone: none, source_type, interval alone, campaign or flow, and interval: day with campaign/flow and message; every other grouping is served in UTC days and says so in timezone_reason.

post/message-stats

Request

  • Base URL
    https://api.pscrpt.com/v1
  • URL
    https://api.pscrpt.com/v1/message-stats
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization code: https://api.pscrpt.com/oauth/authorize
      Token URL: https://api.pscrpt.com/oauth/token scopes: metrics:read

Headers

Postscript-Versionstring date
Example:2026-07-23

Overrides the key's pinned API revision for this request.

Request body

attribution_modelsstring[]

Restrict attribution-dependent statistics to these models. Default — every model the property has.

group_byMessageStatsDimension[]
interval'none' | 'day' | 'week' | 'month'

none returns one row per dimension combination; otherwise rows also carry bucket_start (local day/Monday-week/month start as a UTC instant).

statisticsMessageStatistic[] required
timezonestring

IANA name. Default — the property's timezone as configured in Shopify. The response echoes the timezone actually served and why (timezone_reason).

Example request

{
  "attribution_models": [
    "last_touch"
  ],
  "timeframe": {
    "gte": "2026-07-23T17:32:01.123456Z",
    "lte": "2026-07-23T17:32:01.123456Z"
  }
}

Response

Statistics per requested dimension combination, plus independent totals.

Example response

{
  "data": {
    "rows": [
      {
        "dimensions": {
          "bucket_start": "2026-07-23T17:32:01.123456Z"
        }
      }
    ],
    "timeframe": {
      "gte": "2026-07-23T17:32:01.123456Z",
      "lte": "2026-07-23T17:32:01.123456Z"
    },
    "totals": {
      "dimensions": {
        "bucket_start": "2026-07-23T17:32:01.123456Z"
      }
    }
  }
}

Changes

    • info

      added the new opens enum value to the request property /

    • info

      added the new spam_complaints enum value to the request property /

    • info

      added the new unique_opens enum value to the request property /

    • info

      added the required property / to the response with the status