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
| Endpoint | Purpose |
|---|---|
POST /vaults/{vault_id}/streams | Create a stream (the only creation route) |
GET /streams | List |
GET /streams/{stream_id} | Detail |
PUT /streams/{stream_id} | Update |
GET /streams/{stream_code}/attachments | List the stream's attachments |
POST / GET / DELETE /streams/{stream_id}/permissions | Manage 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:
POST /attachmentswithname,stream_id,ledgerandestimated_size— returnspresigned_urls.PUTeach part's bytes to its presigned S3 URL and keep theETag.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
- Quick Start — a working upload, end to end
- API Reference