WebSockets · JSON Structure

Websocket Message Structure

Structure documentation for a WebSocket message as defined by RFC 6455. A message is composed of one or more frames with the same opcode.

Type: object Properties: 0
Full DuplexNetworkingReal-Time CommunicationRFC 6455Web Technology

Websocket Message Structure is a JSON Structure definition published by WebSockets.

Meta-schema:

JSON Structure

websocket-message-structure.json Raw ↑
{
  "title": "WebSocket Message Structure",
  "description": "Structure documentation for a WebSocket message as defined by RFC 6455. A message is composed of one or more frames with the same opcode.",
  "type": "object",
  "fields": [
    {
      "name": "opcode",
      "type": "integer",
      "required": true,
      "description": "Frame opcode: 0=continuation, 1=text, 2=binary, 8=close, 9=ping, 10=pong"
    },
    {
      "name": "fin",
      "type": "boolean",
      "required": true,
      "description": "Final frame flag — true if this is the last fragment of a message"
    },
    {
      "name": "masked",
      "type": "boolean",
      "required": true,
      "description": "Whether the payload is masked (required for client-to-server messages)"
    },
    {
      "name": "payloadLength",
      "type": "integer",
      "required": true,
      "description": "Length of the payload in bytes (7-bit, 16-bit, or 64-bit value)"
    },
    {
      "name": "maskingKey",
      "type": "string",
      "required": false,
      "description": "4-byte masking key (present only when masked=true)"
    },
    {
      "name": "payload",
      "type": "string",
      "required": false,
      "description": "Frame payload data (UTF-8 text for text frames, binary for binary frames)"
    },
    {
      "name": "rsv1",
      "type": "boolean",
      "required": false,
      "description": "Reserved bit 1 — used by extensions (e.g., permessage-deflate)"
    },
    {
      "name": "rsv2",
      "type": "boolean",
      "required": false,
      "description": "Reserved bit 2 — reserved for future use"
    },
    {
      "name": "rsv3",
      "type": "boolean",
      "required": false,
      "description": "Reserved bit 3 — reserved for future use"
    }
  ]
}

Work with this as data

Every JSON Structure here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for json structure

4 MCP tools reach this
  • find_json_structuresBrowse and filter every JSON Structure in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Structure
curl "https://apis.io/api/v1/json-structures/websocket-message-structure"
All json structure
curl "https://apis.io/api/v1/json-structures?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.