Skip to content

REST API

The Agentfleet API is served at https://api.agentfleet.co.za. All endpoints live under /api and require a bearer token from the identity provider; role-based policies apply per operation. Roles follow the agentfleet:<role> naming convention (e.g. agentfleet:workflow-admin, agentfleet:eval-run-admin), and agentfleet:admin is a superuser with all permissions.

This page is a working overview of the most-used endpoints, not an exhaustive contract.

Conventions

  • Routes follow api/{controller} (e.g. api/resources, api/workflows, api/workflowinstances, api/evalsuites).
  • Mutations take JSON bodies; list endpoints support searchText and status filters, and most also expose a paged variant at /paged?pageNumber=&pageSize=.
  • Errors return standard problem responses; validation failures are 400 with per-field detail.

Resources & tools

Method & pathPurpose
POST /api/resourcesRegister an MCP resource (name, description, baseUrl, path).
POST /api/resources/{id}/import-toolsDiscover and upsert the resource's tools. Returns imported/updated counts.
PUT /api/resources/activate / deactivateManage the resource lifecycle.
GET /api/tools?resourceId=List tools (optionally filtered by resource, status, search text).
PUT /api/toolsUpdate a tool (e.g. correct a scope).

Steps & workflows

Method & pathPurpose
POST /api/stepsCreate a step (name, description, instruction, toolId).
POST /api/workflowsCreate a workflow (name, description).
POST /api/workflows/stepsAttach a step (workflowId, stepId, order).
PUT /api/workflows/activate / deactivateActivate a workflow so it can run (or deactivate it).

Runs

Runs are managed through the workflow instances controller.

Method & pathPurpose
PUT /api/workflowinstances/runQueue a runworkflowId, agentId, optional initialContext (see Run Inputs). Returns 202 with the instance id.
GET /api/workflowinstances/{id}Run state (Idle/Running/Completed/Failed/Cancelled) and failure reason.
GET /api/workflowinstances/{id}/contextThe run's context entries with provenance.
GET /api/workflowinstances/{id}/summaryAggregate metrics: step progress, tokens, latency, timing.
GET /api/workflowinstances/pagedPage through runs.
PUT /api/workflowinstances/cancelRequest cancellation of a running instance.

Queue a run

bash
curl -X PUT "https://api.agentfleet.co.za/api/workflowinstances/run" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "workflowId": "<workflow-id>",
    "agentId": "<agent-id>",
    "initialContext": {
      "task_id": "task-7f3a",
      "purpose": "instance-fulfilment",
      "customerRef": "C-1042"
    }
  }'
# → 202 Accepted { "workflowInstanceId": "…" }

Agents & model providers

Method & pathPurpose
POST /api/agentsCreate an agent (registered as a delegated agent with a secretless client).
PUT /api/agents / activate / deactivateManage the agent lifecycle.
POST /api/modelprovidersConfigure a model provider (models, default model, max tokens).
PUT /api/modelproviders/activate / deactivateManage the provider lifecycle.

Automation

Schedules fire a workflow on a cron cadence; event triggers fire it on an inbound Service Bus event. See Automation.

Method & pathPurpose
POST /api/schedulesCreate a schedule (workflowId, agentId, cron expression, input template).
PUT /api/schedulesUpdate a schedule.
PUT /api/schedules/enable / disableEnable or disable a schedule.
PUT /api/schedules/fireFire now — trigger a run on demand. Returns 202.
DELETE /api/schedulesDelete a schedule.
GET /api/schedules/{id} · GET /api/schedules/paged?workflowId=&isEnabled=Read schedules.
POST /api/eventtriggersCreate an event trigger (workflowId, agentId, event source, event-type filter, input mapping).
PUT /api/eventtriggers · enable · disable · DELETE /api/eventtriggersManage the trigger lifecycle.
GET /api/eventtriggers/{id} · GET /api/eventtriggers/paged?workflowId=&isEnabled=Read event triggers.

Evaluations

Eval suites are managed at api/evalsuites; eval runs at api/evalruns. See Evaluations.

Method & pathPurpose
POST /api/evalsuitesCreate a suite (name, description, targetWorkflowId, optional targetStepId, agentId, scoringRubric).
PUT /api/evalsuitesUpdate a suite (bumps its version).
POST /api/evalsuites/casesAdd a case (evalSuiteId, name, input, optional agentId, method, expectedOutput, passThreshold).
DELETE /api/evalsuites/{id}/cases/{caseId}Remove a case.
GET /api/evalsuites/{id} · GET /api/evalsuites?searchText=&status=Read suites (with their cases).
POST /api/evalrunsStart a runevalSuiteId, optional passThreshold (default 1.0). Returns 202.
GET /api/evalruns/{id}A run with its per-case results.
GET /api/evalruns?evalSuiteId=List runs, most-recent first.
GET /api/evalruns/score-trend/{evalSuiteId}The suite's score-over-time trend.
GET /api/evalruns/{id}/evidence-reportDownload the completed run's evidence report as a JSON attachment.

Start an eval run

bash
curl -X POST "https://api.agentfleet.co.za/api/evalruns" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "evalSuiteId": "<suite-id>", "passThreshold": 0.8 }'
# → 202 Accepted { "evalRunId": "…" }

Observability

Method & pathPurpose
GET /api/modelcalls?workflowInstanceId=Model calls for a run (tokens, latency, round, input/output). Also filterable by stepInstanceId; paged.
GET /api/toolcalls?workflowInstanceId=Tool calls for a run.
GET /api/agentinstances · GET /api/stepinstancesThe agent and step instances behind a run.
GET /api/activities/pagedThe platform-wide audit activity feed.
GET /api/search?searchText=&limit=Cross-entity search over agents, steps, tools, resources, and workflows (results are permission-filtered).
GET /healthUnauthenticated health probe (includes a database check).

Run operations

Operational endpoints for the durable run queue, dead-letter recovery, and resuming paused (waiting) instances. Require the agentfleet:run-operations-admin role.

Method & pathPurpose
GET /api/runoperations/queuePoint-in-time run-queue depth by disposition.
GET /api/runoperations/dead-lettersRuns parked in the dead-letter store.
POST /api/runoperations/dead-letters/requeueRequeue a dead-lettered run. Returns 202.
GET /api/runoperations/pausedInstances paused on a wait step.
POST /api/runoperations/paused/resumeResume a waiting instance when its wait outcome arrives.

Agentfleet — agent workflow orchestration.