Skip to contentSkip to navigationSkip to topbar
On this page

Update Account State



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 state operations allow you to update and retrieve the state of your customer accounts. Accounts can be in one of five states: activated, deactivated, suspended, banned, and indeterminate.

The Update Account State operation allows you to update the state of a specific customer account. A customer account can be updated to either of the following states: activated, deactivated.

The following table shows the actions available to an account based on its state.

ACCOUNT STATELOGINSEND MAILSUBUSERS REMOVEDDEDICATED IPS REMOVEDAPI KEYS DEACTIVATED
Activatedyesyesnonono
Suspendedyesnononono
Deactivatednonononoyes
Bannednonoyesyesyes

*If you find an account in the indeterminate state, please contact Twilio SendGrid support(link takes you to an external page) for help troubleshooting.


PUT/v3/partners/accounts/{accountID}/state

Base url: https://api.sendgrid.com (for global users and subusers)

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

Update the state of the specified account.


Authentication

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

Twilio SendGrid account ID

Encoding type:application/json
SchemaExample
Property nameTypeRequiredDescriptionChild properties
stateenum<string>required

The state of the account (e.g., activated, deactivated)

Possible values:
activateddeactivated
204400401403

State successfully updated

Update a customer account's stateLink to code sample: Update a customer account's state
1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const accountID = "ZGkrHSypTsudrGkmdpJJ";
5
const data = {
6
state: "activated",
7
};
8
9
const request = {
10
url: `/v3/partners/accounts/${accountID}/state`,
11
method: "PUT",
12
body: data,
13
};
14
15
client
16
.request(request)
17
.then(([response, body]) => {
18
console.log(response.statusCode);
19
console.log(response.body);
20
})
21
.catch((error) => {
22
console.error(error);
23
});

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.