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

# Stage files to workspace

> Stage file nodes to a workspace. Do not upload file contents to the repository.



## OpenAPI

````yaml https://dev.hub.oxen.ai/api/_spec/oxen_server_openapi.json post /api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/files/batch/{directory}
openapi: 3.1.0
info:
  description: >-
    Oxen is a fast, unstructured data version control, to help version large
    machine learning datasets written in Rust.
  license:
    name: ''
  title: oxen-server
  version: 0.50.0
servers:
  - description: Production API
    url: https://hub.oxen.ai
  - description: Local Development
    url: http://localhost:3000
security:
  - api_key: []
tags:
  - description: Namespace management endpoints
    name: Namespaces
  - description: Repository management endpoints.
    name: Repositories
paths:
  /api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/files/batch/{directory}:
    post:
      tags:
        - Workspace Files
      summary: Stage files to workspace
      description: >-
        Stage file nodes to a workspace. Do not upload file contents to the
        repository.
      operationId: add_version_files
      parameters:
        - description: The namespace of the repository
          example: ox
          in: path
          name: namespace
          required: true
          schema:
            type: string
        - description: The name of the repository
          example: ImageNet-1k
          in: path
          name: repo_name
          required: true
          schema:
            type: string
        - description: The UUID of the workspace
          example: 580c0587-c157-417b-9118-8686d63d2745
          in: path
          name: workspace_id
          required: true
          schema:
            type: string
        - description: The directory to stage the files into
          example: data/train
          in: path
          name: directory
          required: true
          schema:
            type: string
        - description: >-
            Force staging even if file content has not changed, updating the
            file timestamp
          example: false
          in: query
          name: update_timestamp
          required: false
          schema:
            type: boolean
      requestBody:
        content:
          application/json:
            example:
              - hash: >-
                  e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
                path: images/train/dog.jpg
            schema:
              items:
                $ref: '#/components/schemas/FileWithHash'
              type: array
        description: >-
          List of files and their pre-calculated hashes (must exist in version
          store).
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFilesResponse'
          description: Files staged successfully
        '404':
          description: Workspace not found
components:
  schemas:
    FileWithHash:
      properties:
        hash:
          type: string
        path:
          type: string
      required:
        - hash
        - path
      type: object
    ErrorFilesResponse:
      allOf:
        - $ref: '#/components/schemas/StatusMessage'
        - properties:
            err_files:
              items:
                $ref: '#/components/schemas/ErrorFileInfo'
              type: array
          type: object
    StatusMessage:
      properties:
        oxen_version:
          type:
            - string
            - 'null'
        status:
          type: string
        status_message:
          type: string
      required:
        - status
        - status_message
      type: object
    ErrorFileInfo:
      properties:
        error:
          type: string
        hash:
          type: string
        path:
          type:
            - string
            - 'null'
      required:
        - hash
        - error
      type: object
  securitySchemes:
    api_key:
      bearerFormat: JWT
      scheme: bearer
      type: http

````