Skip to main content

Create a Stream – Streams REST API

Updated on
Nov 18, 2026

Overview​

Creates a new stream with a specified blockchain network, dataset type, destination, and optional filter function. Use this endpoint to programmatically set up real-time or historical blockchain data pipelines.

Key capabilities:

  • Start from a specific block (backfills) or latest block (real-time streaming)
  • Choose destination: webhook, S3, Azure Blob Storage, or PostgreSQL
  • Attach a base64-encoded JavaScript filter to transform data before delivery
  • Configure batch sizes, reorg detection, distance-from-tip, and elastic batching
  • Set up multi-destination delivery with extra_destinations
  • Receive email alerts on stream termination
  • Retry safely: tag the stream with your own external_id and a repeated create returns the existing stream instead of a duplicate

Endpoint​

Send a POST request to the following URL with your stream configuration in the request body.

POST https://api.quicknode.com/streams/rest/v1/streams

Request Parameters​

ParameterTypeRequiredDescription
namestringYesA name for your stream
networkstringYesBlockchain network (see Supported Chains)
datasetstringYesDataset type (see Data Sources)
regionstringYesusa_east
dataset_batch_sizeintegerYesNumber of blocks to batch per delivery (epochs for validator_activity). Tip Streams on networks with sub-second block times require at least 5, see Batch Size and Elastic Batch
elastic_batch_enabledbooleanYesDeliver whatever blocks are available at the chain tip without waiting for the batch to fill
destinationstringYeswebhook, s3, azure, or postgres
destination_attributesobjectYesConfiguration for selected destination
statusstringYesactive or paused
filter_functionstringNoBase64-encoded JavaScript filter function
start_rangeintegerNoStarting block number, or epoch for validator_activity; omit for latest
end_rangeintegerNoEnding block number, or epoch for validator_activity; omit for continuous
fix_block_reorgsintegerNo1 to enable reorg detection and re-streaming
keep_distance_from_tipintegerNoBlocks to stay behind chain tip
notification_emailstringNoEmail for stream termination alerts
extra_destinationsarrayNoAdditional destinations (same structure as primary)
external_idstringNoYour own identifier for the stream, unique within your account. 1–255 printable ASCII characters, no spaces. See Safe retries with external_id

Safe retries with external_id​

If a create request times out or the connection drops, you can't tell whether the stream was created. Send an external_id (or the same value in an Idempotency-Key header) and retrying is always safe:

  • First request: the stream is created and returned with 201 Created.
  • Any retry with the same external_id: nothing new is created. The existing stream is returned unchanged with 200 OK, even if other fields in the retry differ.
  • If the external_id belongs to a stream your API key isn't allowed to see, the request fails with 409 Conflict.

The external_id stays on the stream, so you can map your own identifiers to Quicknode streams and look one up later with GET /streams?external_id=.... To add one to a stream you already have, or to change or remove it, use Update Stream. Deleting a stream frees its external_id.

The Idempotency-Key header​

Idempotency-Key is another way to send external_id when you create a stream. It is not a separate key for each request:

  • Its value is saved as the stream's external_id, and duplicates are detected by that value. Retrying with the same Idempotency-Key works exactly like retrying with the same external_id.
  • If you send both the header and the body field, they must be equal. Otherwise the request fails with 400 Bad Request.
  • Only Create Stream reads it. Update Stream ignores it; see Retrying an update.

Destination Attributes​

Configuration options vary based on the selected destination type. Select a tab below to view the required and optional attributes for each destination.

ParameterTypeRequiredDescription
urlstringYesWebhook endpoint URL
compressionstringYesnone or gzip
max_retryintegerYesMax retry attempts
retry_interval_secintegerYesSeconds between retries
post_timeout_secintegerYesRequest timeout in seconds
headersobjectNoCustom headers as key-value pairs
security_tokenstringNoSecret used to sign every delivery so you can verify it came from Quicknode. At least 32 characters. Omit it on create and one is generated for you; the stream response includes it
mtlsbooleanNoEnable mutual TLS: Quicknode authenticates to your endpoint with its client certificate. Requires an HTTPS URL. See the Webhook destination page for server setup.
ssl_ca_pemstringNoCA certificate (PEM) used to verify your endpoint's server certificate when it is signed by a private CA instead of a public one

For mTLS server configuration and how to download the Quicknode CA certificate, see Mutual TLS on the Webhook destination page.

Example Request​

curl -X POST "https://api.quicknode.com/streams/rest/v1/streams" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"name": "My Stream",
"network": "ethereum-mainnet",
"dataset": "block",
"filter_function": "ZnVuY3Rpb24gbWFpbihkYXRhKSB7Li4ufQ==",
"region": "usa_east",
"start_range": 100,
"end_range": 200,
"dataset_batch_size": 1,
"destination": "webhook",
"fix_block_reorgs": 0,
"keep_distance_from_tip": 0,
"elastic_batch_enabled": true,
"destination_attributes": {
"url": "https://webhook.site",
"compression": "none",
"headers": { "Authorization": "Bearer token" },
"max_retry": 3,
"retry_interval_sec": 1,
"post_timeout_sec": 10,
"mtls": true
},
"status": "active"
}'

Response​

On success, the API returns the created stream object with a unique ID, timestamps, and all configured parameters.

{
"id": "f6ad6459-b5ad-4183-b370-1c1388e47e83",
"name": "My Stream",
"network": "ethereum-mainnet",
"dataset": "block",
"region": "usa_east",
"filter_function": "ZnVuY3Rpb24gbWFpbihkYXRhKSB7Li4ufQ==",
"start_range": 100,
"end_range": 200,
"dataset_batch_size": 1,
"elastic_batch_enabled": true,
"fix_block_reorgs": 0,
"keep_distance_from_tip": 0,
"destination": "webhook",
"destination_attributes": {
"url": "https://webhook.site",
"compression": "none",
"headers": { "Authorization": "Bearer token" },
"max_retry": 3,
"retry_interval_sec": 1,
"post_timeout_sec": 10,
"mtls": true,
"security_token": "qn_xxxxxxxxxxxxxx"
},
"status": "active",
"sequence": 0,
"current_hash": null,
"notification_email": null,
"extra_destinations": [],
"external_id": "acme-stream-42",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}

Response Fields​

FieldTypeDescription
idstringUnique stream identifier (UUID)
namestringStream name
networkstringBlockchain network
datasetstringDataset type
regionstringDeployment region
filter_functionstringBase64-encoded filter function (if configured)
start_rangeintegerStarting block number (epoch for validator_activity)
end_rangeintegerEnding block number, or epoch for validator_activity (null for continuous)
dataset_batch_sizeintegerNumber of blocks per batch (epochs for validator_activity)
elastic_batch_enabledbooleanWhether elastic batching is enabled
fix_block_reorgsintegerReorg detection setting (1 = enabled)
keep_distance_from_tipintegerBlocks to stay behind chain tip
destinationstringDestination type (webhook, s3, azure, postgres)
destination_attributesobjectDestination configuration (varies by type)
statusstringStream status (active or paused)
sequenceintegerLast delivered block from the data range (epoch for validator_activity)
current_hashstringHash of the current block being processed
notification_emailstringEmail for stream termination alerts
extra_destinationsarrayAdditional destinations (if configured)
external_idstringYour own identifier for the stream, or null if you have not set one
created_atstringStream creation timestamp (ISO 8601)
updated_atstringLast update timestamp (ISO 8601)

Response Destination Attributes​

The destination_attributes object in the response varies based on the destination type. Select a tab below to view the fields returned for each destination.

FieldTypeDescription
urlstringWebhook endpoint URL
compressionstringCompression type (none or gzip)
headersobjectCustom headers (if configured)
max_retryintegerMaximum retry attempts
retry_interval_secintegerSeconds between retries
post_timeout_secintegerRequest timeout in seconds
security_tokenstringAuto-generated token for validating webhook authenticity
note

Sensitive fields like secret_key (S3), sas_token (Azure), and password (PostgreSQL) are not returned in the response for security reasons.