LazyAIagent API
Programmatic access to the Workforce OS job queue. Everything runs in Simulation: agents draft, humans approve, nothing is sent externally.
Authentication
Create a key in your cabinet (API keys card). Keys look like wf_live_… and are shown once. Send yours as a header:
X-API-Key: wf_live_…
A key belongs to one workspace (organization). It can only queue and read that workspace's jobs. Revoke a key at any time in the cabinet; revocation is immediate.
Queue a Sales Team run
POST /api/jobs/sales-team
Content-Type: application/json
{"company_id": "acme-dental", "org_id": "<your org id>", "name": "Acme Dental",
"niche": "dentistry", "website_verified": true, "contact_verified": true,
"findings": [{"id": "f1", "kind": "no_chat", "severity": "high",
"evidence_quote": "checked: absent"}]}
Finding kinds: no_chat (25), no_online_booking (25), no_form, no_email, no_https, stale_content, no_phone_on_site (10 each). A run costs 1 credit; it qualifies the lead deterministically, drafts a proposal when qualified, writes a CRM contact and requests your approval. Nothing is ever sent.
Queue a Research Pack (2 credits)
POST /api/jobs/research-pack
Same body. Three analyzers (Milo qualification, Sera SEO, Arbo presence) run in parallel; a Supervisor merges their findings into one ranked action list.
Read jobs
GET /api/jobs — your workspace's recent jobs
GET /api/jobs/{job_id} — status, checkpoint step, result with work receipt
Statuses: queued → running → completed | failed | blocked | cancelled. Jobs are durable: if a worker dies mid-run, the job resumes from its last checkpoint and never charges twice.
Cancel a job
POST /api/jobs/{job_id}/cancel
Works with your API key or a cabinet session. A queued job cancels instantly and is never charged; a running job stops at its next checkpoint and the reserved credit is refunded. Finished jobs return 409.
Webhooks
Register an https endpoint in the cabinet (Webhooks card). We POST signed events:
| Event | When |
|---|---|
| job.completed | A queued job finished; body carries the receipt run_id and qualification |
| job.failed | A job failed permanently (3 attempts); the reserved credit is refunded |
| job.blocked | A job could not start (e.g. insufficient credits) |
| job.cancelled | A job was cancelled via the API or the cabinet; any reserved credit is refunded |
| approval.requested | A draft is waiting for a human decision |
Verify authenticity: X-WF-Signature is the hex HMAC-SHA256 of the raw request body, keyed with the webhook secret shown once at creation.
Radar data
GET /api/radar/search?q=&niche=&city= — public, rate-limited (30/min per IP)
GET /api/radar/facts/{company_id} — full audit findings; account session required
Search returns audited companies (name, city, niche, score). Facts return the underlying audit findings — the paid data layer — so they require a registered account. Inside the cabinet, Radar search → Run qualifies a company and drafts a proposal in one click.
Workspace data (cabinet session)
GET /api/timeline — unified feed: jobs, runs, approvals, CRM activity, credits
GET /api/analytics — workspace counters: runs, jobs, credits, approvals, CRM, Brain
POST /api/org/erase — owner only; body {"confirm": "<exact organization name>"}
permanently erases the whole workspace and returns per-table counts