## Create Stream `client.Pipelines.Streams.New(ctx, params) (*StreamNewResponse, error)` **post** `/accounts/{account_id}/pipelines/v1/streams` Create a new Stream. ### Parameters - `params StreamNewParams` - `AccountID param.Field[string]` Path param: Specifies the public ID of the account. - `Name param.Field[string]` Body param: Specifies the name of the Stream. - `Format param.Field[StreamNewParamsFormat]` Body param - `type StreamNewParamsFormatJson struct{…}` - `Type StreamNewParamsFormatJsonType` - `const StreamNewParamsFormatJsonTypeJson StreamNewParamsFormatJsonType = "json"` - `DecimalEncoding StreamNewParamsFormatJsonDecimalEncoding` - `const StreamNewParamsFormatJsonDecimalEncodingNumber StreamNewParamsFormatJsonDecimalEncoding = "number"` - `const StreamNewParamsFormatJsonDecimalEncodingString StreamNewParamsFormatJsonDecimalEncoding = "string"` - `const StreamNewParamsFormatJsonDecimalEncodingBytes StreamNewParamsFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat StreamNewParamsFormatJsonTimestampFormat` - `const StreamNewParamsFormatJsonTimestampFormatRfc3339 StreamNewParamsFormatJsonTimestampFormat = "rfc3339"` - `const StreamNewParamsFormatJsonTimestampFormatUnixMillis StreamNewParamsFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type StreamNewParamsFormatParquet struct{…}` - `Type StreamNewParamsFormatParquetType` - `const StreamNewParamsFormatParquetTypeParquet StreamNewParamsFormatParquetType = "parquet"` - `Compression StreamNewParamsFormatParquetCompression` - `const StreamNewParamsFormatParquetCompressionUncompressed StreamNewParamsFormatParquetCompression = "uncompressed"` - `const StreamNewParamsFormatParquetCompressionSnappy StreamNewParamsFormatParquetCompression = "snappy"` - `const StreamNewParamsFormatParquetCompressionGzip StreamNewParamsFormatParquetCompression = "gzip"` - `const StreamNewParamsFormatParquetCompressionZstd StreamNewParamsFormatParquetCompression = "zstd"` - `const StreamNewParamsFormatParquetCompressionLz4 StreamNewParamsFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `HTTP param.Field[StreamNewParamsHTTP]` Body param - `Authentication bool` Indicates that authentication is required for the HTTP endpoint. - `Enabled bool` Indicates that the HTTP endpoint is enabled. - `CORS StreamNewParamsHTTPCORS` Specifies the CORS options for the HTTP endpoint. - `Origins []string` - `Schema param.Field[StreamNewParamsSchema]` Body param - `Fields []StreamNewParamsSchemaField` - `type StreamNewParamsSchemaFieldsInt32 struct{…}` - `Type StreamNewParamsSchemaFieldsInt32Type` - `const StreamNewParamsSchemaFieldsInt32TypeInt32 StreamNewParamsSchemaFieldsInt32Type = "int32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsInt64 struct{…}` - `Type StreamNewParamsSchemaFieldsInt64Type` - `const StreamNewParamsSchemaFieldsInt64TypeInt64 StreamNewParamsSchemaFieldsInt64Type = "int64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsFloat32 struct{…}` - `Type StreamNewParamsSchemaFieldsFloat32Type` - `const StreamNewParamsSchemaFieldsFloat32TypeFloat32 StreamNewParamsSchemaFieldsFloat32Type = "float32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsFloat64 struct{…}` - `Type StreamNewParamsSchemaFieldsFloat64Type` - `const StreamNewParamsSchemaFieldsFloat64TypeFloat64 StreamNewParamsSchemaFieldsFloat64Type = "float64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsBool struct{…}` - `Type StreamNewParamsSchemaFieldsBoolType` - `const StreamNewParamsSchemaFieldsBoolTypeBool StreamNewParamsSchemaFieldsBoolType = "bool"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsString struct{…}` - `Type StreamNewParamsSchemaFieldsStringType` - `const StreamNewParamsSchemaFieldsStringTypeString StreamNewParamsSchemaFieldsStringType = "string"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsBinary struct{…}` - `Type StreamNewParamsSchemaFieldsBinaryType` - `const StreamNewParamsSchemaFieldsBinaryTypeBinary StreamNewParamsSchemaFieldsBinaryType = "binary"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsTimestamp struct{…}` - `Type StreamNewParamsSchemaFieldsTimestampType` - `const StreamNewParamsSchemaFieldsTimestampTypeTimestamp StreamNewParamsSchemaFieldsTimestampType = "timestamp"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `Unit StreamNewParamsSchemaFieldsTimestampUnit` - `const StreamNewParamsSchemaFieldsTimestampUnitSecond StreamNewParamsSchemaFieldsTimestampUnit = "second"` - `const StreamNewParamsSchemaFieldsTimestampUnitMillisecond StreamNewParamsSchemaFieldsTimestampUnit = "millisecond"` - `const StreamNewParamsSchemaFieldsTimestampUnitMicrosecond StreamNewParamsSchemaFieldsTimestampUnit = "microsecond"` - `const StreamNewParamsSchemaFieldsTimestampUnitNanosecond StreamNewParamsSchemaFieldsTimestampUnit = "nanosecond"` - `type StreamNewParamsSchemaFieldsJson struct{…}` - `Type StreamNewParamsSchemaFieldsJsonType` - `const StreamNewParamsSchemaFieldsJsonTypeJson StreamNewParamsSchemaFieldsJsonType = "json"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsStruct struct{…}` - `type StreamNewParamsSchemaFieldsList struct{…}` - `Format StreamNewParamsSchemaFormat` - `type StreamNewParamsSchemaFormatJson struct{…}` - `Type StreamNewParamsSchemaFormatJsonType` - `const StreamNewParamsSchemaFormatJsonTypeJson StreamNewParamsSchemaFormatJsonType = "json"` - `DecimalEncoding StreamNewParamsSchemaFormatJsonDecimalEncoding` - `const StreamNewParamsSchemaFormatJsonDecimalEncodingNumber StreamNewParamsSchemaFormatJsonDecimalEncoding = "number"` - `const StreamNewParamsSchemaFormatJsonDecimalEncodingString StreamNewParamsSchemaFormatJsonDecimalEncoding = "string"` - `const StreamNewParamsSchemaFormatJsonDecimalEncodingBytes StreamNewParamsSchemaFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat StreamNewParamsSchemaFormatJsonTimestampFormat` - `const StreamNewParamsSchemaFormatJsonTimestampFormatRfc3339 StreamNewParamsSchemaFormatJsonTimestampFormat = "rfc3339"` - `const StreamNewParamsSchemaFormatJsonTimestampFormatUnixMillis StreamNewParamsSchemaFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type StreamNewParamsSchemaFormatParquet struct{…}` - `Type StreamNewParamsSchemaFormatParquetType` - `const StreamNewParamsSchemaFormatParquetTypeParquet StreamNewParamsSchemaFormatParquetType = "parquet"` - `Compression StreamNewParamsSchemaFormatParquetCompression` - `const StreamNewParamsSchemaFormatParquetCompressionUncompressed StreamNewParamsSchemaFormatParquetCompression = "uncompressed"` - `const StreamNewParamsSchemaFormatParquetCompressionSnappy StreamNewParamsSchemaFormatParquetCompression = "snappy"` - `const StreamNewParamsSchemaFormatParquetCompressionGzip StreamNewParamsSchemaFormatParquetCompression = "gzip"` - `const StreamNewParamsSchemaFormatParquetCompressionZstd StreamNewParamsSchemaFormatParquetCompression = "zstd"` - `const StreamNewParamsSchemaFormatParquetCompressionLz4 StreamNewParamsSchemaFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `Inferred bool` - `WorkerBinding param.Field[StreamNewParamsWorkerBinding]` Body param - `Enabled bool` Indicates that the worker binding is enabled. ### Returns - `type StreamNewResponse struct{…}` - `ID string` Indicates a unique identifier for this stream. - `CreatedAt Time` - `HTTP StreamNewResponseHTTP` - `Authentication bool` Indicates that authentication is required for the HTTP endpoint. - `Enabled bool` Indicates that the HTTP endpoint is enabled. - `CORS StreamNewResponseHTTPCORS` Specifies the CORS options for the HTTP endpoint. - `Origins []string` - `ModifiedAt Time` - `Name string` Indicates the name of the Stream. - `Version int64` Indicates the current version of this stream. - `WorkerBinding StreamNewResponseWorkerBinding` - `Enabled bool` Indicates that the worker binding is enabled. - `Endpoint string` Indicates the endpoint URL of this stream. - `Format StreamNewResponseFormat` - `type StreamNewResponseFormatJson struct{…}` - `Type StreamNewResponseFormatJsonType` - `const StreamNewResponseFormatJsonTypeJson StreamNewResponseFormatJsonType = "json"` - `DecimalEncoding StreamNewResponseFormatJsonDecimalEncoding` - `const StreamNewResponseFormatJsonDecimalEncodingNumber StreamNewResponseFormatJsonDecimalEncoding = "number"` - `const StreamNewResponseFormatJsonDecimalEncodingString StreamNewResponseFormatJsonDecimalEncoding = "string"` - `const StreamNewResponseFormatJsonDecimalEncodingBytes StreamNewResponseFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat StreamNewResponseFormatJsonTimestampFormat` - `const StreamNewResponseFormatJsonTimestampFormatRfc3339 StreamNewResponseFormatJsonTimestampFormat = "rfc3339"` - `const StreamNewResponseFormatJsonTimestampFormatUnixMillis StreamNewResponseFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type StreamNewResponseFormatParquet struct{…}` - `Type StreamNewResponseFormatParquetType` - `const StreamNewResponseFormatParquetTypeParquet StreamNewResponseFormatParquetType = "parquet"` - `Compression StreamNewResponseFormatParquetCompression` - `const StreamNewResponseFormatParquetCompressionUncompressed StreamNewResponseFormatParquetCompression = "uncompressed"` - `const StreamNewResponseFormatParquetCompressionSnappy StreamNewResponseFormatParquetCompression = "snappy"` - `const StreamNewResponseFormatParquetCompressionGzip StreamNewResponseFormatParquetCompression = "gzip"` - `const StreamNewResponseFormatParquetCompressionZstd StreamNewResponseFormatParquetCompression = "zstd"` - `const StreamNewResponseFormatParquetCompressionLz4 StreamNewResponseFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `Schema StreamNewResponseSchema` - `Fields []StreamNewResponseSchemaField` - `type StreamNewResponseSchemaFieldsInt32 struct{…}` - `Type StreamNewResponseSchemaFieldsInt32Type` - `const StreamNewResponseSchemaFieldsInt32TypeInt32 StreamNewResponseSchemaFieldsInt32Type = "int32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsInt64 struct{…}` - `Type StreamNewResponseSchemaFieldsInt64Type` - `const StreamNewResponseSchemaFieldsInt64TypeInt64 StreamNewResponseSchemaFieldsInt64Type = "int64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsFloat32 struct{…}` - `Type StreamNewResponseSchemaFieldsFloat32Type` - `const StreamNewResponseSchemaFieldsFloat32TypeFloat32 StreamNewResponseSchemaFieldsFloat32Type = "float32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsFloat64 struct{…}` - `Type StreamNewResponseSchemaFieldsFloat64Type` - `const StreamNewResponseSchemaFieldsFloat64TypeFloat64 StreamNewResponseSchemaFieldsFloat64Type = "float64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsBool struct{…}` - `Type StreamNewResponseSchemaFieldsBoolType` - `const StreamNewResponseSchemaFieldsBoolTypeBool StreamNewResponseSchemaFieldsBoolType = "bool"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsString struct{…}` - `Type StreamNewResponseSchemaFieldsStringType` - `const StreamNewResponseSchemaFieldsStringTypeString StreamNewResponseSchemaFieldsStringType = "string"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsBinary struct{…}` - `Type StreamNewResponseSchemaFieldsBinaryType` - `const StreamNewResponseSchemaFieldsBinaryTypeBinary StreamNewResponseSchemaFieldsBinaryType = "binary"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsTimestamp struct{…}` - `Type StreamNewResponseSchemaFieldsTimestampType` - `const StreamNewResponseSchemaFieldsTimestampTypeTimestamp StreamNewResponseSchemaFieldsTimestampType = "timestamp"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `Unit StreamNewResponseSchemaFieldsTimestampUnit` - `const StreamNewResponseSchemaFieldsTimestampUnitSecond StreamNewResponseSchemaFieldsTimestampUnit = "second"` - `const StreamNewResponseSchemaFieldsTimestampUnitMillisecond StreamNewResponseSchemaFieldsTimestampUnit = "millisecond"` - `const StreamNewResponseSchemaFieldsTimestampUnitMicrosecond StreamNewResponseSchemaFieldsTimestampUnit = "microsecond"` - `const StreamNewResponseSchemaFieldsTimestampUnitNanosecond StreamNewResponseSchemaFieldsTimestampUnit = "nanosecond"` - `type StreamNewResponseSchemaFieldsJson struct{…}` - `Type StreamNewResponseSchemaFieldsJsonType` - `const StreamNewResponseSchemaFieldsJsonTypeJson StreamNewResponseSchemaFieldsJsonType = "json"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsStruct struct{…}` - `type StreamNewResponseSchemaFieldsList struct{…}` - `Format StreamNewResponseSchemaFormat` - `type StreamNewResponseSchemaFormatJson struct{…}` - `Type StreamNewResponseSchemaFormatJsonType` - `const StreamNewResponseSchemaFormatJsonTypeJson StreamNewResponseSchemaFormatJsonType = "json"` - `DecimalEncoding StreamNewResponseSchemaFormatJsonDecimalEncoding` - `const StreamNewResponseSchemaFormatJsonDecimalEncodingNumber StreamNewResponseSchemaFormatJsonDecimalEncoding = "number"` - `const StreamNewResponseSchemaFormatJsonDecimalEncodingString StreamNewResponseSchemaFormatJsonDecimalEncoding = "string"` - `const StreamNewResponseSchemaFormatJsonDecimalEncodingBytes StreamNewResponseSchemaFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat StreamNewResponseSchemaFormatJsonTimestampFormat` - `const StreamNewResponseSchemaFormatJsonTimestampFormatRfc3339 StreamNewResponseSchemaFormatJsonTimestampFormat = "rfc3339"` - `const StreamNewResponseSchemaFormatJsonTimestampFormatUnixMillis StreamNewResponseSchemaFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type StreamNewResponseSchemaFormatParquet struct{…}` - `Type StreamNewResponseSchemaFormatParquetType` - `const StreamNewResponseSchemaFormatParquetTypeParquet StreamNewResponseSchemaFormatParquetType = "parquet"` - `Compression StreamNewResponseSchemaFormatParquetCompression` - `const StreamNewResponseSchemaFormatParquetCompressionUncompressed StreamNewResponseSchemaFormatParquetCompression = "uncompressed"` - `const StreamNewResponseSchemaFormatParquetCompressionSnappy StreamNewResponseSchemaFormatParquetCompression = "snappy"` - `const StreamNewResponseSchemaFormatParquetCompressionGzip StreamNewResponseSchemaFormatParquetCompression = "gzip"` - `const StreamNewResponseSchemaFormatParquetCompressionZstd StreamNewResponseSchemaFormatParquetCompression = "zstd"` - `const StreamNewResponseSchemaFormatParquetCompressionLz4 StreamNewResponseSchemaFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `Inferred bool` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/pipelines" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) stream, err := client.Pipelines.Streams.New(context.TODO(), pipelines.StreamNewParams{ AccountID: cloudflare.F("0123105f4ecef8ad9ca31a8372d0c353"), Name: cloudflare.F("my_stream"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", stream.ID) } ``` #### Response ```json { "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 }, "schema": { "fields": [ { "type": "int32", "metadata_key": "metadata_key", "name": "name", "required": true, "sql_name": "sql_name" } ], "format": { "type": "json", "decimal_encoding": "number", "timestamp_format": "rfc3339", "unstructured": true }, "inferred": true } }, "success": true } ```