---
title: "Deletes collection."
method: DELETE
path: "/chats/{session_id}"
tags: ["Chat"]
---

# Deletes collection.

`DELETE /chats/{session_id}`

## Request

- Base URL: `https://h2ogpte.genai.h2o.ai/api/v1`
- URL: `https://h2ogpte.genai.h2o.ai/api/v1/chats/{session_id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/h2o/apis/h2ogpte-rest-api/docs/chats/:session_id/delete.ts> (a function with typed inputs; its response is checked against the schema)

Deletes collection with a given unique identifier.

## Path parameters

- `session_id` string, required

## Query parameters

- `timeout` number, double

## Response `204`

Successful operation

- ChatSession
  - `id` string, required
  - `name` string
  - `collection_id` string
  - `collection_name` string
  - `prompt_template_id` string
  - `latest_message_content` string
  - `updated_at` string, date-time, required
  - `workspace` string
  - `status` 'active' | 'expiring' | 'archived': Status of the chat session
  - `expiry_date` string, date-time: An expiry date for the chat session
  - `inactivity_interval` integer: Inactivity interval in days
  - `keep_forever` boolean: Whether the chat session is preserved from auto-archival
  - `username` string: Username of the session owner.
  - `archived_at` string, date-time: Timestamp when the chat session was archived
  - `source` 'user' | 'schedule': How the session was created — 'user' for user-initiated, 'schedule' for scheduled-task-triggered.

## Other responses

- `400`: Bad request
- `401`: Unauthorized - Invalid or missing API key
- `default`: Unexpected error

---

[API](https://skmtc.dev/h2o/apis/h2ogpte-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/revisions/a82a117320f4?raw)
