1. API Overview
StreamSlate exposes a local WebSocket server for real-time event subscriptions and a REST API for command execution.
- WebSocket Endpoint:
ws://localhost:4321/ws
- REST API Base URL:
http://localhost:4321/api/v1
For developers and advanced users, StreamSlate offers a powerful WebSocket and REST API to build custom integrations and automate your workflow.
StreamSlate exposes a local WebSocket server for real-time event subscriptions and a REST API for command execution.
ws://localhost:4321/ws
http://localhost:4321/api/v1
Subscribe to real-time events from StreamSlate to react to changes in the application state. Events are sent as JSON objects.
{
"event": "pageChange",
"data": {
"currentPage": 5,
"totalPages": 10
}
}
pageChange
: Triggered when the current page changes.annotationAdded
: Fired when a new annotation is created.annotationRemoved
: Fired when an annotation is removed.toolChange
: Occurs when the active annotation tool changes.Control StreamSlate programmatically using our REST API. All endpoints return JSON responses.
POST /api/v1/page
Request Body:
{
"pageNumber": 3
}
POST /api/v1/annotations/toggle
Request Body:
{
"visible": false
}
Currently, the local API does not require authentication for ease of integration. For production environments or public-facing applications, consider implementing your own authentication layer if exposing the API.