Skip to main content

Quickstart

These examples use placeholders. Replace lm_usr_your_key, lm_svc_your_key, and <account_id> with values from your Lumio account.

Create A Personal Key​

Create a personal key from a first-party user session or from an existing personal key that already has the required apikeys:create scope and feature:apikeys access:

curl -X POST https://api.lumio.vision/v1/api-keys \
-H "Authorization: Bearer lm_usr_bootstrap_key" \
-H "Content-Type: application/json" \
-d '{
"label": "Event reader",
"permissions": ["events:read"],
"expires_at": "2026-12-31T23:59:59Z"
}'

The response includes key once. Use that value as the bearer token for future calls.

Create A Service Key​

Service keys are account-owned and are the right default for server-side account integrations:

curl -X POST https://api.lumio.vision/v1/service-keys \
-H "Authorization: Bearer lm_usr_bootstrap_key" \
-H "Content-Type: application/json" \
-d '{
"label": "Chat relay",
"permissions": ["chat:read", "chat:write", "events:read"]
}'

Read Events Over REST​

curl "https://api.lumio.vision/v1/events?limit=25" \
-H "Authorization: Bearer lm_svc_your_key" \
-H "Accept: application/json"

The key must belong to the account and hold events:read.

Read Events Over GraphQL​

curl https://api.lumio.vision/v1/gql \
-H "Authorization: Bearer lm_usr_your_key" \
-H "Content-Type: application/json" \
-d '{"query":"query { events(filter: { limit: 25 }) { items { id type platform createdAt } } }"}'

GraphQL fields use camelCase even when the REST equivalent uses snake_case.

Send A Chat Message​

curl -X POST https://api.lumio.vision/v1/chat/send \
-H "Authorization: Bearer lm_usr_your_key" \
-H "Content-Type: application/json" \
-d '{
"platform": "twitch",
"message": "Hello from Lumio API"
}'

The key must hold chat:write, carry a user identity, and the account must have the chat feature enabled. Use a personal key for this REST endpoint.

Subscribe To Events With wscat​

Server-side wscat can send the bearer header during the upgrade:

wscat -c wss://api.lumio.vision/v1/ws \
-H "Authorization: Bearer lm_svc_your_key"

Then subscribe:

{"type":"subscribe","channel":"events:<account_id>"}

The key must hold events:read, belong to <account_id>, and the account must have feature:events enabled.

Browser WebSocket Flow​

Browser clients mint a WebSocket token first:

curl -X POST https://api.lumio.vision/v1/auth/ws-token \
-H "Authorization: Bearer lm_usr_your_key"

Then connect in the browser with the returned ws_token:

const socket = new WebSocket("wss://api.lumio.vision/v1/ws?token=" + encodeURIComponent(wsToken));

socket.addEventListener("open", () => {
socket.send(JSON.stringify({ type: "subscribe", channel: "events:<account_id>" }));
});

Never put an lm_usr_*, lm_svc_*, or lm_dev_* key in the WebSocket URL.