---
title: "Upsert Ingestion Doc"
method: POST
path: "/onyx-api/ingestion"
tags: ["public"]
---

# Upsert Ingestion Doc

`POST /onyx-api/ingestion`

## Request body

- IngestionDocument
  - `document` DocumentBase, required — Used for Onyx ingestion api, the ID is inferred before use if not provided
    - `id` string, nullable
    - `sections` union[], required
      - union
        - TextSection — Section containing text content
          - `link` string, nullable
          - `text` string, required
          - `image_file_id` string, nullable
        - ImageSection — Section containing an image reference
          - `link` string, nullable
          - `text` string, nullable
          - `image_file_id` string, required
    - `source` 'ingestion_api' | 'slack' | 'web' | 'google_drive' | 'gmail' | 'requesttracker' | 'github' | 'gitbook' | 'gitlab' | 'guru' | 'bookstack' | 'outline' | 'confluence' | 'jira' | 'slab' | 'productboard' | 'file' | 'coda' | 'notion' | 'zulip' | 'linear' | 'hubspot' | 'document360' | 'gong' | 'google_sites' | 'zendesk' | 'loopio' | 'dropbox' | 'sharepoint' | 'teams' | 'salesforce' | 'discourse' | 'axero' | 'clickup' | 'mediawiki' | 'wikipedia' | 'asana' | 's3' | 'r2' | 'google_cloud_storage' | 'oci_storage' | 'xenforo' | 'not_applicable' | 'discord' | 'freshdesk' | 'fireflies' | 'egnyte' | 'airtable' | 'highspot' | 'drupal_wiki' | 'imap' | 'bitbucket' | 'testrail' | 'mock_connector' | 'user_file'
    - `semantic_identifier` string, required
    - `metadata` object, required
    - `doc_updated_at` string, date-time, nullable
    - `chunk_count` integer, nullable
    - `primary_owners` BasicExpertInfo[], nullable
      - `display_name` string, nullable
      - `first_name` string, nullable
      - `middle_initial` string, nullable
      - `last_name` string, nullable
      - `email` string, nullable
    - `secondary_owners` BasicExpertInfo[], nullable
      - `display_name` string, nullable
      - `first_name` string, nullable
      - `middle_initial` string, nullable
      - `last_name` string, nullable
      - `email` string, nullable
    - `title` string, nullable
    - `from_ingestion_api` boolean
    - `additional_info` unknown
    - `external_access` ExternalAccess
      - `external_user_emails` string[], required
      - `external_user_group_ids` string[], required
      - `is_public` boolean, required
    - `doc_metadata` object, nullable
  - `cc_pair_id` integer, nullable

## Response `200`

Successful Response

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

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/onyx-dot-app/apis/agents-api.md) · [All operations](https://skmtc.net/onyx-dot-app/apis/agents-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/onyx-dot-app/agents-api/versions/ea131344b29e/schema)
