REST API Reference
CrewForm provides two API layers:- API v2 — Edge Functions API with versioned envelopes, rate limiting, and pagination (recommended)
- API v1 (Legacy) — Direct Supabase PostgREST access (still supported)
API v2 (Recommended)
Base URL: https://<your-project>.supabase.co/functions/v1
The v2 API uses CrewForm Edge Functions with structured responses, per-tier rate limiting, and cursor-based pagination.
Authentication
All requests require one of:
Generate API keys in Settings → API Keys.
Versioning
SetX-API-Version: 2 to opt into v2 response format. Omitting the header defaults to v1 (raw data, no envelope).
Response Format
v2 Success:Rate Limits
Enforced per workspace per minute:
Every response includes:
429 Too Many Requests with a Retry-After header.
Pagination
List endpoints support cursor-based pagination:Endpoints
Agents — /functions/v1/api-agents
Create body:
Tasks — /functions/v1/api-tasks
Create body:
pending, dispatched, running, waiting_for_input, completed, failed, cancelled
Task priorities: low, medium, high, urgent
Teams — /functions/v1/api-teams
Create body:
pipeline, orchestrator, collaboration
Team Runs — /functions/v1/api-runs
Create body:
Webhook Hooks — /functions/v1/api-hooks
Subscribe body:
Identity — /functions/v1/api-me
Response:
Error Codes (v2)
Example: cURL
AG-UI Protocol — Task Runner Endpoints
Base URL: https://<your-task-runner>/ag-ui
These endpoints are served by the task runner (not Edge Functions). They handle real-time agent streaming and user interactions.
SSE Stream — POST /ag-ui/:agentId/sse
Open an SSE connection to stream AG-UI events for a task execution.
Headers:
Submit Interaction Response — POST /ag-ui/:agentId/respond
Submit a user response to a pending interaction request. The task must be in waiting_for_input status.
Headers:
Health Check — GET /ag-ui/health
API v1 (Legacy)
Base URL: https://<your-project>.supabase.co/rest/v1
The v1 API provides direct Supabase PostgREST access. It is still supported but we recommend migrating to API v2 for rate limiting, structured responses, and pagination.
Authentication
All API requests require a REST API key in theAuthorization header:
Creating API Keys
- Go to Settings → API Keys
- Click Generate Key
- Copy the key — it’s only shown once
- The key is hashed (SHA-256) before storage for security
Endpoints
All endpoints are accessed via the Supabase REST API at:apikey header with your Supabase anon key:
Agents
List Agents
Create Agent
Update Agent
Delete Agent
Tasks
List Tasks
Create Task
pending, dispatched, running, waiting_for_input, completed, failed, cancelled
Task priorities: low, medium, high, urgent
Get Task Detail
Teams
List Teams
Create Team
Team Runs
Usage Records
Query Usage
Marketplace
Browse Agents
Install Agent (RPC)
Rate Limits (v1)
The Supabase free tier includes:- 500 requests/minute per API key
- 50,000 requests/month total

