---
title: "Replace source knowledge"
method: PATCH
path: "/sources/{source}/knowledge"
tags: ["Knowledge"]
---

# Replace source knowledge

`PATCH /sources/{source}/knowledge`

## Request

- Base URL: `https://app.vern.so/api/v1`
- URL: `https://app.vern.so/api/v1/sources/{source}/knowledge`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/vern-so/apis/vern-api/docs/sources/:source/knowledge/patch.ts> (a function with typed inputs; its response is checked against the schema)

`knowledge` replaces the whole document; an empty string clears it. Use `if_unmodified_since` for safe read-modify-write.

## Request body

- KnowledgeWrite
  - `knowledge` string, nullable, required: Replaces the whole document. Empty string clears it.
  - `if_unmodified_since` string: The `updated_at` you last read. Supply it to get `412` instead of silently overwriting a concurrent change.

## Response `200`

Knowledge updated.

- SourceKnowledge
  - `source` string
  - `knowledge` string, nullable
  - `updated_at` string, nullable

## Other responses

- `400`: Malformed request.
- `401`: API key missing, malformed, or revoked.
- `404`: No source with this name in your organisation.
- `409`: The source name is ambiguous, or a migration is currently running for this source and holds the knowledge lock.
- `412`: The document changed after the `if_unmodified_since` you supplied. The body carries the current `updated_at`; re-read, merge, and retry.
- `429`: Rate limit hit. Counted per account, not per API key. Creating a migration and starting a `generate` run are limited to 30/hour each; answering a run is limited to 30/hour; reads allow 30/minute and writes 30/minute. `Retry-After` gives the seconds until the window resets, alongside `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`.
- `500`: Unexpected server error.

## Changes

- **2026-08-21** `f23b9ff77f72`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/vern-so/apis/vern-api/changes/sources/:source/knowledge/patch.md)

---

[API](https://skmtc.dev/vern-so/apis/vern-api.md) - [All operations](https://skmtc.dev/vern-so/apis/vern-api/llms.txt) - [OpenAPI document](https://skmtc.dev/vern-so/apis/vern-api/revisions/6ae61af2db81?raw)
