Skip to main content
Manage incidents and dataset versions in the knowledge base. The system supports versioning, rollbacks, and soft deletion of inactive versions.

List Incidents

Retrieve all incidents from the active knowledge base version. Attempts to read from Qdrant first, falls back to local JSON file if unavailable.

Response

success
boolean
Whether the request was successful
incidents
array
Array of incident objects

Example Request

curl https://api.example.com/api/knowledge-base/incidents \
  -H "Authorization: Bearer $TOKEN"

Example Response

{
  "success": true,
  "incidents": [
    {
      "incident_id": "INC001",
      "title": "Database connection timeout",
      "description": "Production database experiencing intermittent connection timeouts",
      "action_taken": "Increased connection pool size and optimized query performance",
      "opened_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T14:20:00Z",
      "source": "servicenow"
    },
    {
      "incident_id": "INC002",
      "title": "API rate limit exceeded",
      "description": "Payment API returning 429 errors during peak traffic",
      "action_taken": "Scaled API instances and implemented request throttling",
      "opened_at": "2024-01-16T09:15:00Z",
      "updated_at": "2024-01-16T11:45:00Z",
      "source": "servicenow"
    }
  ]
}

Delete Incident

Delete a specific incident from both the JSON file and Qdrant vector database.

Path Parameters

incident_id
string
required
Unique incident identifier to delete

Response

success
boolean
Whether the deletion was successful
message
string
Human-readable status message

Example Request

curl -X DELETE https://api.example.com/api/knowledge-base/incidents/INC001 \
  -H "Authorization: Bearer $TOKEN"

Example Response

{
  "success": true,
  "message": "Incident deleted successfully"
}

Get Incident Logs

Retrieve recent incident ingestion logs showing which incidents were added to the knowledge base.

Query Parameters

limit
integer
default:"10"
Maximum number of log entries to return

Response

success
boolean
Whether the request was successful
logs
array
Array of log entries, ordered by creation time (newest first)

Example Request

curl https://api.example.com/api/knowledge-base/logs?limit=5 \
  -H "Authorization: Bearer $TOKEN"

Example Response

{
  "success": true,
  "logs": [
    {
      "id": "a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d",
      "incident_id": "INC150",
      "title": "CDN cache invalidation failed",
      "source": "servicenow",
      "created_at": "2024-03-01T16:30:00Z"
    },
    {
      "id": "b2c3d4e5-f6a7-5b6c-9d0e-1f2a3b4c5d6e",
      "incident_id": "INC149",
      "title": "SSL certificate expiration warning",
      "source": "servicenow",
      "created_at": "2024-03-01T15:45:00Z"
    }
  ]
}

List Dataset Versions

List all dataset versions with pagination. Versions represent snapshots of the knowledge base at different points in time.

Query Parameters

limit
integer
default:"20"
Maximum number of versions to return
offset
integer
default:"0"
Number of versions to skip (for pagination)

Response

success
boolean
Whether the request was successful
versions
array
Array of dataset version objects
total
integer
Total number of versions available
active_version_id
string
UUID of the currently active version

Example Request

curl https://api.example.com/api/knowledge-base/versions?limit=10&offset=0 \
  -H "Authorization: Bearer $TOKEN"

Example Response

{
  "success": true,
  "versions": [
    {
      "id": "a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d",
      "version_number": 5,
      "collection_name": "past_issues_v2",
      "status": "active",
      "is_active": true,
      "incident_count": 150,
      "source": "upload",
      "notes": "Q4 2024 incident data",
      "activated_at": "2024-03-01T10:00:00Z",
      "created_at": "2024-03-01T09:30:00Z",
      "updated_at": "2024-03-01T10:00:00Z"
    },
    {
      "id": "b2c3d4e5-f6a7-5b6c-9d0e-1f2a3b4c5d6e",
      "version_number": 4,
      "collection_name": "past_issues_v2_snapshot_4",
      "status": "inactive",
      "is_active": false,
      "incident_count": 120,
      "source": "servicenow",
      "activated_at": "2024-02-15T14:00:00Z",
      "created_at": "2024-02-15T13:45:00Z",
      "updated_at": "2024-03-01T10:00:00Z"
    }
  ],
  "total": 5,
  "active_version_id": "a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d"
}

Get Active Version

Retrieve the currently active dataset version.

Response

success
boolean
Whether the request was successful
version
object
Active version object (null if no version is active)Structure matches DatasetVersionResponse from List Versions endpoint.

Example Request

curl https://api.example.com/api/knowledge-base/versions/active \
  -H "Authorization: Bearer $TOKEN"

Example Response

{
  "success": true,
  "version": {
    "id": "a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d",
    "version_number": 5,
    "collection_name": "past_issues_v2",
    "status": "active",
    "is_active": true,
    "incident_count": 150,
    "source": "upload",
    "activated_at": "2024-03-01T10:00:00Z",
    "created_at": "2024-03-01T09:30:00Z"
  }
}

Get Version Details

Retrieve detailed information about a specific version.

Path Parameters

version_id
string
required
Version UUID

Response

Returns a single version object with full details (same structure as List Versions response).

Example Request

curl https://api.example.com/api/knowledge-base/versions/a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d \
  -H "Authorization: Bearer $TOKEN"

Rollback to Previous Version

Activate a previous version, making it the current active dataset. Deactivates the currently active version.

Path Parameters

version_id
string
required
Version UUID to activate

Request Body

notes
string
Optional notes explaining the reason for rollback

Response

success
boolean
Whether the rollback was successful
message
string
Confirmation message
version_id
string
UUID of the activated version

Example Request

curl -X POST https://api.example.com/api/knowledge-base/versions/b2c3d4e5-f6a7-5b6c-9d0e-1f2a3b4c5d6e/rollback \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "notes": "Rollback due to data quality issues in version 5"
  }'

Example Response

{
  "success": true,
  "message": "Rolled back to version 4",
  "version_id": "b2c3d4e5-f6a7-5b6c-9d0e-1f2a3b4c5d6e"
}

Delete Version

Permanently delete an inactive version and its associated Qdrant collection.
This operation is irreversible. Active versions cannot be deleted.

Path Parameters

version_id
string
required
Version UUID to delete

Response

success
boolean
Whether the deletion was successful
message
string
Confirmation message

Example Request

curl -X DELETE https://api.example.com/api/knowledge-base/versions/c3d4e5f6-a7b8-6c7d-0e1f-2a3b4c5d6e7f \
  -H "Authorization: Bearer $TOKEN"

Example Response

{
  "success": true,
  "message": "Version deleted"
}

Error Response (Active Version)

{
  "success": false,
  "message": "Cannot delete active version"
}

Build docs developers (and LLMs) love