Skip to content

Read committed event data

GET /v4/stream/{stream}/{tx}

Get event data by event ID. The path parameter stream specifies which stream to read from.

Path parameters

ParameterTypeDescription
streamstringRequired. The stream to read from.
txinteger<int64>Required. The event ID to retrieve.

Response

The response data is base64 encoded in the response for binary data, or JSON object for non-binary.

Example

Get text event

sh
curl --location 'https://api.litebase.io/v4/stream/sample/1' \
--header "Authorization: Bearer $LITEBASE_API_KEY"

Response:

json
HTTP/1.1 200 OK
Content-Type: application/json

"hello world"

Get JSON event

sh
curl --location 'https://api.litebase.io/v4/stream/sample/2' \
--header "Authorization: Bearer $LITEBASE_API_KEY"

Response:

json
HTTP/1.1 200 OK
Content-Type: application/json

{
    "name": "Braavos",
    "type": "city_created"
}

Get binary event data into a file

sh
curl --location --output image.png 'https://api.litebase.io/v4/stream/sample/3' \
--header "Authorization: Bearer $LITEBASE_API_KEY"

The event data will be saved as an PNG file in image.png.