> 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 Source AWS Organizational Units

POST https://%7Baccount-domain%7D.console.eon.io/api/v1/projects/{projectId}/source-aws-organizational-units/list

Retrieves a list of AWS organizational units for the given project.

Reference: https://docs.eon.io/api/api-reference/source-connections/source-aws-ous/list-source-aws-organizational-units

## 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 whose AWS organizational units you want to retrieve. You can get your project ID from the [API Credentials](https://console.eon.io/global-management/api-credentials) page in your global management console.

### Query parameters

- `pageToken` (string, optional) — Cursor that points to the first record of the next page of results. Get this value from the previous response.
- `pageSize` (integer, optional, default: 50) — Maximum number of items to return in the response.

## Response

### 200

AWS organizational units retrieved.

- `organizationalUnits` (list of SourceAwsOrganizationalUnit, required) — List of AWS organizational units.
- `totalCount` (integer, required) — Total number of AWS organizational units that matched the filter options.
- `nextToken` (string, optional) — Cursor that points to the first record of the next page of results. Pass this value in the next request.

## Types

### SourceAwsOrganizationalUnit

- `id` (string, required) — Eon-assigned organizational unit ID.
- `roleArn` (string, required) — ARN of the role Eon assumes to access the organizational unit in AWS.
- `name` (string, required) — Organizational unit display name in Eon.
- `providerOrganizationalUnitId` (string, required) — AWS-assigned organizational unit ID.
- `providerManagementAccountId` (string, required) — AWS-assigned ID of the organization's management account.
- `status` (enum, required) — Connection status of the organizational unit. Only `CONNECTED` organizational units can have their accounts backed up.
  - Allowed values: `CONNECTED`, `DISCONNECTED`, `INSUFFICIENT_PERMISSIONS`, `ACCOUNT_STATUS_UNSPECIFIED`

## Examples

**Response**

```json
{
  "organizationalUnits": [
    {
      "id": "fc495499-9796-5fc9-ade7-1ba924cbcc42",
      "roleArn": "arn:aws:iam::123412341234:role/EonSourceAccountRole",
      "name": "prod-eu organizational unit",
      "providerOrganizationalUnitId": "ou-a1b2-f6g7h111",
      "providerManagementAccountId": "123456789012",
      "status": "CONNECTED"
    }
  ],
  "totalCount": 1,
  "nextToken": "Y2NiMGYyZmMtYjYyZi00OTc5LTgzNjQtYmQ2YjEyYzdjZTNifDE="
}
```

**SDK Code**

```python
import requests

url = "https://{account-domain}.console.eon.io/api/v1/projects/043090df-9fe5-4f89-9859-45db589c2936/source-aws-organizational-units/list"

querystring = {"pageSize":"10","pageToken":"Yjk3ODZjNjktZTIwZC00NjAxLWE1MzktZjg2NGExM2IxYTZlfDE="}

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

response = requests.post(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://{account-domain}.console.eon.io/api/v1/projects/043090df-9fe5-4f89-9859-45db589c2936/source-aws-organizational-units/list?pageSize=10&pageToken=Yjk3ODZjNjktZTIwZC00NjAxLWE1MzktZjg2NGExM2IxYTZlfDE%3D';
const options = {method: 'POST', 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.post("https://{account-domain}.console.eon.io/api/v1/projects/043090df-9fe5-4f89-9859-45db589c2936/source-aws-organizational-units/list?pageSize=10&pageToken=Yjk3ODZjNjktZTIwZC00NjAxLWE1MzktZjg2NGExM2IxYTZlfDE%3D")
  .header("Authorization", "Bearer <token>")
  .asString();
```