PT OPS

Disruptions

Bilingual service disruption messages tied to stations and/or lines.

Last updated: October 8, 2026

Disruptions are bilingual (NOR/ENG) service messages tied to one or more stations and/or lines, active between a startDate and endDate.

POST /disruptions Authentication required
{
  "messageName": "signal-fault-sk",
  "stations": ["SK", "KLH"],
  "lines": ["R81"],
  "disruption": true,
  "NOR": { "Title": "Signalfeil", "Description": "Forsinkelser ved Skogviken." },
  "ENG": { "Title": "Signal fault", "Description": "Delays at Skogviken." },
  "startDate": "2026-09-07T06:00:00Z",
  "endDate": "2026-09-07T18:00:00Z"
}

messageName must be unique.

PUT /disruptions/:id Authentication required

Replaces a disruption's fields (same body shape as POST).

GET /disruptions Public

Returns all disruptions as a JSON array ([] if none).

Response (200 OK)

[
  {
    "_id": "665f1c2e9b1e8a0012a4b7c3",
    "id": "665f1c2e9b1e8a0012a4b7c3",
    "messageName": "track-work-sk",
    "stations": ["SK", "SIG"],
    "lines": ["R81"],
    "disruption": true,
    "NOR": { "Title": "Sporarbeid", "Description": "..." },
    "ENG": { "Title": "Track work", "Description": "..." },
    "startDate": "2026-10-08T04:00:00.000Z",
    "endDate": "2026-10-08T16:00:00.000Z",
    "__v": 0
  }
]

id is a string copy of _id. Dates are UTC ISO 8601 strings.

GET /disruptions/:id Public

Returns a single disruption object by its MongoDB _id (same shape as one element of GET /disruptions), or 404 with { "error": "Disruption not found" }.

GET /locations/:stationCode/disruptions Public

Returns disruptions affecting a station. Add ?isActive=true to only include disruptions currently within their startDate–endDate window. Returns an array of disruption objects (same shape as GET /disruptions), or [] if none match.

GET /lines/:lineCode/disruptions Public

Same as above, filtered by line code. Supports ?isActive=true. Returns the same array shape.

DELETE /disruptions/:id Authentication required

Deletes a disruption. Returns 204 on success.