---
title: "Update a document's raw text"
method: PATCH
path: "/org/kb/nodes/{id}/raw"
tags: ["Knowledge Base"]
---

# Update a document's raw text

`PATCH /org/kb/nodes/{id}/raw`

## Request

- Base URL: `https://apiv2.senso.ai/api/v1`
- URL: `https://apiv2.senso.ai/api/v1/org/kb/nodes/{id}/raw`
- Auth: API key in header `X-API-Key`

Partially updates a raw-text document — supply any of `title`, `summary`, `text` (at least one) — and re-ingests it. Supply `tag_ids` alongside them to replace the document's tags in the same call.

## Path parameters

- `id` string, uuid, required

## Request body

- PatchRawContentRequest: At least one of `title`, `summary`, or `text` must be supplied. `tag_ids` on its own is not a valid update — it accompanies a change to the document's content.
  - `title` string
  - `summary` string
  - `text` string
  - `tag_ids` string[]: Replaces the document's full tag set. Omit to leave the existing tags unchanged; send an empty array to remove them all. Each id must be a tag that already exists in your organization — an unknown id is rejected and no part of the update is applied. To attach tags by name, use the node-tags endpoints.

## Response `200`

The updated document.

- ContentResponse: A content item (an ingested source or generated output) with its current version.
  - `id` string, uuid, required
  - `org_id` string, uuid, required
  - `type` 'raw' | 'web' | 'file', required: The content's source kind.
  - `title` string
  - `summary` string
  - `tags` ContentTagsInfo: Legacy category/topic labels for a content item.
    - `category_id` string
    - `category_name` string
    - `topic_id` string
    - `topic_name` string
  - `org_tags` TagResponse[]: The org tags attached to this content.
    - `id` string, uuid, required
    - `org_id` string, uuid, required
    - `name` string, required
    - `curated` boolean, required: True = part of the org's working vocabulary; false = machine-minted (from search queries), awaiting adoption.
    - `prompt_count` integer: Prompts carrying this tag.
    - `content_count` integer: Content items carrying this tag.
    - `kb_content_count` integer: Knowledge-base nodes carrying this tag.
    - `generated_content_count` integer: Generated content carrying this tag.
    - `generated_draft_count` integer: Generated drafts carrying this tag.
    - `generated_published_count` integer: Published generated content carrying this tag.
    - `kb_search_message_count` integer: Search queries carrying this tag.
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
  - `latest_content_version_id` string, uuid
  - `version_num` integer
  - `processing_status` 'pending' | 'processing' | 'complete' | 'failed': The ingestion status of the content.
  - `error_code` string: Stable classification of an ingestion failure; present only when `processing_status` is `failed`.
  - `content_type` string, required: The MIME type of the content (e.g. `text/markdown`, `application/pdf`).
  - `kb_node_id` string, uuid: The node addressing this content in the KB tree. Absent for content with no node (e.g. content-engine drafts).
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `400`: The request was malformed — a bad path/query parameter or an invalid value.
- `401`: Missing or invalid credentials — supply a valid org API key in the `X-API-Key` header.
- `402`: The organization is out of credits or has reached its spending limit.
- `403`: The API key is authenticated but not permitted to access this resource.
- `404`: The requested resource does not exist or is not visible to this key.
- `409`: The request conflicts with the current state (e.g. a duplicate).

---

[API](https://skmtc.dev/senso/apis/senso-org-api.md) - [All operations](https://skmtc.dev/senso/apis/senso-org-api/llms.txt) - [OpenAPI document](https://skmtc.dev/senso/apis/senso-org-api/revisions/d789b4fcbe84?raw)
