Base URL
All API endpoints are relative to your PhotoFlow installation’s base URL:Request Format
PhotoFlow uses JSON for request and response bodies. All POST and DELETE requests should include:Example Request
Response Format
API responses are returned as JSON. Successful operations typically return either:- A success message string (e.g.,
"Successful!") - An object or array containing the requested data
- An error message string (e.g.,
"Invalid!")
Success Response
Data Response
Error Handling
The PhotoFlow API uses simple string-based error responses. When an error occurs, the API returns a JSON string indicating the failure:"Invalid!"- Request validation failed or operation could not be completed"Something happened..."- Unexpected error during deletion
The API does not use HTTP status codes for error differentiation. Always check the response content to determine success or failure.
SvelteKit API Architecture
PhotoFlow uses SvelteKit’s API routes, which differ from traditional REST APIs:- Routes are defined using file-based routing in
src/routes/api/ - Each endpoint is a
+server.tsfile with exported HTTP method handlers - The API integrates directly with Prisma for database operations
- Real-time updates are handled via Socket.io (see Real-time Updates)
Authentication
Rate Limiting
There are no built-in rate limits. Consider implementing rate limiting at the reverse proxy level if exposing the API publicly.Next Steps
- Learn about Real-time Updates
- Create and manage Tasks
- Add Comments to tasks
- Import data from CSV files