Railway.com GraphQL API automation for projects, services, deployments, and environment variables. Use when automating Railway operations, querying project data, managing deployments, setting variables via API, or integrating Railway into workflows.
66
78%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.claude/skills/railway-api/SKILL.mdThe canonical home for this skill is railway-api in fernandezbaptiste/Skrillz
Comprehensive reference for Railway.com GraphQL API v2 automation including authentication, queries, mutations, and workflow automation.
The Railway GraphQL API enables programmatic access to all Railway platform features:
API Endpoint: https://backboard.railway.com/graphql/v2
Railway supports three token types with different scopes:
| Token Type | Header | Scope | Use Case |
|---|---|---|---|
| Account | Authorization: Bearer <token> | All user resources | Personal automation |
| Team | Team-Access-Token: <token> | Team-specific resources | Team workflows |
| Project | Project-Access-Token: <token> | Single project only | CI/CD, project automation |
Get tokens: Use the railway-auth skill or Railway dashboard → Account Settings → Tokens
curl https://backboard.railway.com/graphql/v2 \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"query": "query { me { name email } }"}'curl https://backboard.railway.com/graphql/v2 \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation($input: VariableUpsertInput!) { variableUpsert(input: $input) }",
"variables": {
"input": {
"projectId": "project-id",
"environmentId": "env-id",
"name": "API_KEY",
"value": "secret-value"
}
}
}'query {
me {
id
name
email
avatar
isAdmin
}
}query {
projects {
edges {
node {
id
name
description
createdAt
updatedAt
}
}
}
}query GetProject($projectId: String!) {
project(id: $projectId) {
id
name
description
services {
edges {
node {
id
name
serviceInstances {
edges {
node {
id
environmentId
serviceId
}
}
}
}
}
}
environments {
edges {
node {
id
name
}
}
}
}
}query GetVariables($projectId: String!, $environmentId: String!) {
variables(projectId: $projectId, environmentId: $environmentId) {
edges {
node {
name
value
}
}
}
}mutation SetVariable($input: VariableUpsertInput!) {
variableUpsert(input: $input)
}
# Variables:
{
"input": {
"projectId": "your-project-id",
"environmentId": "your-env-id",
"name": "DATABASE_URL",
"value": "postgresql://..."
}
}mutation TriggerDeployment($serviceId: String!, $environmentId: String!) {
deploymentTrigger(serviceId: $serviceId, environmentId: $environmentId) {
id
status
createdAt
}
}graphql-endpoint.md - Complete API endpoint documentationauthentication.md - Comprehensive authentication guidecommon-queries.md - 15+ query examples with responsescommon-mutations.md - 15+ mutation examples with patternsquery-project.py - Python script for querying Railway APIset-variables.ts - TypeScript script for variable managementRailway API returns errors in this format:
{
"errors": [
{
"message": "Error message",
"extensions": {
"code": "ERROR_CODE"
}
}
]
}Common errors:
UNAUTHORIZED - Invalid or expired tokenFORBIDDEN - Insufficient permissions for resourceNOT_FOUND - Resource doesn't existVALIDATION_ERROR - Invalid input dataBest practices:
errors field in response# Get project token from railway-auth
# Set deployment variables
# Trigger deployment
# Monitor deployment statusSee scripts/ for complete automation examples.
// Define Railway resources in code
// Apply changes via GraphQL mutations
// Track state and changes# Query deployment status
# Check resource usage
# Alert on failuresreferences/graphql-endpoint.md for endpoint detailsreferences/authentication.md for token setupreferences/common-queries.md for data retrievalreferences/common-mutations.md for operationsscripts/ for workflow examplesquery { me { name email } }query { projects { edges { node { id name } } } }variables query with projectId and environmentIddeployments with filtersvariableUpsert mutationdeploymentTrigger mutationserviceCreate mutationvariableDelete mutationSome GraphQL queries return "Problem processing request" even with valid tokens. This is a Railway API limitation, not a token issue.
Affected queries: deployment(id:), deploymentLogs, buildLogs, me.teams, teams
Workaround: Use Railway CLI for these operations:
railway list --json # Projects/teams
railway logs # Deployment/build logsSee api-limitations.md for full details.
93ed392
Canonical home
since Sep 12, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.