---
title: "Attach session"
method: POST
path: "/session/{sessionID}/attach"
---

# Attach session

`POST /session/{sessionID}/attach`

Explicitly attach the current connection to a session (1:1 exclusive). Already attached by self is a no-op; attached by another connection returns 409. Header-less (global) callers are a no-op.

## Path parameters

- `sessionID` string, required

## Query parameters

- `directory` string
- `workspace` string

## Response `204`

Attached

## Other responses

- `404` — Not found
- `409` — Conflict

---

[API](https://skmtc.net/kaaass/apis/opencode.md) · [All operations](https://skmtc.net/kaaass/apis/opencode/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kaaass/opencode/versions/8bb9a15bd144/schema)
