Skip to main content

API Reference

AgentArea exposes a REST API built with FastAPI. All endpoints are documented with OpenAPI and available via interactive Swagger UI when running locally.

Interactive Documentation

When running AgentArea locally, access the full interactive API docs at:

Authentication

All API requests require authentication via JWT bearer tokens or session cookies managed by Ory Kratos.
# Example: Authenticated request
curl -X GET http://localhost:8000/v1/agents \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

API Endpoint Groups

Agents

/v1/agentsCreate, read, update, and delete AI agents. Configure agent personalities, system prompts, and capabilities.

Skills

/v1/skillsManage reusable skill definitions that can be attached to agents. Skills define tools, prompts, and behaviors.

Tasks

/v1/tasksCreate and manage agent tasks. Stream task execution via SSE. Track task status and results.

MCP Servers

/v1/mcp-server-instancesProvision and manage MCP server instances. Configure managed, remote, and compound MCP servers.

Triggers

/v1/triggersSet up event-driven automation. Configure schedule, webhook, and event-based triggers for agents.

Events

/v1/eventsStream real-time events via SSE. Subscribe to task updates, agent status changes, and system events.

Key Endpoints

Agents

MethodEndpointDescription
GET/v1/agentsList all agents in workspace
POST/v1/agentsCreate a new agent
GET/v1/agents/{id}Get agent details
PATCH/v1/agents/{id}Update agent configuration
DELETE/v1/agents/{id}Delete an agent

Tasks

MethodEndpointDescription
POST/v1/tasksCreate and execute a task
GET/v1/tasks/{id}Get task status and result
GET/v1/tasks/{id}/eventsStream task events (SSE)

MCP Server Instances

MethodEndpointDescription
GET/v1/mcp-server-instancesList MCP server instances
POST/v1/mcp-server-instancesCreate a new MCP instance
GET/v1/mcp-server-instances/{id}Get instance details
DELETE/v1/mcp-server-instances/{id}Remove an instance

Skills

MethodEndpointDescription
GET/v1/skillsList all skills
POST/v1/skillsCreate a new skill
GET/v1/skills/{id}Get skill details
PATCH/v1/skills/{id}Update a skill

Common Patterns

Workspace Scoping

All API resources are scoped to the authenticated user’s workspace. You do not need to pass a workspace ID explicitly — it is derived from the authentication context.

Pagination

List endpoints support cursor-based pagination:
GET /v1/agents?limit=20&offset=0

Error Responses

All errors follow a consistent format:
{
  "detail": "Agent not found",
  "status_code": 404
}

SSE Streaming

Task execution events are streamed via Server-Sent Events:
curl -N http://localhost:8000/v1/tasks/{task_id}/events \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Events are delivered as JSON payloads with event and data fields.
For the complete, interactive API documentation with request/response schemas, run AgentArea locally and visit http://localhost:8000/docs.