---
title: "Delete By Intent"
method: POST
path: "/delete_by_intent"
tags: ["knowledge"]
---

# Delete By Intent

`POST /delete_by_intent`

Delete documents from the knowledge store based on intent similarity.

This endpoint:
1. Takes an intent and tenant_id
2. Searches for documents with similar intent using the default similarity threshold
3. Deletes matching documents
4. Returns the count of deleted documents

Args:
    tenant_id: The tenant identifier
    intent: The intent to match against
    similarity_threshold: Optional threshold for similarity matching

Returns:
    Dict containing:
        - deleted_count: Number of documents deleted
        - status: Operation status message

Raises:
    HTTPException: If deletion fails

## Query parameters

- `tenant_id` string, required
- `intent` string, required
- `similarity_threshold` number, nullable — Optional similarity threshold for matching documents

## Response `200`

Successful Response

- object

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/osmosis/apis/osmosis-agent-improvement-api.md) · [All operations](https://skmtc.net/osmosis/apis/osmosis-agent-improvement-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/osmosis/osmosis-agent-improvement-api/versions/1776d48631c4/schema)
