---
title: "Subscribe To Chat"
method: GET
path: "/api/context-agent/chats/{chat_id}/subscribe"
tags: ["context-agent"]
---

# Subscribe To Chat

`GET /api/context-agent/chats/{chat_id}/subscribe`

## Request

- Base URL: `https://app.getdot.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://app.getdot.ai/api/context-agent/chats/{chat_id}/subscribe`
- Auth: one of:
  - API key in header `X-API-KEY`
  - API key in cookie `Authorization`
  - OAuth 2 (password, token URL `/api/auth/token`)

Reconnect to an in-flight chat's SSE stream without sending a new message.

Replays every logged event with index > after_index (the client's anchor from
GET /chats/{id}.last_event_index) and then tails the live log — the event log
is durable, so this works across workers.

Orphaned-run revival: if the chat looks in-flight but no worker holds its lock
and the engine's persisted conversation is unfinished (its worker was
SIGKILLed mid-run), this endpoint takes the lock and restarts the turn with
message=None so the run continues instead of hanging forever.

## Path parameters

- `chat_id` string, required

## Query parameters

- `after_index` integer

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/getdot/apis/dot-api-2.md) · [All operations](https://skmtc.dev/getdot/apis/dot-api-2/llms.txt) · [OpenAPI document](https://skmtc.dev/getdot/apis/dot-api-2/revisions/d26fe7163a7f?raw)
