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.
The Account Provisioning API account operations allow you to create, retrieve, and authenticate customer accounts.
The Create Account operation allows you to create a new customer account. The Create Account operation requires a JSON request body containing a profile
object and an array of offerings
objects.
The profile
object contains a customer's identity information such as their first_name
, last_name
, and email
. The fields in the profile
object are optional — the customer will be prompted at their first login to enter any profile information you choose not to include when creating the account. See the API reference below for all profile
fields.
The offerings
array contains offering objects that list the offering's name
, type
, and quantity
. The offerings array is required, and it defines the Twilio SendGrid features or offerings available to the customer's account. The offerings available will depend on your agreement with Twilio SendGrid.
To retrieve a list of all the offerings that you can assign to a customer account, use the List Offerings endpoint. Because the available offerings will change infrequently, you may wish to cache the List Offerings response rather than call the endpoint before each account creation or update. A new account may start on any email offering at any price point. Upgrades and downgrades are also available immediately after account provisioning.
The response to a new account creation is the Twilio Sendgrid account ID. This account ID is used in all subsequent calls to the Account Provisioning API, so you should record it in your database for future use.
Creates a new account, with specified offering, under the organization.
Bearer <<YOUR_API_KEY_HERE>>
OPTIONAL Custom request header provided ONLY for a test account
application/json
List of offering names to assign to account.
Created
Twilio SendGrid account ID
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const data = {5profile: {6first_name: "Sender",7last_name: "Wiz",8company_name: "Example Co",9company_website: "https://example.com",10email: "mail@example.com",11timezone: "Asia/Tokyo",12},13offerings: [14{15name: "Miss Christine Morgan",16type: "package",17},18],19};2021const request = {22url: `/v3/partners/accounts`,23method: "POST",24body: data,25};2627client28.request(request)29.then(([response, body]) => {30console.log(response.statusCode);31console.log(response.body);32})33.catch((error) => {34console.error(error);35});
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const headers = {5"T-Test-Account": "true",6};7const data = {8profile: {9first_name: "Sender",10last_name: "Wiz",11company_name: "Example Co",12company_website: "https://example.com",13email: "mail@example.com",14timezone: "Asia/Tokyo",15},16offerings: [17{18name: "Miss Christine Morgan",19type: "package",20},21],22};2324const request = {25url: `/v3/partners/accounts`,26method: "POST",27headers: headers,28body: data,29};3031client32.request(request)33.then(([response, body]) => {34console.log(response.statusCode);35console.log(response.body);36})37.catch((error) => {38console.error(error);39});