> ## Documentation Index
> Fetch the complete documentation index at: https://routeme.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create or update a WebSocket node

> Creates or updates a WebSocket RPC node for one of the authenticated provider's plans. The URL must be a public wss:// endpoint (loopback, private, and link-local hosts are rejected) that accepts eth_subscribe("newHeads"); the server dials the node to verify before persisting. Returns the upserted node set to a healthy status.



## OpenAPI

````yaml /api-reference/openapi.json put /provider/nodes/ws
openapi: 3.0.0
info:
  title: RouteMesh API
  version: 1.0.0
  description: >-
    HTTP API for routing JSON-RPC requests across providers, managing API keys,
    and viewing usage.
  license:
    name: Proprietary
    url: https://routeme.sh
servers:
  - url: https://api.routeme.sh
    description: API server — health, chains, API keys, usage, and public submissions
  - url: https://lb.routeme.sh
    description: RPC router (primary load balancer)
  - url: https://lb2.routeme.sh
    description: RPC router (AWS backup load balancer)
security: []
tags:
  - name: RPC
    description: Forward JSON-RPC requests to the router.
  - name: Chains
    description: Discover supported chains.
  - name: Submissions
    description: Public chain and node listing requests (rate-limited per IP).
  - name: API Keys
    description: Manage your API keys for self-service access.
  - name: Usage
    description: View your usage and billing data.
  - name: Pricing
    description: >-
      Current RPC route and websocket notification prices (public,
      rate-limited).
  - name: Health
    description: Service health checks.
  - name: Provider
    description: >-
      Provider-scoped management endpoints for managing node plans, methods, and
      nodes. Authenticated with a management token whose customer is linked to a
      provider.
paths:
  /provider/nodes/ws:
    put:
      tags:
        - Provider
      summary: Create or update a WebSocket node
      description: >-
        Creates or updates a WebSocket RPC node for one of the authenticated
        provider's plans. The URL must be a public wss:// endpoint (loopback,
        private, and link-local hosts are rejected) that accepts
        eth_subscribe("newHeads"); the server dials the node to verify before
        persisting. Returns the upserted node set to a healthy status.
      operationId: upsertProviderWSNode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProviderWSNodeInput'
      responses:
        '200':
          description: WebSocket node upserted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderUpsertWSNodeResponse'
        '400':
          description: >-
            Invalid request body, non-public URL, or failed newHeads acceptance
            screening
        '401':
          description: Unauthorized
        '403':
          description: Provider not resolved
        '404':
          description: Plan not found (or not owned by the caller's provider)
        '409':
          description: URL already registered to another plan
        '500':
          description: Internal server error
      security:
        - MgmtKeyAuth: []
      servers:
        - url: https://api.routeme.sh
components:
  schemas:
    ProviderWSNodeInput:
      type: object
      properties:
        plan_id:
          type: integer
          description: >-
            Plan ID the WebSocket node belongs to (must be owned by the
            provider).
        chain_id:
          type: string
          description: Chain ID the node serves, e.g. 137.
        url:
          type: string
          description: Public wss:// endpoint URL; must accept eth_subscribe("newHeads").
      required:
        - plan_id
        - chain_id
        - url
    ProviderUpsertWSNodeResponse:
      type: object
      properties:
        message:
          type: string
        node_ws:
          type: object
        status:
          type: string
          description: healthy on success.
  securitySchemes:
    MgmtKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        Management token from the RouteMesh dashboard (Settings → Management
        Tokens). Required for customer API endpoints (/api-keys, /usage). Tokens
        are prefixed rmtm_ and scoped to your account. Authenticate by passing
        the token in the X-Api-Key header. Separate from RPC service keys (rm_),
        which authenticate dApp traffic to the routing layer.

````