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

# Add Document To Folder

> Add a document to a folder.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /folders/{folder_id_or_name}/documents/{document_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /folders/{folder_id_or_name}/documents/{document_id}:
    post:
      tags:
        - Folders
      summary: Add Document To Folder
      description: Add a document to a folder.
      operationId: >-
        add_document_to_folder_folders__folder_id_or_name__documents__document_id__post
      parameters:
        - name: folder_id_or_name
          in: path
          required: true
          schema:
            type: string
            title: Folder Id Or Name
        - name: document_id
          in: path
          required: true
          schema:
            type: string
            title: Document Id
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentAddToFolderResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Morphik from 'morphik';

            const client = new Morphik({
              apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.folders.documents.add('document_id', {
              folder_id_or_name: 'folder_id_or_name',
            });

            console.log(response.message);
        - lang: cURL
          source: >-
            curl
            https://api.morphik.ai/folders/$FOLDER_ID_OR_NAME/documents/$DOCUMENT_ID
            \
                -X POST \
                -H "Authorization: Bearer $MORPHIK_API_KEY"
components:
  schemas:
    DocumentAddToFolderResponse:
      properties:
        status:
          type: string
          title: Status
        message:
          type: string
          title: Message
      type: object
      required:
        - status
        - message
      title: DocumentAddToFolderResponse
      description: Response for adding document to folder endpoint
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````