HTTP endpoints
The server listens on http://localhost:4747 by default.
There is no login and no HTTPS.
All endpoints other than /api/mode and the documentation exist only with demo, kafka, nats, rabbitmq, webhooks, and serve.
Send events
Section titled “Send events”POST /events
Section titled “POST /events”Accepts events. The body can be one event, a JSON array of events, or one event on each line. An event can be a CloudEvent or a plain JSON record. See Events from plain JSON records.
The answer has the status 202 and this body:
{"accepted":1,"rejected":0}If the body is not UTF-8 text, the answer has the status 400.
POST /webhooks/NAME
Section titled “POST /webhooks/NAME”Accepts one webhook, and makes one event from it. The body does not have to be a CloudEvent.
NAME has 1 to 64 characters: letters, digits, ., _, and -.
Events from webhooks gives the fields of the event.
| Body | The data of the event |
|---|---|
| JSON | The JSON. |
A form (application/x-www-form-urlencoded) |
An object that has one text for each field. If the form has only a payload field with a JSON object, that object. |
| Other text | The text. |
| Empty | The event has no data. |
| Query parameter | What it does |
|---|---|
type=TEXT |
Gives the type of the event. |
correlation-field=NAME[,NAME] |
Gives the fields of the body that have the correlation ID. The server looks at these fields before the fields of --correlation-field. |
icon=VALUE |
Gives the lanes of this webhook an icon, for example icon=💳. See The icon of a lane. |
The server reads a body that has a Content-Length header, and a body with Transfer-Encoding: chunked.
The answer has the status 200 and this body:
{"accepted":true,"type":"stripe.payment_intent.succeeded","id":"evt_1"}| Status | Condition |
|---|---|
400 |
The body is not UTF-8 text. |
403 |
The server is read-only. |
404 |
The name is not valid, or there is no name. |
405 |
The request is a GET request that is not a verification request. |
The server does not check signatures, and it does not send a webhook again.
Some services send a verification request before they send webhooks. The server answers these requests, and makes no event:
| Request | Answer |
|---|---|
GET /webhooks/NAME?hub.challenge=TEXT |
TEXT |
GET /webhooks/NAME?challenge=TEXT |
TEXT |
POST with the JSON body {"type":"url_verification","challenge":"TEXT"} |
TEXT |
Read status
Section titled “Read status”GET /api/mode
Section titled “GET /api/mode”{"mode":"live","index":true,"readOnly":false,"demo":false,"latest":1796230000000}| Field | Meaning |
|---|---|
mode |
live with demo, kafka, nats, and serve. mock with day. |
index |
true if the server keeps the index of all values. false with --no-index, and with day. |
readOnly |
true if the server started with --read-only or --public. |
demo |
true if the server started with demo. |
latest |
The time of the latest event on the server, in milliseconds. 0 if there are no events. |
GET /api/stats
Section titled “GET /api/stats”{"received":1200,"stored":1180,"rejected":2,"late":0,"future":0,"duplicates":18,"indexBytes":36864}| Field | Meaning |
|---|---|
received |
The number of events that came in, from all inputs. |
stored |
The number of events that the server has now. |
rejected |
The number of events that were not JSON objects, or that did not have id, source, and type. |
late |
The number of events that came too late for their correct position. See Time and sequence of events. |
future |
The number of events that had a time more than 5 minutes after the current time. These events got their arrival time. |
duplicates |
The number of events that the server ignored, because it had the same source and id. |
indexBytes |
The memory that the index of all values uses, in bytes. This is an estimate. |
GET /api/event/SEQ
Section titled “GET /api/event/SEQ”Gives the stored JSON of one event. SEQ is the number of the event on this server.
The link of a view contains this number as event.
If there is no such event, the answer has the status 404.
POST /api/export
Section titled “POST /api/export”Gives stored events as NDJSON: one CloudEvent on each line. The page uses this endpoint for Export events.
The body is a JSON array of event numbers, for example [10,11,12]. The maximum is 100,000 numbers.
The answer has the events in the sequence of the array. It does not contain an event that the server deleted.
The header X-Streamview-Events gives the number of events in the answer.
If the body is not an array of numbers, or the array is too long, the answer has the status 400.
GET /api/correlation?value=TEXT
Section titled “GET /api/correlation?value=TEXT”Finds a correlation ID. The answer is {"id":N}, where N is the number that the page uses for this ID.
If no event has this correlation ID, the answer is {"id":null}.
Read and change settings
Section titled “Read and change settings”GET /api/sets, /api/colors, /api/pins, /api/order, /api/notes
Section titled “GET /api/sets, /api/colors, /api/pins, /api/order, /api/notes”Each endpoint gives one JSON value. sets, pins, order, and notes are arrays. colors is an object.
order is the sequence of the lanes after a person moved a lane.
PUT /api/sets, /api/colors, /api/pins, /api/order, /api/notes
Section titled “PUT /api/sets, /api/colors, /api/pins, /api/order, /api/notes”Each endpoint replaces the full value. The body must be JSON of the correct kind, and 256 KB or smaller.
The answer is {"saved":true}. If the body is not correct, the answer has the status 400.
The page writes these values. Their content is not a stable format.
Endpoints that the page uses
Section titled “Endpoints that the page uses”| Endpoint | What it gives |
|---|---|
GET / |
The page. |
GET /engine.wasm |
The engine. |
GET /fonts/Geist.woff2, GET /fonts/GeistMono.woff2 |
The fonts. |
GET /api/stream |
All events, in a binary format for the engine. The answer stays open, and new events come in continuously. |
GET /api/paths |
The fields of all events that the index has, as a JSON list of {"path": [...], "lanes": N}. |
GET /api/find?value=TEXT&path=JSON |
The fields that have the value TEXT, with the number of events for each: a JSON list of {"path": [...], "value": ..., "events": N}. With path, only that field. |
GET /api/match?q=JSON&since=SEQ |
The events that agree with filters on paths, in a binary format for the engine. q is a JSON list of {"path": [...], "value": ...}. With since, only the events with that sequence number or a higher one. |
The documentation
Section titled “The documentation”The server gives the documentation that is in the program, as Markdown. It is the same text as streamview docs.
| Endpoint | What it gives |
|---|---|
GET /llms.txt |
The list of all pages, with the address of each page. |
GET /llms-full.txt |
All pages, one after the other. |
GET /docs/NAME.md |
One page, for example /docs/connect-to-kafka.md. |
Read-only servers
Section titled “Read-only servers”With --read-only or --public, each request that is not a GET request gets this answer, with the status 403.
POST /api/export is the exception, because it only reads.
{"error":"this streamview is read-only"}