With the whitelabel API calls you will be able to retrieve whitelabel settings related to your account.


List

Parameter Required Requirements
list Yes Must be set to list
method Yes Must be set to whitelabel

Call

1
https://sendgrid.com/apiv2/reseller.manage.xml?api_user=username&api_key=secureSecret&method=whitelabel&task=list

Response

1
2
3
4
5
6
7
8
9
10
11
12
<?xml version="1.0" encoding="ISO-8859-1"?>

<whitelabels>
   <whitelabel>
      <mail_domain>email.sendgrid.com</mail_domain>
      <url_domain>email.sendgrid.com</url_domain>
   </whitelabel>
   <whitelabel>
      <mail_domain>email.example.com</mail_domain>
      <url_domain>email.example.com</url_domain>
   </whitelabel>
</whitelabels>

Call

1
https://sendgrid.com/apiv2/reseller.manage.json?api_user=username&api_key=secureSecret&method=whitelabel&task=list

Response

1
2
3
4
5
6
7
8
9
10
[
  {
    "mail_domain": "email.sendgrid.com",
    "url_domain": "email.sendgrid.com"
  },
  {
    "mail_domain": "email.example.com",
    "url_domain": "email.example.com"
  }
]

Append

Parameter Required Requirements
list Yes Must be set to append
user Yes Subuser must be registered under your account
mail_domain Yes Whitelabel mail_domain used to append a whitelabel record to a subuser
method Yes Must be set to whitelabel

Call

1
https://sendgrid.com/apiv2/reseller.manage.xml?api_user=username&api_key=secureSecret&method=whitelabel&task=append&user=customer@example.com&mail_domain=email.sendgrid.com=m

Response: Success

1
2
3
4
5
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>success</message>
</result>

Response: Error

1
2
3
4
5
6
7
8
9
10
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>error</message>
   <errors>
      ...
      <error>... error messages ...</error>
      ...
   </errors>
</result>

Call

1
https://sendgrid.com/apiv2/reseller.manage.json?api_user=username&api_key=secureSecret&method=whitelabel&task=append&user=customer@example.com&mail_domain=email.sendgrid.com

Response: Success

1
2
3
{
  "message": "success"
}

Response: Error

1
2
3
4
5
6
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}