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

Subuser Management


(warning)

This documentation is for the SendGrid Web API v2

To access all the latest features and upcoming developments, please see our v3 API.

These calls allow the creation, management, and deletion of subusers.

(warning)

Warning

In both creating and searching for a subuser, use the username parameter. In other API calls, use the user parameter. When creating a subuser, there is no existing user parameter to reference, and one is being created.

(information)

Info

For recommended steps when creating Subusers using the API, check out this SendGrid Knowledge Center article.


Create a Subuser

create-a-subuser page anchor
URI ParameterRequiredRequirementsDescription
usernameYesNo more than 64 charactersNew subuser username
passwordYesSee SendGrid password requirementsNew subuser password
confirm_passwordYesMatch password argumentConfirm new password
emailYesValid email address, no more than 64 charactersNew subuser email. This is an administrative contact address for SendGrid
first_nameYesNo more than 50 charactersNew subuser profile first name
last_nameYesNo more than 50 charactersNew subuser profile last name
addressYesNo more than 100 charactersNew subuser profile street address
cityYesNo more than 100 charactersNew subuser profile city
stateYesNo more than 100 charactersNew subuser profile state
zipYesNo more than 50 charactersNew subuser profile postal code
countryYesValid ISO 3166-1 alpha-2(link takes you to an external page) country codeNew subuser profile country code
phoneYesNo more than 50 charactersNew subuser profile phone number
websiteYesNo more than 255 charactersNew subuser profile website
companyYesNo more than 255 charactersNew subuser profile company name
mail_domainNoExisting domain authentication record on the parent userNew subuser authenticated domain. Be mindful of IP assignment in relation to authenticated domain record
JSONXML

Call

POSThttps://api.sendgrid.com/apiv2/customer.add.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&username=subuser_username&website=domain.com&password=subuser_password&confirm_password=subuser_password&first_name=subuser_first_name&last_name=subuser_last_name&address="123 Sesame Street"&city="New York"&state=NY&zip=10128&email=subuser@domain.com&country=US&phone="(999) 555-5555"

Response


_10
{
_10
"message": "success"
_10
}


(warning)

Warning

This call will delete a subuser and will disable all tracked links on sent messages. Recipients will no longer be able to click existing tracked links and make it to the intended destination. This is irreversible, and should be used with extreme caution.

URI ParameterRequiredRequirementsDescription
userYesMust be existing subuser nameSubuser to delete
JSONXML
MethodURL part
POSThttps://api.sendgrid.com/apiv2/customer.delete.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username

_10
{
_10
"message": "success"
_10
}


Obtain a list of subusers under your account.

URI ParameterRequiredRequirementsDescription
taskYesMust be set to getTask to get list of subusers
usernameNoValid username formatOptional string to filter results
emailNoValid email formatOptional string to filter results
activeNo0 or 1Optional flag to filter results
first_nameNoValid first_name formatOptional string to filter results
last_nameNoValid last_name formatOptional string to filter results
addressNoValid street address formatOptional string to filter results
cityNoValid city formatOptional string to filter results
stateNoValid state formatOptional string to filter results
countryNoValid country formatOptional string to filter results
zipNoValid zip formatOptional string to filter results
phoneNoValid phone formatOptional string to filter results
websiteNoValid website formatOptional string to filter results
companyNoValid company formatOptional string to filter results
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.profile.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&task=get

_30
[
_30
{
_30
"username": "username",
_30
"email": "example1@example.com",
_30
"active": "true",
_30
"first_name": "john",
_30
"last_name": "doe",
_30
"address": "555 any street",
_30
"city": "any city",
_30
"state": "CA",
_30
"zip": "91234",
_30
"country": "US",
_30
"phone": "555-555-5555",
_30
"website": "example.com"
_30
},
_30
{
_30
"username": "username",
_30
"email": "example2@example.com",
_30
"active": "false",
_30
"first_name": "jane",
_30
"last_name": "doe",
_30
"address": "555 any street",
_30
"city": "any city",
_30
"state": "CA",
_30
"zip": "91234",
_30
"country": "US",
_30
"phone": "555-555-5555",
_30
"website": "example.com"
_30
}
_30
]


(warning)

Warning

Subuser username is used to access website and API. Changes occur immediately.

URI ParameterRequiredRequirementsDescription
taskYesMust be set to setUsernameTask to update subuser username
userYesSubuser must be under your accountSubuser to update username of
usernameYesValid username formatNew username for subuser
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.profile.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&task=setUsername&user=subuser_username&username=newsubuser_username

_10
{
_10
"message": "success"
_10
}


Passwords are stored encrypted, and cannot be retrieved. Forgotten passwords must be updated.

URI ParameterRequiredRequirementsDescription
userYesSubuser must be under your accountSubuser to update password of
passwordYesSee SendGrid password requirementsNew password for subuser
confirm_passwordYesMatch password argumentConfirm new password
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.password.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&password=newPassword&confirm_password=newPassword

_10
{
_10
"message": "success"
_10
}


Update Subuser Email Address

update-subuser-email-address page anchor

This is the administrative contact address, used by SendGrid to contact the user. Unrelated to sending address information.

URI ParameterRequiredRequirementsDescription
taskYesMust be set to setEmailTask to update subuser email address
userYesSubuser must be under your accountSubuser to update email address of
emailYesValid email formatNew administrative contact address
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.profile.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&task=setEmail&user=subuser_username&email=newsubuser_username

_10
{
_10
"message": "success"
_10
}


Update Subuser profile information.

URI ParameterRequiredRequirementsDescription
taskYesMust be set to setTask to update subuser profile
userYesSubuser must be under your accountSubuser to update profile
first_nameNoValid first_name formatOptional string to filter results
last_nameNoValid last_name formatOptional string to filter results
addressNoValid street address formatOptional string to filter results
cityNoValid city formatOptional string to filter results
stateNoValid state formatOptional string to filter results
countryNoValid country formatOptional string to filter results
zipNoValid zip formatOptional string to filter results
phoneNoValid phone formatOptional string to filter results
websiteNoValid website formatOptional string to filter results
companyNoValid company formatOptional string to filter results
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.profile.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&task=set&user=subuser_username&first_name=newFirstName&last_name=&newLastName

_10
{
_10
"message": "success"
_10
}


Sets subuser's active flag to 0. Prevents subuser from sending email. Does not affect website login permissions.

URI ParameterRequiredRequirementsDescription
userYesSubuser must be under your accountSubuser to disable email permissions
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.disable.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password

_10
{
_10
"message": "success"
_10
}


Sets subuser's active flag to 1. Allows subuser to send email. Does not affect website login permissions. New subusers are set to active by default.

URI ParameterRequiredRequirementsDescription
userYesSubuser must be under your accountSubuser to enable email permissions
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.enable.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username

_10
{
_10
"message": "success"
_10
}


Disable Website Access To A Subuser

disable-website-access-to-a-subuser page anchor
(warning)

Warning

When you disable website access for a Subuser, website access will also be disabled for all of that Subuser's Teammates.

Disallow a subuser to login to the SendGrid website. Does not affect email sending permissions.

URI ParameterRequiredRequirementsDescription
userYesSubuser must be under your accountSubuser to disable website access
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.website_disable.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password

_10
{
_10
"message": "success"
_10
}


Enable Website Access To A Subuser

enable-website-access-to-a-subuser page anchor

Allow a subuser to login to the SendGrid website. Does not affect email sending permissions. New subusers are enabled by default.

URI ParameterRequiredRequirementsDescription
userYesSubuser must be under your accountSubuser to enable website access
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.website_enable.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username

_10
{
_10
"message": "success"
_10
}


Rate this page: