POST
/
delete_by_intent
curl --request POST \
  --url https://osmosis.gulp.dev/delete_by_intent \
  --header 'x-api-key: <api-key>'
{}

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

Authorizations

x-api-key
string
header
required

Query Parameters

tenant_id
string
required
intent
string
required
similarity_threshold
number | null
default:0.5

Optional similarity threshold for matching documents

Response

200
application/json

Successful Response

The response is of type object.