REST API documentation for the FileMaker WebViewer application.
Development: http://localhost:3000/api
Production: https://your-domain.com/api
Get all activities with pagination and filtering
page (integer): Page number (default: 1)limit (integer): Items per page (default: 10, max: 100)companyId (string): Filter by company IDactivityOwner (string): Filter by creatorkey (string): Filter by activity typestatus (integer): Filter by status (0=inactive, 1=active)search (string): Search in value and key fieldssortBy (string): Sort field (createdAt, updatedAt, key, activityOwner, status)sortOrder (string): Sort order (ASC, DESC)Create a new activity
{
"value": "Note content here",
"companyId": "677E86E4-0BBC-4E17-91B2-008B381FE1BD",
"key": "Note" // optional, defaults to "Note"
}Get activities for a specific company
companyId (string): Company UUIDSame as GET /activities
Get a single activity by ID
id (string): Activity UUIDUpdate an activity's value
id (string): Activity UUID{
"value": "Updated activity value"
}Same as PUT - Update an activity's value
Health check endpoint
Test database connection and show table information
{
"data": [...], // Array of activities
"total": 416, // Total count
"page": 1, // Current page
"limit": 10, // Items per page
"totalPages": 42, // Total pages
"hasNext": true, // Has next page
"hasPrev": false // Has previous page
}{
"id": "F7D949EB-6F14-264F-BDC5-D493732EC504",
"value": "WorkOrder W574583-2 Submitted",
"key": "Workorder",
"activityOwner": "Quintin Driskell",
"status": 0,
"companyId": "677E86E4-0BBC-4E17-91B2-008B381FE1BD",
"createdAt": "2025-06-16T15:14:00.000Z",
"updatedAt": "2025-06-16T19:33:17.000Z",
"createdBy": "Quintin Driskell",
"updatedBy": null
}{
"success": true,
"data": { /* Activity object */ }
}{
"error": "Internal Server Error",
"message": "Failed to fetch activities",
"details": "...", // Only in development
"timestamp": "2024-01-01T00:00:00.000Z"
}POST /api/activities
Content-Type: application/json
{
"value": "Customer called about invoice #12345",
"companyId": "677E86E4-0BBC-4E17-91B2-008B381FE1BD",
"key": "Note"
}PUT /api/activities/F7D949EB-6F14-264F-BDC5-D493732EC504
Content-Type: application/json
{
"value": "WorkOrder W574583-2 Completed"
}GET /api/activities?search=WorkOrder&limit=20
GET /api/activities/company/677E86E4-0BBC-4E17-91B2-008B381FE1BD?status=1
GET /api/activities?activityOwner=mobileapp_api&sortBy=createdAt&sortOrder=DESC
The application uses separate read and write database connections for optimal performance:
This ensures better load distribution and prevents read-only errors during write operations.