Sending
Open and click tracking
Record when an email from your app is opened and which links are clicked, turn tracking off for one email, and read the counts and webhooks.
On this page
Ternwire can record when an email you send from your app is opened and which of its links are clicked. Tracking is off until you turn it on. This page covers email sent with the API, an SDK or SMTP. Newsletters have their own setting, described in Tracking and limits.
Turn tracking on
Turn on open tracking, click tracking or both in Settings, or with PATCH /v1/tracking-settings. Only the workspace owner can change the setting in the dashboard. GET /v1/tracking-settings returns the current setting. Both need a key with the send scope.
curl -X PATCH https://ternwire.com/v1/tracking-settings \
-H "Authorization: Bearer $TERNWIRE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "openTracking": true, "clickTracking": true }'The setting applies to email accepted from then on. An email keeps the setting it was accepted with, so turning tracking off does not change email already sent.
Choose for one email
tracking on POST /v1/emails overrides the setting for that email. A field you leave out follows the setting:
{
"from": "Acme <hello@acme.com>",
"to": ["ada@example.com"],
"subject": "Reset your password",
"html": "<p><a href=\"https://acme.com/reset?token=...\">Reset your password</a></p>",
"tracking": { "clicks": false }
}Turn click tracking off for email with sign-in links, password reset links and other links that work only once. Click tracking sends each link through a Ternwire redirect first, and a security scanner that follows the redirect can use up the link before the recipient clicks it.
The tracking field is part of the request, so sending the same Idempotency-Key with a different tracking returns idempotency_conflict. Email sent through SMTP always follows the setting.
What changes in the email
Open tracking adds a 1x1 image to the HTML part. Click tracking sends each http and https link in the HTML part through a redirect on the Ternwire API, which records the click and forwards the reader to the original address. These links stay as written:
- Links to the Ternwire API, such as an unsubscribe link we add
mailto:andtel:links, links to an anchor such as#top, and relative links- Links longer than 1,200 characters
The plain-text part is never changed, and an email without an HTML part is never tracked. Opening an email's preview in the dashboard does not count as an open.
Read opens and clicks
GET /v1/emails/:id returns tracking, which says whether the email records opens and clicks, and engagement:
{
"tracking": { "opens": true, "clicks": true },
"engagement": {
"opens": 3,
"clicks": 1,
"firstOpenedAt": "2026-11-21T09:12:04.000Z",
"lastOpenedAt": "2026-11-21T14:30:51.000Z",
"lastClickedAt": "2026-11-21T09:12:40.000Z",
"links": [{ "url": "https://acme.com/orders/1042", "clicks": 1 }]
}
}The email's page in the dashboard shows the same numbers.
All recipients of an email get the same copy, so opens and clicks belong to the email, not to one recipient. For an email to several people, you can't tell which of them opened it. Send one email per person when that matters.
Ternwire keeps at most 100 opens and 100 clicks per email, so a scanner that loads the image or follows a link in a loop cannot grow the counts without limit. Opens and clicks are deleted after 90 days.
Webhooks
email.opened is sent the first time an email is opened, and email.clicked the first time each of its links is clicked. Later opens and clicks only raise the counts. Webhooks shows their payloads.
Treat the counts as estimates
Apple Mail Privacy Protection and some corporate mail gateways load every image when a message arrives, which counts an open nobody made. Security scanners follow links before the recipient sees the message, which counts a click. Mail apps that block images never report an open. Do not use an open to decide whether a person read an email.
In the EU and the UK, the ePrivacy rules treat a tracking image and a click redirect like a cookie. You usually need the recipient's consent before you track them, and your privacy notice must describe the tracking. Ternwire does not collect that consent for you. Read the rules that apply to your recipients, and ask your own legal adviser if you are unsure, before you turn tracking on.