For more information about Subusers, visit the longform Subusers documentation. You can also manage Subusers in the SendGrid console.
Enable/Disable website access for a Subuser, while still preserving email send functionality.
Bearer <<YOUR_API_KEY_HERE>>
application/json
Whether or not to disable website access to the Subuser. true
means disabled, false
means enabled.
No properties defined
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const subuser_name = "some_one";5const data = {6disabled: true,7};89const request = {10url: `/v3/subusers/${subuser_name}/website_access`,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});