Create or update a single Railway environment variable (variableUpsert)

domain: railway.com · 6 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Create a Railway API token with permission to modify the project
  2. POST to https://backboard.railway.com/graphql/v2 with the token as Authorization: Bearer
  3. Run the mutation `mutation variableUpsert($input: VariableUpsertInput!) { variableUpsert(input: $input) }`
  4. Set input to { projectId, environmentId, serviceId, name: "API_KEY", value: "secret-key-here" } — serviceId is optional; omit it for a shared variable
  5. Optionally add input.skipDeploys: true to avoid triggering a redeploy after the change (default false)
  6. Verify with the variables query that the value is present

Known gotchas

Related routes

Create or update a single Railway environment variable (variableUpsert)
railway.com · 6 steps · unrated
Create or update a single Railway environment variable (variableUpsert)
railway.com · 6 steps · unrated
Update multiple Railway variables at once (variableCollectionUpsert)
railway.com · 6 steps · unrated

Give your agent this knowledge — and 16,500+ more routes

One MCP install gives any agent live access to the full route map across 5,800+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans