Skip to main content
POST
/
v4
/
knowledge-base-data-sources
JavaScript
import SGPClient from 'sgp';

const client = new SGPClient({
  apiKey: 'My API Key',
});

const knowledgeBaseDataSource = await client.knowledgeBaseDataSources.create({
  account_id: 'account_id',
  data_source_config: {
    aws_account_id: 'aws_account_id',
    aws_region: 'aws_region',
    s3_bucket: 's3_bucket',
    source: 'S3',
  },
  name: 'name',
});

console.log(knowledgeBaseDataSource.id);
{
  "name": "<string>",
  "description": "<string>",
  "data_source_config": {
    "source": "<string>",
    "s3_bucket": "<string>",
    "s3_prefix": "",
    "aws_region": "<string>",
    "aws_account_id": "<string>"
  },
  "tagging_information": {
    "type": "all",
    "tags_to_apply": {}
  },
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "created_by_user_id": "<string>",
  "created_by_identity_type": "user",
  "account_id": "<string>"
}

Authorizations

x-api-key
string
header
required

Headers

x-selected-account-id
string

Body

application/json
name
string
required
data_source_config
object
required
  • S3 DataSource Config
  • SharePoint DataSource Config
  • SharePoint Page DataSource Config
  • Google Drive DataSource Config
  • Azure Blob Storage DataSource Config
  • Confluence DataSource Config
  • Slack DataSource Config
account_id
string
required

The ID of the account that owns the given entity.

description
string
data_source_auth_config
object
  • SharePoint DataSource Auth Config
  • SharePoint Page DataSource Auth Config
  • Azure DataSource Auth Config
  • Google Drive DataSource Auth Config
  • S3 DataSource Auth Config
  • Confluence DataSource Auth Config
  • Slack DataSource Auth Config
tagging_information
object

Response

Successful Response

name
string
required
data_source_config
object
required
  • S3 DataSource Config
  • SharePoint DataSource Config
  • SharePoint Page DataSource Config
  • Google Drive DataSource Config
  • Azure Blob Storage DataSource Config
  • Confluence DataSource Config
  • Slack DataSource Config
id
string
required

The unique identifier of the entity.

created_at
string<date-time>
required

The date and time when the entity was created in ISO format.

updated_at
string<date-time>
required

The date and time when the entity was last updated in ISO format.

created_by_user_id
string
required

The user who originally created the entity.

created_by_identity_type
enum<string>
required

The type of identity that created the entity.

Available options:
user,
service_account
account_id
string
required

The ID of the account that owns the given entity.

description
string
tagging_information
object
I