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

# Add a document from text

> Ingests a document written as text or Markdown. Answers 202 with the source `pending`: parsing and indexing run on a queue, so poll `list sources` until `ready`.



## OpenAPI

````yaml /openapi.json post /v1/knowledge/text
openapi: 3.0.0
info:
  title: wondeya Developer API
  description: >-
    The public REST API for building on wondeya: agents, projects, pages,
    knowledge, assets, brand, theme, usage, retrieval and chat, authenticated by
    a workspace API key (`Authorization: Bearer wdy_live_…`).
  version: 0.1.0
  contact:
    name: wondeya
    url: https://wondeya.com
    email: team@wondeya.com
  license:
    name: Proprietary
    url: https://wondeya.com/terms
servers:
  - url: https://api.wondeya.com
    description: Production
  - url: http://localhost:8080
    description: Development
security: []
tags:
  - name: Identity
  - name: Agents
  - name: Projects
  - name: Pages
  - name: Knowledge
  - name: Assets
  - name: Brand
  - name: Usage
  - name: Chat
paths:
  /v1/knowledge/text:
    post:
      tags:
        - Knowledge
      summary: Add a document from text
      description: >-
        Ingests a document written as text or Markdown. Answers 202 with the
        source `pending`: parsing and indexing run on a queue, so poll `list
        sources` until `ready`.
      operationId: PublicKnowledgeController_uploadText_v1
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadKnowledgeTextDto'
      responses:
        '202':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKnowledgeSourceDto'
        '402':
          description: '`wondeya.billing.limit_reached`: at the document cap'
      security:
        - api-key: []
components:
  schemas:
    UploadKnowledgeTextDto:
      type: object
      properties:
        title:
          type: string
          minLength: 1
          maxLength: 120
        text:
          type: string
          minLength: 1
          maxLength: 200000
          description: The content as plain text or Markdown. Never auto-translated.
        topics:
          maxItems: 12
          description: Lowercase topic tags. An empty list makes the source universal.
          type: array
          items:
            type: array
        agentId:
          type: object
          nullable: true
          description: The agent this belongs to; null/absent = the workspace pool.
      required:
        - title
        - text
    PublicKnowledgeSourceDto:
      type: object
      properties:
        id:
          type: string
        agentId:
          type: object
          nullable: true
          description: null = the workspace pool.
        kind:
          type: string
          description: '`upload`, `url` or `claim`.'
        title:
          type: string
        status:
          type: string
          description: '`pending`, `ready`, `failed`, …'
        error:
          type: string
          description: A machine-readable failure code.
        lang:
          type: string
          description: The canonical corpus language of the chunks.
        sourceLang:
          type: string
        translated:
          type: boolean
        topics:
          type: array
          items:
            type: string
        fileName:
          type: string
        contentType:
          type: string
        byteSize:
          type: number
        url:
          type: string
        resolvedUrl:
          type: string
        lastFetchedAt:
          type: string
          format: date-time
        syncTtlMinutes:
          type: number
        nextSyncAt:
          type: string
          format: date-time
        claim:
          $ref: '#/components/schemas/PublicKnowledgeClaimDto'
        chunkCount:
          type: number
        tokenCount:
          type: number
        summary:
          type: string
          description: 'The index card: one English line naming what this covers.'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - agentId
        - kind
        - title
        - status
        - lang
        - translated
        - topics
        - chunkCount
        - tokenCount
        - summary
        - createdAt
        - updatedAt
    PublicKnowledgeClaimDto:
      type: object
      properties:
        es:
          type: string
        en:
          type: string
      required:
        - es
        - en
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: opaque
      type: http
      description: >-
        A workspace API key: wdy_live_… / wdy_test_…. Created at POST
        /workspaces/{tenantId}/keys and shown exactly once.

````