API / Method reference / Server files
Server files
Listing, reading, writing, deleting and renaming files.
Base URL:
https://sourhost.net/api/v1·Auth: Authorization: Bearer sh_live_…GET
/projects/:id/services/:serviceId/files— List filesGET/projects/:id/services/:serviceId/files/content— Read a filePUT/projects/:id/services/:serviceId/files/content— Write a filePOST/projects/:id/services/:serviceId/files/delete— Delete filesPOST/projects/:id/services/:serviceId/files/rename— Rename a filePOST/projects/:id/services/:serviceId/files/folder— Create a folderGET
/projects/:id/services/:serviceId/filesList files
Scope:
servers:filesParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service number (from GET /projects/:id/services) |
dir | query · string | Folder, 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
| 404 | file_not_found | No such file or folder |
| 400 | path_invalid | Invalid path |
GET
/projects/:id/services/:serviceId/files/contentRead a file
Scope:
servers:filesParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service number (from GET /projects/:id/services) |
pathrequired | query · string | Path 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
| 404 | file_not_found | No such file or folder |
| 413 | file_too_large | Over 1 MB or not text |
| 400 | path_invalid | Invalid path |
PUT
/projects/:id/services/:serviceId/files/contentWrite a file
Replaces the whole file (creates it if it's missing).
Scope:
servers:filesParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service number (from GET /projects/:id/services) |
pathrequired | body · string | File path |
contentrequired | body · string | The 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
| 413 | file_too_large | Over 1 MB or not text |
| 400 | path_invalid | Invalid path |
POST
/projects/:id/services/:serviceId/files/deleteDelete files
Scope:
servers:filesParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service number (from GET /projects/:id/services) |
rootrequired | body · string | Folder, e.g. /game/csgo/cfg |
filesrequired | body · 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/renameRename a file
Scope:
servers:filesParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service 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/folderCreate a folder
Scope:
servers:filesParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service 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
| 400 | bad_request | Invalid body or parameters |
| 401 | token_invalid | The token is wrong, revoked or expired |
| 403 | token_scope_missing | The token lacks the scope |
| 403 | token_project_forbidden | The project or service is outside the token’s limits |
| 404 | not_found | No such project, service or object |
| 429 | token_rate_limited | Too many requests, see Retry-After |
| 503 | upstream_unavailable | The panel or node didn't answer — retry later |