API Overview
Interactive API Documentation
Swagger UI: http://localhost:5001/api-docs (or /api-docs in production)
Use Swagger UI for interactive API testing and detailed endpoint documentation.
Authentication
Most endpoints require HTTP Basic Auth with API_PASSWORD environment variable.
Endpoint Categories
Funding Endpoints
Manage funding applications (søknader) syncing between ClickUp, Cornerstone, and WordPress.
POST /applications/funding- Create/update funding from ClickUp taskPOST /applications/funding/by-entity-uuid- Create/update funding by entity UUIDGET /applications/funding/entity/{task_id}- Get funding entity infoGET /applications/funding/summary/{entity_uuid}- Get funding summaryPOST /applications/funding/create-entity-mapping- Create entity mapping for existing task
Lokallag (Groups) Endpoints
Manage lokallag (organizations) syncing between Cornerstone, ClickUp, and WordPress.
POST /applications/create-new- Create new lokallag across all systemsPOST /applications/sync-lokallag/{task_id}- Sync existing lokallag or create newPOST /lokallag/global-sync- Global sync for all lokallag and funding entities
Webhooks
Receive updates from external systems.
POST /clickup-webhook/funding?task_id={id}- ClickUp funding webhookPOST /webhook?task_id={id}- General webhook for lokallagPOST /wordpress-webhook/funding/{post_id}- WordPress funding webhook
Entity Management
Manage entity mappings across systems.
GET /entities/{entity_type}- List entities by type (group, funding, profile)POST /entities/{entity_uuid}/resync- Resync specific entityPOST /entities/{entity_uuid}/archive- Archive entity
Inspector Endpoints
Debug and fix entity mapping issues.
GET /inspector/entities/missing- Find entities missing IDsGET /inspector/entities/{entity_uuid}- Get entity detailsPOST /inspector/entities/{entity_uuid}/fix- Fix entity mappingGET /inspector/report- Generate inspection reportGET /inspector/funding/health- Check funding entity health
Monitoring
Track sync status and errors.
GET /sync/status- Current sync statusGET /sync/logs- Recent sync logsGET /sync/health- System health checkGET /sync/errors/by-entity?hours=24- Errors by entityGET /sync/history?limit=20- Sync history
Scheduler
Manage scheduled sync operations.
GET /scheduler/status- Get scheduler statusPOST /scheduler/trigger- Trigger manual sync
Grants
BigQuery grants sync operations.
POST /grants- Sync grants (incremental)POST /grants/backfill- Full grants backfillGET /grants/status- Grants sync statusGET /grants/health- Grants health check
Profiles
Profile management endpoints.
POST /profiles/create-wordpress/{task_id}- Create WordPress profile
Utility Endpoints
Helper endpoints for various operations.
POST /applications/update-relationship- Update task relationshipsGET /get-task-id- Get ClickUp task ID by Cornerstone IDPOST /applications/set-type- Set task type field
Common Response Format
{
"status": "success|error",
"message": "Description",
"data": {}
}
Error Responses
400- Bad Request (missing parameters)404- Not Found (entity not found)500- Internal Server Error