---
title: "Ingest Document"
method: POST
path: "/ingestion/document"
tags: ["Ingestion Pipeline"]
---

# Ingest Document

`POST /ingestion/document`

## Request

- Base URL: `https://api.getmetacognition.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.getmetacognition.com/ingestion/document`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/metacognition/apis/tex-api/docs/ingestion/document/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- DocumentIngestRequest: Document ingestion request.
  - `data` string, required: Document content
  - `format` string: Content format
  - `scope` Scope, required: Multi-tenant scope.
    - `org_id` string, required: Organization ID
    - `user_id` string, nullable: User ID
    - `session_id` string, nullable: Session ID
  - `metadata` DocumentMetadata: Document metadata.
    - `title` string, nullable: Document title
    - `author` string, nullable: Document author
    - `source` string, nullable: Document source
    - `timestamp` string, date-time, nullable: Document timestamp
    - `tags` string[]: Tags
    - `custom` object: Custom metadata
  - `options` IngestionOptions: Ingestion options.
    - `auto_create_schema` boolean: Auto-create schema
    - `generate_embeddings` boolean: Generate embeddings
    - `validate` boolean: Validate entities
    - `store_chunks` boolean: Store chunks

## Response `200`

Successful Response

- DocumentIngestResponse: Document ingestion response.
  - `job_id` string, required: Job identifier
  - `document_id` string, required: Document identifier
  - `status` string, required: Job status
  - `estimated_time` integer, nullable: Estimated time in seconds
  - `message` string, nullable: Status message

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/metacognition/apis/tex-api.md) - [All operations](https://skmtc.dev/metacognition/apis/tex-api/llms.txt) - [OpenAPI document](https://skmtc.dev/metacognition/apis/tex-api/revisions/3bef47e50f2e?raw)
