POST /streams//records
Append one or more records atomically to a stream. Records are assigned sequential sequence numbers and timestamps upon successful append.Authentication
Requires a valid access token with write permissions to the stream.Path Parameters
Stream name to append records to. Must be between 1 and 512 bytes in length.
Headers
Basin name where the stream resides.
Encoding format for record headers and body. Options:
base64- Base64-encoded binary data (default)utf8- UTF-8 text
Request body format:
application/json- JSON formatapplication/protobuf- Protocol Buffers formats2s/proto- S2S streaming protocol for bi-directional append
Response format:
application/json- JSON responseapplication/protobuf- Protobuf response
Request Body
Batch of records to append atomically. Must contain at least 1 and no more than 1000 records. The total size may not exceed 1 MiB of metered bytes.
Optional conditional append. Enforces that the sequence number assigned to the first record matches this value. If not, the append fails with
412 Precondition Failed.Optional fencing token for mutual exclusion. Must match the token previously set by a
fence command record. If not, the append fails with 412 Precondition Failed.Response
Position of the first appended record.
Position after the last appended record (exclusive).The difference between
end.seq_num and start.seq_num equals the number of records appended.Current tail position of the stream.This can be greater than
end if there were concurrent appends.Status Codes
200 OK- Records successfully appended400 Bad Request- Invalid request (e.g., empty batch, records too large)403 Forbidden- Insufficient permissions404 Not Found- Stream does not exist412 Precondition Failed- Conditional append failed (returns condition failure details)408 Request Timeout- Operation timed out409 Conflict- Stream is being deleted
Examples
Append a single record
Response
Append multiple records with base64 encoding
Conditional append with sequence number check
Fenced append
S2S Streaming Append
For high-throughput scenarios, use the S2S protocol with bi-directional streaming:AppendInput message, and responses stream back AppendAck messages.
See S2S Protocol for frame format details.
Notes
- Records within a batch are appended atomically - either all succeed or all fail
- Sequence numbers are strictly monotonic and have no gaps within a stream
- Timestamps are monotonic but may have duplicates if client-specified
- The total metered size includes headers and body but excludes protocol overhead
- Empty records (no headers, no body) are valid but occupy a sequence number