As a Marketing Campaigns customer, you have access to rich statistics about your Single Sends and Automations. The Marketing Campaigns Statistics API allows you to retrieve these statistics programmatically. for detailed information about the statistics available, see the Marketing Campaigns Stats Overview.
(information)
Note
These endpoints provide stats for Marketing Campaigns only. For stats related to event tracking, please see the Stats API.
Operation overview
GET/v3/marketing/stats/automations/{id}/links
Base url: https://api.sendgrid.com (The Twilio SendGrid v3 API)
This endpoint lets you retrieve click-tracking stats for a single Automation.
The stats returned list the URLs embedded in your Automation and the number of clicks each one received.
Operation details
Authentication
Headers
Property nameTypeRequiredDescription
Authorizationstring
required
Default: Bearer <<YOUR_API_KEY_HERE>>
Path parameters
Property nameTypeRequiredDescription
idstring<uuid>
required
The ID of the Automation you want to get click tracking stats for.
Query string
Property nameTypeRequiredDescription
group_byarray[enum<string>]
Optional
Automations can have multiple steps. Including step_id as a group_by metric allows further granularity of stats.
Possible values:
step_id
step_idsarray[string<uuid>]
unique
Optional
Comma-separated list of step_ids that you want the link stats for.
page_sizeinteger
Optional
The number of elements you want returned on each page.
Default: 25Minimum: 1Maximum: 50
page_tokenstring
Optional
The stats endpoints are paginated. To get the next page, call the passed _metadata.next URL. If _metadata.prev doesn't exist, you're at the first page. Similarly, if _metadata.next is not present, you're at the last page.
This is the URL of the link clicked. If {{custom_fields}} are part of the URL, they will be included.
url_locationinteger
Optional
This is the location of the link clicked in each Automation step. Links are located according to their position within the message; the topmost link has index 0.
Minimum: 0
step_idstring<uuid>
Optional
This is the ID of the step if the stats were requested to be grouped by step_id.