{"openapi":"3.1.0","info":{"title":"Outbreak Signal Service","description":"Pulls weekly surveillance data from DHIS2, flags statistical aberrations, and publishes alerts for review. An alert is a statistical signal, not a confirmed outbreak — see ETHICS.md.","version":"v1"},"servers":[{"url":"http://outbreak.krrkhan.com","description":"Generated server url"}],"security":[{"bearerAuth":[]}],"paths":{"/api/v1/webhook-subscriptions":{"get":{"tags":["webhook-subscription-controller"],"operationId":"list","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookSubscriptionSummary"}}}}}}},"post":{"tags":["webhook-subscription-controller"],"operationId":"create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookSubscriptionRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionCreated"}}}}}}},"/api/v1/webhook-subscriptions/{id}/deactivate":{"post":{"tags":["webhook-subscription-controller"],"operationId":"deactivate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK"}}}},"/api/v1/sync":{"post":{"tags":["dhis-2-sync-controller"],"operationId":"triggerSync","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SyncResult"}}}}}}},"/api/v1/detection/run":{"post":{"tags":["detection-controller"],"operationId":"triggerDetection","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/DetectionSummary"}}}}}}},"/api/v1/alerts/{id}/resolve":{"post":{"tags":["alert-controller"],"operationId":"resolve","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertSummary"}}}}}}},"/api/v1/alerts/{id}/dismiss":{"post":{"tags":["alert-controller"],"operationId":"dismiss","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DismissRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertSummary"}}}}}}},"/api/v1/alerts/{id}/acknowledge":{"post":{"tags":["alert-controller"],"operationId":"acknowledge","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertSummary"}}}}}}},"/fhir/metadata":{"get":{"tags":["fhir-metadata-controller"],"operationId":"metadata","responses":{"200":{"description":"OK","content":{}}}}},"/fhir/DetectedIssue":{"get":{"tags":["detected-issue-controller"],"operationId":"search","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"identified","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"pageable","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Pageable"}}],"responses":{"200":{"description":"OK","content":{}}}}},"/fhir/DetectedIssue/{id}":{"get":{"tags":["detected-issue-controller"],"operationId":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{}}}}},"/api/v1/webhook-deliveries":{"get":{"tags":["webhook-delivery-controller"],"operationId":"list_1","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","SENDING","DELIVERED","DEAD_LETTERED"]}},{"name":"pageable","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Pageable"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PageWebhookDeliverySummary"}}}}}}},"/api/v1/series":{"get":{"tags":["series-controller"],"operationId":"list_2","parameters":[{"name":"pageable","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Pageable"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PageSeriesSummary"}}}}}}},"/api/v1/series/{id}/observations":{"get":{"tags":["series-controller"],"operationId":"observations","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ObservationSummary"}}}}}}}},"/api/v1/alerts":{"get":{"tags":["alert-controller"],"operationId":"list_3","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["OPEN","ACKNOWLEDGED","RESOLVED","DISMISSED"]}},{"name":"orgUnitId","in":"query","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"algorithm","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"pageable","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Pageable"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PageAlertSummary"}}}}}}},"/api/v1/alerts/{id}":{"get":{"tags":["alert-controller"],"operationId":"get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AlertDetail"}}}}}}}},"components":{"schemas":{"CreateWebhookSubscriptionRequest":{"type":"object","properties":{"url":{"type":"string","minLength":1},"secret":{"type":"string"},"eventTypes":{"type":"array","items":{"type":"string","enum":["OPEN","ACKNOWLEDGED","RESOLVED","DISMISSED"]},"uniqueItems":true}},"required":["url"]},"WebhookSubscriptionCreated":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"url":{"type":"string"},"secret":{"type":"string"},"eventTypes":{"type":"array","items":{"type":"string","enum":["OPEN","ACKNOWLEDGED","RESOLVED","DISMISSED"]},"uniqueItems":true},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}},"DataElementResult":{"type":"object","properties":{"uid":{"type":"string"},"name":{"type":"string"},"succeeded":{"type":"boolean"},"observationsUpserted":{"type":"integer","format":"int32"},"errorMessage":{"type":"string"}}},"SyncResult":{"type":"object","properties":{"orgUnitsCreated":{"type":"integer","format":"int32"},"weeksRequested":{"type":"integer","format":"int32"},"dataElements":{"type":"array","items":{"$ref":"#/components/schemas/DataElementResult"}}}},"DetectionRunSummary":{"type":"object","properties":{"algorithm":{"type":"string"},"seriesEvaluated":{"type":"integer","format":"int32"},"alertsCreated":{"type":"integer","format":"int32"}}},"DetectionSummary":{"type":"object","properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/DetectionRunSummary"}}}},"AlertSummary":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"orgUnitId":{"type":"integer","format":"int64"},"orgUnitName":{"type":"string"},"dataElementName":{"type":"string"},"algorithm":{"type":"string"},"periodStart":{"type":"string","format":"date"},"score":{"type":"number"},"threshold":{"type":"number"},"severity":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"status":{"type":"string","enum":["OPEN","ACKNOWLEDGED","RESOLVED","DISMISSED"]},"version":{"type":"integer","format":"int64"},"createdAt":{"type":"string","format":"date-time"}}},"DismissRequest":{"type":"object","properties":{"reason":{"type":"string","minLength":1}},"required":["reason"]},"Pageable":{"type":"object","properties":{"page":{"type":"integer","format":"int32","minimum":0},"size":{"type":"integer","format":"int32","minimum":1},"sort":{"type":"array","items":{"type":"string"}}}},"WebhookSubscriptionSummary":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"url":{"type":"string"},"eventTypes":{"type":"array","items":{"type":"string","enum":["OPEN","ACKNOWLEDGED","RESOLVED","DISMISSED"]},"uniqueItems":true},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}},"PageWebhookDeliverySummary":{"type":"object","properties":{"totalPages":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"size":{"type":"integer","format":"int32"},"content":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliverySummary"}},"number":{"type":"integer","format":"int32"},"sort":{"$ref":"#/components/schemas/SortObject"},"pageable":{"$ref":"#/components/schemas/PageableObject"},"numberOfElements":{"type":"integer","format":"int32"},"first":{"type":"boolean"},"last":{"type":"boolean"},"empty":{"type":"boolean"}}},"PageableObject":{"type":"object","properties":{"offset":{"type":"integer","format":"int64"},"paged":{"type":"boolean"},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"sort":{"$ref":"#/components/schemas/SortObject"},"unpaged":{"type":"boolean"}}},"SortObject":{"type":"object","properties":{"empty":{"type":"boolean"},"sorted":{"type":"boolean"},"unsorted":{"type":"boolean"}}},"WebhookDeliverySummary":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"outboxEventId":{"type":"integer","format":"int64"},"subscriptionId":{"type":"integer","format":"int64"},"status":{"type":"string","enum":["PENDING","SENDING","DELIVERED","DEAD_LETTERED"]},"attempts":{"type":"integer","format":"int32"},"nextAttemptAt":{"type":"string","format":"date-time"},"lastError":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"PageSeriesSummary":{"type":"object","properties":{"totalPages":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"size":{"type":"integer","format":"int32"},"content":{"type":"array","items":{"$ref":"#/components/schemas/SeriesSummary"}},"number":{"type":"integer","format":"int32"},"sort":{"$ref":"#/components/schemas/SortObject"},"pageable":{"$ref":"#/components/schemas/PageableObject"},"numberOfElements":{"type":"integer","format":"int32"},"first":{"type":"boolean"},"last":{"type":"boolean"},"empty":{"type":"boolean"}}},"SeriesSummary":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"orgUnitId":{"type":"integer","format":"int64"},"orgUnitName":{"type":"string"},"dhis2DataElementUid":{"type":"string"},"name":{"type":"string"},"frequency":{"type":"string","enum":["WEEKLY"]}}},"ObservationSummary":{"type":"object","properties":{"weekStart":{"type":"string","format":"date"},"value":{"type":"number"},"fetchedAt":{"type":"string","format":"date-time"}}},"PageAlertSummary":{"type":"object","properties":{"totalPages":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"size":{"type":"integer","format":"int32"},"content":{"type":"array","items":{"$ref":"#/components/schemas/AlertSummary"}},"number":{"type":"integer","format":"int32"},"sort":{"$ref":"#/components/schemas/SortObject"},"pageable":{"$ref":"#/components/schemas/PageableObject"},"numberOfElements":{"type":"integer","format":"int32"},"first":{"type":"boolean"},"last":{"type":"boolean"},"empty":{"type":"boolean"}}},"AlertDetail":{"type":"object","properties":{"alert":{"$ref":"#/components/schemas/AlertSummary"},"history":{"type":"array","items":{"$ref":"#/components/schemas/AlertEventSummary"}}}},"AlertEventSummary":{"type":"object","properties":{"fromStatus":{"type":"string","enum":["OPEN","ACKNOWLEDGED","RESOLVED","DISMISSED"]},"toStatus":{"type":"string","enum":["OPEN","ACKNOWLEDGED","RESOLVED","DISMISSED"]},"note":{"type":"string"},"actor":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}}},"securitySchemes":{"bearerAuth":{"type":"http","description":"A JWT from the configured issuer (the optional local Keycloak by default — see docs/keycloak.md) with a realm_access.roles claim naming VIEWER, ANALYST or ADMIN.","name":"bearerAuth","scheme":"bearer","bearerFormat":"JWT"}}}}