# Delete a gateway

Deleting a gateway removes it with every environment, API key and user it has. Its URLs stop serving immediately. A deleted gateway cannot be restored.

To stop serving and keep everything, [pause the gateway](https://docs.faustine.ai/agent-gateway/pause-a-gateway/) instead.

## Delete the gateway

To delete a gateway:

1. In the portal, go to [**Agent Gateway**](https://auth.faustine.ai/go?to=%2Fintegrations%2Fagent-gateway) and select your gateway.
2. Select the **Settings** tab.
3. In the **Delete this gateway** row, select **Delete gateway**.
4. Confirm with **Delete**.

The portal returns to the **Agent Gateway** list.

The list has the same action. Open the menu on the gateway's row, select **Delete**, and confirm.

## What is deleted and what stays

| Deleted | Kept |
| --- | --- |
| Every environment of the gateway, with its policies and variables | The APIs the gateway served, with their operations and versions |
| API keys | The APIs' connections |
| Users and their sessions | |
| Which APIs and operations each environment served | |
| Log streams | |

After the delete, an API that only this gateway served can be deleted. See [Delete an API](https://docs.faustine.ai/apis/delete-an-api/).

## What clients get afterwards

A call to any URL of the gateway returns `401` with `Invalid API key`, the same answer as for a gateway that never existed.
A gateway you create later with the same slug has the same URLs and none of the old credentials. Create new keys and users, and give them to your clients.

## Delete one environment

To remove one environment and keep the gateway:

1. In the **Settings** tab, find the **Environments** row.
2. Select the trash icon next to the environment.
3. Confirm with **Delete**.

The environment's URL stops answering immediately. Its API keys, its users and their sessions, and its logs are deleted. This cannot be undone.

The default environment has no trash icon. Select **Set default** on another environment first. See [Environments](https://docs.faustine.ai/agent-gateway/environments/).

## Next steps

- [Pause a gateway](https://docs.faustine.ai/agent-gateway/pause-a-gateway/): stop serving without losing keys and users.
- [Create a gateway](https://docs.faustine.ai/agent-gateway/create-a-gateway/): start a new gateway.
- [Promote from one environment to another](https://docs.faustine.ai/agent-gateway/promote/): copy an environment's configuration before you delete it.
