---
title: "Start or continue a workspace chat (SSE)"
method: POST
path: "/api/v1/workspaces/{workspace}/chat-pro-sse"
tags: ["Workspace Chat"]
---

# Start or continue a workspace chat (SSE)

`POST /api/v1/workspaces/{workspace}/chat-pro-sse`

Stream an AI investigation turn as Server-Sent Events. This is the endpoint the RunWhen UI and MCP `workspace_chat` tool use. Set `sessionId` to null on the first turn; reuse the `sessionId` from the response stream on follow-ups. To invoke a saved slash-command programmatically, set `message` to a markdown link `[command-name](http://chat-command/{commandId})` — the same format the UI sends.

## Path parameters

- `workspace` string, required

## Request body

- WorkspaceChatRequest — Start or continue a workspace chat turn. Set sessionId to null to create a new session; reuse the sessionId from the first SSE frame on follow-up turns. userId must be a valid email.
  - `userId` string, email, required — Caller identity — sessions are keyed on this value
  - `message` string, required — User message for this turn
  - `sessionId` string, nullable, required — Existing session id, or null to start a new session
  - `personaName` string, nullable — Assistant (persona) short name. Omit for the workspace default.
  - `workspaceName` string — Optional when workspace is in the URL path
  - `source` 'ui' | 'slack' | 'teams' — Chat surface — affects prompt-hub override resolution
  - `enableScrubbing` boolean
  - `kbSearchEnabled` boolean
  - `autoApproveReadonly` boolean — When true and sessionId is null, seed auto-approve for read-only task runs on the new session
  - `contextMessages` object[], nullable — Prior messages to seed session context (e.g. Slack thread history)
    - `role` string
    - `content` string

## Response `200`

SSE stream of ChatSseEvent JSON objects

## Other responses

- `400` — Invalid userId (must be email) or request body
- `401` — Missing or invalid Bearer token

---

[API](https://skmtc.dev/runwhen/apis/runwhen-platform-api.md) · [All operations](https://skmtc.dev/runwhen/apis/runwhen-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runwhen/runwhen-platform-api/revisions/9d1a64d4b1c1/schema)
