Functions

create-new-domain

fn (request: POSTDomainsRequest): POSTDomainsResponse
fn (request: POSTDomainsRequest, opts: Map): POSTDomainsResponse

Register a new sending domain. Returns the domain with DNS records that must be configured for verification.

Example

domain ::resend::domains/create-new-domain(::resend::domains/POSTDomainsRequest({
    name: "mail.example.com",
    region: "us-east-1"
}))

// DNS records to add before calling verify-existing-domain
domain.records

remove-existing-domain

fn (request: DELETEDomainsDomainIdRequest): DELETEDomainsDomainIdResponse
fn (request: DELETEDomainsDomainIdRequest, opts: Map): DELETEDomainsDomainIdResponse

Remove a domain from your Resend account. This cannot be undone.

Example

result ::resend::domains/remove-existing-domain(::resend::domains/DELETEDomainsDomainIdRequest({domain-id: "d91cd9bd-1176-453e-8fc1-35364d380206"}))
result.deleted

retrieve-list-domains

fn (request: GETDomainsRequest): GETDomainsResponse
fn (request: GETDomainsRequest, opts: Map): GETDomainsResponse

Retrieve all domains configured in your Resend account.

Example

domains ::resend::domains/retrieve-list-domains(::resend::domains/GETDomainsRequest({}))
domains.data // => [{id: "...", name: "example.com", status: "verified", ...}]

retrieve-single-domain

fn (request: GETDomainsDomainIdRequest): GETDomainsDomainIdResponse
fn (request: GETDomainsDomainIdRequest, opts: Map): GETDomainsDomainIdResponse

Retrieve a single domain by ID, including its DNS records and verification status.

Example

domain ::resend::domains/retrieve-single-domain(::resend::domains/GETDomainsDomainIdRequest({
    domain-id: "domain-id-string"
}))
domain.id     // => "domain-id-string"
domain.name   // => "example.com"
domain.status // => "verified"

update-existing-domain

fn (domain-id: Str, request: PATCHDomainsDomainIdRequest): PATCHDomainsDomainIdResponse
fn (domain-id: Str, request: PATCHDomainsDomainIdRequest, opts: Map): PATCHDomainsDomainIdResponse

Update tracking settings (open tracking, click tracking, TLS) for an existing domain.

Example

updated ::resend::domains/update-existing-domain("d91cd9bd-1176-453e-8fc1-35364d380206", ::resend::domains/PATCHDomainsDomainIdRequest({
    open_tracking: true,
    click_tracking: false,
    tls: "enforced"
}))
updated.id

verify-existing-domain

fn (request: POSTDomainsDomainIdVerifyRequest): POSTDomainsDomainIdVerifyResponse
fn (request: POSTDomainsDomainIdVerifyRequest, opts: Map): POSTDomainsDomainIdVerifyResponse

Trigger DNS verification for a domain. DNS records must be configured before calling this.

Example

result ::resend::domains/verify-existing-domain(::resend::domains/POSTDomainsDomainIdVerifyRequest({domain-id: "d91cd9bd-1176-453e-8fc1-35364d380206"}))
result.id

Types

CreateDomainRequest

CreateDomainRequest type {
    name: Str,
    region: "us-east-1" | "eu-west-1" | "sa-east-1"?
}

CreateDomainResponse

CreateDomainResponse type {
    id: Str?,
    name: Str?,
    created_at: Str?,
    status: Str?,
    records: Vec<DomainRecord>?,
    region: Str?
}

DELETEDomainsDomainIdRequest

DELETEDomainsDomainIdRequest type {
    domain-id: Str
}

DELETEDomainsDomainIdResponse

DELETEDomainsDomainIdResponse type {
    object: Str?,
    id: Str?,
    deleted: Bool?
}

DeleteDomainResponse

DeleteDomainResponse type {
    object: Str?,
    id: Str?,
    deleted: Bool?
}

Domain

Domain type {
    object: Str?,
    id: Str?,
    name: Str?,
    status: Str?,
    created_at: Str?,
    region: Str?,
    records: Vec<DomainRecord>?
}

DomainRecord

DomainRecord type {
    record: Str?,
    name: Str?,
    type: Str?,
    ttl: Str?,
    status: Str?,
    value: Str?,
    priority: Int?
}

GETDomainsDomainIdRequest

GETDomainsDomainIdRequest type {
    domain-id: Str
}

GETDomainsDomainIdResponse

GETDomainsDomainIdResponse type {
    object: Str?,
    id: Str?,
    name: Str?,
    status: Str?,
    created_at: Str?,
    region: Str?,
    records: Vec<DomainRecord>?
}

GETDomainsRequest

GETDomainsRequest type Map

GETDomainsResponse

GETDomainsResponse type {
    data: Vec<ListDomainsItem>?
}

ListDomainsItem

ListDomainsItem type {
    id: Str?,
    name: Str?,
    status: Str?,
    created_at: Str?,
    region: Str?
}

ListDomainsResponse

ListDomainsResponse type {
    data: Vec<ListDomainsItem>?
}

PATCHDomainsDomainIdRequest

PATCHDomainsDomainIdRequest type {
    open_tracking: Bool?,
    click_tracking: Bool?,
    tls: Str?
}

PATCHDomainsDomainIdResponse

PATCHDomainsDomainIdResponse type {
    id: Str?,
    object: Str?
}

POSTDomainsDomainIdVerifyRequest

POSTDomainsDomainIdVerifyRequest type {
    domain-id: Str
}

POSTDomainsDomainIdVerifyResponse

POSTDomainsDomainIdVerifyResponse type {
    object: Str?,
    id: Str?
}

POSTDomainsRequest

POSTDomainsRequest type {
    name: Str,
    region: "us-east-1" | "eu-west-1" | "sa-east-1"?
}

POSTDomainsResponse

POSTDomainsResponse type {
    id: Str?,
    name: Str?,
    created_at: Str?,
    status: Str?,
    records: Vec<DomainRecord>?,
    region: Str?
}

UpdateDomainOptions

UpdateDomainOptions type {
    open_tracking: Bool?,
    click_tracking: Bool?,
    tls: Str?
}

UpdateDomainResponseSuccess

UpdateDomainResponseSuccess type {
    id: Str?,
    object: Str?
}

VerifyDomainResponse

VerifyDomainResponse type {
    object: Str?,
    id: Str?
}