> ## 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.

# Send a message

> Start or continue a session with a visitor message. Use the access token from bootstrap in the Authorization header. Include indexId on the query string.

<script src="/agent-playground-reply.js?v=14" defer />

<div id="webless-agent-history" />

## Try it in this order

<Steps>
  <Step title="1. Bootstrap">
    Open [Bootstrap](/api-reference/latest/agent/bootstrap). Enter your index
    ID, click **Try it**, then **Send**. The playground saves your
    `accessToken` for the next two pages. You can only use it on this site, and
    it expires in about 15 minutes.
  </Step>

  <Step title="2. Send a message">
    Open [Send a message](/api-reference/latest/agent/create-session). This page
    fills in your token and index ID. Send `Hello`. The playground saves your
    `sessionId` (`wrun_…`).
  </Step>

  <Step title="3. Stream the reply">
    Open [Stream events](/api-reference/latest/agent/session-stream). This page
    fills in your token and that `sessionId`. Click **Send** to read the reply.
  </Step>
</Steps>

To send another message, go back to **Send a message** and click **Send**
again. Then open **Stream events** once more. The playground updates the
session id to that new turn.

This is step 2. After you bootstrap, this page fills in your token. After
**Send**, open Stream events to read the reply.


## OpenAPI

````yaml api-reference/openapi-agent-runtime.json POST /eve/v1/session
openapi: 3.1.0
info:
  title: Webless Agent Runtime API
  description: >-
    Browser-facing endpoints for Agentic mode. Call these from the visitor's
    site; bootstrap returns a short-lived access token bound to that page's
    origin.
  version: v1
servers:
  - url: https://runtime.webless.ai
    description: Agent Runtime
security: []
paths:
  /eve/v1/session:
    post:
      tags:
        - Agent Runtime API
      summary: Send a visitor message
      description: >-
        Start or continue a session with a visitor message. Use the access token
        from bootstrap in the Authorization header. Include indexId on the query
        string.
      operationId: agentRuntimeCreateSession
      parameters:
        - name: indexId
          in: query
          required: true
          schema:
            type: string
          description: Your Webless index ID
          example: YOUR_INDEX_ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SessionMessageRequest'
            examples:
              default:
                value:
                  message: Hello
      responses:
        '202':
          description: Turn accepted. Read the reply from the session stream.
          headers:
            x-eve-session-id:
              schema:
                type: string
              description: Session ID for the stream route
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionAccepted'
              example:
                ok: true
                sessionId: wrun_01EXAMPLE
                status: accepted
        '401':
          description: Missing or invalid access token
        '403':
          description: Agent unavailable or token rejected for this origin
      security:
        - visitorBearer: []
components:
  schemas:
    SessionMessageRequest:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Visitor message. Hello is enough to see a reply.
          example: Hello
    SessionAccepted:
      type: object
      properties:
        ok:
          type: boolean
          example: true
        sessionId:
          type: string
          description: Pass this to the stream route.
          example: wrun_01EXAMPLE
        status:
          type: string
          example: accepted
  securitySchemes:
    visitorBearer:
      type: http
      scheme: bearer
      description: >-
        accessToken from POST /webless/v1/bootstrap. Get it on the Bootstrap
        docs page (Send in the playground) or use POST Send a message for the
        full flow.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.