import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.domains.update({
id: 'b8617ad3-b712-41d9-81a0-f7c3d879314e',
openTracking: false,
clickTracking: true,
trackingSubdomain: 'links',
tls: 'enforced',
});
$resend = Resend::client('re_xxxxxxxxx');
$resend->domains->update(
'b8617ad3-b712-41d9-81a0-f7c3d879314e',
[
'open_tracking' => false,
'click_tracking' => true,
'tracking_subdomain' => 'links',
'tls' => 'enforced',
]
);
import resend
resend.api_key = "re_xxxxxxxxx"
params: resend.Domains.UpdateParams = {
"id": "b8617ad3-b712-41d9-81a0-f7c3d879314e",
"open_tracking": False,
"click_tracking": True,
"tracking_subdomain": "links",
"tls": "enforced",
}
resend.Domains.update(params)
Resend.api_key = "re_xxxxxxxxx"
Resend::Domains.update({
id: "b8617ad3-b712-41d9-81a0-f7c3d879314e",
open_tracking: false,
click_tracking: true,
tracking_subdomain: "links",
tls: "enforced",
})
package main
import "github.com/resend/resend-go/v3"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
updateDomainParams := &resend.UpdateDomainRequest{
OpenTracking: false,
ClickTracking: true,
TrackingSubdomain: "links",
Tls: resend.Enforced,
}
client.Domains.Update("b8617ad3-b712-41d9-81a0-f7c3d879314e", updateDomainParams)
}
use resend_rs::{types::{DomainChanges, Tls}, Resend, Result};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let changes = DomainChanges::new()
.with_open_tracking(false)
.with_click_tracking(true)
.with_tracking_subdomain("links")
.with_tls(Tls::Enforced);
let _domain = resend
.domains
.update("b8617ad3-b712-41d9-81a0-f7c3d879314e", changes)
.await?;
Ok(())
}
Resend resend = new Resend("re_xxxxxxxxx");
UpdateDomainOptions params = UpdateDomainOptions.builder()
.id("b8617ad3-b712-41d9-81a0-f7c3d879314e")
.openTracking(false)
.clickTracking(true)
.trackingSubdomain("links")
.tls(Tls.ENFORCED)
.build();
resend.domains().update(params);
using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
await resend.DomainUpdateAsync(
new Guid( "b8617ad3-b712-41d9-81a0-f7c3d879314e" ),
new DomainUpdateData()
{
TrackOpen = false,
TrackClicks = true,
TrackingSubdomain = "links",
TlsMode = TlsMode.Enforced,
}
);
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,
"tracking_subdomain": "links",
"tls": "enforced"
}'
resend domains update b8617ad3-b712-41d9-81a0-f7c3d879314e \
--no-open-tracking \
--click-tracking \
--tracking-subdomain links \
--tls enforced
{
"object": "domain",
"id": "b8617ad3-b712-41d9-81a0-f7c3d879314e"
}
Update Domain
Update an existing domain.
PATCH
/
domains
/
:domain_id
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.domains.update({
id: 'b8617ad3-b712-41d9-81a0-f7c3d879314e',
openTracking: false,
clickTracking: true,
trackingSubdomain: 'links',
tls: 'enforced',
});
$resend = Resend::client('re_xxxxxxxxx');
$resend->domains->update(
'b8617ad3-b712-41d9-81a0-f7c3d879314e',
[
'open_tracking' => false,
'click_tracking' => true,
'tracking_subdomain' => 'links',
'tls' => 'enforced',
]
);
import resend
resend.api_key = "re_xxxxxxxxx"
params: resend.Domains.UpdateParams = {
"id": "b8617ad3-b712-41d9-81a0-f7c3d879314e",
"open_tracking": False,
"click_tracking": True,
"tracking_subdomain": "links",
"tls": "enforced",
}
resend.Domains.update(params)
Resend.api_key = "re_xxxxxxxxx"
Resend::Domains.update({
id: "b8617ad3-b712-41d9-81a0-f7c3d879314e",
open_tracking: false,
click_tracking: true,
tracking_subdomain: "links",
tls: "enforced",
})
package main
import "github.com/resend/resend-go/v3"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
updateDomainParams := &resend.UpdateDomainRequest{
OpenTracking: false,
ClickTracking: true,
TrackingSubdomain: "links",
Tls: resend.Enforced,
}
client.Domains.Update("b8617ad3-b712-41d9-81a0-f7c3d879314e", updateDomainParams)
}
use resend_rs::{types::{DomainChanges, Tls}, Resend, Result};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let changes = DomainChanges::new()
.with_open_tracking(false)
.with_click_tracking(true)
.with_tracking_subdomain("links")
.with_tls(Tls::Enforced);
let _domain = resend
.domains
.update("b8617ad3-b712-41d9-81a0-f7c3d879314e", changes)
.await?;
Ok(())
}
Resend resend = new Resend("re_xxxxxxxxx");
UpdateDomainOptions params = UpdateDomainOptions.builder()
.id("b8617ad3-b712-41d9-81a0-f7c3d879314e")
.openTracking(false)
.clickTracking(true)
.trackingSubdomain("links")
.tls(Tls.ENFORCED)
.build();
resend.domains().update(params);
using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
await resend.DomainUpdateAsync(
new Guid( "b8617ad3-b712-41d9-81a0-f7c3d879314e" ),
new DomainUpdateData()
{
TrackOpen = false,
TrackClicks = true,
TrackingSubdomain = "links",
TlsMode = TlsMode.Enforced,
}
);
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,
"tracking_subdomain": "links",
"tls": "enforced"
}'
resend domains update b8617ad3-b712-41d9-81a0-f7c3d879314e \
--no-open-tracking \
--click-tracking \
--tracking-subdomain links \
--tls enforced
{
"object": "domain",
"id": "b8617ad3-b712-41d9-81a0-f7c3d879314e"
}
Path Parameters
Body Parameters
opportunistic: Opportunistic TLS means that it always attempts to make a secure connection to the receiving mail server. If it can’t establish a secure connection, it sends the message unencrypted.enforced: Enforced TLS on the other hand, requires that the email communication must use TLS no matter what. If the receiving server does not support TLS, the email will not be sent.
Update the domain capabilities for sending and receiving emails. You can specify one or both fields. Omitted fields will keep their current value. At least one capability must remain enabled.
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.domains.update({
id: 'b8617ad3-b712-41d9-81a0-f7c3d879314e',
openTracking: false,
clickTracking: true,
trackingSubdomain: 'links',
tls: 'enforced',
});
$resend = Resend::client('re_xxxxxxxxx');
$resend->domains->update(
'b8617ad3-b712-41d9-81a0-f7c3d879314e',
[
'open_tracking' => false,
'click_tracking' => true,
'tracking_subdomain' => 'links',
'tls' => 'enforced',
]
);
import resend
resend.api_key = "re_xxxxxxxxx"
params: resend.Domains.UpdateParams = {
"id": "b8617ad3-b712-41d9-81a0-f7c3d879314e",
"open_tracking": False,
"click_tracking": True,
"tracking_subdomain": "links",
"tls": "enforced",
}
resend.Domains.update(params)
Resend.api_key = "re_xxxxxxxxx"
Resend::Domains.update({
id: "b8617ad3-b712-41d9-81a0-f7c3d879314e",
open_tracking: false,
click_tracking: true,
tracking_subdomain: "links",
tls: "enforced",
})
package main
import "github.com/resend/resend-go/v3"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
updateDomainParams := &resend.UpdateDomainRequest{
OpenTracking: false,
ClickTracking: true,
TrackingSubdomain: "links",
Tls: resend.Enforced,
}
client.Domains.Update("b8617ad3-b712-41d9-81a0-f7c3d879314e", updateDomainParams)
}
use resend_rs::{types::{DomainChanges, Tls}, Resend, Result};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let changes = DomainChanges::new()
.with_open_tracking(false)
.with_click_tracking(true)
.with_tracking_subdomain("links")
.with_tls(Tls::Enforced);
let _domain = resend
.domains
.update("b8617ad3-b712-41d9-81a0-f7c3d879314e", changes)
.await?;
Ok(())
}
Resend resend = new Resend("re_xxxxxxxxx");
UpdateDomainOptions params = UpdateDomainOptions.builder()
.id("b8617ad3-b712-41d9-81a0-f7c3d879314e")
.openTracking(false)
.clickTracking(true)
.trackingSubdomain("links")
.tls(Tls.ENFORCED)
.build();
resend.domains().update(params);
using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
await resend.DomainUpdateAsync(
new Guid( "b8617ad3-b712-41d9-81a0-f7c3d879314e" ),
new DomainUpdateData()
{
TrackOpen = false,
TrackClicks = true,
TrackingSubdomain = "links",
TlsMode = TlsMode.Enforced,
}
);
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,
"tracking_subdomain": "links",
"tls": "enforced"
}'
resend domains update b8617ad3-b712-41d9-81a0-f7c3d879314e \
--no-open-tracking \
--click-tracking \
--tracking-subdomain links \
--tls enforced
{
"object": "domain",
"id": "b8617ad3-b712-41d9-81a0-f7c3d879314e"
}
Was this page helpful?
⌘I