> 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.

# Disconnect Source AWS Organizational Unit

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

Disconnects an AWS organizational unit (OU) and its accounts from the given project.

After disconnecting, resources in the OU descendant accounts are no longer backed up.
Resources with snapshots continue to be shown in the inventory, and you can still explore, query, and restore them.
Resources with no remaining snapshots are removed from the inventory.


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

## 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 unit you want to disconnect. You can get your project ID from the [API Credentials](https://console.eon.io/global-management/api-credentials) page in your global management console.
- `organizationalUnitId` (string, required) — Eon-assigned ID of the AWS organizational unit to disconnect.

## Response

### 200

AWS organizational unit disconnected.

- `organizationalUnit` (SourceAwsOrganizationalUnit, required) — The disconnected AWS organizational unit.

## 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
{
  "organizationalUnit": {
    "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"
  }
}
```

**SDK Code**

```python
import requests

url = "https://{account-domain}.console.eon.io/api/v1/projects/cc4fe8ee-0c62-56f2-9fda-f27bc7753e55/source-aws-organizational-units/72d29280-a0be-59df-b33c-59f9015606c3/disconnect"

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

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

print(response.json())
```

```javascript
const url = 'https://{account-domain}.console.eon.io/api/v1/projects/cc4fe8ee-0c62-56f2-9fda-f27bc7753e55/source-aws-organizational-units/72d29280-a0be-59df-b33c-59f9015606c3/disconnect';
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/cc4fe8ee-0c62-56f2-9fda-f27bc7753e55/source-aws-organizational-units/72d29280-a0be-59df-b33c-59f9015606c3/disconnect")
  .header("Authorization", "Bearer <token>")
  .asString();
```