curl --request POST \
--url https://app.agentcloud.dev/{resourceSlug}/forms/datasource/add \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: datasource.json' \
--data '{
"name": "<string>",
"originalName": "<string>",
"sourceType": "<string>",
"sourceId": "<string>",
"destinationId": "<string>",
"workspaceId": "<string>",
"connectionId": "<string>",
"createdDate": "2023-11-07T05:31:56Z",
"_id": "<string>",
"orgId": "<string>",
"teamId": "<string>",
"description": "<string>",
"filename": "<string>",
"recordCount": {
"total": 123,
"success": 123,
"failure": 123
},
"lastSyncedDate": "2023-11-07T05:31:56Z",
"discoveredSchema": {},
"embeddingField": "<string>",
"timeWeightField": "<string>",
"modelId": "<string>",
"hidden": true,
"streamConfig": {},
"timeUnit": "<string>"
}'import requests
url = "https://app.agentcloud.dev/{resourceSlug}/forms/datasource/add"
payload = "{\n \"name\": \"<string>\",\n \"originalName\": \"<string>\",\n \"sourceType\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"connectionId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"_id\": \"<string>\",\n \"orgId\": \"<string>\",\n \"teamId\": \"<string>\",\n \"description\": \"<string>\",\n \"filename\": \"<string>\",\n \"recordCount\": {\n \"total\": 123,\n \"success\": 123,\n \"failure\": 123\n },\n \"lastSyncedDate\": \"2023-11-07T05:31:56Z\",\n \"discoveredSchema\": {},\n \"embeddingField\": \"<string>\",\n \"timeWeightField\": \"<string>\",\n \"modelId\": \"<string>\",\n \"hidden\": true,\n \"streamConfig\": {},\n \"timeUnit\": \"<string>\"\n}"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "datasource.json"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'datasource.json'},
body: '{\n "name": "<string>",\n "originalName": "<string>",\n "sourceType": "<string>",\n "sourceId": "<string>",\n "destinationId": "<string>",\n "workspaceId": "<string>",\n "connectionId": "<string>",\n "createdDate": "2023-11-07T05:31:56Z",\n "_id": "<string>",\n "orgId": "<string>",\n "teamId": "<string>",\n "description": "<string>",\n "filename": "<string>",\n "recordCount": {\n "total": 123,\n "success": 123,\n "failure": 123\n },\n "lastSyncedDate": "2023-11-07T05:31:56Z",\n "discoveredSchema": {},\n "embeddingField": "<string>",\n "timeWeightField": "<string>",\n "modelId": "<string>",\n "hidden": true,\n "streamConfig": {},\n "timeUnit": "<string>"\n}'
};
fetch('https://app.agentcloud.dev/{resourceSlug}/forms/datasource/add', 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://app.agentcloud.dev/{resourceSlug}/forms/datasource/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n \"name\": \"<string>\",\n \"originalName\": \"<string>\",\n \"sourceType\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"connectionId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"_id\": \"<string>\",\n \"orgId\": \"<string>\",\n \"teamId\": \"<string>\",\n \"description\": \"<string>\",\n \"filename\": \"<string>\",\n \"recordCount\": {\n \"total\": 123,\n \"success\": 123,\n \"failure\": 123\n },\n \"lastSyncedDate\": \"2023-11-07T05:31:56Z\",\n \"discoveredSchema\": {},\n \"embeddingField\": \"<string>\",\n \"timeWeightField\": \"<string>\",\n \"modelId\": \"<string>\",\n \"hidden\": true,\n \"streamConfig\": {},\n \"timeUnit\": \"<string>\"\n}",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: datasource.json"
],
]);
$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://app.agentcloud.dev/{resourceSlug}/forms/datasource/add"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"originalName\": \"<string>\",\n \"sourceType\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"connectionId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"_id\": \"<string>\",\n \"orgId\": \"<string>\",\n \"teamId\": \"<string>\",\n \"description\": \"<string>\",\n \"filename\": \"<string>\",\n \"recordCount\": {\n \"total\": 123,\n \"success\": 123,\n \"failure\": 123\n },\n \"lastSyncedDate\": \"2023-11-07T05:31:56Z\",\n \"discoveredSchema\": {},\n \"embeddingField\": \"<string>\",\n \"timeWeightField\": \"<string>\",\n \"modelId\": \"<string>\",\n \"hidden\": true,\n \"streamConfig\": {},\n \"timeUnit\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "datasource.json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.agentcloud.dev/{resourceSlug}/forms/datasource/add")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "datasource.json")
.body("{\n \"name\": \"<string>\",\n \"originalName\": \"<string>\",\n \"sourceType\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"connectionId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"_id\": \"<string>\",\n \"orgId\": \"<string>\",\n \"teamId\": \"<string>\",\n \"description\": \"<string>\",\n \"filename\": \"<string>\",\n \"recordCount\": {\n \"total\": 123,\n \"success\": 123,\n \"failure\": 123\n },\n \"lastSyncedDate\": \"2023-11-07T05:31:56Z\",\n \"discoveredSchema\": {},\n \"embeddingField\": \"<string>\",\n \"timeWeightField\": \"<string>\",\n \"modelId\": \"<string>\",\n \"hidden\": true,\n \"streamConfig\": {},\n \"timeUnit\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.agentcloud.dev/{resourceSlug}/forms/datasource/add")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'datasource.json'
request.body = "{\n \"name\": \"<string>\",\n \"originalName\": \"<string>\",\n \"sourceType\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"connectionId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"_id\": \"<string>\",\n \"orgId\": \"<string>\",\n \"teamId\": \"<string>\",\n \"description\": \"<string>\",\n \"filename\": \"<string>\",\n \"recordCount\": {\n \"total\": 123,\n \"success\": 123,\n \"failure\": 123\n },\n \"lastSyncedDate\": \"2023-11-07T05:31:56Z\",\n \"discoveredSchema\": {},\n \"embeddingField\": \"<string>\",\n \"timeWeightField\": \"<string>\",\n \"modelId\": \"<string>\",\n \"hidden\": true,\n \"streamConfig\": {},\n \"timeUnit\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"redirect": "<string>"
}{
"message": "<string>",
"code": 123
}{
"message": "<string>",
"code": 123
}{
"message": "<string>",
"code": 123
}Add A Datasource
Second stage of adding Datasource (check test datasource for the first step), this connects the datasource to a vectordb, creates a connection between the datasource and airbyte, starts a job to synchronise the rows and finally creates a tool for the datasource. A tool for the datasource is required as within agents a datasource is used as a ‘tool’ just the same as any other tool, this is required for the ‘RAG’ process.
curl --request POST \
--url https://app.agentcloud.dev/{resourceSlug}/forms/datasource/add \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: datasource.json' \
--data '{
"name": "<string>",
"originalName": "<string>",
"sourceType": "<string>",
"sourceId": "<string>",
"destinationId": "<string>",
"workspaceId": "<string>",
"connectionId": "<string>",
"createdDate": "2023-11-07T05:31:56Z",
"_id": "<string>",
"orgId": "<string>",
"teamId": "<string>",
"description": "<string>",
"filename": "<string>",
"recordCount": {
"total": 123,
"success": 123,
"failure": 123
},
"lastSyncedDate": "2023-11-07T05:31:56Z",
"discoveredSchema": {},
"embeddingField": "<string>",
"timeWeightField": "<string>",
"modelId": "<string>",
"hidden": true,
"streamConfig": {},
"timeUnit": "<string>"
}'import requests
url = "https://app.agentcloud.dev/{resourceSlug}/forms/datasource/add"
payload = "{\n \"name\": \"<string>\",\n \"originalName\": \"<string>\",\n \"sourceType\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"connectionId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"_id\": \"<string>\",\n \"orgId\": \"<string>\",\n \"teamId\": \"<string>\",\n \"description\": \"<string>\",\n \"filename\": \"<string>\",\n \"recordCount\": {\n \"total\": 123,\n \"success\": 123,\n \"failure\": 123\n },\n \"lastSyncedDate\": \"2023-11-07T05:31:56Z\",\n \"discoveredSchema\": {},\n \"embeddingField\": \"<string>\",\n \"timeWeightField\": \"<string>\",\n \"modelId\": \"<string>\",\n \"hidden\": true,\n \"streamConfig\": {},\n \"timeUnit\": \"<string>\"\n}"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "datasource.json"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'datasource.json'},
body: '{\n "name": "<string>",\n "originalName": "<string>",\n "sourceType": "<string>",\n "sourceId": "<string>",\n "destinationId": "<string>",\n "workspaceId": "<string>",\n "connectionId": "<string>",\n "createdDate": "2023-11-07T05:31:56Z",\n "_id": "<string>",\n "orgId": "<string>",\n "teamId": "<string>",\n "description": "<string>",\n "filename": "<string>",\n "recordCount": {\n "total": 123,\n "success": 123,\n "failure": 123\n },\n "lastSyncedDate": "2023-11-07T05:31:56Z",\n "discoveredSchema": {},\n "embeddingField": "<string>",\n "timeWeightField": "<string>",\n "modelId": "<string>",\n "hidden": true,\n "streamConfig": {},\n "timeUnit": "<string>"\n}'
};
fetch('https://app.agentcloud.dev/{resourceSlug}/forms/datasource/add', 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://app.agentcloud.dev/{resourceSlug}/forms/datasource/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n \"name\": \"<string>\",\n \"originalName\": \"<string>\",\n \"sourceType\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"connectionId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"_id\": \"<string>\",\n \"orgId\": \"<string>\",\n \"teamId\": \"<string>\",\n \"description\": \"<string>\",\n \"filename\": \"<string>\",\n \"recordCount\": {\n \"total\": 123,\n \"success\": 123,\n \"failure\": 123\n },\n \"lastSyncedDate\": \"2023-11-07T05:31:56Z\",\n \"discoveredSchema\": {},\n \"embeddingField\": \"<string>\",\n \"timeWeightField\": \"<string>\",\n \"modelId\": \"<string>\",\n \"hidden\": true,\n \"streamConfig\": {},\n \"timeUnit\": \"<string>\"\n}",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: datasource.json"
],
]);
$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://app.agentcloud.dev/{resourceSlug}/forms/datasource/add"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"originalName\": \"<string>\",\n \"sourceType\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"connectionId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"_id\": \"<string>\",\n \"orgId\": \"<string>\",\n \"teamId\": \"<string>\",\n \"description\": \"<string>\",\n \"filename\": \"<string>\",\n \"recordCount\": {\n \"total\": 123,\n \"success\": 123,\n \"failure\": 123\n },\n \"lastSyncedDate\": \"2023-11-07T05:31:56Z\",\n \"discoveredSchema\": {},\n \"embeddingField\": \"<string>\",\n \"timeWeightField\": \"<string>\",\n \"modelId\": \"<string>\",\n \"hidden\": true,\n \"streamConfig\": {},\n \"timeUnit\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "datasource.json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.agentcloud.dev/{resourceSlug}/forms/datasource/add")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "datasource.json")
.body("{\n \"name\": \"<string>\",\n \"originalName\": \"<string>\",\n \"sourceType\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"connectionId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"_id\": \"<string>\",\n \"orgId\": \"<string>\",\n \"teamId\": \"<string>\",\n \"description\": \"<string>\",\n \"filename\": \"<string>\",\n \"recordCount\": {\n \"total\": 123,\n \"success\": 123,\n \"failure\": 123\n },\n \"lastSyncedDate\": \"2023-11-07T05:31:56Z\",\n \"discoveredSchema\": {},\n \"embeddingField\": \"<string>\",\n \"timeWeightField\": \"<string>\",\n \"modelId\": \"<string>\",\n \"hidden\": true,\n \"streamConfig\": {},\n \"timeUnit\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.agentcloud.dev/{resourceSlug}/forms/datasource/add")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'datasource.json'
request.body = "{\n \"name\": \"<string>\",\n \"originalName\": \"<string>\",\n \"sourceType\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"connectionId\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"_id\": \"<string>\",\n \"orgId\": \"<string>\",\n \"teamId\": \"<string>\",\n \"description\": \"<string>\",\n \"filename\": \"<string>\",\n \"recordCount\": {\n \"total\": 123,\n \"success\": 123,\n \"failure\": 123\n },\n \"lastSyncedDate\": \"2023-11-07T05:31:56Z\",\n \"discoveredSchema\": {},\n \"embeddingField\": \"<string>\",\n \"timeWeightField\": \"<string>\",\n \"modelId\": \"<string>\",\n \"hidden\": true,\n \"streamConfig\": {},\n \"timeUnit\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"redirect": "<string>"
}{
"message": "<string>",
"code": 123
}{
"message": "<string>",
"code": 123
}{
"message": "<string>",
"code": 123
}Authorizations
Path Parameters
Body
Datasource object that was created when testDatasourceApi is run, must include datasourceId.
Represents a data source configuration within the system, including connection details, status, chunking configurations, and record counts.
Response
Successful operation, redirect to '/{resourceSlug}/datasources'. Returns added toolId in return body