For more information about Subusers, visit the longform Subusers documentation. You can also manage Subusers in the SendGrid console.
This endpoint allows you to create a new subuser.
Bearer <<YOUR_API_KEY_HERE>>
application/json
The username for this subuser.
The email address of the subuser.
The password this subuser will use when logging into SendGrid.
The IP addresses that should be assigned to this subuser.
The region this Subuser should be assigned to. Can be global
or eu
. (Regional email is in Public Beta and requires SendGrid Pro plan or above.).
global
Possible values: global
eu
A flag that determines if the Subuser's region should be returned in the response. (Regional email is in Public Beta and requires SendGrid Pro plan or above.)
false
The username of the subuser.
The user ID for this subuser.
The email address for this subuser.
The region this Subuser is assigned to. The property is returned only if the include_region
parameter is included and set to true
in the API request.
global
Possible values: global
eu
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const data = {5username: "John@example.com",6email: "John@example.com",7password: "johns_password",8ips: ["1.1.1.1", "2.2.2.2"],9region: "global",10include_region: true,11};1213const request = {14url: `/v3/subusers`,15method: "POST",16body: data,17};1819client20.request(request)21.then(([response, body]) => {22console.log(response.statusCode);23console.log(response.body);24})25.catch((error) => {26console.error(error);27});