> 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 Security Groups

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

Retrieves a list of security groups 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-security-groups

## 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 security groups are located.

### Query parameters

- `vpcId` (string, optional) — ID of the VPC to filter security groups by.
- `subnetId` (string, optional) — ID of the subnet to filter security groups by.

## Response

### 200

Security groups retrieved.

- `region` (string, required) — Region where the security groups are located.
- `securityGroups` (list of RestoreSecurityGroupsSecurityGroupsItems, required) — List of security groups.

## Types

### RestoreSecurityGroupsSecurityGroupsItems

- `name` (string, required) — Name of the security group.
- `id` (string, required) — Cloud-provider-assigned ID of the security group.
- `vpc` (string, required) — Cloud-provider-assigned ID of the VPC the security group is in.

## Examples

**Response**

```json
{
  "region": "string",
  "securityGroups": [
    {
      "name": "string",
      "id": "string",
      "vpc": "string"
    }
  ]
}
```

**SDK Code**

```python
import requests

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

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-security-groups';
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-security-groups")
  .header("Authorization", "Bearer <token>")
  .asString();
```