Skip to main content

Upload Module

Uploads a new HDP module to the registry. This endpoint accepts multipart form data containing the compiled module, source files, ABI, and metadata. The creator user is automatically inferred from the API key. This endpoint requires authentication.

Endpoint

Authentication

This endpoint requires authentication using an API key:

Request Body (Multipart Form Data)

Example Request

Response

Success Response (201 Created)

Error Response (400 Bad Request)

Error Response (401 Unauthorized)

Response Fields

Version Management

  • Each module can have multiple versions
  • Version numbers must be unique per module (semantic versioning recommended)
  • The uploaded version becomes the latest version for the module
  • If a version already exists for the module, the upload will fail with a 400 error

Storage

  • Compiled programs are stored in S3 (if configured) or in the database as fallback
  • Source code is always stored in the database
  • Scarb.toml is stored in the database for reference

Notes

  • Authentication is required for this endpoint
  • The creator user is automatically inferred from the API key
  • The module must be a Cairo 1 compiled program (Cairo 0 is not supported)
  • The compiler version is extracted from the module if not provided
  • Source files should be provided as a JSON object mapping relative paths to file contents
  • The ABI should be provided as a JSON string
  • Duplicate versions for the same module are not allowed