PHPackages                             webdock/php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. webdock/php-sdk

ActiveLibrary[API Development](/categories/api)

webdock/php-sdk
===============

Webdock API Wrapper for PHP

1.0.0(5y ago)3442[1 PRs](https://github.com/webdock-io/php-sdk/pulls)MITPHPCI failing

Since Nov 23Pushed 5y ago2 watchersCompare

[ Source](https://github.com/webdock-io/php-sdk)[ Packagist](https://packagist.org/packages/webdock/php-sdk)[ RSS](/packages/webdock-php-sdk/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

php-sdk
=======

[](#php-sdk)

[![CI](https://github.com/webdock-io/php-sdk/workflows/CI/badge.svg)](https://github.com/webdock-io/php-sdk/workflows/CI/badge.svg)

> PHP SDK Library / Wrapper for the [Webdock](https://webdock.io) API

Installation
------------

[](#installation)

### Composer

[](#composer)

To use the Webdock SDK, install it to your project with [Composer](https://getcomposer.org/doc/00-intro.md).

- `composer require webdock/php-sdk`

Example Usage
-------------

[](#example-usage)

```

```

Documentation
-------------

[](#documentation)

Full API documentation is available at

API References
--------------

[](#api-references)

- **GET /ping** Sends a ping request to the Webdock API

      Show example ```
    $ping = $client->ping();

    var_dump($ping->getResponse()->toArray());
    ```
- **GET /account/accountInformation** Get Account Information

      Show example ```
    $accountInfo = $client->accountInformation->get();
    ```
- **GET /servers** Get a list of your servers

      Show example ```
    $status = 'active'; // [all, suspended, active]
    $serverList = $client->server->list($status);

    # to view the result
    foreach ($serverList->getResponse() as $server) {
      echo $server->name;
    }

    # or cast the response as arrays
    var_dump($serverList->getResponse()->toArray());

    # each individual item can be casted as an array too
    foreach ($serverList->getResponse() as $server) {
      var_dump($server->toArray());
    }
    ```
- **POST /servers** Create a server

      Show example ```
    $params = [
      'name' => 'mynewserver1',
      'slug' => 'mynewserver1',
      'locationId' => 'fi', # get available locations: $client->location->list();
      'profileSlug' => 'webdockmicro',
      'imageSlug' => 'krellide:webdock-focal-lemp-php74',
    ]
    $newServer = $client->server->create($params);
    ```
- **GET /servers/{serverSlug}** Get a specific server by slug

      Show example ```
    $slug = 'your-server-slug';
    $server = $client->server->get($slug);

    # Since the result is a single element, compared to the previous example (GET /servers), the response is in object/stdclass style

    echo $server->getResponse()->name;

    # We can also cast the response as an array
    var_dump($server->getResponse()->toArray());
    ```
- **DELETE /servers/{serverSlug}** Delete a server

    This endpoint requires special privileges, if you want to enable this endpoint please contact Webdock support!

      Show example ```
    $slug = 'your-server-slug';
    $deleteServer = $client->delete($slug);
    ```
- **PATCH /servers/{serverSlug}** Update server metadata

      Show example ```
    $slug = 'mynewserver1';
    $params = [
      'nextActionDate' => '2020-10-10',
      'name' => 'new server name',
      'description' => 'new server description',
      'notes' => 'another notes',
    ];
    $updateServer = $client->server->update($slug, $params);
    ```
- **POST /servers/{serverSlug}/actions/start** Start a server

      Show example ```
    $slug = 'mynewserver1';
    $startServer = $client->serverAction->start($slug);
    ```
- **POST /servers/{serverSlug}/actions/stop** Stop a server

      Show example ```
    $slug = 'mynewserver1';
    $stopServer = $client->serverAction->stop($slug);
    ```
- **POST /servers/{serverSlug}/actions/reboot** Reboot a server

      Show example ```
    $slug = 'mynewserver1';
    $stopServer = $client->serverAction->reboot($slug);
    ```
- **POST /servers/{serverSlug}/actions/suspend** Suspend a server

      Show example ```
    $slug = 'mynewserver1';
    $stopServer = $client->serverAction->suspend($slug);
    ```
- **POST /servers/{serverSlug}/actions/reinstall** Reinstall a server

      Show example ```
    $slug = 'mynewserver1';
    $image = 'krellide:webdock-focal-lemp-php74';
    $stopServer = $client->serverAction->reinstall($slug, $image);
    ```
- **POST /servers/{serverSlug}/actions/snapshot** Create a snapshot for a server

      Show example ```
    $slug = 'mynewserver1';
    $snapshotName = 'my server snapshot';
    $stopServer = $client->serverAction->snapshot($slug, $snapshotName);
    ```
- **POST /servers/{serverSlug}/actions/restore** Restore the server to a snapshot

      Show example ```
    $slug = 'mynewserver1';
    $snapshotId = 1203;
    $stopServer = $client->serverAction->restore($slug, $snapshotId);
    ```
- **POST /servers/{serverSlug}/actions/resize/dryrun** Dry Run for Server Profile Change

      Show example ```
    $slug = 'mynewserver1';
    $profileSlug = 'server-profile-a'; # Get the server profile in $client->profile->list($locationId);
    $stopServer = $client->serverAction->dryRunResize($slug, $profileSlug);
    ```
- **POST /servers/{serverSlug}/actions/resize** Change a Server Profile

      Show example ```
    $slug = 'mynewserver1';
    $profileSlug = 'server-profile-a';
    $stopServer = $client->serverAction->resize($slug, $profileSlug);
    ```
- **GET /locations** Get a list of possible server datacenter locations

      Show example ```
    $locations = $client->location->list();
    ```
- **GET /profiles** Get a list of possible server hardware profiles

      Show example ```
    $locationId = 1002;
    $locations = $client->profile->list($locationId);
    ```
- **GET /images** Get a list of possible server software images

      Show example ```
    $images = $client->image->list();
    ```
- **GET /account/publicKeys** Get a list of public keys in your Webdock account

      Show example ```
    $myPublicKeys = $client->publicKey->list();
    ```
- **POST /account/publicKeys** Add a new public key

      Show example ```
    $params = [
      'name' => 'my laptop public key',
      'publicKey' => 'ssh-rsa AAAB3...',
    ];
    $addPublicKey = $client->publicKey->create($params);
    ```
- **DELETE /account/publicKeys/{id}** Delete a PublicKey

      Show example ```
    $publicKeyId = 12021;
    $deletePublicKey = $client->publicKey->delete($publicKeyId);
    ```
- **GET /servers/{serverSlug}/shellUsers** Get a list of shell users for a server

      Show example ```
    $serverSlug = 'mynewserver1';
    $shellUsers = $client->serverShellUser->list($serverSlug);
    ```
- **POST /servers/{serverSlug}/shellUsers** Create a shell user in a server

      Show example ```
    $serverSlug = 'mynewserver1';
    $params = [
      'username' => 'user1',
      'password' => 'X1xq0e-12k',
      'group' => 'user1',
      'shell' => 'zsh',
      'publicKeys' => [12021],
    ];
    $createShellUser = $client->serverShellUser->create($serverSlug, $params);
    ```
- **DELETE /servers/{serverSlug}/shellUsers/{shellUserId}** Deletes a shell user

      Show example ```
    $serverSlug = 'mynewserver1';
    $shellUserId = 40591;

    $deleteShellUser = $client->serverShellUser->delete(
      $serverSlug,
      $shellUserId
    );
    ```
- **PATCH /servers/{serverSlug}/shellUsers/{shellUserId}** Update shell user Public Keys in a server

      Show example ```
    $serverSlug = 'mynewserver1';
    $shellUserId = 40591;
    $params = ['publicKeys' => [1293, 19283]];
    $updateShellUser = $client->serverShellUser->update(
      $serverSlug,
      $shellUserId,
      $params
    );
    ```
- **GET /account/scripts** Get a list of account scripts

      Show example ```
    $accountScripts = $client->accountScript->list();
    ```
- **POST /account/scripts** Create an account script

      Show example ```
    $params = [
      'name' => 'my account script',
      'filename' => 'filename',
      'content' => 'the content',
    ];
    $createAccountScript = $client->accountScript->create($params);
    ```
- **GET /account/scripts/{scriptId}** Get an account script by ID

      Show example ```
    $scriptId = 1203;
    $accountScript = $client->accountScript->get($scriptId);
    ```
- **DELETE /account/scripts/{scriptId}** Delete an account script

      Show example ```
    $scriptId = 1203;
    $deleteAccountScript = $client->accountScript->delete($scriptId);
    ```
- **PATCH /account/scripts/{scriptId}** /account/scripts/{scriptId}

      Show example ```
    $scriptId = 1203;
    $params = [
      'name' => 'updated script#1',
      'filename' => 'myscript.sh',
      'content' => 'thecontent',
    ];
    $updateAccountScript = $client->accountScript->update($scriptId, $params);
    ```
- **GET /scripts** Get a list of public scripts

      Show example ```
    $scripts = $client->script->list();
    ```
- **GET /servers/{serverSlug}/scripts** Get a list of server scripts

      Show example ```
    $serverSlug = 'mynewserver1';
    $scripts = $client->serverScript->list($serverSlug);
    ```
- **POST /servers/{serverSlug}/scripts** Create a server script

      Show example ```
    $serverSlug = 'mynewserver1';
    $params = [
      'scriptId' => 123,
      'path' => '/path/to/script',
      'makeScriptExecutable' => true,
      'executeImmediately' => true,
    ];
    $createServerScript = $client->serverScript->create($serverSlug, $params);
    ```
- **GET /servers/{serverSlug}/scripts/{scriptId}** Get a server script by ID

      Show example ```
    $serverSlug = 'mynewserver1';
    $scriptId = 123;
    $script = $client->serverScript->get($serverSlug, $scriptId);
    ```
- **DELETE /servers/{serverSlug}/scripts/{scriptId}** Delete a server script

      Show example ```
    $serverSlug = 'mynewserver1';
    $scriptId = 123;
    $deleteScript = $client->serverScript->delete($serverSlug, $scriptId);
    ```
- **POST /servers/{serverSlug}/scripts/{scriptId}/execute** Execute a server script

      Show example ```
    $serverSlug = 'mynewserver1';
    $scriptId = 123;
    $executeScript = $client->serverScript->executeScript($serverSlug, $scriptId);
    $callbackId = $executeScript->getCallbackID();
    ```
- **POST /servers/{serverSlug}/fetchFile** Fetches a file from the server

      Show example ```
    $serverSlug = 'mynewserver1';
    $filePath = '/path/to/file';
    $fetchFile = $client->serverScript->fetchFile($serverSlug, $filePath);
    ```
- **GET /servers/{serverSlug}/metrics** Get server metrics

      Show example ```
    $serverSlug = 'mynewserver1';
    $metric = $client->serverMetric->getMetrics($serverSlug);
    ```
- **GET ​/servers​/{serverSlug}​/metrics​/now** Get instant metrics

      Show example ```
    $serverSlug = 'mynewserver1';
    $metric = $client->serverMetric->getMetricsNow($serverSlug);
    ```
- **GET /servers/{serverSlug}/snapshots** Get a list of snapshots for a server

      Show example ```
    $serverSlug = 'mynewserver1';
    $snapshots = $client->serverSnapshot->list($serverSlug);
    ```
- **GET ​/servers​/{serverSlug}​/snapshots​/{snapshotId}** Get a snapshot by ID for a server

      Show example ```
    $serverSlug = 'mynewserver1';
    $snapshotId = 1022;
    $snapshot = $client->serverSnapshot->get($serverSlug, $snapshotId);
    ```
- **DELETE /servers/{serverSlug}/snapshots/{snapshotId}** Deletes a snapshot by ID for a server

      Show example ```
    $serverSlug = 'mynewserver1';
    $snapshotId = 1022;
    $deleteSnapshot = $client->serverSnapshot->delete($serverSlug, $snapshotId);
    ```
- **GET /hooks** Get a list of event hooks

      Show example ```
    $eventHooks = $client->eventHook->list();
    ```
- **POST /hooks** Creates an event hook

      Show example ```
    $params = [
      'callbackUrl' => 'the_callback_url',
      'callbackId' => 10293,
    ];
    $createEventHook = $client->eventHook->create($params);
    ```
- **GET /hooks/{hookId}** Get an event hook by ID

      Show example ```
    $hookId = 1223;
    $eventHook = $client->eventHook->get($hookId);
    ```
- **DELETE /hooks/{hookId}** Deletes an event hook

      Show example ```
    $hookId = 1223;
    $deleteEventHook = $client->eventHook->delete($hookId);
    ```
- **GET /events** Get a list of events

      Show example ```
    $params = [];
    $events = $client->eventPoll->list($params);
    ```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2002d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/543111?v=4)[pujianto](/maintainers/pujianto)[@pujianto](https://github.com/pujianto)

![](https://www.gravatar.com/avatar/87af05476c071228d9ff396bea86ae407467bfd11f6e6531c8371d2187aea168?d=identicon)[Webdock.io](/maintainers/Webdock.io)

---

Top Contributors

[![pujianto](https://avatars.githubusercontent.com/u/543111?v=4)](https://github.com/pujianto "pujianto (48 commits)")[![webdock-io-admin](https://avatars.githubusercontent.com/u/68245361?v=4)](https://github.com/webdock-io-admin "webdock-io-admin (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/webdock-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/webdock-php-sdk/health.svg)](https://phpackages.com/packages/webdock-php-sdk)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
