---
title: "Create a document from text"
method: POST
path: "/datasets/{dataset_id}/document/create_by_text"
---

# Create a document from text

`POST /datasets/{dataset_id}/document/create_by_text`

## Request

- Base URL: `https://web-aihub.cequens.com/v1`
- URL: `https://web-aihub.cequens.com/v1/datasets/{dataset_id}/document/create_by_text`
- Auth: API key in header `Authorization`

This api is based on an existing Knowledge and creates a new document through text based on this Knowledge.

## Path parameters

- `dataset_id` string, required

## Request body

- object
  - `name` string, required: Document name
  - `text` string, required: Document content
  - `indexing_technique` string: 1. "high_quality": embedding using embedding model, built as vector database index. 2. "economy": Build using inverted index of Keyword Table Index
  - `process_rule` object: File processing rules
    - `mode` string: Cleaning, segmentation mode
    - `rules` object

## Response `200`

200

- object
  - `document` object
    - `id` string
    - `position` integer
    - `data_source_type` string
    - `data_source_info` object
      - `upload_file_id` string
    - `dataset_process_rule_id` string
    - `name` string
    - `created_from` string
    - `created_by` string
    - `created_at` integer
    - `tokens` integer
    - `indexing_status` string
    - `error` unknown
    - `enabled` boolean
    - `disabled_at` unknown
    - `disabled_by` unknown
    - `archived` boolean
    - `display_status` string
    - `word_count` integer
    - `hit_count` integer
    - `doc_form` string
  - `batch` string

## Other responses

- `400`: 400

---

[API](https://skmtc.dev/cequens/apis/knowledge-base.md) - [All operations](https://skmtc.dev/cequens/apis/knowledge-base/llms.txt) - [OpenAPI document](https://skmtc.dev/cequens/apis/knowledge-base/revisions/226f35f0510c?raw)
