docs/api/resources.md

Resources API

CRUD on the five authored resources. Mirrors the concepts one-for-one.

All paths below are relative to https://<your-install>/api/v1/.

Agents

MethodPathDescription
GET/agentsList all agents for the tenant
GET/agents/:slugGet one agent + its wired skills + workflows
POST/agentsCreate an agent (requires write:resources)
PATCH/agents/:slugUpdate fields or the system prompt

Example: list

curl -H "Authorization: Bearer $TOKEN" https://.../api/v1/agents
{
  "agents": [
    {
      "slug": "sales-assistant",
      "name": "the Sales Assistant",
      "description": "Sales agent — discovery, deal analysis, proposals",
      "active": true,
      "skillSlugs": ["discovery_summary", "draft_followup_email", "..."],
      "workflowSlugs": ["discovery_followup"],
      "updatedAt": "2026-04-14T20:00:00Z"
    }
  ]
}

Skills

MethodPathDescription
GET/skillsList skills (query params: status, category, limit)
GET/skills/:slugFull manifest (including the prompt template if prompt-form)
POST/skillsCreate a prompt skill — { manifest, promptMd }
PATCH/skills/:slugUpdate manifest fields or the prompt

Workflows

MethodPathDescription
GET/workflowsList workflows
GET/workflows/:slugFull workflow manifest (steps + inputSchema)
POST/workflowsCreate a workflow
PATCH/workflows/:slugUpdate trigger, steps, or input schema

Objects

Object types are authored (YAML). Object instances are runtime data (documents, records pushed by connected systems).

MethodPathDescription
GET/objectsList all instances (query: type, status, limit)
GET/objects/typesList types (schemas only)
GET/objects/types/:slugType manifest + sourceRelevance weights
POST/objects/typesCreate an object type
GET/objects/:idInstance detail + linked documents
POST/objects/:slug/instancesIngest a new instance — main external-integration entry point
PATCH/objects/:idUpdate metadata / status

Example: ingest — use case #26 (construction field notes):

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Site 4821 inspection — east retaining wall",
    "metadata": {
      "siteId": "4821",
      "inspector": "mtorres",
      "severity": "medium"
    },
    "content": "Visible cracking along the footing at coordinates ..."
  }' \
  https://.../api/v1/objects/inspection/instances

Returns:

{ "id": 42, "slug": "inspection", "title": "Site 4821 ...", "createdAt": "..." }

The instance is now indexed (retrieval-visible), linkable from skill runs, and can be used as workflow input.

Sources

MethodPathDescription
GET/sourcesList configured sources + connection state
GET/sources/:slugSource config + retrieval overrides
POST/sources/:slug/reindexTrigger a reindex pass (optionally scoped to a filter)

Error shape

All endpoints return errors in a consistent shape:

{
  "error": {
    "code": "NOT_FOUND",
    "message": "No skill found for slug \"nonexistent\"",
    "details": { "slug": "nonexistent" }
  }
}

Common codes: UNAUTHORIZED, FORBIDDEN, NOT_FOUND, VALIDATION_FAILED, RATE_LIMITED, CONFLICT.