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

# Upload a new module

> Upload a compiled Cairo module as a ZIP file. The ZIP should contain the source code (src/ directory), Scarb.toml, and the compiled program JSON. The module will be compiled and stored for later use in HDP tasks.



## OpenAPI

````yaml /data-processor-api/openapi/openapi-hdp-server.json post /modules/upload
openapi: 3.1.0
info:
  title: Herodotus Data Processor Server API
  description: API documentation for the Herodotus Data Processor Server
  license:
    name: ''
  version: 1.0.0
servers:
  - url: https://staging.hdp.api.herodotus.cloud
    description: Staging API endpoint
security: []
tags:
  - name: tasks
    description: Task management endpoints
  - name: health
    description: Health check endpoints
  - name: modules
    description: Module registry endpoints
paths:
  /modules/upload:
    post:
      tags:
        - modules
      summary: Upload a new module
      description: >-
        Upload a compiled Cairo module as a ZIP file. The ZIP should contain the
        source code (src/ directory), Scarb.toml, and the compiled program JSON.
        The module will be compiled and stored for later use in HDP tasks.
      operationId: uploadModule
      requestBody:
        description: Multipart form data with module ZIP file and metadata
        content:
          multipart/form-data: {}
      responses:
        '201':
          description: Module uploaded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModuleUploadResponse'
        '400':
          description: Bad request - Invalid file format or missing required fields
        '401':
          description: Unauthorized - Missing or invalid API key
        '500':
          description: Internal server error
      security:
        - api_key: []
components:
  schemas:
    ModuleUploadResponse:
      type: object
      required:
        - id
        - programHash
      properties:
        id:
          type: string
        programHash:
          type: string
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: X-API-KEY

````