SN-API Reference
REST API endpoints for the Supernode API (SN-API) that handles Cascade file operations.
Base URLs
| Network | Endpoint |
|---|---|
| Testnet | https://snapi.testnet.lumera.io |
| Mainnet | https://snapi.lumera.io |
The SDK client automatically selects the correct endpoint based on your preset configuration.
Authentication
All endpoints require an ADR-036 signature for authentication. The SDK handles this automatically, but if you are calling the API directly:
- Sign the relevant data (action ID for downloads, data hash for uploads) using ADR-036
signArbitrary - Include the base64-encoded signature in the request body
Upload Endpoints
Start Cascade Upload
Form Fields:
| Field | Type | Description |
|---|---|---|
action_id | string | Action ID from on-chain registration |
signature | string | Base64 ADR-036 auth signature |
file | binary | File data |
Response:
Status Codes:
| Code | Meaning |
|---|---|
| 200 | Upload started |
| 400 | Invalid request (missing fields, bad signature) |
| 404 | Action not found (may need retry — eventual consistency) |
| 500 | Server error |
The SDK retries this endpoint up to 5 times with 3-second delays. After on-chain registration, Supernodes need time to index the action.
Get Task Details
Response:
Get Task Status
Returns a simplified status response for lightweight polling.
Download Endpoints
Request Download
Request Body:
Response:
Watch Download Status (SSE)
Server-Sent Events stream with progress updates:
In browser environments, use EventSource:
Download File
Response:
Content-Type: application/octet-stream- Binary file data (streamed)
The response can be consumed as a ReadableStream for efficient memory usage with large files.
Version Fallback
The SDK tries versioned endpoints first (/api/v1/...), then falls back to legacy paths (/api/...) on 404 responses. This ensures compatibility across SN-API versions.
If calling the API directly, prefer the /api/v1/ prefix.
Error Handling
Common error responses:
Rate Limits
The public SN-API endpoints may have rate limits during high traffic. For production applications with high throughput, consider running your own Supernode.