Skip to content
Start here

Update Stream

pipelines.streams.update(strstream_id, StreamUpdateParams**kwargs) -> StreamUpdateResponse
PATCH/accounts/{account_id}/pipelines/v1/streams/{stream_id}

Update a Stream.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
account_id: str

Specifies the public ID of the account.

stream_id: str

Specifies the public ID of the stream.

maxLength32
minLength32
http: Optional[HTTP]
authentication: bool

Indicates that authentication is required for the HTTP endpoint.

enabled: bool

Indicates that the HTTP endpoint is enabled.

cors: Optional[HTTPCORS]

Specifies the CORS options for the HTTP endpoint.

origins: Optional[SequenceNotStr[str]]
worker_binding: Optional[WorkerBinding]
enabled: bool

Indicates that the worker binding is enabled.

ReturnsExpand Collapse
class StreamUpdateResponse:
id: str

Indicates a unique identifier for this stream.

created_at: datetime
formatdate-time
http: HTTP
authentication: bool

Indicates that authentication is required for the HTTP endpoint.

enabled: bool

Indicates that the HTTP endpoint is enabled.

cors: Optional[HTTPCORS]

Specifies the CORS options for the HTTP endpoint.

origins: Optional[List[str]]
modified_at: datetime
formatdate-time
name: str

Indicates the name of the Stream.

maxLength128
minLength1
version: int

Indicates the current version of this stream.

worker_binding: WorkerBinding
enabled: bool

Indicates that the worker binding is enabled.

endpoint: Optional[str]

Indicates the endpoint URL of this stream.

formaturi
format: Optional[Format]
One of the following:
class FormatJson:
type: Literal["json"]
decimal_encoding: Optional[Literal["number", "string", "bytes"]]
One of the following:
"number"
"string"
"bytes"
timestamp_format: Optional[Literal["rfc3339", "unix_millis"]]
One of the following:
"rfc3339"
"unix_millis"
unstructured: Optional[bool]
class FormatParquet:
type: Literal["parquet"]
compression: Optional[Literal["uncompressed", "snappy", "gzip", 2 more]]
One of the following:
"uncompressed"
"snappy"
"gzip"
"zstd"
"lz4"
row_group_bytes: Optional[int]
formatint64
minimum0

Update Stream

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
stream = client.pipelines.streams.update(
    stream_id="033e105f4ecef8ad9ca31a8372d0c353",
    account_id="0123105f4ecef8ad9ca31a8372d0c353",
)
print(stream.id)
{
  "result": {
    "id": "01234567890123457689012345678901",
    "created_at": "2019-12-27T18:11:19.117Z",
    "http": {
      "authentication": false,
      "enabled": true,
      "cors": {
        "origins": [
          "string"
        ]
      }
    },
    "modified_at": "2019-12-27T18:11:19.117Z",
    "name": "my_stream",
    "version": 3,
    "worker_binding": {
      "enabled": true
    },
    "endpoint": "https://01234567890123457689012345678901.ingest.cloudflare.com/v1",
    "format": {
      "type": "json",
      "decimal_encoding": "number",
      "timestamp_format": "rfc3339",
      "unstructured": true
    }
  },
  "success": true
}
Returns Examples
{
  "result": {
    "id": "01234567890123457689012345678901",
    "created_at": "2019-12-27T18:11:19.117Z",
    "http": {
      "authentication": false,
      "enabled": true,
      "cors": {
        "origins": [
          "string"
        ]
      }
    },
    "modified_at": "2019-12-27T18:11:19.117Z",
    "name": "my_stream",
    "version": 3,
    "worker_binding": {
      "enabled": true
    },
    "endpoint": "https://01234567890123457689012345678901.ingest.cloudflare.com/v1",
    "format": {
      "type": "json",
      "decimal_encoding": "number",
      "timestamp_format": "rfc3339",
      "unstructured": true
    }
  },
  "success": true
}