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

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/authentication.md) · [All operations](https://skmtc.dev/cequens/apis/authentication/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cequens/authentication/revisions/deadb0661f19/schema)
