---
title: "Create a raw-text document"
method: POST
path: "/org/kb/raw"
tags: ["Knowledge Base"]
---

# Create a raw-text document

`POST /org/kb/raw`

## Request

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

Creates a document from raw text (or markdown) in the knowledge base and starts ingesting it. Omit `kb_folder_node_id` to create it under the root. Returns `202` while ingestion runs asynchronously — poll the node or `GET /org/kb/sync-status` for completion.

## Request body

- CreateRawContentRequest: Tags cannot be supplied on creation — attach them afterward with the node-tags endpoints (e.g. `PUT /org/kb/nodes/{id}/tags`). Senso auto-tags the document in the background once ingestion finishes.
  - `text` string, required: The document body (raw text or markdown).
  - `title` string
  - `summary` string
  - `kb_folder_node_id` string, uuid, nullable: The folder to create the document in. Omit or null for the root.

## Response `202`

The document was created and is being ingested.

- 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)
