Overview
EventPalour provides two primary ways to interact with the platform programmatically:- Server Actions - Next.js server actions for server-side operations
- REST API Endpoints - Traditional REST endpoints for webhooks and integrations
Authentication
Learn about session-based authentication and authorization
Events
Create and manage events programmatically
Tickets
Handle ticket operations and purchases
Payments
Process payments with Paystack integration
Architecture
EventPalour uses a modern Next.js architecture with:- Server Actions - Type-safe server functions called from client components
- API Routes - RESTful endpoints for external integrations
- Session-based Auth - Secure authentication using sessions
- Role-based Access Control - Platform, admin, and workspace roles
Server Actions vs API Routes
Server Actions
Server actions are the primary way to interact with EventPalour from within the application. They provide:- Type safety with TypeScript
- Automatic serialization
- Built-in CSRF protection
- Direct database access
API Routes
API routes are REST endpoints used for:- Webhook integrations (Paystack, OAuth)
- File uploads
- Email invitations
- Admin operations
Base URL
Rate Limiting
API endpoints implement rate limiting to prevent abuse:- POST requests: Rate limited globally
- Limit: Configurable per endpoint
- Response:
429 Too Many RequestswithRetry-Afterheader
Data Formats
Request Format
All requests should use JSON format unless uploading files:Response Format
Successful responses return data directly:Available Server Actions
EventPalour provides server actions for:Authentication & Authorization
Authentication & Authorization
Events
Events
createEvent()- Create a new eventupdateEvent()- Update event detailsdeleteEvent()- Delete an eventgetEventById()- Get event detailsgetWorkspaceEvents()- List workspace events
Tickets
Tickets
bookTicket()- Purchase a tickettransferTicket()- Transfer ticket to another userscanTicket()- Scan QR code at eventgetUserTickets()- Get user’s tickets
Payments
Payments
initializePayment()- Start payment flowverifyPayment()- Verify payment statusprocessRefund()- Process a refund
Workspaces
Workspaces
createWorkspace()- Create a new workspaceupdateWorkspace()- Update workspace settingsinviteMembers()- Invite team membersupdateMemberRole()- Change member role
Available API Routes
Authentication
GET /api/auth/check-super-admin- Check super admin statusGET /api/auth/oauth/google- Google OAuth flowGET /api/auth/oauth/google/callback- Google OAuth callback
File Management
POST /api/upload- Upload images and documents
Workspace
POST /api/workspace/invite- Send batch email invitations
Payments
POST /api/payments/webhook/paystack- Paystack webhook handler
Admin
POST /api/admin/blue-tickets/approve- Approve blue ticketPOST /api/admin/blue-tickets/reject- Reject blue ticket
Next Steps
Authentication Guide
Learn about authentication and session management
Events API
Create and manage events
Error Handling
Handle errors and status codes
Workspaces API
Manage workspaces and teams