---
title: "Sticky sessions"
method: GET
path: "/api/v1/plans/{id}/sessions"
tags: ["Plans & line generation"]
---

# Sticky sessions

`GET /api/v1/plans/{id}/sessions`

## Request

- Base URL: `https://hproxy.com`
- URL: `https://hproxy.com/api/v1/plans/{id}/sessions`
- Auth: API key in header `X-API-Key`

The sticky sessions a **Residential Premium** plan holds right now, up to 250 per page: the port and its protocol, the session label the line carried, the exit country, the session's full length, the seconds it has run and the seconds it has left. A session whose line was generated here also carries `targeting` (what the line aimed at: country, state or city, `asn`, `os`, exclusions, `strict`, `udp`), `line` (the exact line, with the plan's password) and `generatedAt`; a session opened with a session id of your own carries null in all three. A port holds any number of sessions, one per session id, so `total` can be far larger than the number of ports; read further pages with `page`. A sticky line opens its session on the first request. `POST /plans/{id}/release-sessions` ends sessions and takes exactly one of three bodies: `{"sessions": [{"port": 10000, "sessionId": "a41f9c02"}]}` ends exactly those (up to 1,000 per call), `{"ports": [10000]}` ends every session on those ports (up to 200 ports), `{"all": true}` ends every open session. The next request on a released line draws a fresh IP. The answer carries `releasedSessions` (how many ended), `released` (their ports), `notOpen` (named ports that held none) and `remaining`: a `ports` or `all` release ends at most 5,000 sessions per call, so call again until `remaining` is 0. Plans on other products answer 400.

## Path parameters

- `id` string, required

## Query parameters

- `page` integer
- `pageSize` integer
- `sessions` unknown[]
  - unknown
- `ports` integer
- `all` boolean

## Response `200`

Success

- object

## Other responses

- `400`: Invalid input. The body names the field and the accepted set.
- `401`: Missing or invalid API key.
- `429`: Rate limited. Retry after the delay in the response.

---

[API](https://skmtc.dev/hproxy/apis/hproxy-api.md) · [All operations](https://skmtc.dev/hproxy/apis/hproxy-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hproxy/apis/hproxy-api/revisions/9f6898fe76e2?raw)
