{"openapi":"3.0.3","info":{"title":"9Craft Public API — Server Management","description":"Control your game servers and VPSes from code: start, stop, restart, run commands and read status. Buying, renewing and changing settings is done in the panel only.\n\nEach game server is identified by its name (`world_name`). Server details, graphs and console commands are Minecraft-only for now.\n\nFor files use FTP: the server's `host`, port `1021`, and the username and password from the panel (File manager → FTP button).","version":"1.0.0"},"servers":[{"url":"https://api.9craft.ir/api"}],"security":[{"ApiKeyAuth":[]}],"paths":{"/server/start":{"post":{"operationId":"startServer","summary":"Start a game server","tags":["Game Server — Actions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorldNameRequest"}}}},"responses":{"200":{"description":"Server started","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleMessage"},"examples":{"started":{"$ref":"#/components/examples/StartOk"}}}}},"400":{"description":"`world_name` missing, no Minecraft server with this name, server disk is full, server is being moved, or another operation is running on it (`SERVER_BUSY`; retry in a few seconds).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"worldNameRequired":{"$ref":"#/components/examples/WorldNameRequired"},"serverNotFound":{"$ref":"#/components/examples/StartServerNotFound"},"diskFull":{"$ref":"#/components/examples/DiskFull"},"serverMigrating":{"$ref":"#/components/examples/ServerMigrating"},"serverBusy":{"$ref":"#/components/examples/ServerBusy"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"Server time has run out (`SUBSCRIPTION_EXPIRED`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"subscriptionExpired":{"$ref":"#/components/examples/SubscriptionExpired"}}}}},"404":{"description":"No server with this `world_name`, or the server is not ready yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"actionServerNotFound":{"$ref":"#/components/examples/ActionServerNotFound"},"containerNotFound":{"$ref":"#/components/examples/ContainerNotFound"}}}}},"503":{"$ref":"#/components/responses/HostOffline503"}}}},"/server/stop":{"post":{"operationId":"stopServer","summary":"Stop a game server","tags":["Game Server — Actions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorldNameRequest"}}}},"responses":{"200":{"description":"Server stopped","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleMessage"},"examples":{"stopped":{"$ref":"#/components/examples/StopOk"}}}}},"400":{"$ref":"#/components/responses/BadRequest400"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/ActionServerNotFound404"},"503":{"$ref":"#/components/responses/HostOffline503"}}}},"/server/restart":{"post":{"operationId":"restartServer","summary":"Restart a game server","tags":["Game Server — Actions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorldNameRequest"}}}},"responses":{"200":{"description":"Server restarted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleMessage"},"examples":{"restarted":{"$ref":"#/components/examples/RestartOk"}}}}},"400":{"description":"`world_name` missing, server disk is full, server is being moved, or another operation is running on it (`SERVER_BUSY`; retry in a few seconds).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"worldNameRequired":{"$ref":"#/components/examples/WorldNameRequired"},"diskFull":{"$ref":"#/components/examples/DiskFull"},"serverMigrating":{"$ref":"#/components/examples/ServerMigrating"},"serverBusy":{"$ref":"#/components/examples/ServerBusy"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"Server time has run out (`SUBSCRIPTION_EXPIRED`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"subscriptionExpired":{"$ref":"#/components/examples/SubscriptionExpired"}}}}},"404":{"$ref":"#/components/responses/ActionServerNotFound404"},"503":{"$ref":"#/components/responses/HostOffline503"}}}},"/server/force_restart":{"post":{"operationId":"forceRestartServer","summary":"Force-restart a game server","description":"Closes the server at once without waiting for it to save, then starts it again. Use only when the server is frozen and a normal restart does nothing.","tags":["Game Server — Actions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorldNameRequest"}}}},"responses":{"200":{"description":"Server restarted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleMessage"},"examples":{"restarted":{"$ref":"#/components/examples/RestartOk"}}}}},"400":{"description":"`world_name` missing, server disk is full, server is being moved, or another operation is running on it (`SERVER_BUSY`; retry in a few seconds).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"worldNameRequired":{"$ref":"#/components/examples/WorldNameRequired"},"diskFull":{"$ref":"#/components/examples/DiskFull"},"serverMigrating":{"$ref":"#/components/examples/ServerMigrating"},"serverBusy":{"$ref":"#/components/examples/ServerBusy"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"Server time has run out (`SUBSCRIPTION_EXPIRED`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"subscriptionExpired":{"$ref":"#/components/examples/SubscriptionExpired"}}}}},"404":{"$ref":"#/components/responses/ActionServerNotFound404"},"503":{"$ref":"#/components/responses/HostOffline503"}}}},"/minecraft/server/cmd":{"post":{"operationId":"runServerCommand","summary":"Run a command on a Minecraft game server","description":"Runs any command you would type in the server console (e.g. `whitelist add`, `ban`, `op`) and returns its output.","tags":["Game Server — Actions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CmdRequest"}}}},"responses":{"200":{"description":"Command output","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CmdResponse"},"examples":{"result":{"$ref":"#/components/examples/CmdOk"}}}}},"400":{"description":"`world_name` or `cmd` missing, server is being moved, server is stopped (`SERVER_NOT_RUNNING`), or the command did not reach the server (`SERVER_NOT_REACHABLE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"worldNameRequired":{"$ref":"#/components/examples/WorldNameRequired"},"cmdRequired":{"$ref":"#/components/examples/CmdRequired"},"serverMigrating":{"$ref":"#/components/examples/ServerMigrating"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"Server time has run out (`SUBSCRIPTION_EXPIRED`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"subscriptionExpired":{"$ref":"#/components/examples/CmdSubscriptionExpired"}}}}},"404":{"$ref":"#/components/responses/ActionServerNotFound404"},"503":{"$ref":"#/components/responses/HostOffline503"}}}},"/servers":{"get":{"operationId":"listServers","summary":"List all game servers","tags":["Game Server — Status"],"responses":{"200":{"description":"Your servers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerListResponse"},"examples":{"list":{"$ref":"#/components/examples/ServersListOk"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/server/data":{"get":{"operationId":"getServerData","summary":"Details of a Minecraft game server","tags":["Game Server — Status"],"parameters":[{"$ref":"#/components/parameters/WorldNameQuery"}],"responses":{"200":{"description":"Server details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerData"},"examples":{"data":{"$ref":"#/components/examples/ServerDataOk"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Server not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"$ref":"#/components/examples/DataServerNotFound"}}}}}}}},"/server/logs/query":{"get":{"operationId":"queryServerLogs","summary":"Read a game server's console log","description":"The server console log, for every game. You can search (`grep`), keep only errors (`level`), download a text file (`format=text`) or follow the log live (`follow`). Times are in Tehran time.\n\nTo keep reading, send the response's `next_since` as `since` in the next request. Limit: 30 requests per minute.","tags":["Game Server — Status"],"parameters":[{"$ref":"#/components/parameters/WorldNameQuery"},{"name":"tail","in":"query","description":"How many recent lines. Default 200, max 2000 (up to 20000 for a text file or live log).","schema":{"type":"integer","minimum":1,"maximum":20000}},{"name":"since","in":"query","description":"From when: `start` (since the last start), a duration like `10m`, `2h`, `1d`, or a point in time (epoch or `2026-10-01T14:00:00+03:30`).","schema":{"type":"string"},"example":"10m"},{"name":"until","in":"query","description":"Until when; same format as `since`. Only with `since`, not with `follow`.","schema":{"type":"string"}},{"name":"grep","in":"query","description":"Text to look for (case-insensitive), up to 100 characters","schema":{"type":"string","maxLength":100}},{"name":"level","in":"query","description":"`error` errors only, `warn` warnings and errors","schema":{"type":"string","enum":["warn","error"]}},{"name":"context","in":"query","description":"How many lines before and after each match to include; with `grep` or `level`","schema":{"type":"integer","minimum":0,"maximum":10,"default":0}},{"name":"timestamps","in":"query","description":"Put the time at the start of each line (text file and live log)","schema":{"type":"boolean","default":false}},{"name":"format","in":"query","schema":{"type":"string","enum":["json","text"],"default":"json"}},{"name":"follow","in":"query","description":"Live log (Server-Sent Events); reconnect every 30 minutes","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Log lines. A live log first sends the server state (`state`), then each new line, and finally `end`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogQueryResponse"},"examples":{"lines":{"$ref":"#/components/examples/LogQueryOk"}}},"text/plain":{"schema":{"type":"string","description":"A `.log` file to download"}},"text/event-stream":{"schema":{"type":"string"},"example":"event: state\ndata: {\"status\": \"running\", ...}\n\ndata: [14:00:01 INFO]: Done (3.2s)!\n\n: ping\n\nevent: end\ndata: end\n\n"}}},"400":{"description":"A parameter is invalid (`INVALID_INPUT`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"invalidInput":{"$ref":"#/components/examples/LogInvalidInput"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No server with this `world_name`, or the server is getting ready (retry in ~15 seconds)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"$ref":"#/components/examples/LogServerNotFound"},"containerNotFound":{"$ref":"#/components/examples/LogContainerNotFound"}}}}},"429":{"description":"More than 30 requests per minute; wait `retry_after` seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"retry_after":{"type":"integer","description":"Seconds to wait"}}}}}},"503":{"description":"The log is not available right now; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"unavailable":{"$ref":"#/components/examples/LogUnavailable"}}}}}}}},"/v2/server/graph":{"get":{"operationId":"getServerGraph","summary":"Usage and performance graphs of a Minecraft game server","description":"Data behind the panel's graphs (players, TPS, RAM, CPU, ...) for the last 30 days. Limit: 30 requests per minute.","tags":["Game Server — Status"],"parameters":[{"$ref":"#/components/parameters/WorldNameQuery"},{"name":"period","in":"query","description":"Time range up to now","schema":{"type":"string","enum":["1h","6h","1d","3d","1w","2w"],"default":"1h"}},{"name":"start","in":"query","description":"Range start (epoch seconds); instead of `period`","schema":{"type":"integer"}},{"name":"end","in":"query","description":"Range end (epoch seconds); defaults to now","schema":{"type":"integer"}},{"name":"step","in":"query","description":"Seconds between points; chosen automatically if omitted","schema":{"type":"integer","minimum":15}}],"responses":{"200":{"description":"Graph data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphResponse"},"examples":{"graph":{"$ref":"#/components/examples/GraphOk"}}}}},"400":{"description":"`world_name` missing, invalid range, this game has no graphs, or the server is being moved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"worldNameRequired":{"$ref":"#/components/examples/WorldNameRequired"},"invalidPeriod":{"$ref":"#/components/examples/InvalidPeriod"},"notSupported":{"$ref":"#/components/examples/GraphNotSupported"},"serverMigrating":{"$ref":"#/components/examples/ServerMigrating"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/ActionServerNotFound404"},"429":{"description":"More than 30 requests per minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"tooMany":{"$ref":"#/components/examples/GraphTooMany"}}}}},"503":{"description":"Monitoring is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"unavailable":{"$ref":"#/components/examples/GraphUnavailable"}}}}}}}},"/vm/list":{"get":{"operationId":"listVps","summary":"List VPSes or get one VPS","description":"Status, IP, login, remaining time and traffic of your VPSes. Without `name` you get all of them in `vms` (passwords shown as `***`); with `name` only that VPS, with its real password.","tags":["VPS"],"parameters":[{"name":"name","in":"query","required":false,"description":"VPS name (the `name` from the list); returns only that VPS","schema":{"type":"string"}}],"responses":{"200":{"description":"Your VPSes, or a single VPS when `name` is given","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/VmListResponse"},{"$ref":"#/components/schemas/VmItem"}]},"examples":{"list":{"$ref":"#/components/examples/VmListOk"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/VmNotFound404"}}}},"/vm/init":{"post":{"operationId":"vpsPowerAction","summary":"Start, stop or restart a VPS","description":"The `init` values are listed in the request body table. Success means the command was accepted; read `/vm/list?name=...` until `status` is running (`1`) or stopped (`0`).","tags":["VPS"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VmInitRequest"}}}},"responses":{"200":{"description":"Command accepted","content":{"application/json":{"schema":{"type":"object","properties":{"msg":{"type":"string"}}},"examples":{"ok":{"value":{"msg":"ok"}}}}}},"400":{"description":"`init` is not one of the listed values (`INVALID_INIT`), or the command was not accepted (`SERVICE_UNAVAILABLE`; retry shortly).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"invalidInit":{"$ref":"#/components/examples/VmInvalidInit"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"VPS time has run out; it cannot be started or restarted until renewed (`SUBSCRIPTION_EXPIRED`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"expired":{"$ref":"#/components/examples/VmSubscriptionExpired"}}}}},"404":{"$ref":"#/components/responses/VmNotFound404"},"409":{"description":"Not possible in the VPS's current state; `error_code` says why (e.g. already running, or another operation is in progress).","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorResponse"},{"type":"object","properties":{"status":{"type":"integer"},"task":{"type":"string","nullable":true}}}]},"examples":{"provisioning":{"value":{"error":"vm is being provisioned","error_code":"VM_PROVISIONING"}},"alreadyRunning":{"value":{"error":"action not valid from current vm state","error_code":"VM_ALREADY_RUNNING","status":1,"task":null}},"notRunning":{"value":{"error":"action not valid from current vm state","error_code":"VM_NOT_RUNNING","status":0,"task":null}},"failed":{"value":{"error":"action not valid from current vm state","error_code":"VM_FAILED","status":3,"task":null}},"busy":{"value":{"error":"action not valid from current vm state","error_code":"VM_TASK_IN_PROGRESS","status":7,"task":"rebooting"}}}}}},"503":{"description":"The VPS host is temporarily unavailable (`SERVICE_UNAVAILABLE`); retry in a few minutes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"unavailable":{"value":{"error":"node unavailable","error_code":"SERVICE_UNAVAILABLE"}}}}}}}}},"/public/error-codes":{"get":{"operationId":"getErrorCodes","summary":"List of error codes","description":"Persian text for every `error_code`. Fetch once and keep it. The English text comes in each error's `msg_en`.","tags":["Reference"],"security":[],"responses":{"200":{"description":"Error code → Persian text","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}}}}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Create an API key in the panel, on your account page. The header is exactly `Authorization: api_key <token>` (one space; `Bearer` does not work)."}},"parameters":{"WorldNameQuery":{"name":"world_name","in":"query","required":true,"description":"Server name (the `world_name` from `/servers`)","schema":{"type":"string"}}},"schemas":{"WorldNameRequest":{"type":"object","required":["world_name"],"properties":{"world_name":{"type":"string","description":"Server name (the `world_name` from `/servers`)"}}},"CmdRequest":{"type":"object","required":["world_name","cmd"],"properties":{"world_name":{"type":"string"},"cmd":{"type":"string","description":"Minecraft console command, leading slash optional, e.g. `whitelist add player` or `op player`"},"use_rcon":{"type":"boolean","default":true,"description":"`false` if you do not need the command output"}}},"CmdResponse":{"type":"object","properties":{"result":{"type":"string","description":"Command output; on Bedrock just `ok`, and `error` if it did not run"}}},"SimpleMessage":{"type":"object","properties":{"message":{"type":"string","description":"For debugging only; tell success by the 200 status"}}},"ErrorResponse":{"type":"object","description":"Rely only on `error_code` in your code. To show a message to the user, display `msg_en` or `msg_fa`. `message`/`error`/`msg` are for debugging only and may change.","properties":{"error_code":{"type":"string","description":"Error code; the only field your code should rely on"},"message":{"type":"string","description":"For debugging only"},"error":{"type":"string","description":"For debugging only (some endpoints use it instead of `message`)"},"msg":{"type":"string","description":"For debugging only (some endpoints use it instead of `message`)"},"msg_fa":{"type":"string","description":"Persian text to show the user"},"msg_en":{"type":"string","description":"English text to show the user"},"toast":{"type":"object","description":"Optional; suggested way to show the message","properties":{"level":{"type":"string","enum":["error","warning","info"]},"duration":{"type":"integer","description":"How long to show it, in milliseconds"},"support":{"type":"boolean","description":"`true` means send the user to support"}}}},"required":["error_code"]},"VmItem":{"type":"object","properties":{"name":{"type":"string","description":"VPS name; send this in other requests"},"region":{"type":"string","description":"VPS location (data center) id"},"username":{"type":"string","description":"Login user (SSH or Remote Desktop)"},"password":{"type":"string","nullable":true,"description":"Login password; `***` in the list, the real one only with `?name=`"},"status":{"type":"integer","enum":[0,1,2,3,6,7,8,9],"description":"`0` stopped · `1` running · `2` being created or reinstalled · `3` failed (contact support) · `6` shutting down · `7` restarting · `8` force-restarting · `9` starting"},"task":{"type":"string","nullable":true,"description":"Operation in progress: `provisioning` (creating) or `rebuilding` (reinstalling); otherwise null"},"image":{"type":"string","description":"Operating system, e.g. `ubuntu-24`"},"logo":{"type":"string","nullable":true,"description":"Operating system logo"},"flavor":{"type":"string","description":"Plan name"},"cpu":{"type":"integer","description":"CPU cores"},"ram":{"type":"integer","description":"RAM in GB"},"disk":{"type":"integer","description":"Disk in GB"},"ip":{"type":"string","nullable":true,"description":"Main IP to connect to; may be null until creation finishes"},"ip6":{"type":"string","nullable":true,"description":"The IPv6 address of this VPS (free, assigned by support); null when it has none"},"additional_ips":{"type":"array","items":{"type":"string"},"description":"Extra IPs you bought"},"start_date":{"type":"string","format":"date-time","description":"Purchase date"},"remaining_time":{"type":"integer","description":"Hours left; negative means time has run out and it needs renewal"},"renewal_discount":{"type":"number","nullable":true,"description":"Renewal discount percent; null means none"},"boot_minutes":{"type":"integer","description":"Roughly how many minutes starting up takes"},"traffic_limit_gb":{"type":"number","description":"Total traffic this month (GB)"},"traffic_used_gb":{"type":"number","description":"Traffic used this month"},"traffic_remaining_gb":{"type":"number","description":"Traffic left this month"},"traffic_bank_gb":{"type":"number","description":"Extra traffic you bought (included in the total)"},"traffic_bank_used_gb":{"type":"number","description":"Used so far this month from the extra traffic you bought"},"traffic_period_ends_at":{"type":"string","nullable":true,"description":"When the monthly traffic resets"},"network_suspended":{"type":"boolean","description":"`true` means traffic ran out and the VPS internet is cut until you buy more"},"rebuild_step":{"type":"string","nullable":true,"description":"Reinstall step (only while reinstalling)"},"features":{"type":"object","description":"Panel features enabled for this VPS","properties":{"reset_password":{"type":"boolean","description":"Password reset from the panel"},"novnc":{"type":"boolean","description":"Web console (noVNC) in the panel"}}}}},"VmListResponse":{"type":"object","properties":{"vms":{"type":"array","items":{"$ref":"#/components/schemas/VmItem"}},"warning":{"type":"string","description":"General VPS notice (e.g. network issues); show it to the user when not empty"}}},"VmInitRequest":{"type":"object","required":["name","init"],"properties":{"name":{"type":"string","description":"VPS name from `/vm/list`"},"init":{"type":"integer","enum":[0,1,6,7,8],"description":"What to do: `1` start · `6` normal shutdown (like shutting down inside the OS; programs close properly) · `0` immediate stop (like pulling the plug; for a frozen VPS or a stuck shutdown) · `7` normal restart · `8` immediate restart (like a reset button; for a frozen VPS or a stuck restart). The VPS must be stopped for `1` and running for the others."}}},"ServerListItem":{"type":"object","properties":{"world_name":{"type":"string"},"game":{"type":"string","enum":["minecraft","terraria","hytale","dst","cs16","pz"]},"memory":{"type":"integer","description":"RAM in MB"},"disk":{"type":"integer","description":"Disk in GB"},"is_bedrock":{"type":"boolean"},"remaining_time":{"type":"integer","description":"Hours left; negative means time has run out and it needs renewal"},"is_tmod":{"type":"boolean","description":"Modded Terraria (tModLoader)"},"renewal_discount":{"type":"number","description":"Renewal discount percent (only when you have one)"}}},"ServerListResponse":{"type":"object","properties":{"worlds":{"type":"array","items":{"$ref":"#/components/schemas/ServerListItem"}},"remaining_conversions_this_month":{"type":"integer","description":"How many more times this month you can change the server type (in the panel)"},"convert_monthly_limit":{"type":"integer","description":"Monthly limit on changing the server type"}}},"ServerData":{"type":"object","properties":{"world_name":{"type":"string"},"port":{"type":"integer","description":"Main game port"},"host":{"type":"string","description":"Address players connect to, e.g. de1.9craft.ir"},"ip":{"type":"string","description":"IP of that address"},"ftp_host":{"type":"string","description":"Internal; use `host` for FTP"},"filemanager_base_url":{"type":"string","description":"Internal to the panel; not useful to you"},"remaining_time":{"type":"integer","description":"Hours left; negative means time has run out and it needs renewal"},"is_full":{"type":"integer","enum":[0,1],"description":"`1` means the server disk is full"},"is_migrating":{"type":"boolean","description":"The server is being moved and cannot be controlled until that finishes"},"disk":{"type":"integer","description":"Disk in GB"},"memory":{"type":"integer","description":"RAM in MB"},"version":{"type":"string","nullable":true,"description":"Minecraft version"},"java":{"type":"string","nullable":true,"description":"Java version (empty on Bedrock)"},"software":{"type":"string","description":"paper, purpur, spigot, leaf, fabric, forge, ..."},"is_bedrock":{"type":"boolean"},"additional_port":{"type":"integer","nullable":true,"description":"Second port (if you bought one)"},"listen_ports":{"type":"array","items":{"type":"string"},"description":"Extra ports opened for you"},"subdomain":{"type":"string","nullable":true,"description":"The server's own domain (if you registered one)"},"renewal_discount":{"type":"number","description":"Renewal discount percent (only when you have one)"}}},"ContainerState":{"type":"object","properties":{"status":{"type":"string","description":"`running` running, `exited` stopped, `restarting` restarting"},"started_at":{"type":"string","nullable":true,"description":"Last start time"},"finished_at":{"type":"string","nullable":true},"exit_code":{"type":"integer","nullable":true},"oom_killed":{"type":"boolean","nullable":true,"description":"`true` means the server was closed because it ran out of RAM"},"restart_count":{"type":"integer","nullable":true}}},"LogLine":{"type":"object","description":"One log line; `{\"gap\": true}` means lines were skipped between two matches","properties":{"ts":{"type":"string","nullable":true,"description":"Line time"},"text":{"type":"string","description":"Line text"},"level":{"type":"string","enum":["debug","info","warn","error"],"description":"Line type, when known"},"gap":{"type":"boolean"}}},"LogQueryResponse":{"type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/LogLine"}},"state":{"$ref":"#/components/schemas/ContainerState"},"started_at":{"type":"string","nullable":true,"description":"Last start time"},"next_since":{"type":"string","nullable":true,"description":"To continue, send this as `since`"},"scanned":{"type":"integer","description":"How many lines were searched"},"truncated":{"type":"boolean","description":"`true` means there are more matches; narrow the range"},"timezone":{"type":"string","example":"Asia/Tehran"},"utc_offset":{"type":"string","example":"+03:30"}}},"GraphResponse":{"type":"object","properties":{"start":{"type":"integer","description":"Range start (epoch)"},"end":{"type":"integer","description":"Range end (epoch)"},"step":{"type":"integer","description":"Seconds between points"},"series":{"type":"object","description":"Each graph is a list of `[time, value]`. Java: `player`, `tps`, `mspt`, `ram_usage` (MB), `cpu` (percent), `entity`, `chunk`, `villager`. Bedrock: `cpu`, `memory` (100 means 1 GB).","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2}}}}}},"responses":{"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"invalidAuthHeader":{"$ref":"#/components/examples/InvalidAuthHeader"},"invalidApiKey":{"$ref":"#/components/examples/InvalidApiKey"}}}}},"BadRequest400":{"description":"`world_name` missing, server is being moved, or another operation is running on it (`SERVER_BUSY`; retry in a few seconds)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"worldNameRequired":{"$ref":"#/components/examples/WorldNameRequired"},"serverMigrating":{"$ref":"#/components/examples/ServerMigrating"},"serverBusy":{"$ref":"#/components/examples/ServerBusy"}}}}},"HostOffline503":{"description":"The server's host is temporarily unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"hostOffline":{"$ref":"#/components/examples/HostOffline"}}}}},"ActionServerNotFound404":{"description":"No server with this `world_name` on your account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"$ref":"#/components/examples/ActionServerNotFound"}}}}},"VmNotFound404":{"description":"No VPS with this `name` on your account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"notFound":{"$ref":"#/components/examples/VmNotFound"}}}}}},"examples":{"StartOk":{"value":{"message":"started"}},"StopOk":{"value":{"message":"stopped"}},"RestartOk":{"value":{"message":"restarted"}},"CmdOk":{"value":{"result":"[13:45:01] [Server thread/INFO]: There are 3 of a max of 20 players online"}},"ServersListOk":{"value":{"worlds":[{"world_name":"myworld","game":"minecraft","memory":4000,"disk":20,"is_bedrock":false,"remaining_time":162,"is_tmod":false}],"remaining_conversions_this_month":2,"convert_monthly_limit":3}},"ServerDataOk":{"value":{"world_name":"myworld","port":25565,"host":"de1.9craft.ir","ip":"1.2.3.4","ftp_host":"internal","filemanager_base_url":"https://file.9craft.ir","remaining_time":162,"is_full":0,"is_migrating":false,"disk":20,"memory":4000,"version":"1.21.1","java":"21","software":"paper","is_bedrock":false,"additional_port":null,"subdomain":"myworld.9craft.ir"}},"InvalidAuthHeader":{"value":{"msg":"Invalid Authorization","error_code":"INVALID_AUTH_HEADER"}},"InvalidApiKey":{"value":{"msg":"Invalid api-key","error_code":"INVALID_API_KEY"}},"WorldNameRequired":{"value":{"message":"world_name required","error_code":"WORLD_NAME_REQUIRED"}},"ActionServerNotFound":{"value":{"message":"world not found","error_code":"SERVER_NOT_FOUND"}},"StartServerNotFound":{"value":{"error":"world not found","error_code":"SERVER_NOT_FOUND"}},"DataServerNotFound":{"value":{"error":"world not found","error_code":"SERVER_NOT_FOUND"}},"ContainerNotFound":{"value":{"message":"container not found","error_code":"CONTAINER_NOT_FOUND"}},"DiskFull":{"value":{"error":"فضای آزاد دیسک سرور شما برای این عملیات کافی نیست؛ ابتدا مقداری فضا آزاد کنید","error_code":"DISK_FULL"}},"SubscriptionExpired":{"value":{"error":"زمان سرور تمام شده است؛ ابتدا سرور را تمدید کنید","error_code":"SUBSCRIPTION_EXPIRED"}},"CmdSubscriptionExpired":{"value":{"message":"server time expired","error_code":"SUBSCRIPTION_EXPIRED"}},"CmdRequired":{"value":{"message":"cmd required","error_code":"CMD_REQUIRED"}},"HostOffline":{"value":{"msg":"host unavailable","error_code":"HOST_UNAVAILABLE"}},"ServerMigrating":{"value":{"message":"server is migrating between hosts","error_code":"SERVER_MIGRATING"}},"ServerBusy":{"value":{"msg":"server busy","error_code":"SERVER_BUSY","events":[{"code":"server_locked","msg_fa":"عملیات دیگری روی این سرور در حال انجام است","world_name":"my-world"}]}},"LogQueryOk":{"value":{"lines":[{"ts":"2026-10-01T14:00:01.123+03:30","text":"[14:00:01 INFO]: Done (3.2s)! For help, type \"help\"","level":"info"},{"gap":true},{"ts":"2026-10-01T14:05:12.004+03:30","text":"[14:05:12 ERROR]: Could not pass event PlayerJoinEvent","level":"error"}],"state":{"status":"running","started_at":"2026-10-01T13:59:50.000+03:30","finished_at":"2026-10-01T13:59:40.000+03:30","exit_code":0,"oom_killed":false,"restart_count":0},"started_at":"2026-10-01T13:59:50.000+03:30","next_since":"1790854512.004000000","scanned":4200,"truncated":false,"timezone":"Asia/Tehran","utc_offset":"+03:30"}},"GraphOk":{"value":{"start":1790850000,"end":1790853600,"step":30,"series":{"tps":[[1790850000,20],[1790850030,19]],"mspt":[[1790850000,12.34],[1790850030,18.9]],"ram_usage":[[1790850000,2860],[1790850030,2911]],"cpu":[[1790850000,45],[1790850030,52]],"player":[[1790850000,3],[1790850030,4]],"entity":[[1790850000,812],[1790850030,840]],"chunk":[[1790850000,1450],[1790850030,1462]],"villager":[[1790850000,12],[1790850030,12]]}}},"InvalidPeriod":{"value":{"error":"invalid period","error_code":"INVALID_PERIOD"}},"GraphNotSupported":{"value":{"error":"not supported","error_code":"NOT_SUPPORTED"}},"GraphTooMany":{"value":{"error":"too many requests","error_code":"TOO_MANY_REQUESTS","retry_after":12}},"GraphUnavailable":{"value":{"error":"service unavailable","error_code":"SERVICE_UNAVAILABLE"}},"LogInvalidInput":{"value":{"error":"level must be error or warn","error_code":"INVALID_INPUT"}},"LogServerNotFound":{"value":{"error":"no server with this world_name on your account","error_code":"SERVER_NOT_FOUND"}},"LogContainerNotFound":{"value":{"error":"server container is being recreated; retry in ~15s","error_code":"CONTAINER_NOT_FOUND"}},"LogUnavailable":{"value":{"error":"could not read logs right now; retry","error_code":"SERVICE_UNAVAILABLE"}},"VmListOk":{"value":{"vms":[{"name":"myvps","region":"9craft","username":"ubuntu","password":"***","status":1,"task":null,"image":"ubuntu-24","logo":"/static/os/Ubuntu.svg","flavor":"vps-3","cpu":2,"ram":4,"disk":30,"ip":"185.0.0.10","ip6":null,"additional_ips":[],"start_date":"2026-10-01T12:00:00","remaining_time":412,"renewal_discount":null,"boot_minutes":2,"traffic_limit_gb":150,"traffic_used_gb":12.5,"traffic_remaining_gb":137.5,"traffic_bank_gb":0,"traffic_bank_used_gb":0,"traffic_period_ends_at":"2026-10-31T12:00:00","network_suspended":false,"rebuild_step":null,"features":{"reset_password":true,"novnc":true}}],"warning":""}},"VmNotFound":{"value":{"error":"سرور یافت نشد","error_code":"SERVER_NOT_FOUND"}},"VmInvalidInit":{"value":{"error":"init must be one of [0, 1, 6, 7, 8]","error_code":"INVALID_INIT"}},"VmSubscriptionExpired":{"value":{"error":"subscription expired","error_code":"SUBSCRIPTION_EXPIRED"}}}}}
