Introduction
The Campus API provides programmatic access to all platform features including posts, comments, spaces, groups, events, and materials. The API is built on top of PocketBase, which provides a RESTful interface with automatic CRUD operations for all collections.Base URL
The API base URL depends on your deployment:- Development:
http://localhost:8090/api - Production:
https://your-domain.com/api
POCKETBASE_URL environment variable for server-side requests.
Authentication
All API endpoints require authentication using PocketBase’s authentication system. Include the authentication token in your requests:PocketBase REST API
Campus leverages the full PocketBase REST API for direct database access. In addition to the custom endpoints documented here, you can use PocketBase’s standard collection endpoints:GET /api/collections/{collection}/records- List recordsGET /api/collections/{collection}/records/{id}- Get single recordPOST /api/collections/{collection}/records- Create recordPATCH /api/collections/{collection}/records/{id}- Update recordDELETE /api/collections/{collection}/records/{id}- Delete record
Collections
Campus uses the following main collections:users- User accounts and authenticationprofiles- Extended user profile informationposts- User-generated posts and contentcomments- Comments on postslikes- Post likes and reactionsspaces- Community spacesspace_members- Space membershipgroups- Groups within spacesgroup_members- Group membershipevents- Calendar eventsevent_participants- Event RSVPsmaterials- Educational materials and filesmaterial_access_logs- Material access trackingnotifications- User notificationsreports- Content moderation reports
Response Format
All API responses follow PocketBase’s standard format:Error Handling
Errors follow PocketBase’s format with appropriate HTTP status codes:200- Success201- Created400- Bad Request401- Unauthorized403- Forbidden404- Not Found409- Conflict500- Internal Server Error
Rate Limiting
Rate limiting is handled by PocketBase. Consult your PocketBase configuration for specific limits.SDK and Type Safety
Campus includes TypeScript type definitions generated from PocketBase schema:pocketbase-types.ts for complete type definitions of all collections.