Update IPs assigned to a subuser
PUT /v3/subusers/{subuser_name}/ips Base url: https://api.sendgrid.com This endpoint allows you update your subusers' assigned IP.
Each subuser should be assigned to an IP address from which all of this subuser's mail will be sent. Often, this is the same IP as the parent account, but each subuser can have one or more of their own IP addresses as well.
More information:
Property name Type Required Description
subuser_name string required
The username of the Subuser.
array[string<ipv4>]
The IP addresses you would like to assign to the subuser.
Property name Type Required Description Child properties
ips array[string<ipv4>]
The IP addresses that are assigned to the subuser.
{
"ips" : [
"127.0.0.1"
]
}
Property name Type Required Description Child properties
errors array[object]
Show child properties
for errors Property name Type Required Description Child properties
field string or null
When applicable, this property value will be the field that generated the error.
help object
When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error.
id string
When applicable, this property value will be an error ID.
{
"errors" : [
{
"field" : null ,
"message" : "authorization required"
}
]
}
_22 const client = require('@sendgrid/client');
_22 client.setApiKey(process.env.SENDGRID_API_KEY);
_22 const subuser_name = "Miss Christine Morgan";
_22 url: `/v3/subusers/${subuser_name}/ips`,
_22 client.request(request)
_22 .then(([response, body]) => {
_22 console.log(response.statusCode);
_22 console.log(response.body);
_22 console.error(error);