# Data Sources ## Create **post** `/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources` To add a data source to a knowledge base, send a POST request to `/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources`. ### Returns - **knowledge\_base\_data\_source:** `APIKnowledgeBaseDataSource` Data Source configuration for Knowledge Bases ## List **get** `/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources` To list all data sources for a knowledge base, send a GET request to `/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources`. ### Returns - **knowledge\_base\_data\_sources:** `array of APIKnowledgeBaseDataSource` The data sources - **links:** `APILinks` Links to other pages - **meta:** `APIMeta` Meta information about the data set ## Delete **delete** `/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources/{data_source_uuid}` To delete a data source from a knowledge base, send a DELETE request to `/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources/{data_source_uuid}`. ### Returns - **data\_source\_uuid:** `string` Data source id - **knowledge\_base\_uuid:** `string` Knowledge base id ## Domain Types ### API File Upload Data Source - **APIFileUploadDataSource:** `object` File to upload as data source for knowledge base. - **original\_file\_name:** `string` The original file name - **size\_in\_bytes:** `string` The size of the file in bytes - **stored\_object\_key:** `string` The object key the file was stored as ### API Knowledge Base Data Source - **APIKnowledgeBaseDataSource:** `object` Data Source configuration for Knowledge Bases - **aws\_data\_source:** `object` AWS S3 Data Source for Display - **bucket\_name:** `string` Spaces bucket name - **item\_path:** `string` - **region:** `string` Region of bucket - **bucket\_name:** `string` Name of storage bucket - Deprecated, moved to data_source_details - **created\_at:** `string` Creation date / time - **file\_upload\_data\_source:** `APIFileUploadDataSource` File to upload as data source for knowledge base. - **item\_path:** `string` Path of folder or object in bucket - Deprecated, moved to data_source_details - **last\_datasource\_indexing\_job:** `APIIndexedDataSource` - **last\_indexing\_job:** `APIIndexingJob` IndexingJob description - **region:** `string` Region code - Deprecated, moved to data_source_details - **spaces\_data\_source:** `APISpacesDataSource` Spaces Bucket Data Source - **updated\_at:** `string` Last modified - **uuid:** `string` Unique id of knowledge base - **web\_crawler\_data\_source:** `APIWebCrawlerDataSource` WebCrawlerDataSource ### API Spaces Data Source - **APISpacesDataSource:** `object` Spaces Bucket Data Source - **bucket\_name:** `string` Spaces bucket name - **item\_path:** `string` - **region:** `string` Region of bucket ### API Web Crawler Data Source - **APIWebCrawlerDataSource:** `object` WebCrawlerDataSource - **base\_url:** `string` The base url to crawl. - **crawling\_option:** `"UNKNOWN" OR "SCOPED" OR "PATH" OR 2 more` Options for specifying how URLs found on pages should be handled. - UNKNOWN: Default unknown value - SCOPED: Only include the base URL. - PATH: Crawl the base URL and linked pages within the URL path. - DOMAIN: Crawl the base URL and linked pages within the same domain. - SUBDOMAINS: Crawl the base URL and linked pages for any subdomain. - `"UNKNOWN"` - `"SCOPED"` - `"PATH"` - `"DOMAIN"` - `"SUBDOMAINS"` - **embed\_media:** `boolean` Whether to ingest and index media (images, etc.) on web pages. ### Aws Data Source - **AwsDataSource:** `object` AWS S3 Data Source - **bucket\_name:** `string` Spaces bucket name - **item\_path:** `string` - **key\_id:** `string` The AWS Key ID - **region:** `string` Region of bucket - **secret\_key:** `string` The AWS Secret Key