v1.0.0
OpenAPI 3.1.0

Get automation action metrics

US region

Client Libraries

Get automation action metrics

Returns metrics for an individual action, both in total and as a series of counts, oldest first—the 0-index of any result is the oldest point in the window.

We recommend version 2. Send version=2. It accepts an explicit start, end, and res, reported in the tz you choose. Without it, the endpoint answers with version 1 behavior instead: a window built from period and steps, always in Eastern time.

Version 1 can't return fewer than 2 steps of any period. ?period=days&steps=1 means two days—the 48 hours before the request—and ?period=days&steps=0 returns the maximum for the period, the same as ?period=days&steps=45.

Multi-language messages

If the action is a multi-language message, you can retrieve metrics for a single language variant or all language variants. To retrieve metrics for a single language variant, pass the id of the action. To retrieve aggregate metrics and a breakdown for each language variant, pass the multi_language_branch_action_id, which is the same for each variant of a message. You can get both ids from the List automation actions endpoint.

If you pass the multi_language_branch_action_id, then the metric object shows the total across every variant. The language_variants object shows a breakdown for each language variant.

If you want to get the sum of all metrics across all of an automation's actions, you can use each action id of a multi-language message, like you would for other types of actions.

Path Parameters
  • campaign_id
    Type: integer
    required

    The ID of the automation that you want to trigger or return information about.

  • action_id
    Type: integer
    required

    The action in the automation. If the action is a message with translations, you can pass the id of the action to get metrics for a specific language variant or pass the multi_language_branch_action_id to get metrics for each language variant and total metrics across the variants.

Query Parameters
  • version
    Type: string enum

    Send 2. We recommend version 2: it takes an explicit window (start, end, and res) in the time zone you pass as tz.

    Any other value, including leaving the parameter off, uses version 1: a window derived from period and steps, always in Eastern time.

    values
    • 1
    • 2
  • res
    Type: string enum

    Version 2. Required when you send version=2. Sets the increment for each point in the series—hourly, daily, weekly, or monthly.

    values
    • hours
    • hourly
    • days
    • daily
    • weeks
    • weekly
    • months
    • monthly
  • start
    Type: integer Format: unix timestamp

    Version 2. Required when you send version=2. The unix timestamp for the beginning of your metrics.

  • end
    Type: integer Format: unix timestamp

    Version 2. Required when you send version=2. The unix timestamp for the end of your metrics. Limited to 10 years from the start parameter.

  • tz
    Type: string

    Version 2. The time zone for the window you request. Defaults to UTC. Use the region format.

  • period
    Type: string enum
    deprecated

    Version 1. The unit of time for your report. Send version=2 and set res instead.

    values
    • hours
    • days
    • weeks
    • months
  • steps
    Type: integer
    deprecated

    Version 1. The number of periods you want to return. Defaults to the maximum available, or 12 if the period is in months. Maximums are 24 hours, 45 days, 12 weeks, or 121 months. Days start at 00:00 EST, weeks at 00:00 EST on Sunday, months at 00:00 EST on the 1st. Send version=2 and set start and end instead.

  • type
    Type: string enum

    The type of item you want to return metrics for. When empty, the response contains metrics for all possible types.

    values
    • email
    • webhook
    • twilio
    • whatsapp
    • slack
    • push
    • in_app
    • live_notification
Responses
  • application/json
  • 400

    The campaignID or actionID is invalid.

  • 404

    The automation and/or action do not exist.

  • application/json
Request Example for get/v1/campaigns/{campaign_id}/actions/{action_id}/metrics
curl https://api.customer.io/v1/campaigns/3/actions/1/metrics \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "end": "2025-01-02 00:00:00 +0000 UTC",
  "language_variants": {
    "additionalProperty": {
      "default": false,
      "language": "es",
      "series": {
        "attempted": [
          1
        ],
        "bounced": [
          1
        ],
        "clicked": [
          1
        ],
        "converted": [
          1
        ],
        "created": [
          1
        ],
        "deferred": [
          1
        ],
        "delivered": [
          1
        ],
        "drafted": [
          1
        ],
        "failed": [
          1
        ],
        "human_clicked": [
          1
        ],
        "human_opened": [
          1
        ],
        "link_untracked": [
          1
        ],
        "machine_clicked": [
          1
        ],
        "open_untracked": [
          1
        ],
        "opened": [
          1
        ],
        "prefetch_opened": [
          1
        ],
        "replied": [
          1
        ],
        "sent": [
          1
        ],
        "spammed": [
          1
        ],
        "suppressed": [
          1
        ],
        "topic_unsubscribed": [
          1
        ],
        "tracking_consent_denied": [
          1
        ],
        "tracking_consent_granted": [
          1
        ],
        "undeliverable": [
          1
        ],
        "unsubscribed": [
          1
        ],
        "untracked": [
          1
        ]
      }
    }
  },
  "metric": {
    "series": {
      "attempted": [
        1
      ],
      "bounced": [
        1
      ],
      "clicked": [
        1
      ],
      "converted": [
        1
      ],
      "created": [
        1
      ],
      "deferred": [
        1
      ],
      "delivered": [
        1
      ],
      "drafted": [
        1
      ],
      "failed": [
        1
      ],
      "human_clicked": [
        1
      ],
      "human_opened": [
        1
      ],
      "link_untracked": [
        1
      ],
      "machine_clicked": [
        1
      ],
      "open_untracked": [
        1
      ],
      "opened": [
        1
      ],
      "prefetch_opened": [
        1
      ],
      "replied": [
        1
      ],
      "sent": [
        1
      ],
      "spammed": [
        1
      ],
      "suppressed": [
        1
      ],
      "topic_unsubscribed": [
        1
      ],
      "tracking_consent_denied": [
        1
      ],
      "tracking_consent_granted": [
        1
      ],
      "undeliverable": [
        1
      ],
      "unsubscribed": [
        1
      ],
      "untracked": [
        1
      ]
    }
  },
  "res": "days",
  "start": "2025-01-01 00:00:00 +0000 UTC"
}