Create Custom Data Source
curl --request POST \
--url https://{tenant_id}.api.useago.com/api/v1/custom-data-sources \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"schema_definition": {
"columns": [
{
"name": "<string>",
"nullable": true,
"indexed": false
}
],
"searchable_fields": [
"<string>"
],
"label_field": "<string>"
},
"slug": "<string>",
"description": "",
"extraction_prompt": "",
"embedding_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://{tenant_id}.api.useago.com/api/v1/custom-data-sources"
payload = {
"name": "<string>",
"schema_definition": {
"columns": [
{
"name": "<string>",
"nullable": True,
"indexed": False
}
],
"searchable_fields": ["<string>"],
"label_field": "<string>"
},
"slug": "<string>",
"description": "",
"extraction_prompt": "",
"embedding_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
schema_definition: {
columns: [{name: '<string>', nullable: true, indexed: false}],
searchable_fields: ['<string>'],
label_field: '<string>'
},
slug: '<string>',
description: '',
extraction_prompt: '',
embedding_model_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://{tenant_id}.api.useago.com/api/v1/custom-data-sources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"extraction_prompt": "<string>",
"is_active": true,
"schema_definition": {
"columns": [
{
"name": "<string>",
"type": "text",
"nullable": true,
"indexed": false
}
],
"searchable_fields": [
"<string>"
],
"label_field": "<string>"
},
"embedding_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Custom Data Sources
Create Custom Data Source
Create a new datasource. Provisions a backing SQL table.
Slug/column-name format is validated by the request schema (clean 422). A duplicate slug or name hits the unique constraint here; we return 409 rather than letting it surface as a 500.
POST
/
api
/
v1
/
custom-data-sources
Create Custom Data Source
curl --request POST \
--url https://{tenant_id}.api.useago.com/api/v1/custom-data-sources \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"schema_definition": {
"columns": [
{
"name": "<string>",
"nullable": true,
"indexed": false
}
],
"searchable_fields": [
"<string>"
],
"label_field": "<string>"
},
"slug": "<string>",
"description": "",
"extraction_prompt": "",
"embedding_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://{tenant_id}.api.useago.com/api/v1/custom-data-sources"
payload = {
"name": "<string>",
"schema_definition": {
"columns": [
{
"name": "<string>",
"nullable": True,
"indexed": False
}
],
"searchable_fields": ["<string>"],
"label_field": "<string>"
},
"slug": "<string>",
"description": "",
"extraction_prompt": "",
"embedding_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
schema_definition: {
columns: [{name: '<string>', nullable: true, indexed: false}],
searchable_fields: ['<string>'],
label_field: '<string>'
},
slug: '<string>',
description: '',
extraction_prompt: '',
embedding_model_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://{tenant_id}.api.useago.com/api/v1/custom-data-sources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"extraction_prompt": "<string>",
"is_active": true,
"schema_definition": {
"columns": [
{
"name": "<string>",
"type": "text",
"nullable": true,
"indexed": false
}
],
"searchable_fields": [
"<string>"
],
"label_field": "<string>"
},
"embedding_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Authorizations
Body
application/json
Response
201 - application/json
Created
Schema of a custom datasource: its columns, search config, and display field.
Show child attributes
Show child attributes
