A GTFS-Realtime service alert has sixteen possible fields. Three of them are required. The specification will name each field, its type, and whether it is optional. It will not tell you what a rider standing at a stop actually sees when you fill each one in, and that gap is where most agencies get alerts wrong.
This is a field reference for the message carried inside alerts.pb. Every claim below is checked against the current GTFS-Realtime reference at gtfs.org. Where the spec stays silent on consumer app behavior, that silence is stated plainly rather than guessed past.
What Is a GTFS-Realtime Service Alert?
A GTFS-Realtime service alert is a structured message inside an agency’s alerts.pb feed that describes a disruption: what it affects, when it applies, and why. It combines two enumerated fields, cause and effect, with free-text header and description fields, so software and riders can interpret the same disruption without separate translation.
Alerts are one of three GTFS-Realtime feed types, alongside trip updates and vehicle positions. Alerts extend the static General Transit Feed Specification (GTFS) with information that changes hour to hour: a closed stop, a detour, a suspended route. A trip planner that only reads the static feed has no way to know any of that happened.
What Is Inside alerts.pb?
An alerts.pb file is a serialized FeedMessage containing one or more Alert entities, built from the fields below: some required, most optional, a few still marked experimental.
| Field | Type | Required? | What it carries |
|---|---|---|---|
informed_entity | EntitySelector, repeated | Yes, at least one | What the alert applies to: an agency, route, trip, or stop |
header_text | TranslatedString | Yes | The short, prominent line a rider sees first |
description_text | TranslatedString | Yes | The full explanation a rider sees after tapping in |
cause | Cause enum | Required only if cause_detail is set | Why the disruption happened |
effect | Effect enum | Required only if effect_detail is set | What the disruption does to service |
active_period | TimeRange, repeated | Optional | When the alert should display |
url | TranslatedString | Optional | A link to more detail |
tts_header_text / tts_description_text | TranslatedString | Optional | Text-to-speech versions for voice assistants and accessible displays |
severity_level | SeverityLevel enum | Optional, experimental | UNKNOWN_SEVERITY, INFO, WARNING, or SEVERE |
cause_detail / effect_detail | TranslatedString | Optional, experimental | Agency-specific wording beyond the enum |
image / image_alternative_text | TranslatedImage / TranslatedString | Optional | A supporting image and its alt text |
The reference also defines communication_period and impact_period, newer fields that separate when an alert is shown from when service is affected. Two fields carry the entire meaning riders act on: informed_entity scopes the alert, and header_text plus description_text explain it. Everything else refines those two.
Informed Entity: Who the Alert Is About
informed_entity uses an EntitySelector, which can carry agency_id, route_id, route_type, trip, stop_id, and direction_id. At least one of those has to be set. This is where most invisible alerts go wrong.
| Field | Scopes the alert to | Rider effect when set |
|---|---|---|
agency_id | An entire transit agency | Every rider using every route from that agency sees it |
route_id | One route, all trips and stops | Riders on that route see it; riders on other routes do not, even at a shared stop |
route_type | Every route of a given mode | Useful for “all bus service” alerts, rare in single-mode small agencies |
stop_id | One stop, every route through it | Riders waiting at that stop see it regardless of which bus they are catching |
trip | One scheduled trip | Riders tracking that specific run see it; the rest of the route does not |
direction_id | One travel direction | Meaningless alone. Pair it with route_id, since 0 and 1 carry no fixed meaning outside your own trips.txt |
The scoping mistake that makes an alert invisible is combining fields expecting them to broaden the audience. The spec is explicit: “at least one specifier must be given. If several specifiers are given, the matching has to apply to all.” Setting both route_id and stop_id does not mean “riders of this route, or riders at this stop.” It means the intersection: only riders of this route at this specific stop. An agency wanting a route-wide closure but setting stop_id on every stop the route serves has written dozens of narrow alerts, not one broad one. MobilityData’s alert guidance makes the same point: use one route-level entity, not a stop-by-stop list.
Cause and Effect: The Two Enumerations That Matter
Cause and effect are the fields that let software, not just riders, understand a disruption. Both are enumerations, and both are optional unless you also set the matching _detail field.
Cause, per the GTFS-Realtime Cause enum:
| Value | Typical use |
|---|---|
| UNKNOWN_CAUSE | Default when no cause is known |
| OTHER_CAUSE | Something not covered below |
| TECHNICAL_PROBLEM | Vehicle or equipment failure |
| STRIKE | Labor action |
| DEMONSTRATION | Planned protest or march affecting the route |
| ACCIDENT | Collision or incident on the route |
| HOLIDAY | Reduced service for a holiday schedule |
| WEATHER | Storm, flooding, snow |
| MAINTENANCE | Scheduled vehicle or facility work |
| CONSTRUCTION | Roadwork or sidewalk work along the route |
| POLICE_ACTIVITY | An active police response |
| MEDICAL_EMERGENCY | An onboard or nearby medical incident |
| SPECIAL_EVENT | A parade, game, or festival changing traffic patterns |
Effect, per the GTFS-Realtime Effect enum:
| Value | What changes for the rider |
|---|---|
| NO_SERVICE | Nothing runs in the scoped entity |
| REDUCED_SERVICE | Fewer trips than the published schedule |
| SIGNIFICANT_DELAYS | Trips run, but late |
| DETOUR | A different physical path, possibly different stops |
| ADDITIONAL_SERVICE | Extra trips beyond the schedule |
| MODIFIED_SERVICE | Some other schedule change not covered above |
| STOP_MOVED | The stop location has changed, temporarily or permanently |
| NO_EFFECT | Informational only, nothing about service actually changes |
| ACCESSIBILITY_ISSUE | Service runs, but an accessibility feature does not |
| OTHER_EFFECT | Something not covered above |
| UNKNOWN_EFFECT | Default when no effect is known |
Here is the honest part the spec will not tell you. How each app renders effect is up to the app. The common effects, such as NO_SERVICE and DETOUR, are the ones most likely to get distinct treatment. Rarer values, such as STOP_MOVED or ACCESSIBILITY_ISSUE, may be folded into a generic disruption notice or shown as text only. cause often travels as machine-readable context that apps may not show at all. Never depend on cause to communicate anything to a rider. Put the real explanation in header_text and description_text.
Active Period: Why Your Alert Is Still Showing Three Days Later
active_period is a repeated TimeRange with a start and end timestamp. Leave start empty and the window begins at minus infinity. Leave end empty and it never closes on its own; the alert shows as long as it stays in the feed. Give more than one active_period, and the alert appears during each of them, one recurring Saturday closure published once instead of republished weekly.
The three-day-old alert almost always traces to one of these:
| Symptom | Usual cause | Fix |
|---|---|---|
| Alert shows after the disruption ended | No end value was set | Add an end timestamp when the alert is created, not after |
| Alert shows before the disruption starts | start was left blank | Set start explicitly if the window should not begin immediately |
| Alert never disappears | It is still present as an entity in the feed | Remove the Alert entity from the next feed publish. active_period controls display timing, not feed membership |
| Alert reappears later | A repeated active_period was reused across an unrelated event | Give each disruption its own Alert entity |
Header, Description, and URL: What Riders Read
header_text is required. Per the spec it “will be highlighted, for example in boldface,” which makes it the line in a list view or a push notification. description_text is also required. The spec formats it “as the body of the alert”: the fuller text a rider reaches after tapping in. An optional url field can point to more detail: a detour map, or a full advisory page.
Write header_text as if it is the only thing the rider will read, because for many riders it is. Six to ten words, the disruption and its scope: “Route 12 detoured on Elm Street,” not “Service Advisory.” Save the why, the how long, and the what-to-do-instead for description_text. All three fields are TranslatedString types, each able to carry more than one language in the same feed entity.
Three Worked Examples
Each example shows only the fields that matter for that disruption. header_text and description_text are always required alongside them.
Example 1: A Stop Closure
| Field | Value |
|---|---|
informed_entity | stop_id: 1042 |
cause | CONSTRUCTION |
effect | NO_SERVICE |
active_period | Aug 25, 2026 to Sep 8, 2026 (14 days) |
header_text | “Stop 1042 closed for sidewalk repair” |
description_text | “Stop 1042 is closed for 2 weeks starting August 25 for sidewalk repair. Use Stop 1044, two blocks north, during the closure.” |
Only stop_id is set, not route_id. Every route serving that stop is affected, which is correct: the sidewalk is closed regardless of which bus would have used it.
Example 2: A Detour
| Field | Value |
|---|---|
informed_entity | route_id: 7, direction_id: 0 |
cause | CONSTRUCTION |
effect | DETOUR |
active_period | Sep 2, 2026, 6:00 AM to Sep 4, 2026, 11:59 PM (3 days) |
header_text | “Route 7 detoured around Main Street” |
description_text | “Route 7 outbound is detoured via Second Avenue and Oak Street through September 4. The Main Street and Oak Street stops are not served. Use the temporary stop at Second and Oak.” |
url | Link to the detour map |
direction_id narrows the alert to outbound trips only. The inbound direction runs its normal route and should not carry this alert.
Example 3: A Full Route Suspension
| Field | Value |
|---|---|
informed_entity | route_id: 22 |
cause | WEATHER |
effect | NO_SERVICE |
active_period | start Aug 22, 2026, 5:00 AM; end not set |
header_text | “Route 22 suspended until further notice” |
description_text | “Route 22 is suspended due to flooding at the Cedar Creek crossing. Riders can use Route 9 or contact dispatch for paratransit options. This alert will be updated when service resumes.” |
No end value is set on purpose. Nobody knows yet when the water recedes, and that open-endedness is exactly what an unset end field is for. The agency updates or removes the alert once the crossing reopens.
FAQ
What File Format Is alerts.pb?
It is a serialized Protocol Buffer, not JSON or XML. The .pb extension signals the binary format defined by the GTFS-Realtime FeedMessage schema. Opening it in a text editor produces unreadable output; reading it requires a GTFS-Realtime library or a feed viewer built to decode it.
Can One Alert Affect More Than One Route?
Yes. informed_entity is repeated, so a single Alert can list several EntitySelector entries, for instance two separate route_id values for a shared detour. Each entry follows the same matching rules on its own; they do not combine into one broader scope.
Why Doesn’t My Alert Show Up in Google Maps?
Google Maps and most transit apps read GTFS-Realtime data from a static feed URL your agency registers with each consumer separately from your website widget. If the alert appears on your own site but not in a trip planner, the two are reading different feeds entirely, and the registered feed likely needs attention.
Where This Goes Next
TransitFare is a transit technology company founded in 2012 that builds GTFS-Realtime alert publishing tools for small and mid-sized transit agencies. Its alert dashboard writes a spec-correct GTFS-Realtime alert feed automatically. A transit planner sets cause, effect, and scope in a form, not a protobuf editor. The same alert also goes to the agency’s website widget, email, SMS, and social media.
None of that changes what is written above. The fields behave the way this reference describes no matter what publishes them, and a self-managed pipeline should hold to the same rules. For getting a correctly formed feed in front of Google Maps, see the step-by-step publishing procedure. To see the publishing side of this in a live dashboard, explore Transit Alerts.
