Enable/disable a subuser
For more information about Subusers, visit the longform Subusers documentation. You can also manage Subusers in the SendGrid console.
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.
Property nameTypeRequiredDescription
Authorizationstring
required
Default:
Bearer <<YOUR_API_KEY_HERE>>
Property nameTypeRequiredDescription
subuser_namestring
required
The username of the Subuser.
Encoding type:
application/json
SchemaExample
Property nameTypeRequiredDescriptionChild properties
disabledboolean
Optional
Whether or not this subuser is disabled. true
means disabled, false
means enabled.
204400401500
No response body.
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const subuser_name = "subuser_name";5const data = {6disabled: false,7};89const request = {10url: `/v3/subusers/${subuser_name}`,11method: "PATCH",12body: data,13};1415client16.request(request)17.then(([response, body]) => {18console.log(response.statusCode);19console.log(response.body);20})21.catch((error) => {22console.error(error);23});