# Data Transfer

### **Data Transfer** <a href="#data-transfer" id="data-transfer"></a>

The data transfer APIs allow initiating data transfer on a connection and getting the status of the transfer.

#### **Initiate Transfer** <a href="#initiate-transfer" id="initiate-transfer"></a>

This API can be used to initiate transfer on an active connection. Run time parameters can also be passed during the initiate transfer call.

```
POST /es/v2/data/<connection_id>/transfer
```

**Query parameters**

```
&accountId=<sub_account_id> // Required for data transfers in sub-accounts
```

**Request Body:**

```
{
  "configuration": {
  	"source": {
    
  	},
  	"destination": {
    
  	}
   }
// run time configuration
}
```

**Response:**

```
{
  "id": string,  // batch_id
  "status": string  // in-progress / failure / success
}
```

**Sample Curl::**

```
curl --location --globoff '<host>/es/v2/data/825c0cb809444dba/transfer?account_id=da85fa0834e1bb11}}' \
--header ''Authorization: Bearer f571a1ea-bd6a-487e-a33f-3999bf00b060' \
--header 'Content-Type: application/json' \
--data '{
    "configuration": {
        "source": {
            "bucketURI": "s3://snowflake-native-app-test/connectors/sample"
        }
    }
}'
```

#### **Get Request Status** <a href="#get-request-status" id="get-request-status"></a>

This API allows fetching status of ongoing or completed data transfers.

```
GET /es/v2/data/<connection_id>/status/<batch_id>
```

**Query parameters**

```
&accountId=<sub_account_id> // Required for data transfers in sub-accounts
```

**Response:**

```
{
  "id": string,
  "status": string  // pending / failure / success
}
```

**Sample Curl::**

```
curl --location '<host>/es/v2/data/849b79953b98feac/status/c21c77079c084d0c9846259bf564c070?accountId=a3ba4fbd9d51df11' \
--header 'Authorization: Bearer c076dc2e-d0c2-4d4d-ab13-e4e3dd555fc0'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.madconnect.ai/deployment-options/madconnect-apis/data-transfer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
