Skip to main content
The /delete_by_intent endpoint allows you to remove knowledge entries that match a specific intent.

Base URL

POST https://osmosis.gulp.dev/delete_by_intent

Authentication

Query Parameters

tenant_id
string
required
The tenant identifier
intent
string
required
The intent to match against
similarity_threshold
number
default:"0.5"
Optional similarity threshold for matching documents

Example Requests

curl -X POST 'https://osmosis.gulp.dev/delete_by_intent?tenant_id=api_key&intent=process%20refund&similarity_threshold=0.7' \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key"

Response

Success Response

deleted_count
number
required
Number of documents deleted
status
string
required
Operation status message
Example success response:
{
  "deleted_count": 5,
  "status": "Successfully deleted matching documents"
}

Error Response

detail
array
required
Array of validation errors
Example error response:
{
  "detail": [
    {
      "loc": ["query", "tenant_id"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}

Status Codes

Best Practices

  1. Similarity Threshold
    • Start with the default threshold of 0.5
    • Increase for more precise matching
    • Decrease for broader matching
    • Test with small deletions first
  2. Intent Formatting
    • Use clear, specific intents
    • Keep intents concise