API / Method reference / Server files

Server files

Listing, reading, writing, deleting and renaming files.

GET/projects/:id/services/:serviceId/files

List files

Scope: servers:files
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService number (from GET /projects/:id/services)
dirquery · stringFolder, default /
Example request
curl "https://sourhost.net/api/v1/projects/12/services/34/files?dir=%2Fgame%2Fcsgo%2Fcfg" \
  -H "Authorization: Bearer $SOURHOST_TOKEN"
Response
HTTP
HTTP/2 200 OK
{
  "dir": "/game/csgo/cfg",
  "items": [
    {
      "name": "server.cfg",
      "path": "/game/csgo/cfg/server.cfg",
      "directory": false,
      "size": 1834,
      "mimetype": "text/plain",
      "modifiedAt": "2026-11-10T21:14:00Z"
    }
  ]
}
Method errors
404file_not_foundNo such file or folder
400path_invalidInvalid path
GET/projects/:id/services/:serviceId/files/content

Read a file

Scope: servers:files
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService number (from GET /projects/:id/services)
pathrequiredquery · stringPath to a text file up to 1 MB
Example request
curl "https://sourhost.net/api/v1/projects/12/services/34/files/content?path=%2Fgame%2Fcsgo%2Fcfg%2Fserver.cfg" \
  -H "Authorization: Bearer $SOURHOST_TOKEN"
Response
HTTP
HTTP/2 200 OK
{
  "path": "/game/csgo/cfg/server.cfg",
  "size": 1834,
  "content": "hostname \"Retake #1\"\nsv_cheats 0\n"
}
Method errors
404file_not_foundNo such file or folder
413file_too_largeOver 1 MB or not text
400path_invalidInvalid path
PUT/projects/:id/services/:serviceId/files/content

Write a file

Replaces the whole file (creates it if it's missing).

Scope: servers:files
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService number (from GET /projects/:id/services)
pathrequiredbody · stringFile path
contentrequiredbody · stringThe new content, text up to 1 MB
Example request
curl -X PUT "https://sourhost.net/api/v1/projects/12/services/34/files/content" \
  -H "Authorization: Bearer $SOURHOST_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"path":"/game/csgo/cfg/server.cfg","content":"hostname \"Retake #1\"\nsv_cheats 0\n"}'
Response
204 Empty response
Method errors
413file_too_largeOver 1 MB or not text
400path_invalidInvalid path
POST/projects/:id/services/:serviceId/files/delete

Delete files

Scope: servers:files
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService number (from GET /projects/:id/services)
rootrequiredbody · stringFolder, e.g. /game/csgo/cfg
filesrequiredbody · string[]Names of files and folders in root
Example request
curl -X POST "https://sourhost.net/api/v1/projects/12/services/34/files/delete" \
  -H "Authorization: Bearer $SOURHOST_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"root":"/game/csgo/maps","files":["old_map.bsp"]}'
Response
204 Empty response
POST/projects/:id/services/:serviceId/files/rename

Rename a file

Scope: servers:files
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService number (from GET /projects/:id/services)
Example request
curl -X POST "https://sourhost.net/api/v1/projects/12/services/34/files/rename" \
  -H "Authorization: Bearer $SOURHOST_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"root":"/game/csgo/cfg","from":"server.cfg","to":"server.cfg.bak"}'
Response
204 Empty response
POST/projects/:id/services/:serviceId/files/folder

Create a folder

Scope: servers:files
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService number (from GET /projects/:id/services)
Example request
curl -X POST "https://sourhost.net/api/v1/projects/12/services/34/files/folder" \
  -H "Authorization: Bearer $SOURHOST_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"root":"/game/csgo/cfg","name":"tournament"}'
Response
204 Empty response

Common errors

Any method can answer with these. More on errors

400bad_requestInvalid body or parameters
401token_invalidThe token is wrong, revoked or expired
403token_scope_missingThe token lacks the scope
403token_project_forbiddenThe project or service is outside the token’s limits
404not_foundNo such project, service or object
429token_rate_limitedToo many requests, see Retry-After
503upstream_unavailableThe panel or node didn't answer — retry later