---
title: "Attach a websocket"
method: GET
path: "/websocket/attach"
tags: ["websocket"]
---

# Attach a websocket

`GET /websocket/attach`

If the nodeName query parameter is present, the request will be proxied to the underlying agent environment(endpoint).
If the nodeName query parameter is not specified, the request will be upgraded to the websocket protocol and
an AttachStart operation HTTP request will be created and hijacked.
**Access policy**: authenticated

## Query parameters

- `endpointId` integer, required
- `nodeName` string

## Response `200`

OK

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.net/portainer/apis/portainerce-api.md) · [All operations](https://skmtc.net/portainer/apis/portainerce-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/portainer/portainerce-api/versions/c0b0975cd11b/schema)
