3 min readMar 29, 2026by jakub

Admin API

PRISM includes a built-in admin API for health checks, monitoring, cache management, and manual rendering.

Configuration

TOML
[admin]
enabled = true
address = "127.0.0.1:4001"
bearer_token = "your-secret-token"

The admin API runs on a separate port from the proxy. By default it binds to 127.0.0.1 (localhost only).

Authentication

When bearer_token is set, all admin requests require the Authorization header:

Bash
curl -H "Authorization: Bearer your-secret-token" http://localhost:4001/status

Endpoints

GET /health

Health check. Returns 200 if PRISM is running and Chrome is responsive.

Bash
curl http://localhost:4001/health
JSON
{"status": "ok"}

GET /status

Detailed status including uptime, cache stats, Chrome pool stats, and render counts.

Bash
curl http://localhost:4001/status
JSON
{
  "uptime_secs": 3600,
  "cache": {
    "entries": 1234,
    "memory_bytes": 52428800,
    "hit_rate": 94.2,
    "hits": 45231,
    "misses": 2847
  },
  "pool": {
    "tabs": 8,
    "active_renders": 3,
    "queued": 0,
    "total_renders": 48078,
    "recycled_tabs": 961
  },
  "circuit_breaker": "closed",
  "render_errors": 12
}

GET /metrics

Prometheus-format metrics for Grafana dashboards.

Bash
curl http://localhost:4001/metrics
# HELP prism_renders_total Total render requests
# TYPE prism_renders_total counter
prism_renders_total 48078

# HELP prism_render_duration_seconds Render duration histogram
# TYPE prism_render_duration_seconds histogram
prism_render_duration_seconds_bucket{le="0.5"} 12000
prism_render_duration_seconds_bucket{le="1.0"} 35000
prism_render_duration_seconds_bucket{le="2.0"} 45000
prism_render_duration_seconds_bucket{le="5.0"} 47800
prism_render_duration_seconds_bucket{le="10.0"} 48078

# HELP prism_cache_hit_ratio Cache hit ratio
# TYPE prism_cache_hit_ratio gauge
prism_cache_hit_ratio 0.942

POST /purge/url

Purge a single cached URL.

Bash
curl -X POST http://localhost:4001/purge/url \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "/products/shoes"}'

POST /purge/pattern

Purge cached URLs matching a glob pattern.

Bash
curl -X POST http://localhost:4001/purge/pattern \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"pattern": "/products/**"}'

POST /purge/all

Flush the entire cache.

Bash
curl -X POST http://localhost:4001/purge/all \
  -H "Authorization: Bearer $TOKEN"

POST /render

Manually trigger a render for a URL. Useful for cache warming.

Bash
curl -X POST http://localhost:4001/render \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "/products/shoes"}'

CLI

Bash
# Start PRISM
prism --config /etc/prism/config.toml run

# Validate configuration
prism --config /etc/prism/config.toml validate

# Show version
prism version
Was this page helpful?
PRISM Admin API — Trident PRISM — Trident HTTP Cache Proxy | qoliber Docs