Skip to content

Sources API

Manages data sources (Jira, Prometheus, Azure DevOps, custom webhooks) that feed telemetry into LogSys. Sources are referenced by name (the primary key) and optionally linked to an Application.


Endpoint Summary

Method Path Description
GET /api/sources List all sources
POST /api/sources Create a source
POST /api/sources/ephemeral Upload a file → in-memory events → Vector → Kafka
POST /api/sources/{name}/toggle Enable/disable a source
DELETE /api/sources/{name} Delete a source and its data

List Sources

GET /api/sources

Returns every registered source.

[
  {
    "name": "jira-prod",
    "type": "webhook",
    "connector": "jira",
    "status": "active",
    "enabled": true,
    "application_id": "3f3d2d5a-…",
    "last_event_at": "2026-08-11T09:12:44Z"
  }
]

Create Source

POST /api/sources
Field Type Required Description
name string yes Unique source name
type string no webhook, poll, file, …
connector string no jira, prometheus, azure-devops, custom
application_id string no UUID of the linked application

Errors

Code HTTP When
source_already_exists 409 Source name already in DB
— 429 Rate limit (source_create_limit) exceeded

When an application_id is provided, the source name is appended to the application's hosts list automatically.


Ephemeral Upload

POST /api/sources/ephemeral
Content-Type: multipart/form-data

Takes a file and processes it in memory → canonical events → streamed to Vector → Kafka, without persisting raw data.

Form Field Type Constraints Description
file file ≤ 10 MB CSV, JSON or TXT file
file_type string csv\|json\|txt File format
source_name string 1–120 chars Name of the source
application_id string optional UUID to link the source to

Response 202 Accepted

{
  "status": "accepted",
  "events_processed": 1243,
  "source_name": "billing-app",
  "detail": { "sent": 1243, "errors": 0 }
}

Errors

Code HTTP When
file_too_large 413 File exceeds 10 MB
file_parse_error 422 File unreadable or invalid format (raw message is NOT propagated)
empty_file 422 No rows parsed

The raw file content is never echoed back to the client to avoid leaking uploaded snippets.


Toggle Source

POST /api/sources/{name}/toggle?enabled=false

Enables or disables ingestion for a source without deleting it.


Delete Source

DELETE /api/sources/{name}

Cascades:

  1. All events (events table) matching the source
  2. All alerts with related_source == name
  3. The source row itself