HEAD /streams//records/tail
Retrieve the current tail position of a stream without reading any records. This is useful for:- Determining the current size of a stream
- Finding the starting position for a tail read
- Checking if new records have been appended since last read
- Verifying stream existence
Authentication
Requires a valid access token with read permissions to the stream.Path Parameters
string
required
Stream name to check.
Headers
string
required
Basin name where the stream resides.
Response
object
required
Current tail position of the stream.
Status Codes
200 OK- Tail position successfully retrieved403 Forbidden- Insufficient permissions404 Not Found- Stream does not exist408 Request Timeout- Operation timed out409 Conflict- Stream is being deleted
Examples
Check tail position
Response
- The stream has 1000 records (seq_num 0-999)
- The next append will receive seq_num 1000
- The last record has timestamp 1709481250000
Empty stream
Use tail for conditional append
Check for new records
Verify stream exists
Use Cases
Stream Size Calculation
Theseq_num in the tail response represents the total number of records in the stream (since sequence numbers start at 0).
Efficient Polling
Instead of repeatedly reading records, poll the tail position to detect changes:Read from N Minutes Ago
Combine tail check with timestamp-based reads:Notes
- This is a lightweight operation that doesn’t read record data
- The tail position may change immediately after this call due to concurrent appends
- For empty streams, both
seq_numandtimestampare 0 - Sequence numbers are always contiguous with no gaps
- The timestamp of the tail represents the last record’s timestamp, not the current time
- Deleted streams return
404 Not Found, not a zero tail