---
title: "Document Ingestion"
method: POST
path: "/RECAP-api/doc-ingestion"
---

# Document Ingestion

`POST /RECAP-api/doc-ingestion`

Currently only attaches docs to existing connectors (cc-pairs).
Or to the default ingestion connector that is accessible to all users

Things to note:
- The document id if not provided is automatically generated from the semantic identifier
  so if the document source type etc is updated, it won't create a duplicate

## Request body

- IngestionDocument
  - `document` DocumentBase, required — Used for RECAP ingestion api, the ID is inferred before use if not provided
    - `id` string
    - `sections` Section[], required
      - `text` string, required
      - `link` string
    - `source` 'ingestion_api' | 'slack' | 'web' | 'google_drive' | 'gmail' | 'requesttracker' | 'github' | 'gitlab' | 'guru' | 'bookstack' | 'confluence' | 'discourse' | 'slab' | 'salesforce' | 'jira' | 'productboard' | 'file' | 'notion' | 'zulip' | 'linear' | 'hubspot' | 'document360' | 'gong' | 'google_sites' | 'zendesk' | 'loopio' | 'sharepoint' | 'teams' | 'freshdesk' — An enumeration.
    - `semantic_identifier` string, required
    - `metadata` object, required
    - `doc_updated_at` string, date-time
    - `primary_owners` BasicExpertInfo[]
      - `display_name` string
      - `first_name` string
      - `middle_initial` string
      - `last_name` string
      - `email` string
    - `secondary_owners` BasicExpertInfo[]
      - `display_name` string
      - `first_name` string
      - `middle_initial` string
      - `last_name` string
      - `email` string
    - `title` string
    - `from_ingestion_api` boolean
  - `connector_id` integer
  - `connector_name` string
  - `credential_id` integer
  - `create_connector` boolean
  - `public_doc` boolean

## Response `200`

Successful Response

- IngestionResult
  - `document_id` string, required
  - `already_existed` boolean, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/engineertheory/apis/recap-backend.md) · [All operations](https://skmtc.net/engineertheory/apis/recap-backend/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/engineertheory/recap-backend/revisions/ea9db8f9a24d/schema)
