Overview
Updates the configuration of an existing stream. Use this endpoint to modify a stream's name, filter function, destination, destination attributes, extra destinations, batch size, metadata settings, reorg handling, distance-from-tip, notification email, and other configuration options without needing to delete and recreate the stream.
Key capabilities:
- Change webhook URL or destination credentials
- Update filter functions on-the-fly
- Switch compression settings
- Adjust retry parameters
- Add or modify extra destinations
- Update batch size and elastic batching settings
The network, dataset, and region fields cannot be changed after stream creation. To change these, create a new stream instead.
Endpoint
Send a PATCH request to update an existing stream.
PATCH https://api.quicknode.com/streams/rest/v1/streams/{id}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The unique identifier (UUID) of the stream to update |
Request Parameters
All body parameters are optional. Only include the fields you want to update.
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | No | A new name for your stream |
| filter_function | string | No | Base64-encoded JavaScript filter function |
| start_range | integer | No | Starting block number (epoch for validator_activity) |
| end_range | integer | No | Ending block number (epoch for validator_activity) |
| dataset_batch_size | integer | No | Number 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 |
| status | string | No | active or paused |
| elastic_batch_enabled | boolean | No | Deliver whatever blocks are available at the chain tip without waiting for the batch to fill |
| fix_block_reorgs | integer | No | 1 to enable reorg detection |
| keep_distance_from_tip | integer | No | Blocks to stay behind chain tip |
| notification_email | string | No | Email for stream termination alerts |
| destination | string | No | webhook, s3, azure, or postgres |
| destination_attributes | object | No | Configuration for selected destination |
| extra_destinations | array | No | Additional destinations |
| external_id | string | null | No | Set or change your own identifier for the stream (unique within your account), or send null to remove it. Returns 409 Conflict if another stream already uses the value. See Safe retries with external_id |
Retrying an update
Update Stream doesn't take an Idempotency-Key, and ignores the header if you send one. You don't need it here: an update sets each field you send to the value you give, so sending the same request again leaves the stream in the same state.
One exception: once the stream is active, a request with "status": "active" fails with 400 Bad Request, so a retry after a successful activation returns an error. To start a stream, use Activate Stream instead.
Destination Attributes
When updating destination attributes, the configuration options vary based on the selected destination type. Select a tab below to view the attributes for each destination.
- Webhook
- S3
- Azure
- PostgreSQL
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | Webhook endpoint URL |
| compression | string | Yes | none or gzip |
| max_retry | integer | Yes | Max retry attempts |
| retry_interval_sec | integer | Yes | Seconds between retries |
| post_timeout_sec | integer | Yes | Request timeout in seconds |
| headers | object | No | Custom headers as key-value pairs |
| security_token | string | No | Secret used to sign every delivery so you can verify it came from Quicknode. At least 32 characters. Send a new value to rotate it; omit it to keep the current one |
| mtls | boolean | No | Enable mutual TLS: Quicknode authenticates to your endpoint with its client certificate. Requires an HTTPS URL. Send false explicitly to disable. See the Webhook destination page for server setup. |
| ssl_ca_pem | string | No | CA certificate (PEM) used to verify your endpoint's server certificate when it is signed by a private CA. Send an empty string to clear. |
For mTLS server configuration and how to download the Quicknode CA certificate, see Mutual TLS on the Webhook destination page.
| Parameter | Type | Required | Description |
|---|---|---|---|
| endpoint | string | Yes | S3 endpoint (e.g., s3.amazonaws.com) |
| bucket | string | Yes | Bucket name |
| secret_key | string | Yes | S3 secret key |
| access_key | string | No | S3 access key |
| object_prefix | string | No | Prefix for object keys |
| file_compression_type | string | Yes | none or gzip |
| file_type | string | Yes | .json |
| max_retry | integer | Yes | Max retry attempts |
| retry_interval_sec | integer | Yes | Seconds between retries |
| use_ssl | boolean | Yes | Enable SSL |
| Parameter | Type | Required | Description |
|---|---|---|---|
| storage_account | string | Yes | Azure storage account name |
| container | string | Yes | Container name |
| sas_token | string | Yes | Shared Access Signature token |
| blob_prefix | string | No | Prefix for blob names |
| file_compression_type | string | Yes | none or gzip |
| file_type | string | Yes | .json |
| max_retry | integer | Yes | Max retry attempts |
| retry_interval_sec | integer | Yes | Seconds between retries |
| Parameter | Type | Required | Description |
|---|---|---|---|
| host | string | Yes | Database host |
| port | integer | Yes | Database port |
| username | string | Yes | Database username |
| password | string | Yes | Database password |
| table_name | string | Yes | Target table name |
| sslmode | string | Yes | require or disable |
| max_retry | integer | Yes | Max retry attempts |
| retry_interval_sec | integer | Yes | Seconds between retries |
Example Request
- cURL
- CLI
- JavaScript
Python
- Ruby
- SDK (JS)
SDK (Python)
- SDK (Ruby)
- SDK (Rust)
curl -X PATCH "https://api.quicknode.com/streams/rest/v1/streams/f6ad6459-b5ad-4183-b370-1c1388e47e83" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"name": "Updated Stream Name",
"destination_attributes": {
"url": "https://new-webhook.site",
"compression": "gzip",
"max_retry": 5,
"retry_interval_sec": 2,
"post_timeout_sec": 15,
"mtls": true
}
}'
qn stream update f6ad6459-b5ad-4183-b370-1c1388e47e83 \
--name "Updated Stream Name" \
--notification-email alice@example.com \
-o json
const headers = new Headers()
headers.append('accept', 'application/json')
headers.append('Content-Type', 'application/json')
headers.append('x-api-key', 'YOUR_API_KEY')
const body = JSON.stringify({
name: 'Updated Stream Name',
destination_attributes: {
url: 'https://new-webhook.site',
compression: 'gzip',
max_retry: 5,
retry_interval_sec: 2,
post_timeout_sec: 15,
mtls: true
}
})
fetch('https://api.quicknode.com/streams/rest/v1/streams/f6ad6459-b5ad-4183-b370-1c1388e47e83', {
method: 'PATCH',
headers: headers,
body: body
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error))
import requests
url = "https://api.quicknode.com/streams/rest/v1/streams/f6ad6459-b5ad-4183-b370-1c1388e47e83"
payload = {
"name": "Updated Stream Name",
"destination_attributes": {
"url": "https://new-webhook.site",
"compression": "gzip",
"max_retry": 5,
"retry_interval_sec": 2,
"post_timeout_sec": 15,
"mtls": true
}
}
headers = {
"accept": "application/json",
"Content-Type": "application/json",
"x-api-key": "YOUR_API_KEY"
}
response = requests.patch(url, headers=headers, json=payload)
print(response.json())
require "uri"
require "net/http"
require "json"
url = URI("https://api.quicknode.com/streams/rest/v1/streams/f6ad6459-b5ad-4183-b370-1c1388e47e83")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["accept"] = "application/json"
request["Content-Type"] = "application/json"
request["x-api-key"] = "YOUR_API_KEY"
request.body = {
"name" => "Updated Stream Name",
"destination_attributes" => {
"url" => "https://new-webhook.site",
"compression" => "gzip",
"max_retry" => 5,
"retry_interval_sec" => 2,
"post_timeout_sec" => 15,
"mtls" => true
}
}.to_json
response = https.request(request)
puts response.body
import { QuicknodeSdk } from "@quicknode/sdk"
const qn = new QuicknodeSdk({ apiKey: "YOUR_API_KEY" })
const stream = await qn.streams.updateStream("f6ad6459-b5ad-4183-b370-1c1388e47e83", {
name: "Updated Stream Name",
})
console.log(stream.id, stream.name)
import asyncio
from quicknode_sdk import QuicknodeSdk, SdkFullConfig
async def main():
qn = QuicknodeSdk(SdkFullConfig(api_key="YOUR_API_KEY"))
stream = await qn.streams.update_stream(
id="f6ad6459-b5ad-4183-b370-1c1388e47e83",
name="Updated Stream Name",
)
print(stream.id, stream.name)
asyncio.run(main())
require "quicknode_sdk"
qn = QuicknodeSdk::SDK.from_config(api_key: "YOUR_API_KEY")
stream = qn.streams.update_stream(
id: "f6ad6459-b5ad-4183-b370-1c1388e47e83",
name: "Updated Stream Name",
)
puts "#{stream["id"]} #{stream["name"]}"
use quicknode_sdk::{streams::UpdateStreamParams, QuicknodeSdk, SdkFullConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let qn = QuicknodeSdk::new(&SdkFullConfig::builder().api_key("YOUR_API_KEY").build())?;
let params = UpdateStreamParams {
name: Some("Updated Stream Name".to_string()),
..Default::default()
};
let stream = qn.streams.update_stream("f6ad6459-b5ad-4183-b370-1c1388e47e83", ¶ms).await?;
println!("{} {}", stream.id, stream.name);
Ok(())
}
Response
On success, the API returns the updated stream object with all configuration and status information.
{
"id": "f6ad6459-b5ad-4183-b370-1c1388e47e83",
"name": "Updated Stream Name",
"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://new-webhook.site",
"compression": "gzip",
"max_retry": 5,
"retry_interval_sec": 2,
"post_timeout_sec": 15,
"mtls": true,
"security_token": "qn_xxxxxxxxxxxxxx"
},
"status": "active",
"sequence": 150,
"current_hash": "0x1234567890abcdef...",
"notification_email": null,
"extra_destinations": [],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T14:00:00Z"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| id | string | Unique stream identifier (UUID) |
| name | string | Stream name |
| network | string | Blockchain network |
| dataset | string | Dataset type |
| region | string | Deployment region |
| filter_function | string | Base64-encoded filter function (if configured) |
| start_range | integer | Starting block number (epoch for validator_activity) |
| end_range | integer | Ending block number, or epoch for validator_activity (null for continuous) |
| dataset_batch_size | integer | Number of blocks per batch (epochs for validator_activity) |
| elastic_batch_enabled | boolean | Whether elastic batching is enabled |
| fix_block_reorgs | integer | Reorg detection setting (1 = enabled) |
| keep_distance_from_tip | integer | Blocks to stay behind chain tip |
| destination | string | Destination type (webhook, s3, azure, postgres) |
| destination_attributes | object | Destination configuration (varies by type) |
| status | string | Stream status (active or paused) |
| sequence | integer | Last delivered block from the data range (epoch for validator_activity) |
| current_hash | string | Hash of the current block being processed |
| notification_email | string | Email for stream termination alerts |
| extra_destinations | array | Additional destinations (if configured) |
| created_at | string | Stream creation timestamp (ISO 8601) |
| updated_at | string | Last update timestamp (ISO 8601) |
Sensitive fields like secret_key (S3), sas_token (Azure), and password (PostgreSQL) are not returned in the response for security reasons.