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

# Connect Source Account

POST https://%7Baccount-domain%7D.console.eon.io/api/v1/projects/{projectId}/source-accounts
Content-Type: application/json

Connects a source cloud account to the given project.

Reference: https://docs.eon.io/api/api-reference/source-connections/source-accounts/connect-source-account

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

### Body (application/json)

This endpoint expects a ConnectSourceAccountRequest.

- `sourceAccountAttributes` (SourceAccountAttributesInput, required) — Cloud-provider-specific configuration for the source account.
- `name` (string, optional) — Account display name in Eon.

## Response

### 200

Source account connected.

- `sourceAccount` (SourceAccount, required) — Source account.

## Errors

### 409 Conflict Error

Source account already exists in Eon.

- `any`

## Types

### SourceAccountAttributesInput

- `cloudProvider` (enum, required) — Cloud provider. `PROVIDER_UNSPECIFIED` is supported only in responses.
  - Allowed values: `AWS`, `AZURE`, `GCP`, `MONGO_ATLAS`, `PROVIDER_UNSPECIFIED`
- `aws` (AwsSourceAccountAttributesInput, optional) — AWS account configuration. Applicable if `cloudProvider` is set to `AWS`.
- `azure` (AzureSourceAccountAttributesInput, optional) — Azure subscription configuration. Applicable if `cloudProvider` is set to `AZURE`.
- `gcp` (GcpSourceAccountAttributesInput, optional) — GCP project configuration. Applicable if `cloudProvider` is set to `GCP`.

### SourceAccount

- `id` (string, required) — Eon-assigned source account ID.
- `providerAccountId` (string, required) — Cloud-provider-assigned account ID.
- `name` (string, required) — Account display name in Eon.
- `status` (enum, required) — Connection status of the AWS account, Azure subscription, or GCP project. Only `CONNECTED` source accounts can be backed up. For an explanation of statuses, see [Source Account Statuses](/data-protection/backup-and-protection/backup-configuration/source-accounts/source-account-statuses).
  - Allowed values: `CONNECTED`, `DISCONNECTED`, `INSUFFICIENT_PERMISSIONS`, `ACCOUNT_STATUS_UNSPECIFIED`
- `sourceAccountAttributes` (SourceAccountCloudAttributes, required) — Cloud provider-specific configuration for the restore account.
- `providerAccountName` (string, optional) — Display name inherited from the cloud provider.
- `version` (AccountVersion, optional) — Details on the Eon permissions version and installation method.
- `connectedTime` (datetime, optional) — Date and time the account was connected to Eon.

### AwsSourceAccountAttributesInput

AWS account configuration. Applicable if `cloudProvider` is set to `AWS`.

- `roleArn` (string, required) — ARN of the role Eon assumes to access the account in AWS.

### AzureSourceAccountAttributesInput

Azure subscription configuration. Applicable if `cloudProvider` is set to `AZURE`.

- `tenantId` (string, required) — ID of the Azure tenant the subscription belongs to.
- `subscriptionId` (string, required) — ID of the Azure source subscription.
- `eonInternalResourceGroupName` (string, optional, default: eon-source-internal-rg) — Resource group name for Eon's temporary internal resources.

### GcpSourceAccountAttributesInput

GCP project configuration. Applicable if `cloudProvider` is set to `GCP`.

- `serviceAccount` (string, required) — Email address of the GCP service account Eon uses to access the project.

### SourceAccountCloudAttributes

- `cloudProvider` (enum, required) — Cloud provider. `PROVIDER_UNSPECIFIED` is supported only in responses.
  - Allowed values: `AWS`, `AZURE`, `GCP`, `MONGO_ATLAS`, `PROVIDER_UNSPECIFIED`
- `aws` (AwsSourceAccountAttributes, optional) — AWS account configuration. Applicable if `cloudProvider` is set to `AWS`.
- `gcp` (GcpSourceAccountAttributes, optional) — GCP project configuration. Applicable if `cloudProvider` is set to `GCP`.
- `azure` (AzureSourceAccountAttributes, optional) — Azure subscription configuration. Applicable if `cloudProvider` is set to `AZURE`.

### AccountVersion

Details on the Eon permissions version and installation method.

- `installed` (string, required) — Currently installed permissions version.
- `installationMethod` (enum, optional, default: UNSPECIFIED) — Method used to deploy the cloud permissions. `UNSPECIFIED` is supported only in responses.
  - Allowed values: `UNSPECIFIED`, `CLOUDFORMATION`, `TERRAFORM`, `BASH_SCRIPT`
- `latest` (string, optional) — Latest available permissions version.

### AwsSourceAccountAttributes

AWS account configuration. Applicable if `cloudProvider` is set to `AWS`.

- `roleArn` (string, required) — ARN of the role Eon assumes to access the account in AWS.
- `organizationId` (string, optional) — Cloud-provider-assigned ID of the AWS organization the account belongs to.

### GcpSourceAccountAttributes

GCP project configuration. Applicable if `cloudProvider` is set to `GCP`.

- `serviceAccount` (string, required)
- `organizationId` (string, optional) — Cloud-provider-assigned ID of the GCP project's parent organization.
- `folderId` (string, optional) — Cloud-provider-assigned ID of the GCP project's parent folder.

### AzureSourceAccountAttributes

Azure subscription configuration. Applicable if `cloudProvider` is set to `AZURE`.

- `tenantId` (string, required) — ID of the Azure tenant the subscription belongs to.
- `subscriptionId` (string, required) — ID of the Azure subscription.
- `eonInternalResourceGroupName` (string, optional, default: eon-source-internal-rg) — Resource group name for Eon's temporary internal resources.
- `managementGroupId` (string, optional) — ID of the Azure management group the source account is scoped to.

## Examples

**Request**

```json
{
  "sourceAccountAttributes": {
    "cloudProvider": "AWS"
  }
}
```

**Response**

```json
{
  "sourceAccount": {
    "id": "fc495499-9796-5fc9-ade7-1ba924cbcc42",
    "providerAccountId": "123412341234",
    "name": "prod-eu",
    "status": "CONNECTED",
    "sourceAccountAttributes": {
      "cloudProvider": "AWS",
      "aws": {
        "roleArn": "arn:aws:iam::123412341234:role/EonSourceAccountRole",
        "organizationId": "o-1234567890"
      },
      "gcp": {
        "serviceAccount": "string",
        "organizationId": "123456789012",
        "folderId": "987654321098"
      },
      "azure": {
        "tenantId": "060901b5-ae27-5b6f-aaf5-829b635615e9",
        "subscriptionId": "12345678-1234-1234-1234-123456789012",
        "eonInternalResourceGroupName": "eon-source-internal-rg",
        "managementGroupId": "3eca9074-011f-5008-9605-a7ccf00aa93e"
      }
    },
    "providerAccountName": "string",
    "version": {
      "installed": "1.0.0",
      "installationMethod": "TERRAFORM",
      "latest": "1.2.0"
    },
    "connectedTime": "2024-08-29T13:24:03Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://{account-domain}.console.eon.io/api/v1/projects/cc4fe8ee-0c62-56f2-9fda-f27bc7753e55/source-accounts"

payload = { "sourceAccountAttributes": { "cloudProvider": "AWS" } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://{account-domain}.console.eon.io/api/v1/projects/cc4fe8ee-0c62-56f2-9fda-f27bc7753e55/source-accounts';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"sourceAccountAttributes":{"cloudProvider":"AWS"}}'
};

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-accounts")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"sourceAccountAttributes\": {\n    \"cloudProvider\": \"AWS\"\n  }\n}")
  .asString();
```