a month ago
Hello Railway team and community,
I'm researching Railway's API capabilities for building a read-only deployment monitoring system. Before implementing anything, I'd appreciate clarification on a few questions.
1. Read-only API access
Can an OAuth token with project:viewer permissions retrieve project, service, and deployment metadata through Railway's GraphQL API without having permission to create deployments, modify configurations, or access environment-variable values?
2. Deployment and service monitoring
Which API queries provide information about:
- Active deployment and snapshot IDs
- Running and healthy replicas
- Pending, queued, or staged deployments
- GitHub autodeploy configuration
Can these fields be retrieved without receiving sensitive environment-variable values?
3. Deployment history completeness
Does Railway provide a reliable history of all deployment activity, including canceled, failed, short-lived, and subsequently removed deployments?
For example, if a deployment starts and finishes between two monitoring requests, is there an API or event log that would reliably capture that activity?
4. API freshness and limitations
Are there documented limits regarding event retention, indexing delays, pagination, or API rate limits that would affect monitoring approximately once per minute?
5. Recommended approach
Would Railway recommend GraphQL polling, webhooks, audit logs, or another provider-native mechanism for reliable read-only deployment monitoring?
I'm primarily interested in documented API capabilities and limitations. Links to official documentation would be greatly appreciated.
Thank you for your help!
1 Reply
a month ago
An OAuth token with project:viewer grants viewer access only to the projects the user selects at consent, and the requested scope is a ceiling, so the token never gets more than the user's actual role allows (scopes). Variable values come from their own queries, so a monitor that only queries project, service and deployment fields never receives them. The full schema, including deployment status, service instance source and deploy settings, is browsable through introspection or the GraphiQL playground, with worked examples in Manage Deployments.
The deployments query returns deployments in every status, including FAILED, CRASHED, SKIPPED, REMOVED and queued or waiting ones, so a deployment that starts and finishes between two polls still appears in history afterwards. It is paginated with cursors (first/after). Deleted deployments are excluded by default and are only included when you pass includeDeleted.
Public API limits are per hour and per second by plan, with X-RateLimit-* headers on every response and HTTP 429 plus Retry-After when exceeded (rate limits); polling once a minute is about 60 requests per hour per query. Workspace audit logs are only visible within a plan-based window (2 days on Free/Hobby, 30 days on Pro), so they are not suited as a long-term deployment record.
For monitoring, project webhooks fire on deployment status changes across all environments, but delivery is best-effort and unordered, so the recommended pattern is to treat webhooks as a trigger and reconcile against the GraphQL deployments query as the source of truth.
Status changed to Awaiting User Response Railway • about 1 month ago
24 days ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 24 days ago