---
title: "End the session and release the browser"
method: POST
path: "/browser-sessions/{sid}:cancel"
tags: ["Cloud browser"]
---

# End the session and release the browser

`POST /browser-sessions/{sid}:cancel`

## Request

- Base URL: `https://api.customdomain.ai/v1`
- URL: `https://api.customdomain.ai/v1/browser-sessions/{sid}:cancel`
- Auth: one of:
  - HTTP bearer
  - none

Idempotent: a session that is already over answers its own state. During `applying` it stops at the next change boundary, never inside a change. A `navigator.sendBeacon` cannot set headers, so this route (and only this one) also accepts the token in the body, as `{"token": "..."}` with a content type of `text/plain` or JSON.

## Path parameters

- `sid` string, required

## Request body

- object
  - `token` string: The session token, when it cannot be sent as a header.

## Response `200`

The state the session is in.

- object
  - `state` string

## Other responses

- `401`: Error envelope: {code, title, details}.
- `404`: Error envelope: {code, title, details}.

---

[API](https://skmtc.dev/customdomain/apis/customdomain-control-plane-api.md) · [All operations](https://skmtc.dev/customdomain/apis/customdomain-control-plane-api/llms.txt) · [OpenAPI document](https://skmtc.dev/customdomain/apis/customdomain-control-plane-api/revisions/34d89cb7a7cd?raw)
