Create Subuser
For more information about Subusers, visit the longform Subusers documentation. You can also manage Subusers in the SendGrid console.
POST/v3/subusers
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 create a new subuser.
Bearer <<YOUR_API_KEY_HERE>>application/jsonThe 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.
Optional
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.).
globalPossible values: globaleuOptional
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.)
falseOptional
The username of the subuser.
Optional
The user ID for this subuser.
Optional
The email address for this subuser.
Optional
Optional
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.
globalPossible values: globaleu1const 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});