Skip to contentSkip to navigationSkip to topbar
Page tools
Useful for sharing or LLM
Accelerate development with AI

On this page
Looking for more inspiration?Visit the

Validate a branded link


API Overview

api-overview page anchor

To serve all of the click-tracked links, opens, and images in your emails from your domain, use Email link branding. This replaces sendgrid.net for Global Email send or eu.sendgrid.net for Regional Email send with your domain. To determine whether the email looks trustworthy, spam filters and recipient servers look at the links within emails. To determine if they can trust the links, these systems check the reputation of the root domain.

To manage link branding, go to the Sender Authentication section of the Twilio SendGrid App(link takes you to an external page).

To learn more, see How to set up link branding.


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

Base url: https://api.sendgrid.com (for global users and subusers)

Base url: https://api.eu.sendgrid.com (for EU regional subusers)

This endpoint allows you to validate a branded link.

You can submit this request as one of your subusers if you include their ID in the on-behalf-of header in the request.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
Authorizationstring
required
Default: Bearer <<YOUR_API_KEY_HERE>>

on-behalf-ofstring

Optional

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.

Property nameTypeRequiredDescription
idinteger
required

The ID of the branded link that you want to validate.

200500
SchemaExample
Property nameTypeRequiredDescriptionChild properties
idinteger

Optional

The ID of the branded link.


validenum<boolean>

Optional

Indicates if the link branding is valid.

Possible values:
truefalse

validation_resultsobject

Optional

The individual validation results for each of the DNS records associated with this branded link.

Validate a branded linkLink to code sample: Validate a branded link
1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const id = 42;
5
6
const request = {
7
url: `/v3/whitelabel/links/${id}/validate`,
8
method: "POST",
9
};
10
11
client
12
.request(request)
13
.then(([response, body]) => {
14
console.log(response.statusCode);
15
console.log(response.body);
16
})
17
.catch((error) => {
18
console.error(error);
19
});