> ## Documentation Index
> Fetch the complete documentation index at: https://docs.writerzroom.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload a tenant-private reference document



## OpenAPI

````yaml /api-reference/openapi.json post /api/corpus/documents
openapi: 3.1.0
info:
  title: WriterzRoom API
  version: '2.0'
  description: >-
    Generated from the API server by scripts/generate_api_reference.py. Only the
    endpoints listed on the Endpoints Reference page are included.
servers:
  - url: https://api.writerzroom.com
security:
  - bearerAuth: []
tags:
  - name: Generation
  - name: Content
  - name: Catalog
  - name: Approvals
  - name: Validity
  - name: Replay
  - name: Artifacts
  - name: Corpus
  - name: Account
paths:
  /api/corpus/documents:
    post:
      tags:
        - Corpus
      summary: Upload a tenant-private reference document
      operationId: ingest_private_document_api_corpus_documents_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestDocumentRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    IngestDocumentRequest:
      properties:
        text:
          type: string
          maxLength: 500000
          minLength: 100
          title: Text
          description: The document's text.
        vertical:
          type: string
          maxLength: 64
          minLength: 1
          title: Vertical
          description: Vertical the document is filed under, such as `legal`.
        source_url:
          type: string
          maxLength: 2048
          title: Source Url
          description: Where the document came from, shown when it is cited.
          default: ''
        source_title:
          type: string
          maxLength: 500
          title: Source Title
          description: Title shown when the document is cited.
          default: ''
      type: object
      required:
        - text
        - vertical
      title: IngestDocumentRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A WriterzRoom API key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.