---
title: "Bulk delete persistent sessions"
method: POST
path: "/v1/projects/{project_id}/sessions/{environment_id}/bulk-delete"
tags: ["sessions"]
---

# Bulk delete persistent sessions

`POST /v1/projects/{project_id}/sessions/{environment_id}/bulk-delete`

## Request

- Base URL: `https://api.connic.co`
- URL: `https://api.connic.co/v1/projects/{project_id}/sessions/{environment_id}/bulk-delete`
- Auth: HTTP bearer

Permanently delete every non-internal persistent agent session, with its event history, that matches the optional `app_name` and `search` filters. Missing, null, or empty filters delete every non-internal session in the environment.

Required permission: `retrieval.manage`.

## Path parameters

- `project_id` string, uuid, required
- `environment_id` string, uuid, required

## Request body

- BulkDeleteSessionsRequest
  - `app_name` string, nullable: Non-empty agent application name to match exactly. An empty or null value applies no filter.
  - `search` string, nullable: Case-insensitive session ID pattern. Text is matched anywhere; an unescaped percent (%) matches any sequence and an unescaped underscore (_) matches one character. An empty value applies no search filter.

## Response `200`

Successful Response

- BulkDeleteSessionsResponse
  - `deleted_count` integer, required: Number of sessions deleted.

## Other responses

- `401`: Missing or invalid API key.
- `403`: The API key lacks the required permission or access to the environment.
- `404`: The resource does not exist in this project.
- `422`: Validation Error
- `429`: Rate limit exceeded.

---

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