Skip to main content

Data Streams

A stream is a named channel inside a vault. Data attachments belong to a stream, and a template's required_streams decide which streams a vault starts with.

Creating a stream

Streams are created within a vault — there is no top-level create route:

curl -X POST "https://api.filedgr.network/vaults/$VAULT_ID/streams" \
-H "x-api-key: $FILEDGR_API_KEY" -H "x-api-secret: $FILEDGR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"mapping": "sensor-data",
"description": "Temperature readings",
"required": true
}'

AddStreamRequest takes exactly three fields: mapping, description and required.

The stream routes

EndpointPurpose
POST /vaults/{vault_id}/streamsCreate a stream (the only creation route)
GET /streamsList
GET /streams/{stream_id}Detail
PUT /streams/{stream_id}Update
GET /streams/{stream_code}/attachmentsList the stream's attachments
POST / GET / DELETE /streams/{stream_id}/permissionsManage access

Stream permissions are ADMIN, EDITOR, VIEWER — narrower than vault permissions, with no OWNER or CUSTOM.

Writing data

Data is written as data attachments, not pushed to a stream ingest endpoint:

  1. POST /attachments with name, stream_id, ledger and estimated_size — returns presigned_urls.
  2. PUT each part's bytes to its presigned S3 URL and keep the ETag.
  3. PUT /attachments/{id} with [{part, etag}] to close the upload.

Skip step 3 and the attachment is never notarised.

note

Streaming ingest, pause/resume, threshold alerting and aggregation queries are on the roadmap rather than available today. To react to stream activity now, subscribe to webhooks.

Full reference