---
title: "Subscribe to task workflow events"
method: POST
path: "/task/{taskId}/subscribe"
tags: ["Task"]
---

# Subscribe to task workflow events

`POST /task/{taskId}/subscribe`

## Request

- Base URL: `https://api.chatbotkit.com/api/v1`
- URL: `https://api.chatbotkit.com/api/v1/task/{taskId}/subscribe`
- Auth: HTTP bearer

Subscribe to real-time task workflow events. The stream currently
includes operation begin, operation end, and error events emitted by
the task's conversation engine while a task execution is running. The
response uses the same streaming envelope shape as conversation
completion endpoints: each line is an event with a `type`, `createdAt`,
and `data`.

## Path parameters

- `taskId` string, required: The ID of the task

## Request body

- object
  - `historyLength` integer: Number of recent workflow events to replay before live events.

## Response `200`

Successfully subscribed to task workflow events

## Other responses

- `default`: An error response

---

[API](https://skmtc.dev/chatbotkit/apis/cbk-api.md) · [All operations](https://skmtc.dev/chatbotkit/apis/cbk-api/llms.txt) · [OpenAPI document](https://skmtc.dev/chatbotkit/apis/cbk-api/revisions/13d250576136?raw)
