Skip to main content

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

Set X-API-Version: 2 to opt into v2 response format. Omitting the header defaults to v1 (raw data, no envelope).

Response Format

v2 Success:
v2 List (paginated):
v2 Error:

Rate Limits

Enforced per workspace per minute: Every response includes:
Exceeding the limit returns 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:
Task statuses: pending, dispatched, running, waiting_for_input, completed, failed, cancelled Task priorities: low, medium, high, urgent

Teams — /functions/v1/api-teams

Create body:
Team modes: 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:
Body:
Response: Server-Sent Events stream with AG-UI events:
See AG-UI Protocol for the full event type reference.

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:
Body (approval):
Body (data confirmation):
Body (choice):
Success Response:
Error Responses:

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 the Authorization header:

Creating API Keys

  1. Go to Settings → API Keys
  2. Click Generate Key
  3. Copy the key — it’s only shown once
  4. The key is hashed (SHA-256) before storage for security

Endpoints

All endpoints are accessed via the Supabase REST API at:
You also need the apikey header with your Supabase anon key:

Agents

List Agents

Response:

Create Agent

Update Agent

Delete Agent


Tasks

List Tasks

Query parameters for filtering:

Create Task

Task statuses: 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

Response fields:

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
For higher limits, upgrade your Supabase plan.

Error Handling (v1)

All errors follow the standard Supabase/PostgREST format:
Common error codes: