Skip to main content
This topic describes the API procedure to create a Megaport NAT Gateway (NAT Gateway), including how to look up locations, check available session counts, and place the order. Before you begin, obtain a valid access token. For more information, see Creating an API Key. To create a NAT Gateway, you need to:
  1. Look up NAT Gateway location details to find a location that supports the NAT Gateway speed you require.
  2. Look up available session counts to choose a valid session count for your NAT Gateway.
  3. Create the NAT Gateway design to generate a productUid for the NAT Gateway.
  4. Validate the NAT Gateway order using the productUid.
  5. Buy the NAT Gateway to provision the service.
To look up NAT Gateway location details
  1. Send a GET request to retrieve available locations.
  2. Search the response for a location that includes natGatewaySpeedMbps in the diversityZones object. To provision a NAT Gateway at a location, your required speed must appear in natGatewaySpeedMbps. Check that the location has your required speed and an available diversity zone. To create a NAT Gateway, you need the location id value. In this example, the location ID is 60.
To look up available session counts
  1. Send a GET request to retrieve the available session count and speed combinations for NAT Gateways.
    The response shows the valid session counts for each supported speed.
  2. Choose a speed and session count for your NAT Gateway. Both values are fixed for the life of the service.
To create the NAT Gateway design
  1. Create a request with this URL:
    This request creates the NAT Gateway configuration but does not purchase or provision the service. To purchase the NAT Gateway, you need to validate and buy using the productUid.
  2. Create the request Body. You must include the locationId, productName, speed, term, and config fields. The config object requires an asn and a sessionCount. You can use the Megaport ASN: 133937.
A successful response returns the productUid for the new NAT Gateway. You need this ID to order the NAT Gateway.
To validate the NAT Gateway order
  1. Create a request with this URL:
  2. Create the request Body with the productUid from the previous step.
A successful response (HTTP 200) confirms the order is valid. Proceed to purchase the NAT Gateway. To purchase the NAT Gateway
  1. Send a POST request to purchase and provision the NAT Gateway. Use the same request Body as the validate step.
    If you make the buy API call on api.megaport.com, your account will be charged for the service. Alternatively, you can use the API in the staging environment (api-staging.megaport.com) without charges. For more information, see API Environments.
    Endpoint
    Example Request Body
If the purchase is successful, the response shows the ORDERED provisioning status and the NAT Gateway provisioning begins.
The new NAT Gateway now appears in your working environment, either portal.megaport.com or portal-staging.megaport.com. The next step is to create VXCs on the NAT Gateway.
For more information, see Creating a NAT Gateway VXC with the API.
Last modified on August 21, 2026