Skip to contentSkip to navigationSkip to topbar
On this page

Enable/disable a subuser



API Overview

api-overview page anchor

For more information about Subusers, visit the longform Subusers documentation. You can also manage Subusers in the SendGrid console(link takes you to an external page).


PATCH/v3/subusers/{subuser_name}

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

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

This endpoint allows you to enable or disable a subuser.


Authentication

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

The username of the Subuser.

Encoding type:application/json
SchemaExample
Property nameTypeRequiredDescriptionChild properties
disabledbooleanOptional

Whether or not this subuser is disabled. true means disabled, false means enabled.

204400401500
Schema
Property nameTypeRequiredDescriptionChild properties

No properties defined

Enable/disable a subuserLink to code sample: Enable/disable a subuser
1
const client = require('@sendgrid/client');
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const subuser_name = "Miss Christine Morgan";
5
const data = {
6
"disabled": false
7
};
8
9
const request = {
10
url: `/v3/subusers/${subuser_name}`,
11
method: 'PATCH',
12
body: data
13
}
14
15
client.request(request)
16
.then(([response, body]) => {
17
console.log(response.statusCode);
18
console.log(response.body);
19
})
20
.catch(error => {
21
console.error(error);
22
});

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.