---
canonical_url: "https://docs.composio.dev/reference/api-reference/tool-router/deleteToolRouterSessionBySessionId"
markdown_url: "https://docs.composio.dev/reference/api-reference/tool-router/deleteToolRouterSessionBySessionId.md"
product: "platform"
version: "3.1"
last_updated: null
---

# Delete a tool router session

**Documentation:** /reference/api-reference/tool-router/deleteToolRouterSessionBySessionId

> **API version:** This page documents Composio REST API v3.1, the current version, at `https://backend.composio.dev/api/v3.1`. `https://backend.composio.dev/api/v3` is the previous version and remains supported.

Deletes a tool router session. The session immediately stops being retrievable and executable — subsequent requests against it (including its MCP URL) return 404 — and any compute sandboxes attached to the session are shut down. Deleting an already-deleted session returns 404.

---

## DELETE `/api/v3.1/tool_router/session/{session_id}`

**Endpoint:** `https://backend.composio.dev/api/v3.1/tool_router/session/{session_id}`

**Summary:** Delete a tool router session

Deletes a tool router session. The session immediately stops being retrievable and executable — subsequent requests against it (including its MCP URL) return 404 — and any compute sandboxes attached to the session are shut down. Deleting an already-deleted session returns 404.

### Authentication

**ApiKeyAuth** - API Key in `header` header `x-api-key`

### Path Parameters

- `session_id` (string (toolRouterSessionId)) *(required)*: The unique identifier of the tool router session

### Responses

#### 200 - Session successfully deleted.

**Response Schema:**

- `session_id` (string (toolRouterSessionId)) *(required)*: The unique identifier of the deleted tool router session
- `deleted` (enum: "true") *(required)*: Always true — present to make the outcome explicit

**Example Response:**

```json
{
  "session_id": "string",
  "deleted": true
}
```

#### 400 - Bad request. This may occur if the session_id format is invalid, please pass this in trs_ prefix format

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 401 - Unauthorized. Authentication is required or the provided credentials are invalid.

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 404 - Not found. The session with the provided ID does not exist or has already been deleted.

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 500 - Internal server error.

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

### Example cURL Request

```bash
curl -X DELETE "https://backend.composio.dev/api/v3.1/tool_router/session/string" \
  -H "x-api-key: YOUR_API_KEY"
```

---

## REST API version

The current REST API version is **v3.1**, served at `https://backend.composio.dev/api/v3.1`. Prefer it for new code and new examples.

`https://backend.composio.dev/api/v3` is the previous version. It is frozen with pinned tool-version defaults and remains supported — existing v3 integrations keep working and do not need to migrate.