Duplicate a datasource
import requests
url = "https://{FUSION_HOST}/api/connectors/datasources/{id}/duplicate"
payload = { "targetId": "test-data-source-copy" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://{FUSION_HOST}/api/connectors/datasources/{id}/duplicate")
.header("Content-Type", "application/json")
.body("{\n \"targetId\": \"test-data-source-copy\"\n}")
.asString();const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({targetId: 'test-data-source-copy'})
};
fetch('https://{FUSION_HOST}/api/connectors/datasources/{id}/duplicate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION_HOST}/api/connectors/datasources/{id}/duplicate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"targetId\": \"test-data-source-copy\"\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION_HOST}/api/connectors/datasources/{id}/duplicate"
payload := strings.NewReader("{\n \"targetId\": \"test-data-source-copy\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION_HOST}/api/connectors/datasources/{id}/duplicate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'targetId' => 'test-data-source-copy'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request POST \
--url https://{FUSION_HOST}/api/connectors/datasources/{id}/duplicate \
--header 'Content-Type: application/json' \
--data '
{
"targetId": "test-data-source-copy"
}
'{
"id": "test-data-source-copy",
"created": "2026-03-13T18:20:00.000Z",
"modified": "2026-03-13T18:20:00.000Z",
"connector": "lucidworks.file-upload",
"type": "lucidworks.file-upload",
"pipeline": "api-test-app",
"parserId": "api-test-app",
"description": "Copy of test-data-source",
"coreProperties": {
"skipConfigValidation": false
},
"properties": {
"collection": "api-test-app",
"fileId": "products.json",
"mediaType": "application/json"
}
}{
"validationErrors": [
{
"field": "id",
"value": "classic-data-source",
"error": "classic.connector.not.supported"
}
]
}{}{}Duplicate a datasource
Create a new datasource by copying the configuration of an existing datasource.
Only V2 (SDK) datasources can be duplicated. A request to duplicate a classic (V1) datasource returns a 400 error.
The new datasource gets all settings from the source datasource, including the pipeline and parser IDs, except for the fields you provide in the request body:
targetIdis required and becomes the ID of the new datasource.description,application, andcollectionare optional and replace the source values when provided.
Fusion doesn’t validate the copied pipeline and parser IDs, or the application and collection values.
POST
/
connectors
/
datasources
/
{id}
/
duplicate
Duplicate a datasource
import requests
url = "https://{FUSION_HOST}/api/connectors/datasources/{id}/duplicate"
payload = { "targetId": "test-data-source-copy" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://{FUSION_HOST}/api/connectors/datasources/{id}/duplicate")
.header("Content-Type", "application/json")
.body("{\n \"targetId\": \"test-data-source-copy\"\n}")
.asString();const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({targetId: 'test-data-source-copy'})
};
fetch('https://{FUSION_HOST}/api/connectors/datasources/{id}/duplicate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION_HOST}/api/connectors/datasources/{id}/duplicate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"targetId\": \"test-data-source-copy\"\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION_HOST}/api/connectors/datasources/{id}/duplicate"
payload := strings.NewReader("{\n \"targetId\": \"test-data-source-copy\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION_HOST}/api/connectors/datasources/{id}/duplicate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'targetId' => 'test-data-source-copy'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request POST \
--url https://{FUSION_HOST}/api/connectors/datasources/{id}/duplicate \
--header 'Content-Type: application/json' \
--data '
{
"targetId": "test-data-source-copy"
}
'{
"id": "test-data-source-copy",
"created": "2026-03-13T18:20:00.000Z",
"modified": "2026-03-13T18:20:00.000Z",
"connector": "lucidworks.file-upload",
"type": "lucidworks.file-upload",
"pipeline": "api-test-app",
"parserId": "api-test-app",
"description": "Copy of test-data-source",
"coreProperties": {
"skipConfigValidation": false
},
"properties": {
"collection": "api-test-app",
"fileId": "products.json",
"mediaType": "application/json"
}
}{
"validationErrors": [
{
"field": "id",
"value": "classic-data-source",
"error": "classic.connector.not.supported"
}
]
}{}{}Query Parameters
Body
application/json
The ID for the new datasource and any fields to override in the copy.
Response
Created
The response is of type object.
Was this page helpful?