Files

Read a file

GET
/game-servers/{slice}/files/contents

This endpoint answers with the file itself, not with JSON. A file is bytes: encoding one into JSON would refuse anything that is not valid UTF-8, and base64 would inflate every transfer by a third to describe what you already have. Only the error responses are JSON.

Files up to 10 MiB are served whole. Past that, either ask for a window with offset and length, or take a URL from GET files/download and fetch it from the node directly — the ceiling exists to keep a large read off the API's request path, not because the node cannot serve it.

A windowed read answers 206 with a Content-Range, so an ordinary HTTP client can walk a large log without any of this being special-cased.

A whole-file read carries an ETag of the form "sha256:<hex>" — the SHA-256 of the bytes. Send it back as If-Match on PUT files/contents to write only if nobody changed the file in the meantime.

Authorization

orgApiKey game-servers.files.read
AuthorizationBearer <token>

An organisation API key, prefixed tbk_. Create one under Organisation to API keys; the plaintext is shown once.

The scopes listed on each operation are the abilities the key must carry. They are not OAuth scopes and are not negotiated per request.

In: header

Scope: game-servers.files.read

Path Parameters

slice*string

The server's UUID, as returned by the list endpoint.

Formatuuid

Query Parameters

file*string

Absolute path from the server root. A .. segment is refused rather than resolved — whether /a/link/../b means /b depends on whether link is a symlink, which only the node knows.

Lengthlength <= 1024
offset?integer

First byte to read. Any value above zero makes this a windowed read.

Range0 <= value
Default0
length?integer

How many bytes to read from offset. Capped at 10 MiB.

Range1 <= value <= 10485760

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/game-servers/497f6eca-6276-4993-bfeb-53cbbbba6f08/files/contents?file=%2Fserver.properties"
"string"