API reference
Surface overview for pipedai-api. Full canonical reference lives in the API repo's API.md.
Production base URL: https://api-beta.pipedai.app. All endpoints live under /api/v1/.
Source of truth
This page summarizes the PipedAI API surface for context. The canonical reference — request bodies, response shapes, status codes, audit actions — lives in
API.md on Marolence/pipedai-api. Treat that file as authoritative when integrating.Authentication
PipedAI issues its own JWT cookies via /api/v1/auth/*. Three auth substrates:
- Cookie JWT for browsers (the dashboard) — set by login / register, auto-sent on subsequent calls
pwk_Bearer for external systems / webhooks / scripts; mint viaPOST /environments/:envId/api-keyswithprefix: "pwk"wkt_Bearer for workers polling for assigned runs; issued by/workers/registerin exchange for awrk_registration token
Common headers
Authorization: Bearer pwk_… # external clients
Cookie: auth_token=… # dashboard browser sessions
Origin: https://your.app # required for credentialed CORSEndpoint surface (high level)
Auth
POST /api/v1/auth/register # email + password → 201 + cookie
POST /api/v1/auth/login # email + password → 200 + cookie
POST /api/v1/auth/logout # 204, clears cookie
GET /api/v1/auth/me # 200 with user, 401 otherwiseWorkspaces and Environments
POST /api/v1/workspaces
GET /api/v1/workspaces
POST /api/v1/workspaces/:wsId/environments
GET /api/v1/workspaces/:wsId/environments
PATCH /api/v1/environments/:id
DELETE /api/v1/environments/:idMembers + API keys + Audit log
GET /api/v1/environments/:envId/members # viewer+
POST /api/v1/environments/:envId/members # admin+
PATCH /api/v1/environments/:envId/members/:userId # admin+
DELETE /api/v1/environments/:envId/members/:userId # admin+
GET /api/v1/environments/:envId/api-keys # viewer+
POST /api/v1/environments/:envId/api-keys # admin+ — { name, prefix }
DELETE /api/v1/environments/:envId/api-keys/:keyId # admin+
GET /api/v1/environments/:envId/audit-log # admin+; ?action, ?actions, ?targetId, ?cursor
GET /api/v1/users/lookup?email=… # auth required; for member-invite flowTriggers and runs
GET /api/v1/environments/:envId/triggers # viewer+; ?cursor, ?limit, ?workerId
POST /api/v1/environments/:envId/triggers # admin+ on env
GET /api/v1/triggers/:id
PATCH /api/v1/triggers/:id # admin+ on env
DELETE /api/v1/triggers/:id # admin+; soft delete
POST /api/v1/triggers/:id/rotate-mcp-token # admin+ on env
POST /api/v1/triggers/:id/run # operator+ JWT or pwk_
GET /api/v1/triggers/:id/runs # viewer+; ?status, ?from, ?to, ?cursor
GET /api/v1/environments/:envId/runs # viewer+; cross-trigger; ?workerId, ?status, ?from, ?toWorkers
POST /api/v1/workers/register # public; consumes wrk_ for wkt_
GET /api/v1/environments/:envId/workers # viewer+; ?status=online|offline
GET /api/v1/workers/:id/poll # wkt_; returns assigned runs
POST /api/v1/workers/:id/runs/:runId/{claim,start,heartbeat,complete} # wkt_Dashboard overview
GET /api/v1/environments/:envId/dashboard/overview # viewer+
# → onlineWorkers, todaysRuns,
# successRatePct, monthTokenSpendUsdError shapes
4xx and 5xx responses return JSON { error: string }. Zod validation failures include { error, details: { fieldErrors, formErrors } }. Common codes:
400 validation / missing required field
401 auth missing or invalid
403 authenticated but lacks role for the resource
404 resource not found OR no visibility (we don't 403-leak existence)
409 state-machine rejection (e.g. last-owner removal, soft-delete with active children)