Skip to contentSkip to navigationSkip to topbar
On this page

Subuser Management


(warning)

This documentation is for the SendGrid Web API v2

We will deprecate this version on February 10, 2025. To access all the latest features and upcoming developments, please see our v3 API. For assistance with transitioning, refer to our migration guide.

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

1
{
2
"message": "success"
3
}

(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
1
{
2
"message": "success"
3
}

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
1
[
2
{
3
"username": "username",
4
"email": "example1@example.com",
5
"active": "true",
6
"first_name": "john",
7
"last_name": "doe",
8
"address": "555 any street",
9
"city": "any city",
10
"state": "CA",
11
"zip": "91234",
12
"country": "US",
13
"phone": "555-555-5555",
14
"website": "example.com"
15
},
16
{
17
"username": "username",
18
"email": "example2@example.com",
19
"active": "false",
20
"first_name": "jane",
21
"last_name": "doe",
22
"address": "555 any street",
23
"city": "any city",
24
"state": "CA",
25
"zip": "91234",
26
"country": "US",
27
"phone": "555-555-5555",
28
"website": "example.com"
29
}
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
1
{
2
"message": "success"
3
}

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
1
{
2
"message": "success"
3
}

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
1
{
2
"message": "success"
3
}

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
1
{
2
"message": "success"
3
}

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
1
{
2
"message": "success"
3
}

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
1
{
2
"message": "success"
3
}

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
1
{
2
"message": "success"
3
}

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
1
{
2
"message": "success"
3
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.