---
title: "Clear History"
method: DELETE
path: "/api/v1/agents/{system}/{entity_id}/history"
tags: ["v1", "Agent Chat", "agent-chat"]
---

# Clear History

`DELETE /api/v1/agents/{system}/{entity_id}/history`

## Request

- Base URL: `https://api.jeevyfabrication.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.jeevyfabrication.com/api/v1/agents/{system}/{entity_id}/history`
- Auth: none declared

Clear conversation history — rotates the conversation to a fresh
thread (JEEVY-1691a slice 1), so no state channel, queued memory job,
or later turn from before the clear reaches the next message.

lifecycle.clear_* tombstones the CURRENT thread and bumps the
generation (the write that actually rotates the conversation — fails
loud, no silent success). ``lifecycle.clear_thread_messages`` on the
just-retired old thread stays too (JEEVY-1679's RemoveMessage
sentinel, not a plain empty-list write — see that helper's docstring)
— belt and braces: harmless once the thread is rotated away from,
since nothing resolves to it again.
For shop, thread is resolved from session (shop_id + user + instance_id query).

JEEVY-1740: ``keep_draft_ids``, if given, are kept (as project/
quote-owned copies) INSIDE ``lifecycle._clear``, before the tombstone
insert — a keep failure means this clear fails closed (nothing
tombstoned) rather than silently dropping what the caller asked to
keep.

## Path parameters

- `system` string, required
- `entity_id` string, required

## Query parameters

- `instance_id` string: Chat instance id (default 'default'). Shop: per-user tab. Estimator/project_manager: additional tabs on the same quote/project.
- `keep_draft_ids` string[]: Draft ids to keep (as project/quote-owned copies, JEEVY-1740) before this clear tombstones their conversation. Omit for today's behavior — a plain clear with nothing kept.

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-20** `9eebba4f395d`: 1 info
  - added the new optional `query` request parameter `keep_draft_ids`

[Operation history](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api/changes/api/v1/agents/:system/:entity_id/history/delete.md)

---

[API](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api.md) - [All operations](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api/revisions/ad9a01abeac9?raw)
