{"openapi":"3.0.3","info":{"title":"awork Pfeilomat Middleware API","description":"Read-only middleware API for normalized awork, Pfeilomat\/FileMaker, and Kapa-Tool data.","version":"0.1.0"},"servers":[{"url":"http:\/\/localhost","description":"local server"}],"tags":[{"name":"System"},{"name":"Kapa"},{"name":"Time Entries"},{"name":"Projects"},{"name":"Clients"},{"name":"Users"},{"name":"Sub Clients"}],"paths":{"\/api\/v1\/status":{"get":{"tags":["System"],"summary":"Service status","responses":{"200":{"$ref":"#\/components\/responses\/Ok"}}}},"\/api\/v1\/health":{"get":{"tags":["System"],"summary":"Health checks","responses":{"200":{"$ref":"#\/components\/responses\/Ok"},"503":{"$ref":"#\/components\/responses\/Failed"}}}},"\/api\/v1\/kapa\/booked-hours":{"get":{"tags":["Kapa"],"summary":"Kapa-compatible booked hours","parameters":[{"name":"year","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by ISO year."},{"name":"kw","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by ISO calendar week, 1-53."},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Start date, YYYY-MM-DD."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"End date, YYYY-MM-DD."},{"name":"user_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by middleware user ID."},{"name":"personio_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by Personio employee ID."},{"name":"client_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by middleware client ID."},{"name":"project_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by middleware project ID."},{"name":"job_number","in":"query","required":false,"schema":{"type":"string"},"description":"Filter by project job number."},{"name":"sub_client_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by middleware sub-client ID."},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["awork","filemaker"]},"description":"Filter by source system."},{"name":"page","in":"query","required":false,"schema":{"type":"integer"},"description":"Page number."},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer"},"description":"Items per page, max 1000."}],"responses":{"200":{"description":"Paginated Kapa booked hours","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/KapaBookedHour"}}}}}}},"422":{"$ref":"#\/components\/responses\/ValidationError"}}}},"\/api\/v1\/time-entries":{"get":{"tags":["Time Entries"],"summary":"List normalized time entries","parameters":[{"name":"year","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by ISO year."},{"name":"kw","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by ISO calendar week, 1-53."},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Start date, YYYY-MM-DD."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"End date, YYYY-MM-DD."},{"name":"user_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by middleware user ID."},{"name":"personio_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by Personio employee ID."},{"name":"client_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by middleware client ID."},{"name":"project_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by middleware project ID."},{"name":"job_number","in":"query","required":false,"schema":{"type":"string"},"description":"Filter by project job number."},{"name":"sub_client_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by middleware sub-client ID."},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["awork","filemaker"]},"description":"Filter by source system."},{"name":"page","in":"query","required":false,"schema":{"type":"integer"},"description":"Page number."},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer"},"description":"Items per page, max 1000."}],"responses":{"200":{"$ref":"#\/components\/responses\/TimeEntryCollection"},"422":{"$ref":"#\/components\/responses\/ValidationError"}}}},"\/api\/v1\/time-entries\/{id}":{"get":{"tags":["Time Entries"],"summary":"Show one time entry","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"$ref":"#\/components\/responses\/TimeEntryItem"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/api\/v1\/projects":{"get":{"tags":["Projects"],"summary":"List projects","parameters":[{"name":"active","in":"query","required":false,"schema":{"type":"boolean"},"description":"Filter by Kapa active flag."},{"name":"job_number","in":"query","required":false,"schema":{"type":"string"},"description":"Filter by project job number."},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer"},"description":"Items per page, max 1000."}],"responses":{"200":{"$ref":"#\/components\/responses\/ProjectCollection"}}}},"\/api\/v1\/projects\/{id}":{"get":{"tags":["Projects"],"summary":"Show one project","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"$ref":"#\/components\/responses\/ProjectItem"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/api\/v1\/clients":{"get":{"tags":["Clients"],"summary":"List clients","parameters":[{"name":"active","in":"query","required":false,"schema":{"type":"boolean"},"description":"Filter active clients."},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer"},"description":"Items per page, max 1000."}],"responses":{"200":{"$ref":"#\/components\/responses\/ClientCollection"}}}},"\/api\/v1\/clients\/{id}":{"get":{"tags":["Clients"],"summary":"Show one client","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"$ref":"#\/components\/responses\/ClientItem"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/api\/v1\/clients\/{client}\/projects":{"get":{"tags":["Clients","Projects"],"summary":"List projects for one client","parameters":[{"name":"client","in":"path","required":true,"schema":{"type":"integer"}},{"name":"active","in":"query","required":false,"schema":{"type":"boolean"},"description":"Filter by Kapa active flag."},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer"},"description":"Items per page, max 1000."}],"responses":{"200":{"$ref":"#\/components\/responses\/ProjectCollection"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/api\/v1\/users":{"get":{"tags":["Users"],"summary":"List users","parameters":[{"name":"active","in":"query","required":false,"schema":{"type":"boolean"},"description":"Filter active users."},{"name":"personio_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by Personio ID."},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer"},"description":"Items per page, max 1000."}],"responses":{"200":{"$ref":"#\/components\/responses\/UserCollection"}}}},"\/api\/v1\/users\/{id}":{"get":{"tags":["Users"],"summary":"Show one user","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"$ref":"#\/components\/responses\/UserItem"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/api\/v1\/users\/{user}\/time-entries":{"get":{"tags":["Users","Time Entries"],"summary":"List time entries for one user","parameters":[{"name":"user","in":"path","required":true,"schema":{"type":"integer"}},{"name":"year","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by ISO year."},{"name":"kw","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by ISO calendar week, 1-53."},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Start date, YYYY-MM-DD."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"End date, YYYY-MM-DD."},{"name":"client_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by middleware client ID."},{"name":"project_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by middleware project ID."},{"name":"job_number","in":"query","required":false,"schema":{"type":"string"},"description":"Filter by project job number."},{"name":"sub_client_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Filter by middleware sub-client ID."},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["awork","filemaker"]},"description":"Filter by source system."},{"name":"page","in":"query","required":false,"schema":{"type":"integer"},"description":"Page number."},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer"},"description":"Items per page, max 1000."}],"responses":{"200":{"$ref":"#\/components\/responses\/TimeEntryCollection"},"422":{"$ref":"#\/components\/responses\/ValidationError"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/api\/v1\/sub-clients":{"get":{"tags":["Sub Clients"],"summary":"List sub-clients\/products","responses":{"200":{"$ref":"#\/components\/responses\/SubClientCollection"}}}}},"components":{"responses":{"Ok":{"description":"Successful response"},"Failed":{"description":"Health check failed"},"NotFound":{"description":"Resource not found"},"ValidationError":{"description":"Validation error"},"TimeEntryCollection":{"description":"TimeEntry collection","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/TimeEntry"}}}}}}},"TimeEntryItem":{"description":"TimeEntry item","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/TimeEntry"}}}}}},"ProjectCollection":{"description":"Project collection","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Project"}}}}}}},"ProjectItem":{"description":"Project item","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/Project"}}}}}},"ClientCollection":{"description":"Client collection","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Client"}}}}}}},"ClientItem":{"description":"Client item","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/Client"}}}}}},"UserCollection":{"description":"User collection","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/User"}}}}}}},"UserItem":{"description":"User item","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/User"}}}}}},"SubClientCollection":{"description":"SubClient collection","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/SubClient"}}}}}}}},"schemas":{"User":{"type":"object","properties":{"id":{"type":"integer"},"awork_user_id":{"type":"string","nullable":true},"personio_id":{"type":"integer","nullable":true},"name":{"type":"string"},"firstname":{"type":"string","nullable":true},"lastname":{"type":"string","nullable":true},"email":{"type":"string","format":"email"},"is_active":{"type":"boolean"}}},"Client":{"type":"object","properties":{"id":{"type":"integer"},"filemaker_client_id":{"type":"string","nullable":true},"awork_company_id":{"type":"string","nullable":true},"canonical_name":{"type":"string"},"is_active":{"type":"boolean"}}},"SubClient":{"type":"object","properties":{"id":{"type":"integer"},"filemaker_product_id":{"type":"string","nullable":true},"awork_company_id":{"type":"string","nullable":true},"name":{"type":"string"},"client":{"$ref":"#\/components\/schemas\/Client"}}},"Project":{"type":"object","properties":{"id":{"type":"integer"},"awork_project_id":{"type":"string","nullable":true},"job_number":{"type":"string"},"name":{"type":"string"},"kapatool_active":{"type":"boolean"},"status":{"type":"string","nullable":true},"client":{"$ref":"#\/components\/schemas\/Client"},"sub_client":{"$ref":"#\/components\/schemas\/SubClient"}}},"TimeEntry":{"type":"object","properties":{"id":{"type":"integer"},"awork_time_entry_id":{"type":"string","nullable":true},"filemaker_booking_ref":{"type":"string","nullable":true},"date":{"type":"string","format":"date"},"year":{"type":"integer"},"kw":{"type":"integer"},"duration_hours":{"type":"number","format":"float"},"description":{"type":"string","nullable":true},"source":{"type":"string","enum":["awork","filemaker"]},"user":{"$ref":"#\/components\/schemas\/User"},"project":{"$ref":"#\/components\/schemas\/Project"},"client":{"$ref":"#\/components\/schemas\/Client"},"sub_client":{"$ref":"#\/components\/schemas\/SubClient"}}},"KapaBookedHour":{"type":"object","properties":{"date":{"type":"string","format":"date"},"year":{"type":"string"},"employee_firstname":{"type":"string","nullable":true},"employee_lastname":{"type":"string","nullable":true},"employee_id":{"type":"integer","nullable":true},"project_number":{"type":"string"},"customer":{"type":"string"},"kw":{"type":"integer"},"project_name":{"type":"string"},"time_booked":{"type":"number","format":"float"},"category":{"type":"string"},"source":{"type":"string","enum":["awork","filemaker"]},"external_id":{"type":"string","nullable":true}}}}}}