API Reference
Complete REST and gRPC API documentation.
15 min readReference
On this page
REST API
The StreamHouse REST API is available on port 8080 by default. All endpoints accept and return JSON.
Topics API
CRUD operations for topic management.
text
# List all topics
GET /api/topics
# Get topic details
GET /api/topics/{name}
# Create a topic
POST /api/topics
Body: {
"name": "events",
"partitions": 6,
"config": {
"retention_ms": 604800000,
"compression": "lz4"
}
}
# Delete a topic
DELETE /api/topics/{name}Produce API
Send messages to topics.
text
# Produce a single message
POST /api/topics/{name}/produce
Body: {
"key": "user-123",
"value": {"event": "login"},
"headers": {"source": "web-app"}
}
# Produce a batch of messages
POST /api/topics/{name}/produce/batch
Body: {
"messages": [
{"key": "k1", "value": {"a": 1}},
{"key": "k2", "value": {"a": 2}}
]
}Consume API
Read messages from topics.
text
# Consume messages
GET /api/topics/{name}/consume?partition=0&offset=0&limit=100
# Consume with consumer group
POST /api/consumer-groups/{group}/subscribe
Body: {"topics": ["events"]}
# Commit offsets
POST /api/consumer-groups/{group}/commit
Body: {"offsets": {"events": {"0": 1000, "1": 500}}}gRPC API
The gRPC API is available on port 9092 and provides higher throughput for produce and consume operations. The protobuf definitions are available in the repository under proto/streamhouse.proto.