Skip to main content

Publishing standalone service alerts in your GTFS-Realtime feed

Publish Fixed Route service alerts that aren't tied to a schedule adjustment, such as weather or event notices, in your GTFS-Realtime ServiceAlerts feed.

Written by Cameron Stone

Service alerts tell riders and trip planners about disruptions and notices on your Fixed Route network. Until now, a service alert was always created from a schedule adjustment. You can now also create standalone service alerts: alerts that aren't tied to an adjustment, such as weather warnings or event notices. Standalone alerts are published in your GTFS-Realtime ServiceAlerts feed together with your adjustment-linked alerts.

Standalone service alerts are currently managed through the Spare API only. There is no screen for them in the Admin Interface yet.


Standalone and adjustment-linked alerts

Your service alerts now come from two sources.

Adjustment-linked alerts

These are created from a schedule adjustment and describe that adjustment, for example a detour or a cancelled trip.

Standalone alerts

These are created on their own, without an adjustment. Use them for notices that don't change your schedule, such as severe weather, a special event or general network information.

When you list service alerts, standalone and adjustment-linked alerts are returned together in one list.


Before you start

Check that you have what you need to work with standalone alerts.

  • Access to the Spare API for your organization.

  • The service alerts read permission to view alerts, and the service alerts write permission to create, edit or delete them. These are two new permissions added for standalone alerts.

  • Your GTFS-Realtime ServiceAlerts feed shared with the trip planners and apps your riders use.


Manage standalone alerts with the API

Standalone alerts are created and managed through the Fixed Route service alerts endpoint.

  1. Make sure the user or API key you are using has the service alerts read and write permissions.

  2. Send your requests to /fixedRoute/serviceAlerts. This endpoint lets you create, view, update and delete standalone alerts.

  3. Create the alert with the details riders need to see.

  4. List your service alerts to check the new alert is there. You should see it alongside your adjustment-linked alerts.

  5. Check your GTFS-Realtime ServiceAlerts feed. You should see the standalone alert published in it.

To stop publishing a standalone alert, delete it through the same endpoint.

Adjustment-linked alerts are still managed from their schedule adjustment, not through standalone alert requests.


What your ServiceAlerts feed publishes

Your GTFS-Realtime ServiceAlerts feed now includes both kinds of alerts.

Standalone alerts

Standalone alerts are published in the feed together with your adjustment-linked alerts, so trip planners and rider apps that read your feed pick them up.

Whole-network alerts

When an alert applies to your whole network rather than specific routes or stops, the feed identifies it using your organization's GTFS agency ID.


Upcoming alerts on multi-day adjustments

Alerts for adjustments that run across several days now show the right status between those days.

If an adjustment-linked alert belongs to a schedule that applies in daily windows over several days, the alert now shows as upcoming in the time between two windows. Previously it could show as past, even though the adjustment would apply again the next day.


FAQ

Common questions about standalone service alerts.

Can I create a standalone alert in the Admin Interface?

Not yet. Standalone alerts are currently created and managed through the Spare API.

Do I need to change anything to publish standalone alerts in my feed?

No. Once a standalone alert is created, it is included in your existing GTFS-Realtime ServiceAlerts feed.

Will my existing adjustment-linked alerts change?

They keep working as before. The only change is that alerts on multi-day adjustments now show as upcoming between daily windows instead of past.

Did this answer your question?