---
title: "Update Knowledge Source"
method: PATCH
path: "/v2/KnowledgeBases/{kbId}/Knowledge/{knowledgeId}"
tags: ["Knowledge"]
---

# Update Knowledge Source

`PATCH /v2/KnowledgeBases/{kbId}/Knowledge/{knowledgeId}`

Partially update mutable fields of an existing knowledge source such as name, description, tags, or source-specific
configuration. Only the fields provided in the request body will be updated. Some changes (e.g., KnowledgeSourceTypes)
may trigger asynchronous reprocessing of the underlying content. Fields omitted from the request remain unchanged.
Immutable fields (id, type, status, url, createdAt, updatedAt) cannot be modified directly.

## Refresh ##

To request reprocessing without changing fields, pass the query parameter `refresh=true`. When `refresh=true` is provided,
the server will re-queue processing for this knowledge resource (transitioning the persisted status to `QUEUED`) and
return 202 Accepted. This query parameter is idempotent while the resource is already QUEUED or PROCESSING.

## Query parameters

- `refresh` boolean

## Request body

- KnowledgeCore — Core properties for knowledge source that can be set at creation time. Regularly update and organize your Knowledge sources to ensure it contains the most accurate and relevant information. This includes adding new entries, updating existing ones, and removing outdated content.
  - `name` string, required — The name of the knowledge source.
  - `description` string — A detailed description of the knowledge source and when to use it. This helps provide context about the content and its intended purpose.
  - `source` union — Details specific to the knowledge source type. Each knowledge source type has its own set of configuration parameters and source specific properties.
    - object — Configuration details for raw text knowledge sources
      - `type` 'Text', required — Raw text knowledge sources
      - `content` string, required — The raw text content to be processed
    - object — Configuration details for web based knowledge sources
      - `type` 'Web', required — Web based knowledge sources
      - `url` string, uri, required — The URL to crawl for web content
      - `crawlDepth` integer — The maximum depth to crawl from the source URL
      - `crawlPeriod` 'WEEKLY' | 'BIWEEKLY' | 'MONTHLY' | 'NEVER' — Frequency of re-crawling the website for updated content
      - `errors` KnowledgeErrorGroup[] — Processing errors encountered during web crawling, grouped by title. Array of error groups, where each group has a title and list of error instances. Only present when crawl errors occurred.
        - `title` string, required — The error type or reason (e.g., "404 Not Found", "500 Internal Server Error").
        - `instances` KnowledgeErrorInstance[], required — Array of error instances for this error title. Required when an error group is present.
          - `type` string, required — A URI reference identifying the problem type, resolving to human-readable documentation (e.g., https://www.twilio.com/docs/api/errors/420018).
          - `code` integer, required — Twilio-specific numeric error code for programmatic handling.
          - `instance` string, required — The specific URL or resource that caused the error.
          - `detail` string — Detailed explanation of the error.
    - object — Configuration details for file based knowledge sources. Supported file formats (extension → MIME type): .csv → text/csv .md → text/markdown .pdf → application/pdf .tsv → text/tab-separated-values .txt → text/plain Maximum file size: 16MB (16 * 1024 * 1024 bytes).
      - `type` 'File', required — File based knowledge sources
      - `fileName` string, required — Name of the file to be uploaded
      - `fileSize` integer, required — Expected size of the file in bytes
      - `mimeType` 'text/csv' | 'text/markdown' | 'application/pdf' | 'text/tab-separated-values' | 'text/plain', required — Supported MIME types for knowledge file imports. Maximum file size for any file is 16MB (16 * 1024 * 1024 bytes). Extensions → MIME: .csv → text/csv .md → text/markdown .pdf → application/pdf .tsv → text/tab-separated-values .txt → text/plain
      - `importUrl` string, uri — Presigned S3 URL for file upload (when status is SCHEDULED). Use PUT method to upload the file to this URL when status is SCHEDULED.
      - `uploadExpiration` string, date-time — Expiration time of the presigned upload URL in ISO 8601 format (only present when status is SCHEDULED)

## Response `200`

OK

- Knowledge
  - `name` string, required — The name of the knowledge source.
  - `description` string — A detailed description of the knowledge source and when to use it. This helps provide context about the content and its intended purpose.
  - `source` union — Details specific to the knowledge source type. Each knowledge source type has its own set of configuration parameters and source specific properties.
    - object — Configuration details for raw text knowledge sources
      - `type` 'Text', required — Raw text knowledge sources
      - `content` string, required — The raw text content to be processed
    - object — Configuration details for web based knowledge sources
      - `type` 'Web', required — Web based knowledge sources
      - `url` string, uri, required — The URL to crawl for web content
      - `crawlDepth` integer — The maximum depth to crawl from the source URL
      - `crawlPeriod` 'WEEKLY' | 'BIWEEKLY' | 'MONTHLY' | 'NEVER' — Frequency of re-crawling the website for updated content
      - `errors` KnowledgeErrorGroup[] — Processing errors encountered during web crawling, grouped by title. Array of error groups, where each group has a title and list of error instances. Only present when crawl errors occurred.
        - `title` string, required — The error type or reason (e.g., "404 Not Found", "500 Internal Server Error").
        - `instances` KnowledgeErrorInstance[], required — Array of error instances for this error title. Required when an error group is present.
          - `type` string, required — A URI reference identifying the problem type, resolving to human-readable documentation (e.g., https://www.twilio.com/docs/api/errors/420018).
          - `code` integer, required — Twilio-specific numeric error code for programmatic handling.
          - `instance` string, required — The specific URL or resource that caused the error.
          - `detail` string — Detailed explanation of the error.
    - object — Configuration details for file based knowledge sources. Supported file formats (extension → MIME type): .csv → text/csv .md → text/markdown .pdf → application/pdf .tsv → text/tab-separated-values .txt → text/plain Maximum file size: 16MB (16 * 1024 * 1024 bytes).
      - `type` 'File', required — File based knowledge sources
      - `fileName` string, required — Name of the file to be uploaded
      - `fileSize` integer, required — Expected size of the file in bytes
      - `mimeType` 'text/csv' | 'text/markdown' | 'application/pdf' | 'text/tab-separated-values' | 'text/plain', required — Supported MIME types for knowledge file imports. Maximum file size for any file is 16MB (16 * 1024 * 1024 bytes). Extensions → MIME: .csv → text/csv .md → text/markdown .pdf → application/pdf .tsv → text/tab-separated-values .txt → text/plain
      - `importUrl` string, uri — Presigned S3 URL for file upload (when status is SCHEDULED). Use PUT method to upload the file to this URL when status is SCHEDULED.
      - `uploadExpiration` string, date-time — Expiration time of the presigned upload URL in ISO 8601 format (only present when status is SCHEDULED)
  - `id` string, required — The unique identifier of knowledge source.
  - `status` 'SCHEDULED' | 'QUEUED' | 'PROCESSING' | 'COMPLETED' | 'FAILED', required — The status of processing the knowledge source ('SCHEDULED', 'QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED').
  - `createdAt` string, date-time, required — The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
  - `updatedAt` string, date-time, required — The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.

## Other responses

- `202` — Knowledge update accepted and is being processed.
- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `429` — This error indicates that you have sent too many requests to the API. You should retry according to the `Retry-After` response header.
- `500` — Internal Server Error
- `503` — Service Unavailable

---

[API](https://skmtc.dev/twilio/apis/knowledge-v2.md) · [All operations](https://skmtc.dev/twilio/apis/knowledge-v2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/twilio/knowledge-v2/revisions/36dc1dbda0b4/schema)
