Skip to main content
Run agents on-demand via HTTP webhooks using agentuse serve. Integrate with external services, CI/CD pipelines, or any system that can make HTTP requests.

Quick Start

  1. Start the daemon:
  1. Trigger an agent via HTTP:

Serving Multiple Projects

AgentUse runs one serve daemon at a time. Repeat -C on that daemon to serve multiple project roots:
Project ids default to directory basenames. Duplicate ids fail startup. Select a project in the request body:
Without project, multi-project requests return 400 PROJECT_REQUIRED unless a default is set:
Explicit project fields override the default.

Global config

You can put serve defaults in ~/.agentuse/config.json. See Configuration Files for the schema and CLI override behavior.

Environment isolation

Each project loads its own .env / .env.local in its worker process; env vars never mix across projects.

API Reference

All JSON endpoints live under the /api/* prefix. The root paths (/agents, /sessions, /schedules, /stores, /approvals) serve the HTML dashboard pages instead. The per-session page /sessions/:id and its action subroutes carry their own capability auth (session token / API key / local); see Approval Gates.
POST /run, POST /resume/:id, and the POST /approvals/:id/... action endpoints are also still reachable at their original (un-prefixed) paths for backward compatibility. GET /approvals/:id now redirects to /sessions/:id. Prefer the /api/* and /sessions paths; the legacy aliases will be removed in a future release.

GET /api

Returns version, default project, and served projects. (GET / serves the HTML dashboard built from the same data.)

POST /api/run

Execute an agent and receive the result. (Legacy alias: POST /run.) Request:
Response:
Error Response:

GET /api/agents

Lists the agents the daemon loaded as JSON. path matches what POST /api/run expects. (The browsable HTML page is at /agents.) For one agent’s capability summary and raw source, use GET /api/agents/detail?project=<id>&path=<agent-path>. The path must match an agent already loaded by that project; the browsable detail hub is at /agents/<project>/<agent-path>.

GET /api/schedules

Lists scheduled agents as JSON, soonest next run first. (The browsable HTML page is at /schedules.)
From the terminal, agentuse serve agents and agentuse serve schedules render these as tables. See CLI Commands.

GET /api/sessions

Lists every run (top-level sessions; subagent sessions are excluded) as JSON, newest first. Filter with ?agent=<id>, ?trigger=scheduled|manual|slack|api, and ?days=<n|all> (default ~7 days). The browsable HTML page is at /sessions.
trigger records how the run started: scheduled (the built-in scheduler), api (POST /api/run), slack, or manual (CLI runs and the default).

GET /api/sessions/:id

Returns one session including its run-log entries. API-key gated.
For the human-facing view + approve page, the redirect target, and the session token, see Approval Gates.

Streaming Response

For real-time output, request NDJSON streaming:
Each line is a JSON event:

Authentication

When exposing the server externally, authentication is required:
Include the key in requests:
Use --no-auth to bypass authentication (dangerous for production).

Exposing Your Local Server

Access from your devices or team only:
Connect via http://<machine-name>:12233 from any device on your tailnet.

Integration Examples

GitHub Webhook

Create an agent to handle GitHub events:
Configure a GitHub webhook to POST to your server:

Slack Integration

Slack slash commands require a response within 3 seconds and signature verification. Use a workflow tool as middleware: With n8n or Make:
  1. Add Slack trigger node (receives slash commands)
  2. Add HTTP Request node → POST to http://server:12233/api/run
  3. Return agent response to Slack
With Zapier:
  1. Trigger: Slack → New Slash Command
  2. Action: Webhooks → POST to AgentUse /run
  3. Action: Slack → Send Channel Message with result
Direct Slack integration requires handling the 3-second timeout, form-urlencoded parsing, and request signature verification. Workflow tools handle this automatically.

n8n / Make / Zapier

Use HTTP request nodes to trigger agents:
  1. Set URL to http://your-server:12233/api/run
  2. Method: POST
  3. Headers: Content-Type: application/json
  4. Body:

Cron Job (External)

Trigger from system cron instead of built-in scheduler:

Server Configuration

See CLI Commands - agentuse serve for all server options including port, host, debug mode, and authentication configuration.

Production Deployment

For deploying agentuse serve in production with reverse proxies (nginx), process management (PM2), and Docker, see Self-Hosting.

Next Steps

Scheduled Agents

Run agents on a cron schedule

Self-Hosting

Deploy in production