Skip to main content

Methods

Get

func (s *DomainsSvcImpl) Get(domainId string) (Domain, error)
Retrieves a domain object by ID.

GetWithContext

func (s *DomainsSvcImpl) GetWithContext(ctx context.Context, domainId string) (Domain, error)
Retrieves a domain object by ID with context support.

Parameters

domainId
string
required
The unique identifier of the domain to retrieve

Response

Domain

id
string
The unique identifier for the domain
object
string
Object type (“domain”)
name
string
The domain name
created_at
string
Timestamp when the domain was created
status
string
The verification status of the domain
region
string
The region where emails are sent from
records
[]Record
DNS records for domain verification. Each record contains:
  • record (string): Record identifier
  • name (string): DNS record name
  • type (string): Record type (TXT, MX, CNAME)
  • ttl (string): Time to live
  • status (string): Verification status
  • value (string): Record value
  • priority (json.Number, optional): Priority for MX records

Example

package main

import (
    "fmt"
    "github.com/resend/resend-go/v2"
)

func main() {
    client := resend.NewClient("re_123456789")

    domain, err := client.Domains.Get("d1e9e6f7-6a1c-4b3d-8c9e-1f2e3d4c5b6a")
    if err != nil {
        panic(err)
    }

    fmt.Println("Domain:", domain.Name)
    fmt.Println("Status:", domain.Status)
    fmt.Println("Region:", domain.Region)
    fmt.Println("Created:", domain.CreatedAt)
}

Example with Context

ctx := context.Background()

domain, err := client.Domains.GetWithContext(ctx, "d1e9e6f7-6a1c-4b3d-8c9e-1f2e3d4c5b6a")
if err != nil {
    panic(err)
}

Build docs developers (and LLMs) love