Disclaimer: This project is currently in Beta, meaning features and APIs may evolve over time.
👉 Please report bugs or request new features by creating a GitHub issue.
👉 Please report bugs or request new features by creating a GitHub issue.
How it works
The SDK is generated from the official Upsun OpenAPI specification — the same source of truth used by the official Upsun CLI and Upsun Console. Before running the OpenAPI Generator to build the SDK, we run a PHP pre-processing script —templates/pre-processing/preprocess-schema.php.
Its job is to enrich the OpenAPI schema with a bit of extra data (fields like x-*) for each endpoint method.
We can’t easily inject that info directly from the Mustache templates
, because in Mustache only basic if tests are possible — no transformation logic or complex operations can be
performed. This script handles all the necessary transformations beforehand, so the OpenAPI Generator has everything it
needs up front, while our templates stay clean, simple, and focused.
The SDK is then built using OpenAPI Generator, producing:
- Models (
src/Model/): PHP representations of the Component schemas defined in the OpenAPI specification - APIs (
src/Api/): PHP classes for each API endpoint, providing low-level methods to interact with the platform
src/Tasks/).
These are handwritten by our Advocacy team and serve as the SDK’s public-facing interface, giving developers
simple, intuitive methods for common actions without having to deal with the low-level Models or APIs directly.

Staying up to date
Every day, a GitHub workflow checks the official OpenAPI spec against our local version. If it finds any differences, it automatically opens a Pull Request and notifies our Advocacy team to keep the SDK aligned with the live API.Usage examples
To give you an overview of what you can do with this Upsun SDK PHP, here are some examples below:Installation
Install the Upsun SDK PHP via Composer:Authentication
You’ll need an Upsun API token to use the SDK.Store it securely, for example in an environment variable:
List organizations
List projects in an organization
Get a project
Create a new project
Update a project
Delete a project
You can find the complete example in this test-sdk.php file.
Clear and helpful PHPDoc
Every class, property, and method in the SDK is carefully documented.The PHPDoc comments are written to guide you through each endpoint, model, and expected parameter, making the SDK easy to navigate with IDE autocomplete and inline hints. This means developers can explore the SDK intuitively — just type
$client-> and let your IDE show you what’s
available.
And when a task method expects an array (for example, the $client->projects->create() call,
the PHPDoc includes a detailed description of the expected array structure, so you always know exactly which keys and
values to provide.
Coverage
- Full API Coverage: Access every Upsun public API endpoint.
- Simple Authentication: Use your Upsun API token to connect instantly.
- Modern PHP Design: Compatible with PHP 8.1 and later, using readonly properties and strict typing.
- Auto-generated Models and APIs: Consistent and always up to date with Upsun’s OpenAPI spec.
- Comprehensive Test Suite: Every task is covered by PHPUnit tests similar to the example below.
Contributing
Contributions are more than welcome! If you find bugs, have ideas, or want to add new API endpoints, please open a pull request or a GitHub issue. You can also reach out to the Advocacy team and other developers on our Discord community.Final thoughts
This SDK marks a first step toward making Upsun’s public APIs easier to use from PHP-based projects.It’s still experimental, but it already provides full access to our API endpoints — and it’s built to evolve alongside Upsun itself. If you’re a PHP developer building automation, tooling, or integrations on Upsun, give it a try and tell us what you think! 👉 Try it today: github.com/upsun/upsun-sdk-php
Coming soon: SDKs for Node.js, Python, and Go
The Upsun Advocacy team is also working on official SDKs for Node.js, Python, and Go.Each SDK will follow the same philosophy as the PHP one — open-source, API-spec driven, and developer-friendly. Stay tuned for future announcements and beta releases on our GitHub organization and Discord server.
— The Upsun Advocacy Team