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

Create Account



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 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.

Profile object

profile-object page anchor

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.


POST/v3/partners/accounts

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

Creates a new account, with specified offering, under the organization.


Property nameTypeRequiredDescription
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>

T-Test-AccountstringOptional

OPTIONAL Custom request header provided ONLY for a test account

SchemaExample
Property nameTypeRequiredDescriptionChild properties
profileobjectOptional

offeringsarray[object]required

List of offering names to assign to account.

201400401403

Created

SchemaExample
Property nameTypeRequiredDescriptionChild properties
account_idstring

Twilio SendGrid account ID

Create a customer account

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

_34
const client = require('@sendgrid/client');
_34
client.setApiKey(process.env.SENDGRID_API_KEY);
_34
_34
const data = {
_34
"profile": {
_34
"first_name": "Sender",
_34
"last_name": "Wiz",
_34
"company_name": "Example Co",
_34
"company_website": "https://example.com",
_34
"email": "mail@example.com",
_34
"timezone": "Asia/Tokyo"
_34
},
_34
"offerings": [
_34
{
_34
"name": "Miss Christine Morgan",
_34
"type": "package"
_34
}
_34
]
_34
};
_34
_34
const request = {
_34
url: `/v3/partners/accounts`,
_34
method: 'POST',
_34
body: data
_34
}
_34
_34
client.request(request)
_34
.then(([response, body]) => {
_34
console.log(response.statusCode);
_34
console.log(response.body);
_34
})
_34
.catch(error => {
_34
console.error(error);
_34
});

Create test customer account

create-test-customer-account page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
curl

_38
const client = require('@sendgrid/client');
_38
client.setApiKey(process.env.SENDGRID_API_KEY);
_38
_38
const headers = {
_38
"T-Test-Account": "true"
_38
};
_38
const data = {
_38
"profile": {
_38
"first_name": "Sender",
_38
"last_name": "Wiz",
_38
"company_name": "Example Co",
_38
"company_website": "https://example.com",
_38
"email": "mail@example.com",
_38
"timezone": "Asia/Tokyo"
_38
},
_38
"offerings": [
_38
{
_38
"name": "Miss Christine Morgan",
_38
"type": "package"
_38
}
_38
]
_38
};
_38
_38
const request = {
_38
url: `/v3/partners/accounts`,
_38
method: 'POST',
_38
headers: headers,
_38
body: data
_38
}
_38
_38
client.request(request)
_38
.then(([response, body]) => {
_38
console.log(response.statusCode);
_38
console.log(response.body);
_38
})
_38
.catch(error => {
_38
console.error(error);
_38
});


Rate this page: