RailwayDocs
Back to Guides

Manage Environments with the Public API

Here are examples to help you manage your environments using the Public API.

List environments

Get all environments for a project:

Variables

Exclude ephemeral environments

Filter out PR/preview environments:

Variables

Get a single environment

Fetch an environment by ID with its service instances:

Variables

Create an environment

Create a new environment:

Variables

Rename an environment

Variables

Delete an environment

Variables

Get environment logs

Fetch logs from all services in an environment:

Variables

Staged changes

Railway supports staging variable changes before deploying them.

Get staged changes

Variables

Commit staged changes

Variables