Skip to main content
Confect’s HTTP API integration lets you define HTTP endpoints using @effect/platform’s HTTP API modules and mount them onto Convex’s HTTP router. It includes built-in interactive API documentation powered by Scalar.

Defining endpoints

Define your API groups and endpoints using @effect/platform.
confect/http/notes.ts

Implementing handlers

Implement your endpoint handlers in the same file using HttpApiBuilder. All Confect action services (QueryRunner, MutationRunner, ActionRunner, Scheduler, Auth, StorageReader, StorageWriter, StorageActionWriter) are available in handlers.
confect/http/notes.ts (continued)

Creating the router

Create the Convex HTTP router in confect/http.ts using HttpApi.make from @confect/server. Each key is a path prefix that must be either "/" or end with a trailing slash (e.g. "/api/").
confect/http.ts
Each path prefix entry accepts:

API documentation

Interactive API docs are automatically served at {pathPrefix}docs (e.g. /api/docs). The docs are powered by Scalar and generated from your endpoint definitions and OpenApi annotations.