bitcain docs
API Reference

Agent Dashboard

Agent swarm monitoring - real-time status, MTTR trends, incident tracking, pending approvals, and runbook effectiveness (requires admin role)

Get dashboard summary

GET
/api/agents/dashboard/summary

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/api/agents/dashboard/summary"
{
  "active_incidents": 0,
  "critical_incidents": 0,
  "resolved_today": 0,
  "avg_mttr_today_minutes": 0,
  "pending_approvals": 0,
  "active_agents": 0,
  "runbooks_applied_today": 0,
  "auto_resolution_rate": 0,
  "timestamp": "2019-08-24T14:15:22Z"
}

Get all agent statuses

GET
/api/agents/dashboard/agents

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/api/agents/dashboard/agents"
[
  {
    "agent_name": "string",
    "status": "active",
    "actions_total": 0,
    "actions_successful": 0,
    "actions_failed": 0,
    "success_rate": 0,
    "last_activity": "2019-08-24T14:15:22Z"
  }
]

Get agent metrics

GET
/api/agents/dashboard/agents/{agent_name}/metrics

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

agent_name*string

Query Parameters

period?string

Time period: 1h, 6h, 24h, 7d, 30d

Default"24h"
Match^(1h|6h|24h|7d|30d)$

Response Body

application/json

application/json

curl -X GET "https://loading/api/agents/dashboard/agents/string/metrics"
{
  "agent_name": "string",
  "period": "string",
  "actions_total": 0,
  "actions_successful": 0,
  "actions_failed": 0,
  "success_rate": 0,
  "avg_duration_seconds": 0,
  "incidents_resolved": 0,
  "patterns_extracted": 0,
  "runbooks_applied": 0,
  "prs_reviewed": 0
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get active incidents

GET
/api/agents/dashboard/incidents/active

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

severity?|

Filter by severity

limit?integer

Maximum results

Default50
Range1 <= value <= 100

Response Body

application/json

application/json

curl -X GET "https://loading/api/agents/dashboard/incidents/active"
[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "title": "string",
    "severity": "low",
    "status": "open",
    "incident_type": "string",
    "affected_services": [],
    "created_at": "2019-08-24T14:15:22Z",
    "resolved_at": "2019-08-24T14:15:22Z",
    "resolved_by": "string",
    "resolution_time_minutes": 0
  }
]
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get MTTR by severity

GET
/api/agents/dashboard/mttr

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/api/agents/dashboard/mttr"
[
  {
    "severity": "low",
    "incident_count": 0,
    "avg_mttr_minutes": 0,
    "min_mttr_minutes": 0,
    "max_mttr_minutes": 0,
    "median_mttr_minutes": 0
  }
]
GET
/api/agents/dashboard/mttr/trends

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

days?integer

Number of days

Default30
Range7 <= value <= 90

Response Body

application/json

application/json

curl -X GET "https://loading/api/agents/dashboard/mttr/trends"
[
  {
    "date": "2019-08-24T14:15:22Z",
    "avg_mttr_minutes": 0,
    "incident_count": 0
  }
]
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get pending approvals

GET
/api/agents/dashboard/approvals/pending

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/api/agents/dashboard/approvals/pending"
[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "action_type": "string",
    "action_details": {},
    "agent_name": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "expires_at": "2019-08-24T14:15:22Z",
    "slack_channel_id": "string"
  }
]

Get runbook effectiveness

GET
/api/agents/dashboard/runbooks/effectiveness

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

limit?integer

Maximum results

Default20
Range1 <= value <= 100

Response Body

application/json

application/json

curl -X GET "https://loading/api/agents/dashboard/runbooks/effectiveness"
[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "pattern_name": "string",
    "pattern_classification": "string",
    "description": "string",
    "success_count": 0,
    "failure_count": 0,
    "total_uses": 0,
    "effectiveness_score": 0,
    "confidence_level": "untested",
    "avg_resolution_time_minutes": 0,
    "last_used_at": "2019-08-24T14:15:22Z",
    "auto_created": false,
    "requires_approval": true
  }
]
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get PR review statistics

GET
/api/agents/dashboard/pr-reviews/stats

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

days?integer

Number of days

Default7
Range1 <= value <= 30

Response Body

application/json

application/json

curl -X GET "https://loading/api/agents/dashboard/pr-reviews/stats"
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Force-run an agent via repository_dispatch

POST
/api/agents/dashboard/{agent_slug}/force-run

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

agent_slug*string

Request Body

application/json

reason?|

Human-readable reason recorded in the dispatch payload

Response Body

application/json

application/json

curl -X POST "https://loading/api/agents/dashboard/string/force-run" \  -H "Content-Type: application/json" \  -d '{}'
{
  "agent_slug": "string",
  "event_type": "string",
  "dispatched": true,
  "dispatched_at": "2019-08-24T14:15:22Z",
  "triggered_by": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}