Summary
Implement the Next.js server with all API routes — the actual HTTP surface of OpenThreads. This includes the core sending endpoint, channel webhook receivers, management CRUD API, and server infrastructure.
Tasks
Recipient Inbound (core sending endpoint)
Channel Inbound Webhooks
Management API (CRUD)
Auth
Infrastructure
Acceptance Criteria
- Recipient can POST to
/send/... with token and receive response
- Recipient can POST to
/send/... with API key and send proactively
- Channel webhooks receive and correctly route inbound messages
- Management CRUD works for all entities
- Invalid tokens/keys return 401
- Rate limiting prevents abuse on public endpoints
- Health check returns 200 with status
Dependencies
References
Summary
Implement the Next.js server with all API routes — the actual HTTP surface of OpenThreads. This includes the core sending endpoint, channel webhook receivers, management CRUD API, and server infrastructure.
Tasks
Recipient Inbound (core sending endpoint)
POST /send/channel/:channelId/target/:groupOrUser/thread/:threadIdOrMessageId?token=) OR channel API key (Authorization: Bearer){ message: object | array }:threadIdOrMessageIdabsentPOST /send/channel/:channelId/target/:groupOrUser— new thread variantChannel Inbound Webhooks
POST /webhook/:channelId— generic webhook receiver per channelManagement API (CRUD)
GET/POST /api/channels— list / create channelsGET/PUT/DELETE /api/channels/:id— channel detail / update / deleteGET/POST /api/recipients— list / create recipientsGET/PUT/DELETE /api/recipients/:idGET/POST /api/routes— list / create routesGET/PUT/DELETE /api/routes/:idGET /api/threads— list threads (filterable by channel, target)GET /api/threads/:threadId— thread detailGET /api/threads/:threadId/turns— list turns in threadAuth
Infrastructure
GET /health)Acceptance Criteria
/send/...with token and receive response/send/...with API key and send proactivelyDependencies
References