> This page is for API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.eon.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.eon.io/_mcp/server.

# List Subnets

GET https://%7Baccount-domain%7D.console.eon.io/api/projects/{projectId}/restore-accounts/{accountId}/regions/{region}/aws-subnets-v2

Retrieves a list of subnets available to Eon in the specified region of the restore account.

Reference: https://docs.eon.io/api/api-reference/restore-connections/restore-accounts/aws-restore-account-assets/list-aws-subnets-v-2

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `projectId` (string, required) — ID of the project the restore account is in. You can get your project ID from the [API Credentials](https://console.eon.io/global-management/api-credentials) page in your global management console.
- `accountId` (string, required) — Eon-assigned ID of the restore account.
- `region` (string, required) — Region where the subnets are located.

## Response

### 200

Subnets retrieved.

- `subnets` (list of ListSubnetsResponseV2SubnetsItems, required) — List of subnets.

## Types

### ListSubnetsResponseV2SubnetsItems

- `id` (string, required) — Cloud-provider-assigned ID of the subnet.
- `vpc` (string, required) — Cloud-provider-assigned ID of the VPC the subnet is in.
- `availabilityZone` (string, required) — Availability zone the subnet is in.
- `name` (string, optional) — Name of the subnet.
- `cidrBlock` (string, optional) — Primary IPv4 CIDR range of the subnet.

## Examples

**Response**

```json
{
  "subnets": [
    {
      "id": "string",
      "vpc": "string",
      "availabilityZone": "string",
      "name": "string",
      "cidrBlock": "10.0.0.0/24"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://{account-domain}.console.eon.io/api/projects/projectId/restore-accounts/accountId/regions/region/aws-subnets-v2"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://{account-domain}.console.eon.io/api/projects/projectId/restore-accounts/accountId/regions/region/aws-subnets-v2';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://{account-domain}.console.eon.io/api/projects/projectId/restore-accounts/accountId/regions/region/aws-subnets-v2")
  .header("Authorization", "Bearer <token>")
  .asString();
```