Skip to contentSkip to navigationSkip to topbar
Rate this page:
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

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.

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 subuser

enabledisable-a-subuser 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 subuser_name = "Miss Christine Morgan";
_22
const data = {
_22
"disabled": false
_22
};
_22
_22
const request = {
_22
url: `/v3/subusers/${subuser_name}`,
_22
method: 'PATCH',
_22
body: data
_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: