# Create a Knowledge Source

Launch stage: Beta

`POST /api/2.1/{parent=knowledge-assistants/*}/knowledge-sources`

Creates a Knowledge Source under a Knowledge Assistant.

API scopes: knowledge-assistants

## Path parameters

- `parent` (string, required)
  Parent resource where this source will be created.
   Format: knowledge-assistants/{knowledge_assistant_id}

## Request body

- `name` (string, optional, ID, Immutable)
  Full resource name:
   knowledge-assistants/{knowledge_assistant_id}/knowledge-sources/{knowledge_source_id}
- `display_name` (string, required)
  Human-readable display name of the knowledge source.
   Required when creating a Knowledge Source.
   When updating a Knowledge Source, optional unless included in update_mask.
- `description` (string, required)
  Description of the knowledge source.
   Required when creating a Knowledge Source.
   When updating a Knowledge Source, optional unless included in update_mask.
- `source_type` (string, ^(index|files|file_table)$, required)
  The type of the source: "index", "files", or "file_table".
   Required when creating a Knowledge Source.
   When updating a Knowledge Source, this field is ignored.
- `index` (object, optional)
  - `index_name` (string, required)
    Full UC name of the vector search index, in the format of {CATALOG}.{SCHEMA}.{INDEX_NAME}.
  - `text_col` (string, required)
    The column that includes the document text for retrieval.
  - `doc_uri_col` (string, required)
    The column that specifies a link or reference to where the information came from.
- `files` (object, optional)
  - `path` (string, required)
    A UC volume path that includes a list of files.
- `file_table` (object, optional)
  - `table_name` (string, required)
    Full UC name of the table, in the format of {CATALOG}.{SCHEMA}.{TABLE_NAME}.
  - `file_col` (string, required)
    The name of the column containing BINARY file content to be indexed.

## Returns

Returns the KnowledgeSource object.

## Response

```json
{
  "name": "string",
  "display_name": "string",
  "description": "string",
  "source_type": "string",
  "index": {
    "index_name": "string",
    "text_col": "string",
    "doc_uri_col": "string"
  },
  "files": {
    "path": "string"
  },
  "file_table": {
    "table_name": "string",
    "file_col": "string"
  },
  "state": "UPDATING",
  "id": "string",
  "knowledge_cutoff_time": "string",
  "create_time": "string"
}
```

