---
title: "Update Click/Open Tracking via API"
slug: update-click-open-tracking-via-api
description: "Manage the entire lifecycle of your domains programmatically."
created_at: "2024-03-06"
updated_at: "2024-11-28"
image: https://cdn.resend.com/posts/update-click-open-tracking-via-api.jpg
humans: ["bu-kinoshita"]
---

Many teams use Resend to empower their customers to send emails with their own domains. They can add domains, retrieve, verify, list, and delete them using the Resend API. However, until now, the only way to update click and open tracking settings for a domain was through the Resend dashboard.

Today, we're excited to announce that you can now update click and open tracking settings for a domain using the Resend API.

## Updating Domains via API

You can use the various Resend SDKs, including [Python](https://github.com/resend/resend-python), [Ruby](https://github.com/resend/resend-ruby), [PHP](https://github.com/resend/resend-php), [Go](https://github.com/resend/resend-go), and [Java](https://github.com/resend/resend-java) to update click/open tracking.

Here's an example using the [Node.js SDK](https://github.com/resend/resend-node):

```ts
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

await resend.domains.update({
  id: 'b8617ad3-b712-41d9-81a0-f7c3d879314e',
  openTracking: false,
  clickTracking: true,
});
```

You can also use the REST API directly.

The endpoint is available at `PATCH /domains/:domain_id`, and it accepts both `click_tracking` and `open_tracking` parameters.

```bash
curl -X PATCH 'https://api.resend.com/domains/b8617ad3-b712-41d9-81a0-f7c3d879314e' \
     -H 'Authorization: Bearer re_xxxxxxxxx' \
     -H 'Content-Type: application/json' \
     -d $'{
  "open_tracking": false,
  "click_tracking": true
}'
```

Check the [Resend OpenAPI spec](https://github.com/resend/resend-openapi) or the [Postman collection](https://www.postman.com/resend/workspace/resend-api/collection/78558-536fcef8-4f87-42a5-ae1a-57f891ef1404) for additional details.

## Get started

Go to the [documentation](https://resend.com/docs/api-reference/domains/update-domain) to learn more about managing domains via the API.
