Skip to content
API Blog

Agent Management

Lobu exposes a settings API at /api/v1/agents for managing agents at runtime. Both the admin page and CLI commands use this API.

Agents are created via lobu.toml (at startup) or the API (at runtime):

Terminal window
# Via API
curl -X POST http://localhost:8080/api/v1/agents \
-H "Authorization: Bearer $ADMIN_PASSWORD" \
-H "Content-Type: application/json" \
-d '{ "agentId": "support", "name": "Support Agent" }'

Returns the agent ID and a settings URL for configuration.

Terminal window
curl http://localhost:8080/api/v1/agents \
-H "Authorization: Bearer $ADMIN_PASSWORD"

Returns all agents with their name, description, channel count, and last activity.

Terminal window
curl -X PATCH http://localhost:8080/api/v1/agents/support \
-H "Authorization: Bearer $ADMIN_PASSWORD" \
-H "Content-Type: application/json" \
-d '{ "name": "Customer Support", "description": "Handles billing and account questions" }'
Terminal window
curl -X DELETE http://localhost:8080/api/v1/agents/support \
-H "Authorization: Bearer $ADMIN_PASSWORD"

Unbinds all platform channels and removes the agent configuration.

Fetch the full configuration for an agent:

Terminal window
curl http://localhost:8080/api/v1/agents/support/config \
-H "Authorization: Bearer $ADMIN_PASSWORD"

This returns everything about the agent:

SectionWhat it contains
providersInstalled providers, connection status, model preferences, available catalog
instructionsIdentity, soul, and user prompts (the IDENTITY.md / SOUL.md / USER.md content)
skillsEnabled skills with metadata, MCP server status
mcpServersCustom MCP server configurations
toolsNix packages, domain grants, active schedules
settingsVerbose logging, memory enabled

Each section includes source (local, inherited, or mixed) and editable flags so the UI knows what can be changed.

When a user creates a new agent through a platform connection (e.g., a new Slack channel), it inherits settings from the template agent — the agent that owns the connection. This means:

  • One configuration applies to all new users by default
  • Individual agents can override specific sections
  • Changes to the template propagate to agents that haven’t overridden that section
Terminal window
curl -X POST http://localhost:8080/api/v1/auth/openai/save-key \
-H "Authorization: Bearer $ADMIN_PASSWORD" \
-H "Content-Type: application/json" \
-d '{ "agentId": "support", "apiKey": "sk-..." }'

Some providers use device-code auth:

Terminal window
# Start the flow
curl -X POST http://localhost:8080/api/v1/auth/github/start \
-H "Authorization: Bearer $ADMIN_PASSWORD" \
-H "Content-Type: application/json" \
-d '{ "agentId": "support" }'
# Poll for completion
curl -X POST http://localhost:8080/api/v1/auth/github/poll \
-H "Authorization: Bearer $ADMIN_PASSWORD" \
-H "Content-Type: application/json" \
-d '{ "agentId": "support", "deviceAuthId": "..." }'
Terminal window
curl -X POST http://localhost:8080/api/v1/auth/openai/logout \
-H "Authorization: Bearer $ADMIN_PASSWORD" \
-H "Content-Type: application/json" \
-d '{ "agentId": "support" }'
Terminal window
curl http://localhost:8080/api/v1/agents/support/config/providers/catalog \
-H "Authorization: Bearer $ADMIN_PASSWORD"

Returns providers that are not yet installed for this agent.

List, create, and cancel agent schedules:

Terminal window
# List schedules
curl http://localhost:8080/api/v1/agents/support/schedules \
-H "Authorization: Bearer $ADMIN_PASSWORD"
# Create a recurring schedule (cron)
curl -X POST http://localhost:8080/api/v1/agents/support/schedules \
-H "Authorization: Bearer $ADMIN_PASSWORD" \
-H "Content-Type: application/json" \
-d '{ "task": "Check for open support tickets", "cron": "0 9 * * 1-5" }'
# Create a one-time delay
curl -X POST http://localhost:8080/api/v1/agents/support/schedules \
-H "Authorization: Bearer $ADMIN_PASSWORD" \
-H "Content-Type: application/json" \
-d '{ "task": "Follow up on ticket #123", "delayMinutes": 60 }'
# Cancel a schedule
curl -X DELETE http://localhost:8080/api/v1/agents/support/schedules/sched_abc \
-H "Authorization: Bearer $ADMIN_PASSWORD"

Check agent status, view messages, and get session stats:

Terminal window
# Is the agent online?
curl http://localhost:8080/api/v1/agents/support/history/status \
-H "Authorization: Bearer $ADMIN_PASSWORD"
# Get recent messages (paginated)
curl http://localhost:8080/api/v1/agents/support/history/session/messages \
-H "Authorization: Bearer $ADMIN_PASSWORD"
# Session statistics (message counts, token usage)
curl http://localhost:8080/api/v1/agents/support/history/session/stats \
-H "Authorization: Bearer $ADMIN_PASSWORD"

View which platform channels are bound to an agent:

Terminal window
curl http://localhost:8080/api/v1/agents/support/channels \
-H "Authorization: Bearer $ADMIN_PASSWORD"

All endpoints are documented in the OpenAPI spec at /api/docs on your running gateway. Browse it for request/response schemas and try requests directly.