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:| Method | Header | Use case |
|---|---|---|
| API Key | X-API-Key: cf_your_key | Zapier, scripts, third-party tools |
| JWT | Authorization: Bearer <token> | Frontend, authenticated clients |
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:| Plan | Requests/min |
|---|---|
| Free | 30 |
| Pro | 120 |
| Team | 300 |
| Enterprise | 600 |
429 Too Many Requests with a Retry-After header.
Pagination
List endpoints support cursor-based pagination:| Param | Type | Default | Description |
|---|---|---|---|
limit | int | 50 | Items per page |
cursor | string | — | Cursor from next_cursor of previous response |
Endpoints
Agents — /functions/v1/api-agents
| Method | Params | Description |
|---|---|---|
GET | — | List all agents |
GET | ?id=<uuid> | Get single agent |
POST | body | Create agent |
PATCH | ?id=<uuid> + body | Update agent |
DELETE | ?id=<uuid> | Delete agent |
Tasks — /functions/v1/api-tasks
| Method | Params | Description |
|---|---|---|
GET | — | List all tasks |
GET | ?status=running | Filter by status |
GET | ?id=<uuid> | Get single task |
POST | body | Create task (auto-dispatches if agent/team assigned) |
PATCH | ?id=<uuid> + body | Update task |
DELETE | ?id=<uuid> | Delete task |
pending, dispatched, running, completed, failed, cancelled
Task priorities: low, medium, high, urgent
Teams — /functions/v1/api-teams
| Method | Params | Description |
|---|---|---|
GET | — | List all teams (includes members) |
GET | ?id=<uuid> | Get single team |
POST | body | Create team |
PATCH | ?id=<uuid> + body | Update team |
DELETE | ?id=<uuid> | Delete team |
pipeline, orchestrator, collaboration
Team Runs — /functions/v1/api-runs
| Method | Params | Description |
|---|---|---|
GET | — | List all runs |
GET | ?team_id=<uuid> | Filter by team |
GET | ?id=<uuid> | Get single run (includes messages) |
POST | body | Start a new team run |
Webhook Hooks — /functions/v1/api-hooks
| Method | Params | Description |
|---|---|---|
GET | — | List active webhook subscriptions |
POST | body | Subscribe (Zapier REST Hook) |
DELETE | ?id=<uuid> | Unsubscribe |
Identity — /functions/v1/api-me
| Method | Description |
|---|---|
GET | Returns current user, workspace, plan, and API version |
Error Codes (v2)
| Code | HTTP Status | Description |
|---|---|---|
bad_request | 400 | Invalid request body or parameters |
unauthorized | 401 | Missing or invalid authentication |
not_found | 404 | Resource not found |
method_not_allowed | 405 | HTTP method not supported |
rate_limit_exceeded | 429 | Too many requests |
internal_error | 500 | Server error |
Example: cURL
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
| Parameter | Example | Description |
|---|---|---|
status | eq.running | Filter by status |
priority | eq.high | Filter by priority |
agent_id | eq.{uuid} | Filter by assigned agent |
Create Task
pending, running, completed, failed, cancelled
Task priorities: low, medium, high, critical
Get Task Detail
Teams
List Teams
Create Team
Team Runs
Usage Records
Query Usage
| Field | Type | Description |
|---|---|---|
task_id | uuid | Associated task |
agent_id | uuid | Agent that ran |
provider | string | LLM provider |
model | string | Model used |
prompt_tokens | integer | Input tokens |
completion_tokens | integer | Output tokens |
estimated_cost_usd | decimal | Estimated cost |
billing_model | string | per-token or subscription-quota |
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
Error Handling (v1)
All errors follow the standard Supabase/PostgREST format:| HTTP Status | Meaning |
|---|---|
401 | Missing or invalid API key |
403 | Row-Level Security denied access |
404 | Resource not found |
409 | Conflict (duplicate key) |
422 | Validation error |

