---
title: "Connect to a task's websocket"
method: GET
path: "/v1/tasks/{task-id}/websocket/{websocket-id}"
tags: ["changes and tasks"]
---

# Connect to a task's websocket

`GET /v1/tasks/{task-id}/websocket/{websocket-id}`

Establish a websocket connection to a specific task.

## Path parameters

- `task-id` string, required
- `websocket-id` string, required

## Other responses

- `101` — The connection is upgraded to the websocket protocol and the websocket connection is established. The full websocket protocol is not documented. For details, see the [Python client code](https://github.com/canonical/operator/blob/main/ops/pebble.py#L1818).

## Changes

- **2025-01-13** `20135041d803` — 2 info
  - api tag `changes and tasks` added
  - api tag `files` removed
- **2025-01-02** `1cb37312be6c` — 1 info
  - endpoint added
- **2024-12-22** `b3903318c3bd` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/canonical/apis/pebble-api/changes/v1/tasks/:task-id/websocket/:websocket-id/get.md)

---

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