Skip to contentSkip to navigationSkip to topbar
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 (for global users and subusers)

Base url: https://api.eu.sendgrid.com (for EU regional subusers)

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

Encoding type:application/json
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 accountLink to code sample: Create a customer account
1
const client = require('@sendgrid/client');
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const data = {
5
"profile": {
6
"first_name": "Sender",
7
"last_name": "Wiz",
8
"company_name": "Example Co",
9
"company_website": "https://example.com",
10
"email": "mail@example.com",
11
"timezone": "Asia/Tokyo"
12
},
13
"offerings": [
14
{
15
"name": "Miss Christine Morgan",
16
"type": "package"
17
}
18
]
19
};
20
21
const request = {
22
url: `/v3/partners/accounts`,
23
method: 'POST',
24
body: data
25
}
26
27
client.request(request)
28
.then(([response, body]) => {
29
console.log(response.statusCode);
30
console.log(response.body);
31
})
32
.catch(error => {
33
console.error(error);
34
});
1
const client = require('@sendgrid/client');
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const headers = {
5
"T-Test-Account": "true"
6
};
7
const data = {
8
"profile": {
9
"first_name": "Sender",
10
"last_name": "Wiz",
11
"company_name": "Example Co",
12
"company_website": "https://example.com",
13
"email": "mail@example.com",
14
"timezone": "Asia/Tokyo"
15
},
16
"offerings": [
17
{
18
"name": "Miss Christine Morgan",
19
"type": "package"
20
}
21
]
22
};
23
24
const request = {
25
url: `/v3/partners/accounts`,
26
method: 'POST',
27
headers: headers,
28
body: data
29
}
30
31
client.request(request)
32
.then(([response, body]) => {
33
console.log(response.statusCode);
34
console.log(response.body);
35
})
36
.catch(error => {
37
console.error(error);
38
});