Skip to main content
SN-API is the REST gateway in front of SuperNodes. It handles Cascade file uploads and downloads over plain HTTPS. The JavaScript SDK and the Rust SDK route all file transfers through it. The Go SDK skips the gateway and talks gRPC directly to SuperNodes on port 4444. Call SN-API directly when you build in a language without an official SDK or need full control over the HTTP layer. Register the action on chain first. The gateway only moves bytes for actions that already exist.

Base URLs

The JavaScript SDK picks the endpoint from its preset configuration. The Rust SDK reads it from the SNAPI_BASE environment variable.

Authentication

Uploads and private downloads require an ADR-036 signature. ADR-036 is the Cosmos standard for signing arbitrary data off chain. The SDKs produce these signatures for you. When calling the API directly, follow two steps.
  1. Sign the relevant data with ADR-036 signArbitrary. Uploads sign the data hash. Downloads sign the action ID.
  2. Include the Base64 encoded signature in the request body.

POST /api/v1/actions/cascade

Starts a Cascade upload. Send the file as multipart/form-data after the on-chain registration.

Form fields

string
required
Action ID returned by the on-chain registration transaction.
string
required
Base64 encoded ADR-036 auth signature.
binary
required
The file data.

Example response

string
Upload task identifier. Use it with the task endpoints below.

Status codes

SuperNodes need a moment to index a freshly registered action. The SDKs retry this endpoint up to 5 times with 3 second delays. Apply the same retry policy when you call it directly.

GET /api/v1/actions/cascade/tasks/{task_id}

Returns the stored request metadata for an upload task. This endpoint describes what was requested, not how far it has progressed. For task state use the status stream or the history endpoint below.

Path parameters

string
required
Task ID returned by the upload endpoint.

Example response

Response fields

string
Upload task identifier.
string
The on-chain action this upload belongs to.
string
Name of the uploaded file.
string
Path the SuperNode stored the incoming file at.
integer
File size in kilobytes.
string
The ADR-036 signature submitted with the upload.
string
RFC 3339 timestamp of task creation.

GET /api/v1/actions/cascade/tasks/{task_id}/status

Streams progress updates for an upload task as Server-Sent Events (SSE), a one-way HTTP stream of messages. Send Accept: text/event-stream.
string
required
Task ID returned by the upload endpoint.
Each event carries a JSON payload on a data: line with the fields id, task_id, status, data, and created_at.

GET /api/v1/actions/cascade/tasks/{task_id}/history

Returns the status history for an upload task as JSON. Use this when you want to poll rather than hold a stream open.
string
required
Task ID returned by the upload endpoint.

POST /api/v1/actions/cascade/{action_id}/downloads

Requests a download task for a stored file. Private files need an ADR-036 signature. Files stored with isPublic: true can be requested without one.

Path parameters

string
required
The on-chain action ID of the stored file.

Query parameters

boolean
Set to true for a file that was stored with isPublic: true. The signature then becomes optional.

Request body

string
Base64 encoded ADR-036 signature of the action ID. Required unless you pass public=true.

Example request for a private file

Example request for a public file

Requesting a private file without a signature returns 400 with the message signature is required.

Example response

string
Download task identifier. Use it with the status and file endpoints below.

Status codes

As with the upload endpoint, this creates a task and returns 202 Accepted. The file itself comes from the file endpoint below.

GET /api/v1/downloads/cascade/{task_id}/status

Streams progress updates as Server-Sent Events (SSE), a one-way HTTP stream of messages. Send Accept: text/event-stream.
string
required
Download task ID returned by the download request endpoint.
Each event carries the same fields as a history entry, so id, task_id, status, data, and created_at. There is no percentage field. Progress is expressed as a sequence of named states, and data carries any detail that state has.

Example stream

States are namespaced by who reported them. sdk: states come from the gateway’s client, and supernode: states come from the SuperNode serving the request. The terminal states are sdk:completed and sdk:failed. In browsers, consume the stream with EventSource.
To poll for status as JSON instead of holding this stream open, use the history endpoint below.

GET /api/v1/downloads/cascade/{task_id}/history

Returns the status history for a download task as JSON. This is the polling counterpart to the stream above.
string
required
Download task ID returned by the download request endpoint.

GET /api/v1/downloads/cascade/{task_id}/file

Streams the file bytes once the download task completes. The response arrives with Content-Type: application/octet-stream.
string
required
Download task ID returned by the download request endpoint.
Consume the response as a ReadableStream to keep memory use flat on large files.

Version fallback

The SDKs try versioned paths first (/api/v1/...) and fall back to legacy paths (/api/...) on a 404. This keeps them compatible across SN-API versions. Prefer the /api/v1/ prefix when calling the API directly.

Errors

Error bodies carry a message and a machine readable code.

Rate limits

The public SN-API endpoints may rate limit during high traffic. For high throughput production workloads, run your own SuperNode. The SuperNode overview explains the requirements.

Next steps

Upload lifecycle

What happens between registration and DONE.

Download lifecycle

How SuperNodes reassemble your file from symbols.

Error handling

Retry strategies for uploads and downloads.