Proferprofer

HTTP API

Reference for the Profer HTTP API endpoints

The Supabase edge functions expose these HTTP endpoints.

Auth'd endpoints (API key optional in alpha)

If PROFER_API_KEY is configured on the server, requests must include Authorization: Bearer <PROFER_API_KEY>.

POST /pages

Create a new page. At least one of html, artifact, or messages is required.

curl -X POST https://your-project.supabase.co/functions/v1/pages \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [{ "role": "agent", "text": "Here is the spec..." }],
    "artifact": { "type": "html", "content": "<h1>Auth Migration</h1><p>...</p>" },
    "title": "Auth Migration Spec",
    "questions": [
      { "id": "q1", "type": "approve", "text": "Ready to implement?" }
    ]
  }'

Response (201):

{ "id": "PF-K8M3N", "url": "https://profer.dev/v/PF-K8M3N" }

GET /pages/:id

Get page with all feedback (paginated via ?limit=100&offset=0).

curl https://your-project.supabase.co/functions/v1/pages/PF-K8M3N

PATCH /pages/:id

Update a page. Increments version, resets status to awaiting_feedback.

curl -X PATCH https://your-project.supabase.co/functions/v1/pages/PF-K8M3N \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [{ "role": "agent", "text": "Updated spec..." }],
    "artifact": { "type": "html", "content": "<h1>Updated</h1>" }
  }'

DELETE /pages/:id

Delete a page and all its feedback.

curl -X DELETE https://your-project.supabase.co/functions/v1/pages/PF-K8M3N

Response:

{ "ok": true, "id": "PF-K8M3N" }

Public endpoints (no auth required)

GET /v/:id/data

Returns page data as JSON (messages, artifact, questions, version, status).

GET /v/:id/version

Returns current version number (for polling/realtime checks).

POST /v/:id/feedback

Submit feedback. No authentication required.

curl -X POST https://profer.dev/v/PF-K8M3N/feedback \
  -H "Content-Type: application/json" \
  -d '{
    "answers": { "q1": "yes" },
    "reviewer": "Alice"
  }'

Limits

ResourceLimit
HTML / artifact content5 MB
Title length500 characters
Questions per page50
Reviewer name200 characters
API rate limit60 requests/min per IP
Feedback rate limit30 submissions/min per IP

Webhooks

If webhook_url is set on a page, a POST request is sent when feedback is received:

{
  "event": "feedback_received",
  "page_id": "PF-K8M3N",
  "version": 1,
  "answers": { "q1": "yes" },
  "reviewer": "Alice"
}

Webhook failures are non-blocking — feedback is stored regardless.

On this page