Skip to main content
The streams API covers the full shared FlowGuard stream product:
  • vesting-style schedules
  • hybrid schedules
  • recurring schedules
  • milestone schedules
  • tranche schedules
  • treasury batch creation
  • activity and batch run history
All routes live under /api.

Supported Stream Types

Current streamType values:
  • LINEAR
  • RECURRING
  • STEP
  • TRANCHE
  • HYBRID

Get Stream Templates

GET /api/streams/templates
Returns the current contract-backed schedule template catalog used by the stream gallery and builder.

List Streams

GET /api/streams?recipient={address}
GET /api/streams?sender={address}
GET /api/streams?address={address}
GET /api/streams?vaultId={vaultId}&treasury=true
GET /api/streams?contextSource=dao&treasury=true&page=1&limit=20

Query Parameters

ParamMeaning
recipientfilter by recipient address
senderfilter by sender address
addressmatch sender or recipient
statusfilter by stream status
vaultIdfilter by linked treasury / vault
contextSourcefilter by saved launch context source such as dao
treasury=trueonly return streams linked to a vault
pagepage number, default 1
limitpage size, default 20, max 100

Stream Activity Feed

GET /api/streams/activity?address={address}
GET /api/streams/activity?vaultId={vaultId}&treasury=true
GET /api/streams/activity?contextSource=dao&eventType=claimed&dateFrom=1761955200&dateTo=1764547200

Activity Filters

  • address
  • vaultId
  • contextSource
  • treasury=true
  • eventType
  • dateFrom
  • dateTo
  • page
  • limit

Batch Run History

GET /api/streams/batch-runs
GET /api/streams/batch-runs/:id
GET /api/streams/batch-runs/:id/export
Use these routes to inspect treasury batch runs and export batch-level history.

Get a Stream

GET /api/streams/:id
Returns the stream record and its claim history.

Create a Stream

POST /api/streams/create
x-user-address: bchtest:q...

Body

{
  "sender": "bchtest:q...",
  "recipient": "bchtest:q...",
  "tokenType": "BCH",
  "totalAmount": 12,
  "streamType": "HYBRID",
  "startTime": 1761955200,
  "endTime": 1793491200,
  "cancelable": true,
  "description": "Contributor vesting lane",
  "vaultId": "optional-vault-id",
  "scheduleTemplate": "hybrid-upfront-linear",
  "hybridUnlockTimestamp": 1769817600,
  "hybridUpfrontPercentage": 25,
  "launchContext": {
    "source": "dao",
    "title": "Treasury stream launch",
    "description": "Approved by treasury operators",
    "preferredLane": "contributors"
  }
}

Family-Specific Fields

FamilyRequired or relevant fields
LINEARstartTime, endTime, optional cliffTimestamp
RECURRINGintervalSeconds, optional refillable, endTime is stored as null for open runway recurring streams
STEPintervalSeconds
HYBRIDhybridUnlockTimestamp, hybridUpfrontPercentage
TRANCHEtrancheSchedule

Funding Info

GET /api/streams/:id/funding-info
Returns the wallet transaction the sender signs to fund a pending stream.

Confirm Funding

POST /api/streams/:id/confirm-funding
{
  "txHash": "hex64"
}
Confirms the on-chain funding transaction and activates the stream.

Claim Info

GET /api/streams/:id/claim-info
Returns the current claimable amount and the built wallet transaction.

Claim

POST /api/streams/:id/claim
x-user-address: bchtest:qrecipient...
{
  "recipientAddress": "bchtest:qrecipient..."
}
Builds the claim transaction for the current recipient.

Confirm Claim

POST /api/streams/:id/confirm-claim
{
  "claimedAmount": 1.5,
  "txHash": "hex64"
}
Records the claim and refreshes stream state.

Pause and Resume

POST /api/streams/:id/pause
POST /api/streams/:id/confirm-pause
POST /api/streams/:id/resume
POST /api/streams/:id/confirm-resume
These routes are sender-only and require x-user-address.

Refill a Refillable Recurring Stream

POST /api/streams/:id/refill
POST /api/streams/:id/confirm-refill

Refill Body

{
  "refillAmount": 2.5
}
Refill is only available for recurring streams created with refillable: true.

Transfer Recipient Rights

POST /api/streams/:id/transfer
POST /api/streams/:id/confirm-transfer
Recurring streams do not support recipient transfer. Vesting-style streams require the current recipient to sign.

Cancel

POST /api/streams/:id/cancel
POST /api/streams/:id/confirm-cancel
Cancellation is sender-controlled and only available on cancelable streams.

Treasury Batch Create

POST /api/treasuries/:vaultId/batch-create
POST /api/treasuries/:vaultId/batch-create/confirm

Batch Create Body

{
  "senderAddress": "bchtest:q...",
  "tokenType": "BCH",
  "entries": [
    {
      "recipient": "bchtest:q...",
      "totalAmount": 5,
      "streamType": "RECURRING",
      "startTime": 1761955200,
      "endTime": 1777507200,
      "intervalSeconds": 2592000,
      "refillable": true,
      "scheduleTemplate": "recurring-open-monthly"
    }
  ],
  "launchContext": {
    "source": "dao",
    "title": "Treasury batch payroll",
    "preferredLane": "payroll"
  }
}
The response includes:
  • created pending stream records
  • batch metadata
  • one funding transaction for the full run

Batch Confirm Body

{
  "txHash": "hex64",
  "batchId": "uuid",
  "streamIds": ["uuid-1", "uuid-2"]
}
This verifies that the transaction funded every expected stream output before the batch is activated.