Skip to main content

POST /projects

Attach a project to an existing token. Auth: required.
tokenSlug
string
required
Slug of the token to attach to.
title
string
required
Project display title.
brief
string
required
What the agents should build. Single paragraph.
agentTemplate
string
required
Preset for agent assignment. One of fullstack-builder, bot-builder, content-machine, research-agent.
private
boolean
default:"false"
If true, hides the live feed from non-owners.
curl -X POST https://api.agentflow.website/projects \
  -H "Content-Type: application/json" \
  -H "Cookie: af_session=..." \
  -d '{
    "tokenSlug": "hermes-dispatch",
    "title": "Hermes Dispatch landing",
    "brief": "Build a Next.js landing for Hermes Dispatch with hero, demo, waitlist.",
    "agentTemplate": "fullstack-builder"
  }'
Response
{
  "id": "prj_01HQ...",
  "slug": "hermes-dispatch",
  "tokenSlug": "hermes-dispatch",
  "status": "idle",
  "createdAt": "2026-04-25T11:00:00Z"
}

GET /projects/:slug

Fetch project metadata and current status. Public for non-private projects; auth-gated otherwise.

POST /projects/:slug/start

Trigger an agent run. Auth: required (project owner).
curl -X POST https://api.agentflow.website/projects/hermes-dispatch/start \
  -H "Cookie: af_session=..."
Returns { "runId": "run_01HQ..." }. The run begins emitting SSE events on the stream endpoint immediately.

GET /projects/:slug/stream

Open a Server-Sent Events stream of the project’s live build. Public unless the project is private.
const evt = new EventSource(
  "https://api.agentflow.website/projects/hermes-dispatch/stream",
);

evt.addEventListener("plan", (e) => console.log("plan:", JSON.parse(e.data)));
evt.addEventListener("tool_call", (e) => console.log(JSON.parse(e.data)));
evt.addEventListener("done", () => evt.close());
Event types
EventData
plan{ steps: [...], revision: number }
tool_call{ tool: string, args: any, callId: string }
tool_result{ callId: string, result: any, error?: string }
message{ role: "assistant", text: string }
screenshot{ url: string, caption?: string }
commit{ sha: string, message: string, files: string[] }
error{ message: string, recoverable: boolean }
done{ runId: string, finalStatus: string }
The server honors Last-Event-ID for replay. Last 1000 events are stored per project.

POST /projects/:slug/subscribe

Subscribe to milestone notifications for the project. Notifications go through the AgentFlow Telegram bot.
curl -X POST https://api.agentflow.website/projects/hermes-dispatch/subscribe \
  -H "Cookie: af_session=..."
Response
{ "subscribed": true }

Errors

CodeWhen
token_no_matchToken slug not owned by caller
project_lockedAlready has an active project
template_unknownagentTemplate not in preset list
private_forbiddenStream attempted on private project without auth