Module: Resend::Domains::Claims

Defined in:
lib/resend/domains/claims.rb

Overview

Domain Claims API wrapper

Class Method Summary collapse

Class Method Details

.create(params) ⇒ Object

Start a claim for a domain that another Resend account has already verified. The domain is recreated under your account with fresh DKIM keys, so the previous account's DNS records cannot be reused. Returns a TXT record to add to your DNS to prove ownership. Uses the same request body as creating a domain.

https://resend.com/docs/api-reference/domains/claim-domain

Parameters:

  • params (Hash)

    the parameters

Options Hash (params):

  • :name (String)

    the name of the domain you want to claim (required)

  • :region (String)

    the region where emails will be sent from. Possible values: 'us-east-1' | 'eu-west-1' | 'sa-east-1' | 'ap-northeast-1'

  • :custom_return_path (String)

    subdomain for the Return-Path address (default 'send')

  • :tracking_subdomain (String)

    the custom subdomain used for click and open tracking links

  • :click_tracking (Boolean)

    track clicks within the body of each HTML email

  • :open_tracking (Boolean)

    track the open rate of each email



24
25
26
27
# File 'lib/resend/domains/claims.rb', line 24

def create(params)
  path = "domains/claim"
  Resend::Request.new(path, params, "post").perform
end

.get(domain_id = "") ⇒ Object

Retrieve the latest claim for the placeholder domain created by the claim.

https://resend.com/docs/api-reference/domains/get-domain-claim

Parameters:

  • domain_id (String) (defaults to: "")

    the ID of the placeholder domain created by the claim



35
36
37
38
# File 'lib/resend/domains/claims.rb', line 35

def get(domain_id = "")
  path = "domains/#{domain_id}/claim"
  Resend::Request.new(path, {}, "get").perform
end

.verify(domain_id = "") ⇒ Object

Trigger asynchronous DNS verification and ownership transfer for a domain claim. The claim stays 'pending' while verification runs; poll get for status. Once 'completed', the transferred domain has new DKIM records that must be added to DNS and verified via Resend::Domains.verify.

https://resend.com/docs/api-reference/domains/verify-domain-claim

Parameters:

  • domain_id (String) (defaults to: "")

    the ID of the placeholder domain created by the claim



49
50
51
52
# File 'lib/resend/domains/claims.rb', line 49

def verify(domain_id = "")
  path = "domains/#{domain_id}/claim/verify"
  Resend::Request.new(path, {}, "post").perform
end