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

# Append to Document

> Append content to an existing document. Fetches current content, appends new content, and regenerates embeddings synchronously.



## OpenAPI

````yaml api/openapi.json post /api/documents/{id}/append
openapi: 3.1.0
info:
  version: '0.1'
  title: Orchata API
servers:
  - url: https://api.orchata.ai
    description: Orchata API Server
security:
  - ApiKey: []
paths:
  /api/documents/{id}/append:
    post:
      tags:
        - Documents
      summary: Append to Document
      description: >-
        Append content to an existing document. Fetches current content, appends
        new content, and regenerates embeddings synchronously.
      parameters:
        - schema:
            type: string
            example: document_123
          required: true
          name: id
          in: path
      requestBody:
        description: Content to append
        content:
          application/json:
            schema:
              type: object
              properties:
                spaceId:
                  type: string
                  description: The ID of the space containing the document
                  example: space_123
                content:
                  type: string
                  minLength: 1
                  maxLength: 10000000
                  description: Content to append to the document (max 10MB)
                  example: |-

                    - New item added
                separator:
                  type: string
                  description: 'Separator between existing and new content (default: ''\n\n'')'
                  example: |+


              required:
                - spaceId
                - content
      responses:
        '200':
          description: Content appended successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  document:
                    type: object
                    properties:
                      id:
                        type: string
                      orgId:
                        type: string
                      spaceId:
                        type: string
                      filename:
                        type: string
                      mimeType:
                        type: string
                      fileSize:
                        type: string
                      storageUrl:
                        type: string
                      status:
                        type: string
                      errorMessage:
                        type:
                          - string
                          - 'null'
                      embeddingModel:
                        type: string
                      indexingType:
                        type: string
                      metadata: {}
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - id
                      - orgId
                      - spaceId
                      - filename
                      - mimeType
                      - fileSize
                      - storageUrl
                      - status
                      - errorMessage
                      - embeddingModel
                      - indexingType
                      - createdAt
                      - updatedAt
                required:
                  - document
        '401':
          description: Authentication required
        '403':
          description: Insufficient permissions
        '404':
          description: Document not found
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: |-
            import { Orchata } from '@orchata-ai/sdk';

            const client = new Orchata({ apiKey: 'oai_your_api_key' });

            // Add a new item to a to-do list without fetching first
            const { document } = await client.documents.append('doc_123', {
              spaceId: 'space_123',
              content: '- [ ] New task added by AI'
            });
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Oai-Api-Key

````