Delete data source
curl --request DELETE \
--url https://ai.data.cloud/api/v2/team/datasets/{dataset_id}/datasources/{datasource_id} \
--header 'Content-Type: application/json' \
--header 'x-pd-api-key: <api-key>' \
--data '
{
"user_id": "tmm-dafasdfasdfasdf"
}
'import requests
url = "https://ai.data.cloud/api/v2/team/datasets/{dataset_id}/datasources/{datasource_id}"
payload = { "user_id": "tmm-dafasdfasdfasdf" }
headers = {
"x-pd-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-pd-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({user_id: 'tmm-dafasdfasdfasdf'})
};
fetch('https://ai.data.cloud/api/v2/team/datasets/{dataset_id}/datasources/{datasource_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ai.data.cloud/api/v2/team/datasets/{dataset_id}/datasources/{datasource_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => 'tmm-dafasdfasdfasdf'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-pd-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ai.data.cloud/api/v2/team/datasets/{dataset_id}/datasources/{datasource_id}"
payload := strings.NewReader("{\n \"user_id\": \"tmm-dafasdfasdfasdf\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("x-pd-api-key", "<api-key>")
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))
}HttpResponse<String> response = Unirest.delete("https://ai.data.cloud/api/v2/team/datasets/{dataset_id}/datasources/{datasource_id}")
.header("x-pd-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"tmm-dafasdfasdfasdf\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ai.data.cloud/api/v2/team/datasets/{dataset_id}/datasources/{datasource_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-pd-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"tmm-dafasdfasdfasdf\"\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"data": {}
}Data sources
Delete data source
Deletes a data source from the specified dataset. Once deleted, the data source cannot be recovered.
You can only delete data sources from datasets you have created.
DELETE
/
v2
/
team
/
datasets
/
{dataset_id}
/
datasources
/
{datasource_id}
Delete data source
curl --request DELETE \
--url https://ai.data.cloud/api/v2/team/datasets/{dataset_id}/datasources/{datasource_id} \
--header 'Content-Type: application/json' \
--header 'x-pd-api-key: <api-key>' \
--data '
{
"user_id": "tmm-dafasdfasdfasdf"
}
'import requests
url = "https://ai.data.cloud/api/v2/team/datasets/{dataset_id}/datasources/{datasource_id}"
payload = { "user_id": "tmm-dafasdfasdfasdf" }
headers = {
"x-pd-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-pd-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({user_id: 'tmm-dafasdfasdfasdf'})
};
fetch('https://ai.data.cloud/api/v2/team/datasets/{dataset_id}/datasources/{datasource_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ai.data.cloud/api/v2/team/datasets/{dataset_id}/datasources/{datasource_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => 'tmm-dafasdfasdfasdf'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-pd-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ai.data.cloud/api/v2/team/datasets/{dataset_id}/datasources/{datasource_id}"
payload := strings.NewReader("{\n \"user_id\": \"tmm-dafasdfasdfasdf\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("x-pd-api-key", "<api-key>")
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))
}HttpResponse<String> response = Unirest.delete("https://ai.data.cloud/api/v2/team/datasets/{dataset_id}/datasources/{datasource_id}")
.header("x-pd-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"tmm-dafasdfasdfasdf\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ai.data.cloud/api/v2/team/datasets/{dataset_id}/datasources/{datasource_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-pd-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"tmm-dafasdfasdfasdf\"\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"data": {}
}Headers
Path Parameters
The ID of the dataset that contains the data source you want to delete.
To check the datasets you have access to, call GET /v2/team/datasets.
The ID of the data source you want to delete.
To check data sources existing in a specified dataset, call GET /v2/team/datasets/{id}/datasources.
Body
application/json
Your user ID, which uniquely identifies you within your team. To obtain your ID:
- If you're the team admin, refer to Check user information.
- If you're a system or virtual user, ask your team admin to check your user ID by referring to Check user information.
Response
200 - application/json
Status code. 0 indicates that the operation is successful. Otherwise, the operation fails. For error troubleshooting, refer to Error Codes.