dots.v2.genAi.knowledge_bases.post()
Generated on 13 Nov 2026
from DoTs version
v1.24.0
Usage
client.v2.genAi.knowledge_bases.post(body: ApiCreateKnowledgeBaseInputPublic, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | ApiCreateKnowledgeBaseOutput>Description
To create a knowledge base, send a POST request to /v2/gen-ai/knowledge_bases.
Parameters
databaseIdstring optionalExample:
"12345678-1234-1234-1234-123456789012"Identifier of the DigitalOcean OpenSearch database this knowledge base will use, optional.
If not provided, we create a new database for the knowledge base in
the same region as the knowledge base.datasourcesarray of objects optionalOptional data sources to attach at creation. Omit or use an empty list to create the knowledge base without sources, then add sources (with chunking strategy and sizes) using Add a Data Source to a Knowledge Base. When provided, see Organize Data Sources for best practices.
Show child properties
awsDataSourceobject optionalAWS S3 Data Source
Show child properties
bucketNamestring optionalExample:
example nameSpaces bucket name
itemPathstring optionalExample:
example stringkeyIdstring optionalExample:
123e4567-e89b-12d3-a456-426614174000The AWS Key ID
regionstring optionalExample:
example stringRegion of bucket
secretKeystring optionalExample:
example stringThe AWS Secret Key
bucketNamestring optionalExample:
example nameDeprecated, moved to data_source_details
bucketRegionstring optionalExample:
example stringDeprecated, moved to data_source_details
chunkingAlgorithmstring optionalchunkingOptionsobject optionalShow child properties
childChunkSizeinteger optionalExample:
350maxChunkSizeinteger optionalExample:
750Common options
parentChunkSizeinteger optionalExample:
1000Hierarchical options
semanticThresholdnumber optionalExample:
0.5Semantic options
dropboxDataSourceobject optionalDropbox Data Source
Show child properties
folderstring optionalExample:
example stringrefreshTokenstring optionalExample:
example stringRefresh token. you can obrain a refresh token by following the oauth2 flow. see /v2/gen-ai/oauth2/dropbox/tokens for reference.
fileUploadDataSourceobject optionalFile to upload as data source for knowledge base.
Show child properties
originalFileNamestring optionalExample:
example nameThe original file name
sizeInBytesstring optionalExample:
12345The size of the file in bytes
storedObjectKeystring optionalExample:
example stringThe object key the file was stored as
googleDriveDataSourceobject optionalGoogle Drive Data Source
Show child properties
folderIdstring optionalExample:
123e4567-e89b-12d3-a456-426614174000refreshTokenstring optionalExample:
example stringRefresh token. you can obrain a refresh token by following the oauth2 flow. see /v2/gen-ai/oauth2/google/tokens for reference.
itemPathstring optionalExample:
example stringspacesDataSourceobject optionalSpaces Bucket Data Source
Show child properties
bucketNamestring optionalExample:
example nameSpaces bucket name
itemPathstring optionalExample:
example stringregionstring optionalExample:
example stringRegion of bucket
webCrawlerDataSourceobject optionalWebCrawlerDataSource
Show child properties
baseUrlstring optionalExample:
example stringThe base url to crawl.
crawlingOptionstring optionalOptions 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.
- SITEMAP: Crawl URLs discovered in the sitemap.embedMediaboolean optionalExample:
trueWhether to ingest and index media (images, etc.) on web pages.
excludeTagsarray of strings optionalExample:
["example string"]Declaring which tags to exclude in web pages while webcrawling
embeddingModelUuidstring optionalExample:
"12345678-1234-1234-1234-123456789012"Identifier for the embedding model.
namestring optionalExample:
"My Knowledge Base"Name of the knowledge base.
projectIdstring optionalExample:
"12345678-1234-1234-1234-123456789012"Identifier of the DigitalOcean project this knowledge base will belong to.
regionstring optionalExample:
"tor1"The datacenter region to deploy the knowledge base in.
rerankingConfigobject optionalConfiguration for cross-encoder reranking during retrieval.
Show child properties
enabledboolean optionalExample:
trueWhether reranking is enabled for retrieval
modelstring optionalExample:
"bge-reranker-v2-m3"Reranker model internal name
sizestring optionaltagsarray of strings optionalExample:
["example string"]Tags to organize your knowledge base.
vpcUuidstring optionalExample:
"12345678-1234-1234-1234-123456789012"The VPC to deploy the knowledge base database in
Request Sample
Response Example
More Information
See /v2/gen-ai/knowledge_bases in the API reference for additional detail on responses, headers, parameters, and more.