POST /v2/streaming/data/databases/{databaseName}/schemas/{schemaName}/pipes/{pipeName}/channels/{channelName}/rows
restnot supportedData loading & unloadingThe Append Rows operation inserts a batch of rows to the given channel. Send this request to the ingest hostname returned by Get Hostname, not to your Snowflake account hostname. Set the continuationToken query parameter to the next_continuation_token value returned by the Open Channel request for the first request, and to the next_continuation_token value returned by the previous Append Rows response for each later request.
Syntax
POST /v2/streaming/data/databases/{databaseName}/schemas/{schemaName}/pipes/{pipeName}/channels/{channelName}/rows
Parameters
| Name | In | Required | Description |
|---|---|---|---|
databaseName | path | required | Database name, case-insensitive. |
schemaName | path | required | Schema name, case-insensitive. |
pipeName | path | required | Pipe, case-insensitive. |
channelName | path | required | Channel name, case-insensitive. |
continuationToken | query | required | Continuation token from Snowflake. It encapsulates both client and row sequencers. Use next_continuation_token from the latest successful open or append response. See Named Channel append workflow. |
offsetToken | query | optional | User-defined source offset for this request. Set offsetToken on each append so a later open-channel response can return it as last_committed_offset_token. For how this token differs from continuationToken, see Roles of offsetToken and continuationToken. |
startOffsetToken | query | optional | Offset token for the first row in the batch. |
endOffsetToken | query | optional | Offset token for the last row in the batch. |
rows | body | required | The actual data payload to be ingested in NDJSON format. The maximum allowed size for this attribute is 4 MB. |
requestId | query | optional | A UUID used to track requests through the system. |
Authorization | header | required | Authentication token |
X-Snowflake-Authorization-Token-Type | header | optional | JWT/OAuth |
Content-Type (required when the request has a body) | header | required | Media 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-Encoding | header | optional | Specifies the compression format of the payload. Supported: gzip, zstd. |
User-Agent | header | optional | Identifies 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). |
Usage notes
- Every Named Channel append request must include a continuation token. Snowflake issues this token, and your client sends it back unchanged. You get the first token when you open the channel. Each successful append returns the token to use for the next append.
- Call Open a Named Channel. In the JSON response body, read the top-level next_continuation_token field and save its value in your client.
- Send an Append Rows request. Set these query parameters: continuationToken: The saved token value, unchanged.
- offsetToken: Your source offset for this batch, such as a Kafka offset. This value records exactly-once progress, and a later open-channel response returns it as last_committed_offset_token.
- When the append succeeds, read next_continuation_token from the append response body. Replace your saved token with this new value, and discard the old one.
- Repeat steps 2 and 3 for each batch.
- Send appends for one channel one at a time. Wait for each append response before you send the next append, because the next request needs the token from that response.
- The request body must be a non-empty NDJSON rowset, and the payload sent on the network must be 4 MB or smaller. For retries, see REST API retry policy. For Named Channel recovery, see Recover a Named Channel after a REST error.
- The JSON text within the NDJSON payload must strictly conform to the RFC 8259 standard. Each JSON text must be followed by a newline character \n (0x0A). You can also insert a carriage return \r (0x0D) before the newline character.
Response
{ "next_continuation_token": "string" } next_continuation_token (string): The next continuation token from Snowflake, which encapsulates both client and row sequencers. It should be used for inserting the next batch.