Endpoint
Request
This endpoint does not require any parameters.cURL
Response
ISO 8601 timestamp of the last data refresh in America/New_York timezone, or
null if data has never been refreshedResponse Examples
Data Available
No Data Yet
If the app has just started and no data has been fetched:Behavior
Timestamp Source
The endpoint retrieves the timestamp from Redis keyclassrooms:last_refresh, which is updated when:
- Manual refresh: User triggers
/api/refreshsuccessfully - Automatic refresh on startup: App wakes up and data is from a previous day
- Cache miss:
/api/open-classroomsfetches fresh data when cache is empty
Timestamp Format
Timestamps use full ISO 8601 format:- Date and time:
YYYY-MM-DDTHH:MM:SS.ffffff - Timezone offset:
-05:00(Eastern Standard Time) or-04:00(Eastern Daylight Time) - Example:
2026-03-03T14:30:00.123456-05:00
Error Handling
This endpoint is designed to be resilient and never returns an HTTP error. If there’s an issue reading the timestamp from Redis:- Returns
{"last_updated": null} - Logs the error server-side
- Continues to serve the response
Error Fallback
The fail-safe behavior ensures clients can always request this information without error handling complexity. A
null value indicates either no refresh has occurred or there was an error reading the timestamp.Example Usage
Check Data Freshness
JavaScript
Display to User
React Example
Python
cURL
Comparison with /api/open-classrooms
Both endpoints return last updated information:
| Endpoint | Last Updated Info | Use Case |
|---|---|---|
/api/last-updated | Lightweight, timestamp only | Quick freshness check without fetching classroom data |
/api/open-classrooms | Includes last_updated field in response | Get data and freshness in a single request |
Use Cases
- Data Freshness Indicators: Display “Last updated X hours ago” in the UI
- Cache Validation: Determine if client-side cached data is still valid
- Health Monitoring: Check if the data refresh mechanism is working
- Conditional Refresh: Trigger refresh only if data is older than a threshold
Best Practices
Combine this endpoint with
/api/cooldown-status to build smart refresh logic that only refreshes when data is stale AND cooldown is expired.Smart Refresh Example
Notes
- The timestamp reflects when data was fetched, not when it was generated by BU’s system
- Data is cached for 24 hours but may be refreshed more frequently
- The timestamp is in Eastern Time regardless of the client’s timezone
- Parse the timestamp with timezone-aware libraries to handle DST correctly