PUT /v2/streaming/databases/{databaseName}/schemas/{schemaName}/pipes/{pipeName}/channels/{channelName}

restnot supportedData loading & unloading

docs.snowflake.com ↗

Snowpipe Streaming

The Open Channel operation creates or opens a new channel against a pipe or table. If the channel already exists, Snowflake bumps the client sequencer of the channel and returns the last committed offset token.

Syntax

PUT /v2/streaming/databases/{databaseName}/schemas/{schemaName}/pipes/{pipeName}/channels/{channelName}

Parameters

NameInRequiredDescription
databaseNamepathrequiredDatabase name, case-insensitive.
schemaNamepathrequiredSchema name, case-insensitive.
pipeNamepathrequiredPipe name, case-insensitive.
channelNamepathrequiredThe name of the channel that you create or re-open, case-insensitive.
offset_tokenbodyoptionalString used to set an offset token when opening a channel.
fail_on_uncommitted_rowsbodyoptionalBoolean. When true, the server rejects the request with HTTP 409 Conflict (ERR_CHANNEL_HAS_UNCOMMITTED_DATA) if the channel has uncommitted in-flight data. Otherwise, in-flight data is silently discarded and can slow co-located channels on the pipe (default: false). For how to use this field during recovery, see Recover a Named Channel after a REST error.
requestIdqueryoptionalA universally unique identifier (UUID) used to track requests through the system.
AuthorizationheaderrequiredAuthentication token
X-Snowflake-Authorization-Token-TypeheaderoptionalJWT/OAuth
Content-Type (required when the request has a body)headerrequiredMedia type of the request body. Use application/x-ndjson for append-rows requests. Use application/json for open-channel, drop-channel, and bulk channel-status bodies. Use application/x-www-form-urlencoded for the scoped-token exchange.
Content-EncodingheaderoptionalSpecifies the compression format of the payload. Supported: gzip, zstd.
User-AgentheaderoptionalIdentifies the client application. Recommended format: SnowpipeStreamingSDK/{version} ({platform}) {LANGUAGE}/{language_version} (app={partner-name}). Example: SnowpipeStreamingSDK/1.0.0 (Linux amd64) PYTHON/3.11.0 (app=MyPartnerApp).

Response

{ "next_continuation_token": "string", "channel_status": { "database_name": "string", "schema_name": "string", "pipe_name": "string", "channel_name": "string", "channel_status_code": "string", "last_committed_offset_token": "string", "created_on_ms": "long", "rows_inserted": "int", "rows_parsed": "int", "rows_error_count": "int", "last_error_offset_upper_bound": "string", "last_error_message": "string", "last_error_timestamp": "timestamp_utc", "snowflake_avg_processing_latency_ms": "int" } } next_continuation_token (String): An API-managed token that must be used in the subsequent Append Rows request. The token links a series of calls, ensuring a contiguous, in-order stream of data and maintaining the session state for exactly once delivery. channel_status (Object): A nested object with the following detailed information about the channel: database_name (String): The name of the database where the pipe is located. schema_name (String): The name of the schema where the pipe is located. pipe_name (String): The name of the specific pipe being used. channel_name (String): The name of the streaming channel. channel_status_code (String): A code that indicates the current status of the channel; for example, “ACTIVE”. last_committed_offset_token (String): The channel’s latest persisted rowset checkpoint. It can advance when a rowset checkpoint commits even if some or all rows were rejected. See Offset checkpoints and rejected rows. created_on_ms (Long): The timestamp, in milliseconds, when the channel was created. rows_inserted (Int): The total number of rows successfully inserted. rows_parsed (Int): The total number of rows parsed. rows_error_count (Int): The total number of rows that encountered an error. last_error_offset_upper_bound (String): A token that indicates the upper bound of the offset where the last error occurred. last_error_message (String): The message of the last error that occurred. last_error_timestamp (Long): The timestamp, in milliseconds, of the last error. snowflake_avg_processing_latency_ms (Int): The average processing latency of Snowflake in milliseconds. Use the same databaseName, schemaName, pipeName, and channelName for later open, append, drop, and status calls on that channel. Send open requests for one channel name one at a time. Overlapping open calls against the same name are rejected. Store next_continuation_token for the next append and last_committed_offset_token from this response when the open succeeds. For the recovery sequence, see Recover a Named Channel after a REST error.