Allow subusers to manage their account from your website using an iframe to our site.

Initial API Call

In order to login your subuser, you need to contact our API to retrieve the unique URL to automatically login your subuser. Then display the generated URL to automatically login your subuser.

Parameter Required Requirements Description
user Yes Subuser must be under your account This is the subuser to automatically login
password No subuser password Automatically authenticate the subuser with this API call
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/apiv2/customer.geturl.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username

Response

1
2
3
{
  "params": "al_username=your_sendgrid_username&al_subuser_name=subuser_username&al_hash=aa39649af578679d3a90d2cc43245d56"
}

Call

POST https://api.sendgrid.com/apiv2/customer.geturl.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username

Response

1
2
3
<params>
   <params>al_username=your_sendgrid_username=subuser_username=aa39649af578679d3a90d2cc43245d56</params>
</params>

If you submit the password and we cannot authenticate the user, the params are returned with a NULL al_hash.


iFrame Usage

Using the parameters returned from the Initial API Call, you can construct the iFrame URL as shown below.

1
<iframe src="https://sendgrid.com/account?al_username=your_username&al_subuser_name=subuser_username&al_hash=aa39649af578679d3a90d2cc43245d56"></iframe>