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

Get Teammate Subuser Access



API Overview

api-overview page anchor

Twilio SendGrid's Teammates feature allows multiple users, or "Teammates," to work from a single SendGrid account.

Teammates enables groups of users with different roles and responsibilities to share one account, where each of these users has access to varying SendGrid features depending on their needs. By only giving your individual team members access to the features that they need to do their jobs, you can limit access to sensitive areas of your account. Teammates makes it easy to add, remove, and manage different users. See the Teammate Permissions documentation for more information about managing user permissions.

(information)

Info

Free and Essentials plans allow for adding one Teammate per account and do not offer Single Sign-On (SSO), while Pro and higher plans allow for up to 1,000 Teammates and include SSO and other features. Learn more about the different Email API Plans on our pricing page(link takes you to an external page).


You can think of Subusers like subaccounts. Each Subuser account is its own email ecosystem with isolated contacts, templates, suppressions, and data. Subusers feed off their parent account email credits, and all billing rolls up to the parent account. Teammates may have access to a parent account, a group of Subusers, or a single Subuser account only.


GET/v3/teammates/{teammate_name}/subuser_access

Base url: https://api.sendgrid.com

This operation allows you to retrieve the Subusers that can be accessed by a specified Teammate.

This operation will return the Subusers available to a Teammate, including the scopes available. If the Teammate is an administrator, all Subusers will be returned.


Authentication

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

The username of the Teammate for whom you want to retrieve Subuser access information.

Property nameTypeRequiredDescription
after_subuser_idintegerOptional

The Subuser ID from which the API request will begin retrieving Subusers. This query parameter can be used in successive API calls to retrieve additional Subusers.


limitintegerOptional

Limit the number of Subusers to be returned. The default limit is 100 per request.

Default: 100

usernamestringOptional

A Subuser's username that will be used to filter the returned result.

200400401403500

200 Success

SchemaExample
Property nameTypeRequiredDescriptionChild properties
has_restricted_subuser_accessboolean

When this property is set to true, the Teammate has permissions to operate only on behalf of a Subuser. This property value is true when the subuser_access property is not empty. The subuser_access property determines which Subusers the Teammate may act on behalf of.


subuser_accessarray[object]

Specifies which Subusers the Teammate may access and act on behalf of. If this property is populated, the has_restricted_subuser_access property will be true.


_metadataobject

This object contains response metadata. The presence of the after_subuser_id property in the metadata indicates that some items are still outstanding and have not been retrieved. You can use the after_subuser_id value to retrieve additional items with another request.

Get Teammate Subuser Access

get-teammate-subuser-access page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
curl

_22
const client = require('@sendgrid/client');
_22
client.setApiKey(process.env.SENDGRID_API_KEY);
_22
_22
const teammate_name = "Miss Christine Morgan";
_22
const queryParams = {
_22
"limit": 100
_22
};
_22
_22
const request = {
_22
url: `/v3/teammates/${teammate_name}/subuser_access`,
_22
method: 'GET',
_22
qs: queryParams
_22
}
_22
_22
client.request(request)
_22
.then(([response, body]) => {
_22
console.log(response.statusCode);
_22
console.log(response.body);
_22
})
_22
.catch(error => {
_22
console.error(error);
_22
});


Rate this page: