> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/network-services/nat-gateway/api-howtos/list-managed-nat-gateway.md).

# List Managed NAT Gateways

Retrieve a list of all NAT gateways provisioned in a specific data center using the `GET` request. The API paginates responses to help you manage large collections of NAT gateways.

## Endpoint

`https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/natgateways`

## Request

```bash
curl --location \
--request GET 'https://api.ionos.com/cloudapi/v6/datacenters/15f67991-0f51-4efc-a8ad-ef1fb31a480c/natgateways?offset=0&limit=100' \
--header 'Authorization: Bearer $IONOS_TOKEN'
```

## Request parameters

{% tabs %}
{% tab title="Path Parameters" %}
The following table lists the path parameters:

| **Parameter**  | **Required** | **Type** | **Description**                   | **Example**                            |
| -------------- | ------------ | -------- | --------------------------------- | -------------------------------------- |
| `datacenterId` | Yes          | string   | The unique ID of the data center. | `15f67991-0f51-4efc-a8ad-ef1fb31a480c` |
| {% endtab %}   |              |          |                                   |                                        |

{% tab title="Query Parameters" %}
The following table lists the query parameters:

| **Parameter** | **Required** | **Type** | **Description**                                                 | **Example** |
| ------------- | ------------ | -------- | --------------------------------------------------------------- | ----------- |
| `offset`      | No           | integer  | Starts the response at a specific element index for pagination. | `0`         |
| `limit`       | No           | integer  | Sets the maximum number of elements to return per page.         | `100`       |
| `depth`       | No           | integer  | Determines the level of detail (0–10) for the response objects. | `0`         |
| {% endtab %}  |              |          |                                                                 |             |

{% tab title="Request Header Parameters" %}
Include the following mandatory fields in the request header to authenticate your requests:

| **Header Parameters** | **Required** | **Type** | **Description**                                                                            |
| --------------------- | ------------ | -------- | ------------------------------------------------------------------------------------------ |
| `Authorization`       | yes          | string   | Use a Bearer token to authenticate requests through a JSON Web Token (JWT).                |
| `X-Contract-Number`   | no           | integer  | Specifies the contract number for the request. Required for users with multiple contracts. |
| {% endtab %}          |              |          |                                                                                            |
| {% endtabs %}         |              |          |                                                                                            |

## Response

A **200 OK** response indicates that the NAT Gateways are successfully listed. Each NAT Gateway's `id`, configuration details, and associated resources are provided in the response.

```json
{
  "id": "natgateways",
  "type": "collection",
  "href": "https://api.ionos.com/cloudapi/v6/datacenters/15f67991-0f51-4efc-a8ad-ef1fb31a480c/natgateways",
  "items": [
    {
      "id": "cb4ac7f1-9e7e-4c97-90f0-f5b6e1a8b9f5",
      "type": "natgateway",
      "href": "https://api.ionos.com/cloudapi/v6/datacenters/15f67991-0f51-4efc-a8ad-ef1fb31a480c/natgateways/cb4ac7f1-9e7e-4c97-90f0-f5b6e1a8b9f5",
      "metadata": {
        "etag": "4506cf970711b0e6ba0c6d7b10b9f872",
        "createdDate": "2024-01-15T13:37:50+00:00",
        "createdBy": "ionos:identity:::users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "lastModifiedDate": "2024-01-15T13:40:47+00:00",
        "lastModifiedBy": "ionos:identity:::users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "state": "AVAILABLE"
      },
      "properties": {
        "name": "Production NAT Gateway",
        "publicIps": [
          "203.0.113.5",
          "203.0.113.6"
        ],
        "lans": [
          {
            "id": 2,
            "gatewayIps": [
              "10.0.1.1"
            ]
          }
        ]
      },
      "entities": {
        "rules": {
          "id": "cb4ac7f1-9e7e-4c97-90f0-f5b6e1a8b9f5/rules",
          "type": "collection",
          "href": "https://api.ionos.com/cloudapi/v6/datacenters/15f67991-0f51-4efc-a8ad-ef1fb31a480c/natgateways/cb4ac7f1-9e7e-4c97-90f0-f5b6e1a8b9f5/rules"
        },
        "flowlogs": {
          "id": "cb4ac7f1-9e7e-4c97-90f0-f5b6e1a8b9f5/flowlogs",
          "type": "collection",
          "href": "https://api.ionos.com/cloudapi/v6/datacenters/15f67991-0f51-4efc-a8ad-ef1fb31a480c/natgateways/cb4ac7f1-9e7e-4c97-90f0-f5b6e1a8b9f5/flowlogs"
        }
      }
    },
    {
      "id": "a2f6d2e4-5c8e-4b97-82f0-c9b4f1a7c3e2",
      "type": "natgateway",
      "href": "https://api.ionos.com/cloudapi/v6/datacenters/15f67991-0f51-4efc-a8ad-ef1fb31a480c/natgateways/a2f6d2e4-5c8e-4b97-82f0-c9b4f1a7c3e2",
      "metadata": {
        "etag": "7a4f2c850922c1f7ba1d7e8c20a8f973",
        "createdDate": "2024-01-10T09:15:30+00:00",
        "createdBy": "ionos:identity:::users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "lastModifiedDate": "2024-01-10T09:18:25+00:00",
        "lastModifiedBy": "ionos:identity:::users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "state": "AVAILABLE"
      },
      "properties": {
        "name": "Development NAT Gateway",
        "publicIps": [
          "198.51.100.12"
        ],
        "lans": [
          {
            "id": 3,
            "gatewayIps": [
              "192.168.1.1",
              "192.168.1.2"
            ]
          }
        ]
      },
      "entities": {
        "rules": {
          "id": "a2f6d2e4-5c8e-4b97-82f0-c9b4f1a7c3e2/rules",
          "type": "collection",
          "href": "https://api.ionos.com/cloudapi/v6/datacenters/15f67991-0f51-4efc-a8ad-ef1fb31a480c/natgateways/a2f6d2e4-5c8e-4b97-82f0-c9b4f1a7c3e2/rules"
        },
        "flowlogs": {
          "id": "a2f6d2e4-5c8e-4b97-82f0-c9b4f1a7c3e2/flowlogs",
          "type": "collection",
          "href": "https://api.ionos.com/cloudapi/v6/datacenters/15f67991-0f51-4efc-a8ad-ef1fb31a480c/natgateways/a2f6d2e4-5c8e-4b97-82f0-c9b4f1a7c3e2/flowlogs"
        }
      }
    }
  ],
  "offset": 0,
  "limit": 100,
  "_links": {
    "prev": "https://api.ionos.com/cloudapi/v6/datacenters/15f67991-0f51-4efc-a8ad-ef1fb31a480c/natgateways?offset=0&limit=100",
    "self": "https://api.ionos.com/cloudapi/v6/datacenters/15f67991-0f51-4efc-a8ad-ef1fb31a480c/natgateways?offset=0&limit=100",
    "next": "https://api.ionos.com/cloudapi/v6/datacenters/15f67991-0f51-4efc-a8ad-ef1fb31a480c/natgateways?offset=100&limit=100"
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ionos.com/cloud/network-services/nat-gateway/api-howtos/list-managed-nat-gateway.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
