POST/v2/vpc_nat_gateways

Create a New VPC NAT Gateway

To create a new VPC NAT gateway, send a POST request to /v2/vpc_nat_gateways setting the required attributes.

The response body will contain a JSON object with a key called vpc_nat_gateway containing the standard attributes for the new VPC NAT gateway.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

9 body fields
namestringrequired
The human-readable name of the VPC NAT gateway.
typestringrequired
The type of the VPC NAT gateway.
Allowed:PUBLIC
regionstringrequired
The region in which the VPC NAT gateway is created.
Allowed:nyc1nyc2nyc3ams2ams3sfo1sfo2sfo3sgp1lon1fra1tor1
sizeintegerrequired
The size of the VPC NAT gateway.
vpcsarray<object>required
An array of VPCs associated with the VPC NAT gateway.
udp_timeout_secondsintegeroptional
The UDP timeout in seconds for the VPC NAT gateway.
icmp_timeout_secondsintegeroptional
The ICMP timeout in seconds for the VPC NAT gateway.
tcp_timeout_secondsintegeroptional
The TCP timeout in seconds for the VPC NAT gateway.
egressesobjectoptional
An optional object specifying the public egress IP address to assign to the VPC NAT gateway. Provide this only to use a specific address. If omitted, DigitalOcean allocates a public IP address automatically.

5 status codes
202The response will be a JSON object with a key called `vpc_nat_gateway`. This will be set to a JSON object that contains the standard VPC NAT gateway attributes.
vpc_nat_gatewayobjectoptional
401Authentication failed due to invalid credentials.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429The API rate limit has been exceeded.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500There was a server error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
defaultThere was an unexpected error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.

Error handling

A 401 is returned: Authentication failed due to invalid credentials. A 429 is returned: The API rate limit has been exceeded. A 500 is returned: There was a server error. Any other status is an error: There was an unexpected error.