Skip to content

API Guide

Nyk edited this page Mar 6, 2026 · 1 revision

API Guide

Last reviewed: 2026-03-06 Owner: backend

Use this page for day-to-day API integration and quick endpoint discovery.

Auth Patterns

Session auth:

curl -X POST http://localhost:3000/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"your-password"}'

API key auth:

curl http://localhost:3000/api/status -H "x-api-key: YOUR_API_KEY"

Core Endpoint Groups

  • Auth: /api/auth/*
  • Agents: /api/agents*
  • Tasks: /api/tasks*
  • Monitoring: /api/status, /api/activities, /api/sessions, /api/tokens
  • Integrations: /api/webhooks*, /api/github, /api/connect, /api/events
  • Admin/System: /api/settings, /api/gateway-config, /api/super/*

Common Flows

Create Task

curl -X POST http://localhost:3000/api/tasks \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"title":"Investigate latency spike","priority":"high"}'

Fetch Task Queue For Agent

curl "http://localhost:3000/api/tasks/queue?agent=research-bot" \
  -H "x-api-key: YOUR_API_KEY"

Read Agent Attribution

curl "http://localhost:3000/api/agents/42/attribution?hours=24&section=identity,audit,cost" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-agent-name: research-bot"

Contract Notes

  • Most endpoints require authenticated context.
  • Attribution is self-scoped by default; admin override requires ?privileged=1.
  • Validate payloads against current server behavior before automating large workflows.

API Source of Truth

Clone this wiki locally