Menu

Expand
Rate this page:

Domain Authentication

An authenticated domain allows you to remove the “via” or “sent on behalf of” message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will get 2 TXT records and 1 MX record.

Domain Authentication was formerly called "Domain Whitelabel".

For more information, please see How to set up domain authentication.

Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings.

Validate a domain authentication.

POST /v3/whitelabel/domains/{id}/validate

Base url: https://api.sendgrid.com

This endpoint allows you to validate an authenticated domain. If it fails, it will return an error message describing why the domain could not be validated.

Authentication

  • API Key

Headers

Authorization
string
default: Bearer <<YOUR_API_KEY_HERE>>
required
on-behalf-of
string

The on-behalf-of header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be "account-id" followed by the customer account's ID (e.g., on-behalf-of: account-id <account-id>). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., on-behalf-of: <subuser-username>). See On Behalf Of for more information.

default: None

Path Parameters

id
integer

ID of the domain to validate.

default: None
required

Responses

object
id
integer

The ID of the authenticated domain.

valid
boolean

Indicates if this is a valid authenticated domain.

validation_results
object

The individual DNS records that are checked when validating, including the reason for any invalid DNS records.

mail_cname
object

The CNAME record for the authenticated domain.

valid
boolean

Indicates if this DNS record is valid.

reason
string or null

The reason this record is invalid.

dkim1
object

A DNS record for this authenticated domain.

valid
boolean

Indicates if the DNS record is valid.

reason
string or null
dkim2
object

A DNS record for this authenticated domain.

valid
boolean

Indicates if the DNS record is valid.

reason
string or null
spf
object

The SPF record for the authenticated domain.

valid
boolean

Indicates if the SPF record is valid.

reason
string or null
object
errors
array[object]
message
string

A message explaining the reason for the error.

required
Loading Code Sample...
        
        

        Validate a domain authentication.

        Rate this page:

        Need some help?

        We all do sometimes. Get help now from the Twilio SendGrid Support Team.

        Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.

        Loading Code Sample...
              
              
              

              Thank you for your feedback!

              Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

              Sending your feedback...
              🎉 Thank you for your feedback!
              Something went wrong. Please try again.

              Thanks for your feedback!

              thanks-feedback-gif