Module API routes

Ship handlers under the client-platform API tree or via the module route loader.

Your manifest routes array advertises namespaces such as /api/v1/my-integration. Implement Next.js route handlers (or the platform module router) that call your package services.

Example endpoints

# Example: apps/client-platform/src/app/api/v1/my-integration/records/route.ts
# - GET    list records   (permission: my-integration.records:read)
# - POST   create record  (permission: my-integration.records:write)

GET /api/v1/my-integration/records?page=1&pageSize=25
Authorization: Bearer <tenant-session> | X-Api-Key: <connect-key>

POST /api/v1/my-integration/records
Content-Type: application/json
{ "name": "Example", "externalId": "ext-123" }

Auth modes

  • Tenant admin session — browser cookie from Core login
  • Connect API key — server-to-server with scoped permissions
  • Service tokens — internal platform calls (not for third-party use)