Skip to main content
You can control your game servers from your game client, a custom backend service, or any other application by using the PlayFlow API. We provide two primary ways to interact with the API:
  • Unity SDK: A convenient C# wrapper for developers using Unity.
  • REST API: For all other game engines and custom backends.

REST API Reference

Base URL, authentication, and curl examples for every endpoint.

OpenAPI Endpoints

The interactive, auto-generated reference for schemas and responses.

Prerequisites

Before you start, make sure you have:
  • The PlayFlow Unity SDK installed. See the installation guide.
  • A PlayFlow project with at least one build uploaded.
  • An API key from the PlayFlow Dashboard under Project Settings. PlayFlow issues two key types:
    • Server key (pf_*) — full access. Keep it server-side (backend, CI/CD). Required for actions like deleting builds or updating project settings.
    • Client key (pfclient_*) — safe to ship inside a game build.
Never embed a server key (pf_*) in a client or WebGL build. Use a client key (pfclient_*) for anything that ships to players.

Unity SDK Examples

The following examples use the PlayflowServerApiClient class from the SDK.

Initialization

First, you need to initialize the client with your PlayFlow API key.

Starting a Game Server

To start a new server, you provide a configuration that specifies the server’s name, region, and any custom data you want to pass to it. Both name and region are required. Select a build with version_tag (the build name) plus an optional version.
On the Free plan every server is forced to the small compute size and a 1-hour TTL, and you can run one active server at a time. Upgrade to Pro ($20/mo) for all compute sizes, TTLs up to 24 hours, and unlimited active servers. See plan and instance types and regions.
To connect a game client, read the host and port from the network_ports array on the server object once the server is running — do not hardcode a port. Ports are allocated by the proxy and differ from your build’s internal port. Poll the server (GetServerAsync) or list servers until network_ports is populated, then use host + external_port for each entry.

Stopping a Game Server

To stop a running server, you just need its unique instance_id.

Listing Game Servers

You can get a list of all your currently running servers. This is perfect for building a server browser.

REST API (any engine)

If you’re not using Unity, the same operations are available over plain HTTP. The API base URL is https://api.computeflow.cloud/api, and every request authenticates with an api-key header. Starting a server with the REST API mirrors the Unity example above:
The response includes a snake_case instance_id. Once the server is running, read host and external_port from each entry in network_ports to connect a client — never hardcode a port.
See the REST API Reference for authentication, the full server-start parameter set, and curl examples for stopping, listing, and inspecting servers.

Next steps

Lobbies & Matchmaking

Group players and match them into sessions before launching a server.

Uploading Builds

Upload and manage the server builds you launch with version_tag.

Plans & Instance Types

Compare compute sizes, plan limits, and TTLs.

Regions

The regions you can launch servers in.