Client API (src/Client)
This section documents per-server operations available to a regular client via the panel’s client API. All methods require a server’s short UUID (first 8 chars) a.k.a. uuidShort unless noted.
Setup
use Gigabait93\Pterodactyl;
$p = Pterodactyl::make('https://panel.example.com', 'ptlc_xxx');
$uuid = '54f52795'; // server identifier (uuidShort)
Common responses
ListBuilder→send()returnsListResponse(data[],pagination)ItemResponse→dataobjectActionResponse→ok,messageand optionaldata
Modules
Server
Namespace: Gigabait93\Client\Server\Server
resources(string $uuidShort): ItemResponse— live stats/resourcesdetails(string $uuidShort, array $includes = ['egg','subusers']): ItemResponsewebsocket(string $uuidShort): ItemResponse— token and socket URL-
power(string $uuidShort, string $signal): ActionResponse— signals: startstop restart kill command(string $uuidShort, string $command): ActionResponse
Example
$p->server->power($uuid, 'restart');
$p->server->command($uuid, 'say hello');
Files
Namespace: Gigabait93\Client\Files\Files
all(string $uuidShort, string $path = '/'): ListBuilderread(string $uuidShort, string $filePath): ItemResponsedownload(string $uuidShort, string $filePath): ItemResponserename(string $uuidShort, string $old, string $new, string $path = '/'): ActionResponsecopy(string $uuidShort, string $filePath): ActionResponsewrite(string $uuidShort, string $filePath, string $content): ActionResponsecompress(string $uuidShort, array $files, string $path = '/'): ActionResponsedecompress(string $uuidShort, string $fileName, string $path = '/'): ActionResponsedestroy(string $uuidShort, array $files, string $path): ActionResponsemkdir(string $uuidShort, string $folderName, string $path = '/'): ActionResponseexists(string $uuidShort, string $path, string $name): booluploadUrl(string $uuidShort, string $directory = '/'): ItemResponsemakeUpload(string $uuidShort): UploadBuilder
UploadBuilder (namespace Gigabait93\Client\Files\Builders):
dir(string $directory): selfsignedUrl(string $url): selfaddFile(string $localPath, ?string $asName = null, ?string $mime = null): selfaddContents(string $name, string $contents, ?string $mime = null): selfaddMany(array $items): selfsend(?string $signedUrl = null): ActionResponsesendAndVerify(?string $signedUrl = null): ActionResponse— verifies with Files::all()
Database
Namespace: Gigabait93\Client\Database\Database
all(string $uuidShort): ListBuildercreate(string $uuidShort, string $database, string $remote = '%'): ItemResponseresetPassword(string $uuidShort, string $database): ActionResponsedestroy(string $uuidShort, string $database): ActionResponse
Backups
Namespace: Gigabait93\Client\Backups\Backups
all(string $uuidShort): ListBuilderget(string $uuidShort, string $backup): ItemResponsedownload(string $uuidShort, string $backup): ItemResponsecreate(string $uuidShort, string $name, string $ignored = ''): ItemResponsedestroy(string $uuidShort, string $backup): ActionResponserestore(string $uuidShort, string $backup, bool $truncate = false): ActionResponselockToggle(string $uuidShort, string $backup): ActionResponse
Schedules
Namespace: Gigabait93\Client\Schedules\Schedules
all(string $uuidShort): ListBuilderget(string $uuidShort, string $scheduleId): ItemResponsecreate(string $uuidShort, ...): ItemResponseupdate(string $uuidShort, int $scheduleId, ...): ItemResponseexecute(string $uuidShort, int $scheduleId): ActionResponsedestroy(string $uuidShort, string $scheduleId): ActionResponsecreateTask(string $uuidShort, string $scheduleId, array $task): ItemResponseupdateTask(string $uuidShort, string $scheduleId, string $taskId, array $task): ItemResponsedeleteTask(string $uuidShort, string $scheduleId, string $taskId): ActionResponse
Network (Allocations)
Namespace: Gigabait93\Client\Network\Network
all(string $uuidShort): ListBuilderassignAllocation(string $uuidShort): ActionResponsesetNote(string $uuidShort, string $allocationId, string $note): ActionResponsesetPrimary(string $uuidShort, string $allocationId): ActionResponsedestroy(string $uuidShort, string $allocationId): ActionResponse
Startup (variables)
Namespace: Gigabait93\Client\Startup\Startup
variables(string $uuidShort): ItemResponseupdate(string $uuidShort, array $data): ActionResponse
Settings
Namespace: Gigabait93\Client\Settings\Settings
rename(string $uuidShort, string $name): ActionResponsereinstall(string $uuidShort): ActionResponsesetDockerImage(string $uuidShort, string $dockerImage): ActionResponse
Subusers
Namespace: Gigabait93\Client\Subusers\Subusers
all(string $uuidShort): ListBuildercreate(string $uuidShort, string $email, array $permissions): ItemResponseupdate(string $uuidShort, string $subuserUuid, array $permissions): ItemResponsedestroy(string $uuidShort, string $subuserUuid): ActionResponse
Examples
List files and download one:
$files = $p->files->all($uuid, '/')->send();
foreach ($files->data as $it) {
$name = $it['attributes']['name'] ?? '';
if ($name === 'server.properties') {
$content = $p->files->read($uuid, '/server.properties');
break;
}
}
Create a backup and wait for it to appear:
$create = $p->backups->create($uuid, 'nightly');
if ($create->ok) {
// poll list until it shows up
}
Send a power signal and a console command:
$p->server->power($uuid, 'restart');
$p->server->command($uuid, 'say Update deployed');