Skip to content

Admin & Utility Endpoints

System health, Prometheus metrics, session memory, and dataset management endpoints.

Comprehensive health check of all backend services. No authentication required.

Checks connectivity and latency for each service with a 5-second timeout per check:

ServiceDescription
qdrantVector search engine
neo4jKnowledge graph database
postgresPrimary relational database
redisCache and rate limiting
artifact_storageFile storage (R2 or local)
worker_ingestARQ background worker heartbeat (stored in Redis)

The status field aggregates individual service health:

StatusMeaning
healthyAll services operational
degradedOne or more services down, but system partially functional
unhealthyAll services down
Terminal window
curl http://localhost:8000/v1/health
{
"status": "healthy",
"version": "0.12.0",
"stores": [
{ "name": "qdrant", "status": "up", "latency_ms": 3.2 },
{ "name": "neo4j", "status": "up", "latency_ms": 15.8 },
{ "name": "postgres", "status": "up", "latency_ms": 2.1 },
{ "name": "redis", "status": "up", "latency_ms": 0.8 },
{ "name": "artifact_storage", "status": "up", "latency_ms": 45.3 },
{ "name": "worker_ingest", "status": "up", "latency_ms": 1.2 }
],
"uptime_seconds": 86423.15
}

Prometheus-format metrics endpoint. Access is restricted by IP allowlist.

The endpoint is protected by the MetricsIPAllowlistMiddleware:

  • Allowed IPs are configured via VALTER_METRICS_IP_ALLOWLIST (CIDR notation supported, e.g., 10.0.0.0/8).
  • IP resolution respects cf-connecting-ip (Cloudflare) and x-forwarded-for (generic proxies).
  • If the allowlist is empty, the endpoint returns 403 Forbidden.
  • Requests from non-allowed IPs return 403 Forbidden.

The Prometheus endpoint exports counters, histograms, and gauges including:

  • valter_request_count — Total HTTP request count by method, path, status
  • valter_request_duration_seconds — Request latency histogram
  • valter_store_health — Per-service health gauge (1 = up, 0 = down)
  • valter_rate_limit_blocks_total — Rate limit block events
  • valter_rate_limit_redis_errors_total — Redis errors during rate limiting
Terminal window
curl http://localhost:8000/metrics

Session-scoped key-value storage backed by PostgreSQL with configurable TTL. Used by MCP tools to maintain conversation context across tool calls.

Store a key-value pair with optional TTL for session context.

ParameterTypeDefaultDescription
session_idstringrequiredSession identifier to scope memory entries
keystringrequiredMemory key (upsert semantics by session_id + key)
valuestringrequiredMemory value payload
ttl_secondsinteger86400Time-to-live in seconds (60 to 2,592,000 = 30 days)
Terminal window
curl -X POST http://localhost:8000/v1/memories \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"session_id": "session-abc123",
"key": "caso_atual",
"value": "REsp 1.234.567/SP - dano moral por atraso de voo",
"ttl_seconds": 3600
}'
{
"data": {
"id": "mem-d4e5f6a7-b8c9-0123-def0-123456789abc",
"session_id": "session-abc123",
"key": "caso_atual",
"value": "REsp 1.234.567/SP - dano moral por atraso de voo"
},
"meta": {
"trace_id": "a1b2c3d4-...",
"latency_ms": 5.3
}
}

List all memories for a session.

ParameterTypeDescription
session_idstring (query)Session identifier (required)
Terminal window
curl "http://localhost:8000/v1/memories?session_id=session-abc123" \
-H "Authorization: Bearer $API_KEY"
{
"data": [
{
"id": "mem-d4e5f6a7-...",
"session_id": "session-abc123",
"key": "caso_atual",
"value": "REsp 1.234.567/SP - dano moral por atraso de voo",
"created_at": "2026-02-28T14:30:00+00:00",
"expires_at": "2026-02-28T15:30:00+00:00"
}
],
"meta": {
"trace_id": "b2c3d4e5-...",
"latency_ms": 3.1
}
}

GET /v1/datasets/uploads/{dataset_item_id}

Section titled “GET /v1/datasets/uploads/{dataset_item_id}”

Retrieve metadata for a previously uploaded dataset item. Returns storage details, file metadata, and provenance information.

ParameterTypeDescription
dataset_item_idstring (path)Dataset item identifier
Terminal window
curl http://localhost:8000/v1/datasets/uploads/ds-item-789 \
-H "Authorization: Bearer $API_KEY"
{
"data": {
"id": "ds-item-789",
"sha256": "a1b2c3d4e5f6...",
"original_filename": "processo-12345.pdf",
"size_bytes": 2048576,
"storage_path": "/data/uploads/processo-12345.pdf",
"storage_backend": "r2",
"bucket": "valter-artifacts",
"object_key": "uploads/ds-item-789/processo-12345.pdf",
"storage_uri": "r2://valter-artifacts/uploads/ds-item-789/processo-12345.pdf",
"source_system": "projudi",
"extraction_id": "ext-abc123",
"included_policy": "full",
"created_at": "2026-02-28T10:00:00+00:00"
},
"meta": {
"trace_id": "c3d4e5f6-...",
"latency_ms": 8.4
}
}