Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.webless.ai/llms.txt

Use this file to discover all available pages before exploring further.

Generate one sessionId per browser session and one requestId per user action. Reuse both values across the coordinated calls for that action.

Environments

EnvironmentREST base URLWebSocket URL
Staginghttps://api.staging.webless.aiwss://api.staging.webless.ai/api/v1/ws
Productionhttps://api.webless.aiwss://api.webless.ai/api/v1/ws
Use ws:// only for local development.

Request flow

Latest and legacy routes

UseLatest
Query tilesPOST /api/v1/queries
Stream summarywss://api.webless.ai/api/v1/ws
Select CTAPOST /api/v1/cta-selection
Get suggestionsPOST /api/v1/suggestions

Orchestrate the full experience

Create identifiers

Create a sessionId once per user session. Create a new requestId for each query or action.

Fetch tiles with /api/v1/queries

Call POST /api/v1/queries to fetch the top content tiles for the query. Keep the same sessionId and requestId you will use everywhere else.

Stream the summary over WebSocket

Open /api/v1/ws and send the get_summary_with_cache action. Append summary_part chunks as they arrive, then finalize the UI when you receive summary_complete.

Fetch a CTA and suggestions in parallel

Call POST /api/v1/cta-selection and POST /api/v1/suggestions with the same IDs so the platform can correlate the entire experience.

WebSocket request

{
  "action": "get_summary_with_cache",
  "params": {
    "query": "What does Webless do?",
    "company": "YOUR_COMPANY",
    "requestId": "YOUR_REQUEST_ID",
    "sessionId": "YOUR_SESSION_ID",
    "version": "published",
    "markdown": true,
    "number_of_tiles": 6,
    "summary_word_limit": 120
  }
}

WebSocket events

EventMeaning
summary_partA streamed chunk of summary text
summary_tilesTile IDs emitted near completion
summary_completeThe stream finished successfully
errorThe request failed

JavaScript example

const sessionId = getOrCreateSessionId();
const requestId = crypto.randomUUID();

const ws = new WebSocket("wss://api.webless.ai/api/v1/ws");

ws.onopen = () => {
  ws.send(
    JSON.stringify({
      action: "get_summary_with_cache",
      params: {
        query: "What does Webless do?",
        company: "YOUR_COMPANY",
        requestId,
        sessionId,
        version: "published",
        number_of_tiles: 6,
        markdown: true,
        summary_word_limit: 120
      }
    })
  );
};

ws.onmessage = (event) => {
  const message = JSON.parse(event.data);

  if (message.event === "summary_part") {
    appendSummary(message.data.summary_part);
  } else if (message.event === "summary_tiles") {
    renderTileIds(message.data.summary_tiles);
  } else if (message.event === "summary_complete") {
    finalizeExperience();
  } else if (message.event === "error") {
    console.error(message.data?.message);
  }
};
Use the pages in API reference for request and response schemas. Use this guide for orchestration and WebSocket behavior.