Skip to contentSkip to navigationSkip to topbar
Page tools
Useful for sharing or LLM
Accelerate development with AI

On this page
Looking for more inspiration?Visit the

Enable or disable website access for 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}/website_access

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

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

Enable/Disable website access for a Subuser, while still preserving email send functionality.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
Authorizationstring
required
Default: Bearer <<YOUR_API_KEY_HERE>>
Property nameTypeRequiredDescription
subuser_namestring
required
Encoding type:application/json
SchemaExample
Property nameTypeRequiredDescriptionChild properties
disabledboolean

Optional

Whether or not to disable website access to the Subuser. true means disabled, false means enabled.

204
No response body.
Enable/Disable website access for a subuser, while still preserving email send functionalityLink to code sample: Enable/Disable website access for a subuser, while still preserving email send functionality
1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const subuser_name = "some_one";
5
const data = {
6
disabled: true,
7
};
8
9
const request = {
10
url: `/v3/subusers/${subuser_name}/website_access`,
11
method: "PATCH",
12
body: data,
13
};
14
15
client
16
.request(request)
17
.then(([response, body]) => {
18
console.log(response.statusCode);
19
console.log(response.body);
20
})
21
.catch((error) => {
22
console.error(error);
23
});