---
title: "Cancel a test session"
method: POST
path: "/v1/test-sessions/{testSessionId}/cancel"
tags: ["Test sessions"]
---

# Cancel a test session

`POST /v1/test-sessions/{testSessionId}/cancel`

Cancels in-progress Playwright runs within the specified test session. Use the optional `sequenceId` field in the request body to cancel only specific results within the session; omit it to cancel everything still running.

Returns `204 No Content` once the cancellation requests have been dispatched. Returns `404 Not Found` if the test session does not exist.

## Path parameters

- `testSessionId` string, uuid, required — Test session ID.

## Headers

- `x-checkly-account` string, uuid — Your Checkly account ID, you can find it at https://app.checklyhq.com/settings/account/general

## Request body

- TestSessionsV1CancelRequest
  - `sequenceId` string[] — Subset of sequence IDs to cancel. Omit to cancel all in-progress sequences.

## Response `204`

Cancellation accepted.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `429` — Too Many Requests

---

[API](https://skmtc.net/checklyhq/apis/checkly-public-api.md) · [All operations](https://skmtc.net/checklyhq/apis/checkly-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/checklyhq/checkly-public-api/versions/9e903da4f3da/schema)
