Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Single Sign-On



API Overview

api-overview page anchor

The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customers. This API is for companies that have a formal reseller partnership with Twilio SendGrid.

You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio SendGrid Subusers feature, which is available with Pro and Premier plans(link takes you to an external page).

The Account Provisioning API account operations allow you to create, retrieve, and authenticate customer accounts.

The Single Sign-On operation authenticates a customer that you specify by account ID with the Twilio SendGrid user interface. The customer will be authenticated as an Admin Teammate with all the permissions to manage any aspect of their account, including API keys, additional teammates, and domain authentication.

A successful request to this endpoint generates a redirect containing a one-time authorization code used to log the user into the Twilio SendGrid UI. This one-time code is good for 60 seconds and can be used for login once, ensuring that any type of man-in-the-middle or replay attack can be securely blocked. This allows you to manage your customers' authentication credentials without sharing any of the information with Twilio SendGrid.

This SSO flow is limited to authentication on the base Admin Teammate. It cannot be used for SSO on a subsequently created teammate or subuser whose credentials will be managed through Twilio SendGrid.


POST/v3/partners/accounts/{accountID}/sso

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

Authenticates and logs in a user to Twilio Sendgrid as a specific admin identity configured for SSO by partner. Any additional teammates or subusers will need to log in directly via app.sendgrid.com


Authentication

authentication page anchor
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>
accountIDstringrequired

Twilio SendGrid account ID

303401403404

Successful redirect to app.sendgrid.com.

Authenticate a customer account user

authenticate-a-customer-account-user page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
curl

_19
const client = require('@sendgrid/client');
_19
client.setApiKey(process.env.SENDGRID_API_KEY);
_19
_19
const accountID = "ZGkrHSypTsudrGkmdpJJ";
_19
_19
const request = {
_19
url: `/v3/partners/accounts/${accountID}/sso`,
_19
method: 'POST',
_19
_19
}
_19
_19
client.request(request)
_19
.then(([response, body]) => {
_19
console.log(response.statusCode);
_19
console.log(response.body);
_19
})
_19
.catch(error => {
_19
console.error(error);
_19
});


Rate this page: