Skip to navigation

Create a NAT gateway

Creates a managed NAT gateway that gives VMs in a VPC outbound internet access without public IPs of their own. Requires scope: network.write.

# Example request with curl (set IBEE_API_TOKEN to a platform API token and WORKSPACE_ID to the workspace first).
# VPC_ID: VPC ID
curl -X POST "https://api.ibee.ai/v1/networking/vpcs/$VPC_ID/nat-gateways?workspace_id=$WORKSPACE_ID" \
-H "Authorization: Bearer $IBEE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"subnet_id": "<subnet_id>", "reserved_public_ip_id": "<reserved_public_ip_id>"}'

Authentication

AuthorizationBearer

IBEE platform API token. Production tokens start with ibee_prod_key_; development tokens start with ibee_dev_key_. Use a token only with its matching gateway environment.

Path parameters

vpc_idstringRequired
VPC ID.

Headers

X-Idempotency-KeystringOptionalformat: "^[!-~]{1,256}$"1-256 characters

Retry key for this create. Send the same key and the same body on every retry. The key is scoped to organization, workspace and path.

  • Create completed: you get the original answer for 24 hours, even if the plan limit has since been reached.
  • Refused or never sent: nothing was created, so the key is free to use again, including with a corrected body.
  • Unknown outcome (timeout, server error, lost connection): 409 idempotency_in_progress with Retry-After. This usually lasts 30 seconds and at most 3 minutes. Keep retrying with the same key and body. The next retry returns the Reserved IP, subnet or NAT gateway. For a VPC, firewall group or port forward, it either creates the resource or answers 409 “already exists”.
  • Changed body, while the outcome is unresolved or after the create completed: 409 idempotency_conflict.
  • New key at the plan limit: 402.

Query parameters

workspace_idstringRequiredformat: "^[1-9][0-9]*$">=1 character

The positive numeric workspace ID to scope this request to. Zero, negative, and non-numeric values are rejected.

Request

This endpoint expects an object.
subnet_idstring or nullOptional

Subnet the gateway is placed in; chosen by the service when omitted.

reserved_public_ip_idstring or nullOptional

Reserved IP to use as the gateway’s public address; a platform-assigned address is used when omitted.

namestringOptional1-80 charactersDefaults to NAT Gateway

Display name of the gateway. Default NAT Gateway.

Response

NAT gateway created successfully.
nat_gateway_idstring
Unique ID of the gateway.
vpc_idstring
VPC the gateway serves.
site_idstring
Site the gateway lives at.
namestring
Display name of the gateway.
public_ip_idstring
ID of the public IP the gateway uses.
public_ipstring
Public IPv4 address of the gateway.
statusenum

Lifecycle status of a VPC, subnet, NAT gateway or port-forwarding rule.

  • provisioning: being created.
  • available: ready for use.
  • error: the last change failed; see error_message.
  • deleting: being removed.
Allowed values:
subnet_idstring or nullOptional
Subnet the gateway is placed in.
organization_idstringOptional
ID of the owning organization.
workspace_idstringOptional
ID of the owning workspace.
pricingobjectOptional
Price of a NAT gateway as recorded when it was created.
error_messagestring or nullOptional

Error detail when status is error.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
413
Content Too Large Error
422
Unprocessable Entity Error
423
Locked Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error
503
Service Unavailable Error
504
Gateway Timeout Error