blazeauth
Protocol

Message format

How Blazeauth requests, responses, events, and binary streams are encoded over WebSocket.

Message format

Each Blazeauth operation is identified by a numeric usecase type and an operation-specific JSON payload.

Envelope

Client-to-server requests and server-to-client responses use the same JSON envelope:

  • type (number): the operation selector (APIUsecaseType).
  • payload (object): the operation-specific request or response body.
Message envelope
Every request is a { type, payload } JSON object.

Packet id (payload.id)

Every request payload contains an id field (uint64). The server copies this value into the response payload so you can match responses to requests.

Recommendations:

  • Keep id unique within a single WebSocket connection.
  • If you are implementing a JavaScript client, keep id within the safe integer range (<= 9007199254740991) because JSON numbers lose precision above that.

Responses and status

Most operations include a status field in the response payload.

  • status = 1 means OK.
  • status = 0 means “no status” (used in streaming scenarios and usually omitted from JSON).

See Status codes for the full list.

initialize
Bind the socket session to an application environment.

Levels

Some authorization-related responses include levels.

levels is a JSON array of strings.

Levels payload
levels is always a JSON array of strings.

Server-push events (panel events)

Blazeauth can send asynchronous events to the client.

  • Envelope type: 18 (panel_event_subscribe)
  • Payload id: 18446744073709551615 (uint64 max)
Panel event payload
Server-push event message shape.

See Panel events for the event type list.

Binary streaming messages

Some operations (file transfer) stream binary data.

For each streamed chunk the server sends two WebSocket messages:

  1. A JSON message with a TransferFileResponse payload (binary_data: true, chunk_size: N).
  2. A binary WebSocket frame containing exactly N bytes.

If chunk_size is 0, the server sends only the JSON message.

See File transfer for the exact streaming behavior.

Note about the envelope

The on-wire envelope (type + payload) is the format used by the Blazeauth socket server. If you use the official SDK, the SDK builds and parses this envelope for you.

On this page