> 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/update-managed-nat-gateway.md).

# Update a Managed NAT Gateway

Update the name or properties of a managed NAT gateway in a Virtual Data Center using a `PATCH` request. It updates only the specified properties without affecting other settings.

## Endpoint

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

## Request

```bash
curl --location \
--request PATCH 'https://api.ionos.com/cloudapi/v6/datacenters/8feda53f-15f0-447f-badf-ebe32dad2fc0/natgateways/d0989a01-6e5f-41f5-9e6e-0f5f2d3a0c7b' \
--header 'Authorization: Bearer $IONOS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "properties": {
    "name": "Updated NAT Gateway"
  }
}'
```

{% tabs %}
{% tab title="Request Body Parameters" %}
The following table lists the request body parameters:

| **Body Parameters** | **Required** | **Type** | **Description**              | **Example**           |
| ------------------- | ------------ | -------- | ---------------------------- | --------------------- |
| `properties.name`   | No           | string   | The name of the NAT Gateway. | `Updated NAT Gateway` |
| {% 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). |
| `Content-Type`        | Yes          | string   | Set it to `application/json`.                                               |
| {% endtab %}          |              |          |                                                                             |
| {% endtabs %}         |              |          |                                                                             |

## Response

A **202 Accepted** response indicates a successful update to the managed NAT gateway. The resource maintains a `BUSY` status until the update completes. The `id` and updated properties are provided in the response.

{% hint style="info" %}
**Note:** NAT Gateway updates are performed asynchronously. The response includes a `Location` header with a URL to poll the request status.
{% endhint %}

```json
{
  "id": "d0989a01-6e5f-41f5-9e6e-0f5f2d3a0c7b",
  "type": "nat-gateway",
  "href": "/cloudapi/v6/datacenters/8feda53f-15f0-447f-badf-ebe32dad2fc0/natgateways/d0989a01-6e5f-41f5-9e6e-0f5f2d3a0c7b",
  "metadata": {
    "createdDate": "2024-01-15T09:30:00+00:00",
    "createdBy": "ionos:identity:::users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2024-01-15T10:45:00+00:00",
    "lastModifiedBy": "ionos:identity:::users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "resourceURN": "ionos:resource:nat-gateway:d0989a01-6e5f-41f5-9e6e-0f5f2d3a0c7b",
    "status": "BUSY",
    "statusMessage": null,
    "publicIps": [
      "198.51.100.45",
      "198.51.100.46"
    ]
  },
  "properties": {
    "name": "Updated NAT Gateway",
    "publicIps": [
      "198.51.100.45",
      "198.51.100.46"
    ],
    "lans": [
      {
        "id": "33",
        "gatewayIps": [
          "10.0.1.1"
        ]
      },
      {
        "id": "34",
        "gatewayIps": [
          "10.0.2.1"
        ]
      }
    ]
  }
}
```


---

# 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/update-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.
