---
title: "Automation clicks by link"
method: GET
path: "/v1/sites/{site_id}/automations/{automation_id}/stats/clicks"
tags: ["Automations"]
---

# Automation clicks by link

`GET /v1/sites/{site_id}/automations/{automation_id}/stats/clicks`

## Request

- Base URL: `https://api.getsitecontrol.com`
- URL: `https://api.getsitecontrol.com/v1/sites/{site_id}/automations/{automation_id}/stats/clicks`
- Auth: HTTP bearer

Clicks by link in the e-mails of one automation, most clicked first. Without
`from` and `to` they cover its whole life, and `period` is null.

A link is given without its query string, user info and fragment; its path
is kept as it is. Clicks on links equal after that are added up, and the
500 links with the most clicks are listed. Every click is counted,
so the sum is not the unique `click` of `get_automation_stats`.

## Path parameters

- `site_id` integer, required
- `automation_id` integer, required: Automation id from `list_automations`

## Query parameters

- `from` string, date: UTC day, included; omit for the whole life
- `to` string, date: UTC day, included; with `from`, today when omitted

## Response `200`

Successful Response

- EmailClicks
  - `period` StatsPeriod
    - `date_from` string, date, required: First day, UTC, included
    - `date_to` string, date, required: Last day, UTC, included
  - `items` EmailClickItem[], required: Links in the e-mails of this broadcast or automation by clicks, most first. Every click is counted, so the sum is not the unique `click` of the e-mails. Clicks on one address with different query strings are added up.
    - `url` string, nullable: The link without its query string, user info and fragment; null for clicks whose link was not recorded
    - `text` string, nullable: The link text; null when the link has none
    - `clicks` integer, required: Every click on the link counted

## Other responses

- `400`: Unsupported GSC-Version
- `401`: Missing or invalid API key or access token
- `403`: Access denied
- `404`: Not found
- `422`: Validation failed
- `429`: Rate limited
- `503`: `temporarily_unavailable`: the statistics took longer than 25 seconds or rate limits cannot be enforced; narrow the period or retry later. The heavy request is spent all the same

---

[API](https://skmtc.dev/getsitecontrol/apis/getsitecontrol-public-api.md) - [All operations](https://skmtc.dev/getsitecontrol/apis/getsitecontrol-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/getsitecontrol/apis/getsitecontrol-public-api/revisions/084fcad80e75?raw)
