curl -X PUT https://stream.tonbo.dev/ds/demo/hello
curl -X PUT https://stream.tonbo.dev/ds/demo/hello \
-H 'Content-Type: application/json' \
--data-binary '{"msg": "first entry"}'
curl -X PUT https://stream.tonbo.dev/ds/demo/ephemeral \
-H 'Stream-TTL: 3600'
Streams
Create stream
Create a new append-only stream within a bucket.
PUT
/
ds
/
{bucket}
/
{stream}
curl -X PUT https://stream.tonbo.dev/ds/demo/hello
curl -X PUT https://stream.tonbo.dev/ds/demo/hello \
-H 'Content-Type: application/json' \
--data-binary '{"msg": "first entry"}'
curl -X PUT https://stream.tonbo.dev/ds/demo/ephemeral \
-H 'Stream-TTL: 3600'
string
required
Bucket ID. Must match
[a-z0-9_-]{4,64}.string
required
Stream ID within the bucket.
string
Content type of the initial payload (e.g.
application/json). Becomes the stream’s content type.string
Set to
true to close the stream immediately after creation.string
Time-to-live in seconds. The stream will expire after this duration.
string
Absolute expiration timestamp (RFC 3339). Mutually exclusive with
Stream-TTL.string
Conditional create: only succeed if the stream’s ETag matches.
string
Client-supplied sequence token for conflict detection.
string
Producer identity for exactly-once writes.
string
Producer epoch (must accompany
Producer-Id).string
Producer sequence number (must accompany
Producer-Id).binary
Optional initial payload. If provided, becomes the first entry in the stream.
Response
| Status | Meaning |
|---|---|
201 | Stream created. |
200 | Stream already exists with identical configuration (idempotent). |
400 | Invalid stream ID, invalid headers, or bad JSON payload. |
404 | Bucket not found. |
409 | Stream already exists with different configuration, or sequence conflict. |
412 | If-Match precondition failed. |
Location, Content-Type, Stream-Next-Offset, and ETag.
curl -X PUT https://stream.tonbo.dev/ds/demo/hello
curl -X PUT https://stream.tonbo.dev/ds/demo/hello \
-H 'Content-Type: application/json' \
--data-binary '{"msg": "first entry"}'
curl -X PUT https://stream.tonbo.dev/ds/demo/ephemeral \
-H 'Stream-TTL: 3600'
If a stream with the same ID already exists and has identical configuration, the response is
200 OK (idempotent). If the existing stream differs in content type, closed state, or retention, the response is 409 Conflict.
