{"openapi":"3.0.1","info":{"title":"Adhoc Notifications API","description":"Reactive Spring Boot API for managing adhoc notifications. Publishes preboard, onboard, and cancellation notifications via AWS SNS and queries notification history from DynamoDB.","version":"1.0.22","contact":{"name":"Amtrak IT Team","email":"api-support@amtrak.com"},"license":{"name":"Proprietary","url":"https://www.amtrak.com/licenses"}},"servers":[{"url":"https://{dev-host}/{basePath}","description":"Development environment","variables":{"dev-host":{"default":"dev-host","description":"Development API host — substituted at runtime"},"basePath":{"default":"","description":"API base path (e.g. v1, soap/trainstatusv2)"}}},{"url":"https://{stage-host}/{basePath}","description":"Stage environment","variables":{"stage-host":{"default":"stage-host","description":"Stage API host — substituted at runtime"},"basePath":{"default":"","description":"API base path (e.g. v1, soap/trainstatusv2)"}}},{"url":"https://{prod-host}/{basePath}","description":"Production environment","variables":{"prod-host":{"default":"prod-host","description":"Production API host — substituted at runtime"},"basePath":{"default":"","description":"API base path (e.g. v1, soap/trainstatusv2)"}}}],"paths":{"/v1/adhocnotification/preboard":{"post":{"tags":["Adhoc Notifications"],"summary":"Publish preboard notification","description":"Publishes a preboard travel notification to SNS.","operationId":"publishPreboardNotification","requestBody":{"description":"Preboard notification payload","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishPreboardNotificationCommand"}}}},"responses":{"200":{"description":"Notification published successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleSuccessResponse"}}}},"400":{"description":"Invalid request payload"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/v1/adhocnotification/onboard":{"post":{"tags":["Adhoc Notifications"],"summary":"Publish onboard notification","description":"Publishes an onboard travel notification to SNS.","operationId":"publishOnboardNotification","requestBody":{"description":"Onboard notification payload","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishOnboardNotificationCommand"}}}},"responses":{"200":{"description":"Notification published successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleSuccessResponse"}}}},"400":{"description":"Invalid request payload"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/v1/adhocnotification/fullCancel":{"post":{"tags":["Adhoc Notifications"],"summary":"Publish full cancel notification","description":"Publishes a full trip cancellation notification to SNS.","operationId":"publishFullCancelNotification","requestBody":{"description":"Full cancel notification payload","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishFullCancelNotificationCommand"}}}},"responses":{"200":{"description":"Notification published successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleSuccessResponse"}}}},"400":{"description":"Invalid request payload"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/v1/adhocnotification/partialCancel":{"post":{"tags":["Adhoc Notifications"],"summary":"Publish partial or full cancel notification","description":"Publishes a partial or full trip cancellation notification to SNS. SubType controls type (PARTIAL_CANCEL or FULL_CANCEL).","operationId":"publishPartialCancelNotification","requestBody":{"description":"Partial/full cancel notification payload","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishPartialCancelNotificationCommand"}}}},"responses":{"200":{"description":"Notification published successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleSuccessResponse"}}}},"400":{"description":"Invalid request payload"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/v1/adhocnotification/list":{"post":{"tags":["Adhoc Notifications"],"summary":"List notifications","description":"Query paginated list of adhoc notifications by train number, travel date, and notification category.","operationId":"listNotifications","requestBody":{"description":"Notification query criteria with pagination","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationQuery"}}}},"responses":{"200":{"description":"Notifications retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationListResponse"}}}},"400":{"description":"Invalid query parameters"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/v1/adhocnotification/{id}":{"get":{"tags":["Adhoc Notifications"],"summary":"Get notification by ID","description":"Retrieves a single adhoc notification record by its UUID.","operationId":"getNotificationById","parameters":[{"name":"id","in":"path","description":"UUID of the notification to retrieve","required":true,"schema":{"type":"string","format":"uuid"},"example":"550e8400-e29b-41d4-a716-446655440000"}],"responses":{"200":{"description":"Notification found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationResponse"}}}},"404":{"description":"Notification not found"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}},"/v1/adhocnotification/station/messages":{"get":{"tags":["Station Messages"],"summary":"Get active station messages","description":"Retrieves active station messages, optionally filtered by station code.","operationId":"getStationMessages","parameters":[{"name":"stationCode","in":"query","description":"Station code to filter messages (e.g. NYP, PHL). Omit for all stations.","required":false,"schema":{"type":"string"},"example":"NYP"}],"responses":{"200":{"description":"Station messages retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetStationMessagesResponse"}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]},"post":{"tags":["Station Messages"],"summary":"Create or update station message","description":"Creates a new station message or updates an existing one (if id is provided).","operationId":"createStationMessage","requestBody":{"description":"Station message to create or update","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateStationMessageCommand"}}}},"responses":{"200":{"description":"Station message created or updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StationMessageCreateResponse"}}}},"400":{"description":"Invalid request payload"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]},"delete":{"tags":["Station Messages"],"summary":"Delete station message","description":"Deletes a station message by its ID and station code.","operationId":"deleteStationMessage","requestBody":{"description":"Station message ID and station code to delete","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteStationMessageCommand"}}}},"responses":{"202":{"description":"Station message deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StationMessageCreateResponse"}}}},"400":{"description":"Invalid request payload"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Station message not found"},"500":{"description":"Internal server error"}},"security":[{"BearerAuth":[]}]}}},"components":{"schemas":{"SimpleSuccessResponse":{"type":"object","description":"Standard success response returned for all notification publish operations","properties":{"success":{"type":"string","description":"HTTP status code as string indicating success","example":"200"}}},"NotificationListResponse":{"type":"object","description":"Paginated list of adhoc notification records","properties":{"count":{"type":"integer","description":"Total number of notifications returned in this page","example":25},"lastEvaluatedKey":{"type":"object","description":"DynamoDB pagination key for the next page; null when no more results","additionalProperties":{"type":"string"}},"data":{"type":"array","description":"List of notification records","items":{"$ref":"#/components/schemas/NotificationListItem"}}}},"NotificationListItem":{"type":"object","properties":{"serviceNumber":{"type":"string","example":"174"},"departureDate":{"type":"string","example":"2026-03-26"},"notificationDateTime":{"type":"string","example":"2026-03-26T17:58:38.000Z"},"notificationType":{"type":"string","example":"PRE_TRIP"},"notificationSubType":{"type":"string","example":"SCHEDULE_NOTIFICATION"},"status":{"type":"string","example":"SUCCESS"},"stationCode":{"type":"string","example":"NYP"}}},"NotificationResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"notificationType":{"type":"string","example":"PREBOARD"},"status":{"type":"string","example":"SUCCESS"}}},"GetStationMessagesResponse":{"type":"object","description":"Response containing active station messages","properties":{"correlationId":{"type":"string","example":"f47ac10b-58cc-4372-a567-0e02b2c3d479"},"currentTime":{"type":"string","example":"2026-06-28T10:00:00.000Z"},"count":{"type":"string","example":"5"},"items":{"type":"array","items":{"$ref":"#/components/schemas/StationMessageResponse"}}}},"StationMessageResponse":{"type":"object","properties":{"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"stationCode":{"type":"string","example":"NYP"},"message":{"type":"string","example":"Platform 12 temporarily closed for maintenance."},"updateTime":{"type":"string","example":"2026-06-28T10:00:00.000Z"}}},"StationMessageCreateResponse":{"type":"object","description":"Response returned after creating, updating, or deleting a station message","properties":{"correlationId":{"type":"string","example":"f47ac10b-58cc-4372-a567-0e02b2c3d479"},"currentTime":{"type":"string","example":"2026-06-28T10:00:00.000Z"},"message":{"type":"string","example":"Created Successfully"}}},"PublishPreboardNotificationCommand":{"type":"object","description":"Preboard notification payload","properties":{"traceID":{"type":"string","example":"TRACE-001"},"notification":{"type":"object"}}},"PublishOnboardNotificationCommand":{"type":"object","description":"Onboard notification payload","properties":{"traceID":{"type":"string","example":"TRACE-002"},"notification":{"type":"object"}}},"PublishFullCancelNotificationCommand":{"type":"object","description":"Full cancel notification payload","properties":{"traceID":{"type":"string","example":"TRACE-003"},"notification":{"type":"object"}}},"PublishPartialCancelNotificationCommand":{"type":"object","description":"Partial/full cancel notification payload","properties":{"traceID":{"type":"string","example":"TRACE-004"},"notification":{"type":"object"}}},"NotificationQuery":{"type":"object","description":"Query criteria for listing notifications with pagination","properties":{"trainNumber":{"type":"string","example":"174"},"travelDate":{"type":"string","example":"2026-03-26"},"lastEvaluatedKey":{"type":"object","additionalProperties":{"type":"string"}}}},"CreateStationMessageCommand":{"type":"object","description":"Command to create or update a station message","properties":{"id":{"type":"string","description":"Provide to update an existing message; omit to create new","example":"550e8400-e29b-41d4-a716-446655440000"},"stationCode":{"type":"string","example":"NYP"},"message":{"type":"string","example":"Platform 12 temporarily closed."}}},"DeleteStationMessageCommand":{"type":"object","description":"Command to delete a station message","properties":{"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"stationCode":{"type":"string","example":"NYP"}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Azure AD OAuth2 JWT token. Pass as 'Authorization: Bearer <token>'."}}}}