Skip to main content

Overview

The Agents API allows you to programmatically execute any of the 20 SO1 agents, monitor their execution status, and retrieve results. Agents operate across 7 domains and implement specific capabilities within the FORGE automation framework.
Base URL: https://api.so1.io/v1/control-plane/agents

Available Agents

SO1 provides 20 production-ready agents across 7 domains:
DomainAgentsPurpose
Orchestrationfactory-orchestrator, forge-gatekeeperWorkflow coordination, gate validation
Automationworkflow-architect, webhook-engineer, schedule-optimizern8n workflow management
Engineeringhono-backend, nextjs-frontend, typescript-sharedCode generation
DevOpsrailway-deployer, github-actions, pipeline-auditorInfrastructure management
Documentationmintlify-author, api-documenter, runbook-writerContent creation
Promptsprompt-refiner, chain-architect, fragment-curatorVeritas library management
Incidentincident-commander, triage-responder, postmortem-analystEmergency response
See Agent Reference for complete specifications.

Execute Agent

Start an agent execution with specified context and parameters.

Endpoint

POST /v1/control-plane/agents/execute

Request Body

agentId
string
required
Agent identifier (e.g., mintlify-author, hono-backend)
taskType
string
required
Specific task for the agent to perform (agent-specific)
context
object
required
Task-specific context data (varies by agent and task type)
forge
object
FORGE stage and gate validation settings
execution
object
Execution mode and timeout settings
webhook
object
Webhook configuration for completion notifications

Example Request

curl -X POST https://api.so1.io/v1/control-plane/agents/execute \
  -H "Authorization: Bearer so1_key_abc123xyz" \
  -H "Content-Type: application/json" \
  -d '{
    "agentId": "mintlify-author",
    "taskType": "create-agent-reference",
    "context": {
      "agentName": "workflow-architect",
      "sourcePath": "/agents/automation/workflow-architect.md",
      "outputPath": "/docs/agents/automation/workflow-architect.mdx"
    },
    "forge": {
      "stage": "IMPLEMENT",
      "validateGates": true
    },
    "webhook": {
      "url": "https://your-app.com/webhooks/so1",
      "events": ["task.completed", "task.failed"],
      "secret": "whsec_abc123xyz789"
    }
  }'

Response

success
boolean
Indicates if request was accepted
data
object
Example Response
{
  "success": true,
  "data": {
    "taskId": "task-xyz789abc123",
    "status": "queued",
    "agentId": "mintlify-author",
    "taskType": "create-agent-reference",
    "createdAt": "2024-03-10T15:30:00Z",
    "estimatedDuration": 45
  },
  "meta": {
    "requestId": "req-abc123",
    "timestamp": "2024-03-10T15:30:00.123Z"
  }
}

Get Task Status

Retrieve the current status and details of an agent execution.

Endpoint

GET /v1/control-plane/agents/tasks/{taskId}

Path Parameters

taskId
string
required
Task identifier returned from execute endpoint

Example Request

curl -X GET https://api.so1.io/v1/control-plane/agents/tasks/task-xyz789abc123 \
  -H "Authorization: Bearer so1_key_abc123xyz"

Response

Example Response (Running)
{
  "success": true,
  "data": {
    "taskId": "task-xyz789abc123",
    "status": "running",
    "agentId": "mintlify-author",
    "taskType": "create-agent-reference",
    "progress": {
      "percentage": 67,
      "currentStep": "Generating code examples",
      "stepsCompleted": 4,
      "stepsTotal": 6
    },
    "createdAt": "2024-03-10T15:30:00Z",
    "startedAt": "2024-03-10T15:30:05Z",
    "estimatedCompletionAt": "2024-03-10T15:30:50Z"
  }
}
Example Response (Completed)
{
  "success": true,
  "data": {
    "taskId": "task-xyz789abc123",
    "status": "completed",
    "agentId": "mintlify-author",
    "taskType": "create-agent-reference",
    "result": {
      "filesCreated": [
        "/docs/agents/automation/workflow-architect.mdx"
      ],
      "filesModified": [],
      "linesWritten": 487,
      "output": {
        "documentationPath": "/docs/agents/automation/workflow-architect.mdx",
        "quality": {
          "completeness": 100,
          "examplesIncluded": true,
          "crossReferencesValid": true
        }
      }
    },
    "createdAt": "2024-03-10T15:30:00Z",
    "startedAt": "2024-03-10T15:30:05Z",
    "completedAt": "2024-03-10T15:30:47Z",
    "duration": 42
  }
}
Example Response (Failed)
{
  "success": true,
  "data": {
    "taskId": "task-xyz789abc123",
    "status": "failed",
    "agentId": "hono-backend",
    "taskType": "implement-endpoint",
    "error": {
      "code": "GATE_VALIDATION_FAILED",
      "message": "Entry gate validation failed: Missing required DESIGN stage outputs",
      "details": {
        "stage": "IMPLEMENT",
        "missingOutputs": ["schemaValidated", "endpointSpec"]
      }
    },
    "createdAt": "2024-03-10T15:30:00Z",
    "startedAt": "2024-03-10T15:30:05Z",
    "failedAt": "2024-03-10T15:30:12Z",
    "duration": 7
  }
}

List Agent Executions

Retrieve a paginated list of agent executions with optional filtering.

Endpoint

GET /v1/control-plane/agents/tasks

Query Parameters

agentId
string
Filter by specific agent
status
string
Filter by status: queued, running, completed, failed
limit
number
default:"20"
Number of results per page (1-100)
offset
number
default:"0"
Pagination offset
sortBy
string
default:"createdAt"
Sort field: createdAt, completedAt, duration
sortOrder
string
default:"desc"
Sort order: asc or desc

Example Request

curl -X GET "https://api.so1.io/v1/control-plane/agents/tasks?agentId=mintlify-author&status=completed&limit=10" \
  -H "Authorization: Bearer so1_key_abc123xyz"

Response

{
  "success": true,
  "data": {
    "tasks": [
      {
        "taskId": "task-xyz789",
        "agentId": "mintlify-author",
        "taskType": "create-agent-reference",
        "status": "completed",
        "createdAt": "2024-03-10T15:30:00Z",
        "completedAt": "2024-03-10T15:30:47Z",
        "duration": 47
      },
      // ... more tasks
    ],
    "pagination": {
      "total": 156,
      "limit": 10,
      "offset": 0,
      "hasMore": true
    }
  }
}

Cancel Task

Cancel a queued or running agent execution.

Endpoint

POST /v1/control-plane/agents/tasks/{taskId}/cancel

Path Parameters

taskId
string
required
Task identifier to cancel

Request Body

reason
string
Reason for cancellation (optional, for audit logs)

Example Request

curl -X POST https://api.so1.io/v1/control-plane/agents/tasks/task-xyz789/cancel \
  -H "Authorization: Bearer so1_key_abc123xyz" \
  -H "Content-Type: application/json" \
  -d '{"reason": "Duplicate execution detected"}'

Response

{
  "success": true,
  "data": {
    "taskId": "task-xyz789",
    "status": "cancelled",
    "cancelledAt": "2024-03-10T15:35:00Z"
  }
}
Running Tasks: Tasks in running state may take up to 30 seconds to fully cancel as the agent completes its current operation.

Get Agent Metadata

Retrieve metadata and capabilities for a specific agent.

Endpoint

GET /v1/control-plane/agents/{agentId}

Example Request

curl -X GET https://api.so1.io/v1/control-plane/agents/mintlify-author \
  -H "Authorization: Bearer so1_key_abc123xyz"

Response

{
  "success": true,
  "data": {
    "agentId": "mintlify-author",
    "name": "Mintlify Author",
    "domain": "Documentation",
    "forgeStage": "IMPLEMENT",
    "version": "1.0.0",
    "capabilities": [
      "create-agent-reference",
      "create-runbook",
      "update-navigation"
    ],
    "inputs": {
      "required": ["agentName", "sourcePath"],
      "optional": ["outputPath", "includeExamples"]
    },
    "outputs": {
      "filesCreated": "string[]",
      "documentationPath": "string",
      "quality": "object"
    },
    "averageDuration": 45,
    "successRate": 98.7
  }
}

Common Patterns

Polling for Completion

async function waitForCompletion(taskId: string): Promise<any> {
  const maxAttempts = 120; // 10 minutes with 5s intervals
  
  for (let attempt = 0; attempt < maxAttempts; attempt++) {
    const response = await fetch(
      `https://api.so1.io/v1/control-plane/agents/tasks/${taskId}`,
      { headers: { 'Authorization': `Bearer ${process.env.SO1_API_KEY}` } }
    );
    
    const { data } = await response.json();
    
    if (data.status === 'completed') {
      return data.result;
    } else if (data.status === 'failed') {
      throw new Error(data.error.message);
    }
    
    // Still running, wait and retry
    await new Promise(resolve => setTimeout(resolve, 5000));
  }
  
  throw new Error('Task timeout after 10 minutes');
}

Batch Agent Execution

async function executeBatch(tasks: AgentTask[]): Promise<string[]> {
  const executions = await Promise.all(
    tasks.map(task =>
      fetch('https://api.so1.io/v1/control-plane/agents/execute', {
        method: 'POST',
        headers: {
          'Authorization': `Bearer ${process.env.SO1_API_KEY}`,
          'Content-Type': 'application/json'
        },
        body: JSON.stringify(task)
      }).then(r => r.json())
    )
  );
  
  return executions.map(e => e.data.taskId);
}

const taskIds = await executeBatch([
  { agentId: 'mintlify-author', taskType: 'create-agent-reference', context: {...} },
  { agentId: 'api-documenter', taskType: 'generate-openapi', context: {...} },
  { agentId: 'runbook-writer', taskType: 'create-runbook', context: {...} }
]);

Error Codes

CodeDescriptionResolution
AGENT_NOT_FOUNDAgent ID does not existCheck available agents at /agents
INVALID_TASK_TYPETask type not supported by agentReview agent capabilities in metadata
GATE_VALIDATION_FAILEDFORGE gate requirements not metProvide required stage outputs
CONTEXT_VALIDATION_FAILEDMissing or invalid context fieldsCheck agent input requirements
TASK_TIMEOUTExecution exceeded timeout limitIncrease timeout or optimize task
RATE_LIMIT_EXCEEDEDToo many concurrent executionsReduce concurrency or upgrade tier
See Error Reference for complete error handling guide.