Menu

Expand
Rate this page:

Account Provisioning API: Account Operations

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.

Create Account

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

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.

Offerings array

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.

Response

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.

Authentication

  • API Key

Headers

Authorization
string
default: Bearer <<YOUR_API_KEY_HERE>>
required
T-Test-Account
string

OPTIONAL Custom request header provided ONLY for a test account

default: None

Request Body

object
profile
object
first_name
string

First name of the account holder

last_name
string

Last name of the account holder

company_name
string

Company name of the account holder

company_website
string

Company website of the account holder

email
string

Email of the account holder

phone
string

Phone number with a maximum of fifteen digits formatted using the E.164 standard consisting of [+] [country code] [subscriber number including area code]

timezone
string

Area/Location as listed in the IANA Time Zone database

offerings
array[object]

List of offering names to assign to account.

required
name
string

Name of the offering

required
type
string

Defines the type of offering (e.g., package or addon).

Allowed Values: package, addon
required
quantity
integer

Quantity of the specified addon to be added. If offering type is package, quantity must be 1.

format: int64

Responses

object
account_id
string

Twilio SendGrid account ID

required
{
  "account_id": "sg2a2bcd3ef4ab5c67d8efab91c01de2fa"
}
object
errors
array[object]
required
message
string

The message representing the error from the API.

required
field
string

The field associated with the error.

required
error_id
string

ID representing the error as a unique nubmer.

required
object
errors
array[object]
message
string

The message representing the error from the API.

required
field
string

The field associated with the error.

required
error_id
string

ID representing the error as a unique nubmer.

required
object
errors
array[object]
message
string

The message representing the error from the API.

required
field
string

The field associated with the error.

required
error_id
string

ID representing the error as a unique nubmer.

required
Loading Code Sample...
        
        

        Create a customer account

        Loading Code Sample...
              
              

              Create test customer account

              Rate this page:

              Need some help?

              We all do sometimes. Get help now from the Twilio SendGrid Support Team.

              Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.

              Loading Code Sample...
                    
                    
                    

                    Thank you for your feedback!

                    Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                    Sending your feedback...
                    🎉 Thank you for your feedback!
                    Something went wrong. Please try again.

                    Thanks for your feedback!

                    thanks-feedback-gif