Departments Docs
API Reference
Complete API documentation for the Departments neural operating system. All endpoints are available via both GraphQL and REST, secured by Bearer token authentication.
Base URL
https://api.departments.cyrus365.com/v1
Authentication: Bearer token via Authorization header
Authentication
All API requests require a valid API token. Pass it in the Authorization header:
curl https://api.departments.cyrus365.com/v1/agents \
-H "Authorization: Bearer dep_live_c7x3k9m2_..." \
-H "Content-Type: application/json"| Header | Value | Required |
|---|---|---|
| Authorization | Bearer dep_live_<token> | Yes |
| Content-Type | application/json | Yes |
| X-Departments-Version | 4.2.7 | No (defaults to latest) |
| X-Request-Id | <uuid> | Recommended |
Agents
Manage agent lifecycles — deploy, list, inspect, and terminate.
GET
/agentsReturns all agents in the nexus.
// Response
{
"data": [
{
"id": "agt_c7x3k9m2",
"name": "cogniscan-Ω",
"status": "ACTIVE",
"role": "market-intelligence",
"uptime_seconds": 8472,
"throughput_ops": 847.3,
"latency_ms": 12,
"model": "gpt-4o",
"created_at": "2026-06-01T10:00:00Z"
}
],
"meta": {
"total": 4,
"page": 1,
"per_page": 10
}
}POST
/agents/deployDeploy a new agent from a configuration file.
// Request
{
"config": "agents/cogniscan.yml",
"replicas": 2,
"region": "us-neural-1",
"environment": { "DEP_DEBUG": "false" }
}
// Response
{
"job_id": "j_8k2m4x9q",
"agent_id": "agt_c7x3k9m2",
"status": "PROVISIONING",
"estimated_ready_seconds": 4
}DELETE
/agents/:idTerminate an agent and free its resources.
// Response
{
"id": "agt_c7x3k9m2",
"status": "TERMINATED",
"terminated_at": "2026-06-09T14:23:00Z",
"uptime_seconds": 15283,
"total_ops_processed": 12456789
}GraphQL Endpoint
The GraphQL endpoint is available at https://api.departments.cyrus365.com/graphql.
query GetAgentStatus {
agent(id: "agt_c7x3k9m2") {
name
status
metrics {
throughput
latency
memoryUsage
}
currentTask {
id
type
progress
}
}
nexus {
clusters {
id
region
activeAgents
loadPercent
}
}
}Example response:
{
"data": {
"agent": {
"name": "cogniscan-Ω",
"status": "ACTIVE",
"metrics": {
"throughput": 847.3,
"latency": 12.4,
"memoryUsage": 0.67
},
"currentTask": {
"id": "task_m9k2x7p3",
"type": "competitive-analysis",
"progress": 0.73
}
}
}
}WebSocket / Events
Subscribe to real-time agent events via WebSocket at wss://api.departments.cyrus365.com/events.
// Connect
const ws = new WebSocket("wss://api.departments.cyrus365.com/events?token=dep_live_...");
ws.onmessage = (event) => {
const { type, data } = JSON.parse(event.data);
switch (type) {
case "agent.status_change":
console.log(`Agent ${data.agent_id} is now ${data.status}`);
break;
case "consensus.result":
console.log(`Consensus reached: ${data.decision}`);
break;
case "alert.threshold":
console.warn(`${data.metric} exceeded threshold: ${data.value}`);
break;
}
};
// Available event types
// agent.status_change → Agent state transitions
// consensus.result → Decision outcomes
// alert.threshold → Metric threshold breaches
// task.completed → Task execution results
// nexus.scale_event → Auto-scaling notificationsError Codes
| Code | HTTP Status | Description |
|---|---|---|
| INVALID_AUTH | 401 | Missing or expired token |
| RATE_LIMITED | 429 | Too many requests (1000 req/s per token) |
| AGENT_NOT_FOUND | 404 | Agent ID does not exist |
| INSUFFICIENT_CREDITS | 402 | Account balance too low |
| DEPLOYMENT_FAILED | 500 | Agent failed to provision |
| CONSENSUS_TIMEOUT | 408 | Voting round exceeded timeout |