# Update

Launch stage: Beta

`PATCH /api/2.1/{name=knowledge-assistants/*/knowledge-sources/*}`

Updates a Knowledge Source.

API scopes: knowledge-assistants

## Path parameters

- `name` (string, optional)
  The resource name of the Knowledge Source to update.
   Format: knowledge-assistants/{knowledge_assistant_id}/knowledge-sources/{knowledge_source_id}

## Query parameters

- `update_mask` (string, optional)
  Comma-delimited list of fields to update on the Knowledge Source.
   Allowed values: `display_name`, `description`.
   Examples:
   - `display_name`
   - `display_name,description`

## Request body

- `knowledge_source` (object, optional)
  The Knowledge Source update payload.
   Only fields listed in update_mask are updated.
   REQUIRED annotations on Knowledge Source fields describe create-time
   requirements and do not mean all those fields are required for update.
  - `name` (string, optional)
    Full resource name:
     knowledge-assistants/{knowledge_assistant_id}/knowledge-sources/{knowledge_source_id}
  - `display_name` (string, optional)
    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, optional)
    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, optional)
    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, required)
    - `index_name` (string, optional)
      Full UC name of the vector search index, in the format of {CATALOG}.{SCHEMA}.{INDEX_NAME}.
    - `text_col` (string, optional)
      The column that includes the document text for retrieval.
    - `doc_uri_col` (string, optional)
      The column that specifies a link or reference to where the information came from.
  - `files` (object, required)
    - `path` (string, optional)
      A UC volume path that includes a list of files.
  - `file_table` (object, required)
    - `table_name` (string, optional)
      Full UC name of the table, in the format of {CATALOG}.{SCHEMA}.{TABLE_NAME}.
    - `file_col` (string, optional)
      The name of the column containing BINARY file content to be indexed.
  - `state` (string, optional)
    Possible values: `STATE_UNSPECIFIED`, `UPDATING`, `UPDATED`, `FAILED_UPDATE`
  - `id` (string, optional)
  - `knowledge_cutoff_time` (string, optional)
    Timestamp representing the cutoff before which content in this knowledge source is being ingested.
  - `create_time` (string, optional)
    Timestamp when this knowledge source was created.

## 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": "string",
  "id": "string",
  "knowledge_cutoff_time": "string",
  "create_time": "string"
}
```

