Introduction
Scroll down for code samples, example requests and responses.
Welcome to the SpinupWP REST API documentation.
This API is currently in BETA, which means it can change at any time. We highly recommend that you subscribe to the What's New email list to be notified in advance of any updates to the API.
We’ve released a very limited set of endpoints to start so that we can gather input from REST API users. We welcome feedback and suggestions, which can be shared with us in the SpinupWP developer community, or via email.
To get started with our API, you will need a SpinupWP account. If you don't have an account yet, you can sign up for a free trial.
Our API accepts form-encoded request bodies and returns JSON responses. All API requests must be made over HTTPS.
Alternatively, we also have a PHP SDK, which provides an expressive interface for interacting with SpinupWP's API. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses.
Authentication
Request
curl -X GET https://api.spinupwp.app/v1/servers \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
Once you have a SpinupWP account, you will need an API access token to use our API. The API access token must be sent with each request in the Authorization header as a Bearer token. API access tokens can be created for your personal account or as part of a team.
To generate a personal API access token, navigate to the API Tokens tab in your “My Account” settings page in SpinupWP. API access tokens you create via the “My Account” page are only relevant to resources created under your personal account.
If you are a team admin or a team owner, you can also generate access tokens from the API Tokens tab on the “Team Settings” page for any of the teams you own/manage. API access tokens you create via the “Team Settings” page are only relevant for resources associated with that team.
Pagination
Request
curl -X GET https://api.spinupwp.app/v1/servers?page=2 \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$servers = $spinupwp->servers->list();
// Auto-pagination handles fetching lists of resources without having
// to paginate results and perform subsequent requests manually
foreach ($servers as $server) {
// Do something with $server
}
Response
{
"data": [...],
"pagination": {
"previous": "https://api.spinupwp.app/v1/sites?page=1",
"next": "https://api.spinupwp.app/v1/sites?page=3",
"count": 25
}
}
All “list” endpoints include pagination, and have a limit of 10 objects per page. These endpoints will include a top-level pagination object with previous and next links along with a total count of objects.
These endpoints accept a page query parameter, which is the index of the page you want to retrieve. You can also optionally pass a limit parameter between 1 and 100, which is the limit of the number of objects to be returned. The default limit is 10.
Rate Limiting
The SpinupWP API has limit of 60 requests per minute. If you exceed the allowed limit you will receive a 429 Too Many Attempts response. To help you determine if you are approaching the limit we include the X-RateLimit-Limit and X-RateLimit-Remaining headers on each request.
SSH Keys
The SSH Keys endpoints let you retrieve SpinupWP’s public key used for provisioning, as well as list the SSH keys configured on your team.
SpinupWP’s provisioning key is particularly useful when provisioning custom servers. By adding this key to your server ahead of time, you ensure that SpinupWP can securely access the server. This SSH key is only used during server provisioning. Once provisioning is complete, the key is removed from the server for security reasons.
Show SpinupWP SSH key
Request
curl -X GET https://api.spinupwp.app/v1/ssh-key \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$sshKey = $spinupwp->sshKey->get();
echo $sshKey->key;
Response
{
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD..."
}
GET /ssh-key
Retrieves SpinupWP’s public SSH key used for server provisioning.
List all SSH keys
Request
curl -X GET https://api.spinupwp.app/v1/ssh-keys \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$sshKeys = $spinupwp->sshKeys->list();
Response
{
"data": [
{
"id": 1,
"name": "Vincent's laptop",
"fingerprint": "SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8",
"publickey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD...",
"created_at": "2024-07-01T12:00:00.000000Z"
}
],
"pagination": {
"previous": null,
"next": "https://api.spinupwp.app/v1/ssh-keys?page=2",
"per_page": 10,
"count": 15
}
}
GET /ssh-keys
Retrieves a list of SSH keys. Returns a paginated list of TeamSshKey objects.
Server Providers
Retrieve metadata
Request
curl -X GET https://api.spinupwp.app/v1/providers/{provider}/metadata \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$metadata = $spinupwp->providers->metadata($provider);
Response
{
"regions": {
"Europe": [
{
"slug": "ams",
"name": "Amsterdam, NL",
"available": true,
"continent": "Europe",
"sizes": [
"vc2-1c-0.5gb-v6"
]
}
]
},
"sizes": [
{
"slug": "vc2-1c-0.5gb-v6",
"type": "basic",
"memory": 512,
"vcpus": 1,
"disk": 10,
"transfer": 0.5,
"priceMonthly": 2.5,
"backupPriceMonthly": 0.5,
"available": true,
"processor": "regular"
}
]
}
GET /providers/{provider}/metadata
List available regions and instance sizes for each supported server provider.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
provider* |
string | Supported values: digitalocean, linode, vultr and hetzner. |
Servers
The Servers endpoint allows you to view servers.
List all servers
Request
curl -X GET https://api.spinupwp.app/v1/servers \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$servers = $spinupwp->servers->list();
Response
{
"data": [
{
"id": 1,
"name": "turnipjuice-media",
"provider_name": "DigitalOcean",
"ubuntu_version": "24.04",
"ip_address": "10.0.0.1",
"ssh_port": 22,
"timezone": "UTC",
"region": "TOR1",
"size": "1 GB / 1 vCPU",
"disk_space": {
"total": 25210576000,
"available": 20966548000,
"used": 4244028000,
"updated_at": "2024-07-01T12:00:00.000000Z"
},
"database": {
"server": "mysql-8.0",
"host": "localhost",
"port": 3306
},
"ssh_publickey": "ssh-rsa AAAA....",
"git_publickey": "ssh-rsa AAAA....",
"connection_status": "connected",
"reboot_required": true,
"upgrade_required": false,
"install_notes": null,
"created_at": "2024-07-01T12:00:00.000000Z",
"status": "provisioned"
}
],
"pagination": {
"previous": null,
"next": "https://api.spinupwp.app/v1/servers?page=2",
"per_page": 10,
"count": 15
}
}
GET /servers
Retrieves a list of servers. Returns a paginated list of Server objects.
Provision a server
Request
curl -X POST https://api.spinupwp.app/v1/servers \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'server_provider[id]'=1 \
-d 'server_provider[region]'="tor1" \
-d 'server_provider[size]'="s-1vcpu-1gb" \
-d 'server_provider[enable_backups]'=true \
-d 'hostname'="turnipjuice-media" \
-d 'timezone'="America/Toronto" \
-d 'database[root_password]'="V9ByakWHYgFN"
-d 'post_provision_script'="apt-get install -q -y nodejs; apt-get install -q -y npm;"
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$server = $spinupwp->servers->create([
'server_provider' => [
'id' => 1,
'region' => 'tor1',
'size' => 's-1vcpu-1gb',
'enable_backups' => true,
],
'hostname' => 'turnipjuice-media',
'timezone' => 'America/Toronto',
'database' => [
'root_password' => 'V9ByakWHYgFN',
],
'post_provision_script' => "apt-get install -q -y nodejs; apt-get install -q -y npm;",
]);
Response
{
"event_id": 1,
"data": {
"id": 1,
"name": "turnipjuice-media",
"provider_name": "DigitalOcean",
"ubuntu_version": "24.04",
"ip_address": "10.0.0.1",
"ssh_port": 22,
"timezone": "UTC",
"region": "TOR1",
"size": "1 GB / 1 vCPU",
"disk_space": {
"total": 25210576000,
"available": 20966548000,
"used": 4244028000,
"updated_at": "2024-07-01T12:00:00.000000Z"
},
"database": {
"server": "mysql-8.0",
"host": "localhost",
"port": 3306
},
"ssh_publickey": "ssh-rsa AAAA....",
"git_publickey": "ssh-rsa AAAA....",
"connection_status": "connected",
"reboot_required": true,
"upgrade_required": false,
"install_notes": null,
"created_at": "2024-07-01T12:00:00.000000Z",
"status": "provisioned"
}
}
POST /servers
Provisions a new server. Returns the event_id of the create server event along with the created Server object. On average, it takes 10 minutes for a new server to be provisioned, and we’ll email you once your server is ready. You can check the events endpoint for the event_id to find out when the server has finished provisioning.
Currently supported server providers: DigitalOcean, Vultr, Akamai/Linode, and Hetzner. You must provide either the ID of an existing Server Provider or a valid provider API token.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
server_provider.id |
integer | The ID of the Server Provider where the server should be provisioned. This can be found in the Account Settings in SpinupWP. Required unless using a provider API token. |
server_provider.name |
string | Choose one of the following available options: digitalocean, vultr, linode or hetzner. Required unless using a Server Provider ID. |
server_provider.api_token |
string | A provider API token. Required unless using a Server Provider ID. |
server_provider.region* |
string | The slug of the region where the server will be provisioned. See Server Providers for a list of available regions. |
server_provider.size* |
string | The slug of the size for the server to be provisioned. See Server Providers for a list of available sizes. |
server_provider.enable_backups |
boolean | If backups should be enabled at the server provider level. Each provider manages backups differently. Refer to their documentation for exact behavior and limitations. Defaults to false. |
hostname* |
string | Hostname for the server. Can only contain alphanumeric characters, dashes, and periods. |
timezone |
string | Configures the server’s timezone, which affects when Unix cron jobs run and the date format of some log files. Here you can find a list of supported timezones. Defaults to UTC. |
database_provider.id |
integer | The ID of an External Database. This can be found in the Account Settings in SpinupWP. The latest version of MySQL will be installed on your server if not provided. |
database.root_password |
string | Database root password. Leave blank to auto generate. |
post_provision_script |
string | This script will run as the root user once your server has successfully provisioned. |
Provision a custom server
Request
curl -X POST https://api.spinupwp.app/v1/servers/custom \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'provider_name=OVH' \
-d 'ubuntu_version=24.04' \
-d 'ip_address=10.0.0.1' \
-d 'ssh_port=22' \
-d 'auth_method=password' \
-d 'username=root' \
--data-urlencode 'password=9X1PU0cnJp8FyjMW' \
-d 'hostname=turnipjuice-media' \
-d 'timezone=America/Toronto' \
--data-urlencode 'database_root_password=V9ByakWHYgFN' \
--data-urlencode 'post_provision_script=apt-get install -q -y nodejs; apt-get install -q -y npm;'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$server = $spinupwp->servers->createCustom([
'provider_name' => 'OVH',
'ip_address' => '10.0.0.1',
'ssh_port' => 22,
'ubuntu_version' => 24.04,
'username' => 'root',
'password' => '9X1PU0cnJp8FyjMW',
'auth_method' => 'password',
'hostname' => 'turnipjuice-media',
'timezone' => 'America/Toronto',
'database_root_password' => 'V9ByakWHYgFN',
'post_provision_script' => 'apt-get install -q -y nodejs; apt-get install -q -y npm;',
]);
Response
{
"event_id": 1,
"data": {
"id": 1,
"name": "turnipjuice-media",
"provider_name": "OVH",
"ubuntu_version": "24.04",
"ip_address": "10.0.0.1",
"ssh_port": 22,
"timezone": "UTC",
"region": "",
"size": "",
"disk_space": {
"total": 25210576000,
"available": 20966548000,
"used": 4244028000,
"updated_at": "2024-07-01T12:00:00.000000Z"
},
"database": {
"server": "mysql-8.0",
"host": "localhost",
"port": 3306
},
"ssh_publickey": "ssh-rsa AAAA....",
"git_publickey": "ssh-rsa AAAA....",
"connection_status": "connected",
"reboot_required": true,
"upgrade_required": false,
"install_notes": null,
"created_at": "2024-07-01T12:00:00.000000Z",
"status": "provisioned"
}
}
POST /servers/custom
Provisions a new custom server. Returns the event_id of the event along with the Server object. On average, it takes 10 minutes for a custom server to be provisioned, and we’ll email you once your server is ready. You can check the events endpoint for the event_id to find out when the server has finished provisioning.
If you choose publickey as the authentication method, you must add SpinupWP’s SSH public key to your server’s authorized_keys file before provisioning. This allows SpinupWP to connect and configure the server. You can retrieve the key from the Show SpinupWP SSH key endpoint.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
provider_name* |
string | The name of the company providing the server (e.g. OVH). |
ubuntu_version* |
string | The version of Ubuntu installed on the server. Must be one of the latest two LTS versions of Ubuntu (e.g. 24.04). |
ip_address* |
string | The public IP address of the server. |
ssh_port |
integer | The port to use for SSH. Defaults to 22. |
username* |
string | The username SpinupWP should use to connect via SSH. |
auth_method |
string | The authentication method to connect to the server. Either password or publickey. Defaults to publickey. |
password |
string | The SSH password. Required if auth_method is password. |
hostname* |
string | Hostname for the server. Can only contain alphanumeric characters, dashes, and periods. |
timezone |
string | Configures the server’s timezone. List of supported timezones. Defaults to UTC. |
post_provision_script |
string | This script will run as the root user once your server has been successfully provisioned. |
database_root_password |
string | Database root password. Leave blank to auto generate one. |
database_provider_id |
integer | The ID of an external database to use instead of installing one. Found in your SpinupWP Account Settings. |
Retrieve a server
Request
curl -X GET https://api.spinupwp.app/v1/servers/{id} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$server = $spinupwp->servers->get($serverId);
Response
{
"data": {
"id": 1,
"name": "turnipjuice-media",
"provider_name": "DigitalOcean",
"ubuntu_version": "24.04",
"ip_address": "10.0.0.1",
"ssh_port": 22,
"timezone": "UTC",
"region": "TOR1",
"size": "1 GB / 1 vCPU",
"disk_space": {
"total": 25210576000,
"available": 20966548000,
"used": 4244028000,
"updated_at": "2024-07-01T12:00:00.000000Z"
},
"database": {
"server": "mysql-8.0",
"host": "localhost",
"port": 3306
},
"ssh_publickey": "ssh-rsa AAAA....",
"git_publickey": "ssh-rsa AAAA....",
"connection_status": "connected",
"reboot_required": true,
"upgrade_required": false,
"install_notes": null,
"created_at": "2024-07-01T12:00:00.000000Z",
"status": "provisioned"
}
}
GET /servers/{id}
Retrieves the details of a single server. Returns a Server object.
Delete a server
Request
curl -X DELETE https://api.spinupwp.app/v1/servers/{id} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d delete_server_on_provider=true \
-G
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->servers->delete($serverId, $deleteOnProvider);
Response
{
"event_id": 1
}
DELETE /servers/{id}
Permanently deletes a server. This cannot be undone. Returns the event_id of the delete server event.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
delete_server_on_provider |
boolean | Also, delete the server from the server provider (DigitalOcean, etc.). |
Reboot a server
Request
curl -X POST https://api.spinupwp.app/v1/servers/{id}/reboot \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->servers->reboot($serverId);
Response
{
"event_id": 1
}
POST /servers/{id}/reboot
Reboot a server. Returns the event_id of the reboot server event.
Restart Nginx service
Request
curl -X POST https://api.spinupwp.app/v1/servers/{id}/services/nginx/restart \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->servers->restartNginx($serverId);
Response
{
"event_id": 1
}
POST /servers/{id}/services/nginx/restart
Restart the Nginx service on a server. Returns the event_id of the restart Nginx event.
Restart Redis service
Request
curl -X POST https://api.spinupwp.app/v1/servers/{id}/services/redis/restart \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->servers->restartRedis($serverId);
Response
{
"event_id": 1
}
POST /servers/{id}/services/redis/restart
Restart the Redis service on a server. Returns the event_id of the restart Redis event.
Restart PHP-FPM service
Request
curl -X POST https://api.spinupwp.app/v1/servers/{id}/services/php/restart \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->servers->restartPhp($serverId);
Response
{
"event_id": 1
}
POST /servers/{id}/services/php/restart
Restart all versions of the PHP-FPM service installed on a server. Returns the event_id of the restart PHP-FPM event.
Restart MySQL service
Request
curl -X POST https://api.spinupwp.app/v1/servers/{id}/services/mysql/restart \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->servers->restartMysql($serverId);
Response
{
"event_id": 1
}
POST /servers/{id}/services/mysql/restart
Restart the MySQL or MariaDB service on a server. Returns the event_id of the restart MySQL event.
Sites
The Sites endpoint allows you to create, view, and delete sites.
List all sites
Request
curl -X GET https://api.spinupwp.app/v1/sites \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d server_id=1 \
-G
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
// List all sites
$sites = $spinupwp->sites->list();
// List sites by server
$sites = $spinupwp->sites->listForServer($serverId);
Response
{
"data": [
{
"id": 0,
"server_id": 1,
"domain": "turnipjuice.media",
"additional_domains": [
{
"id": 1,
"domain": "www.turnipjuice.media",
"redirect": {
"enabled": true,
"type": 301,
"destination": "turnipjuice.media"
},
"created_at": "2024-07-01T12:00:00.000000Z"
}
],
"site_user": "turnipjuicemedia",
"php_version": "8.3",
"public_folder": "/",
"is_wordpress": true,
"page_cache": {
"enabled": true,
"duration": 1,
"duration_unit": "d",
"path_exclusions": "/wp-admin/|/wp-json/|...",
"cookie_exclusions": "comment_author|wordpress_logged_in|...",
"ignored_query_params": "utm_[a-zA-Z0-9_-]+|fbclid|gclid|..."
},
"https": {
"enabled": true
},
"nginx": {
"uploads_directory_protected": true,
"xmlrpc_protected": true,
"subdirectory_rewrite_in_place": false
},
"database": {
"id": 1,
"user_id": 1,
"table_prefix": "wp_"
},
"backups": {
"files": true,
"database": true,
"paths_to_exclude": "node_modules\\n/files/vendor",
"retention_period": 30,
"next_run_time": "2024-07-01T12:00:00.000000Z",
"storage_provider": {
"id": 1,
"region": "nyc3",
"bucket": "turnipjuice-media"
},
"schedule": {
"daily": {
"backup_database": true,
"backup_files": true,
"retention_period": 30,
"time_of_day": [
2
]
},
"weekly": {
"backup_database": true,
"backup_files": true,
"retention_period": 30,
"time_of_day": 3,
"day_of_week": [
0
]
},
"monthly": {
"backup_database": true,
"backup_files": true,
"retention_period": 90,
"time_of_day": 4,
"day_of_month": [
{
"week_of_month": "first",
"day_of_week": 1
}
]
}
}
},
"wp_core_update": true,
"wp_theme_updates": 0,
"wp_plugin_updates": 3,
"git": {
"repo": "git@github.com:spinupwp/spinupwp-composer-site.git",
"branch": "main",
"deploy_script": "composer install --optimize-autoload --no-dev",
"push_enabled": true,
"deployment_url": "https://api.spinupwp.app/git/jeJLdKrl63/deploy"
},
"basic_auth": {
"enabled": true,
"username": "turnipjuice"
},
"subdomain": {
"enabled": true,
"url": "https://5q2g62kzyn.xyz.spinupwp.site"
},
"created_at": "2024-07-01T12:00:00.000000Z",
"disabled_at": null,
"status": "deployed"
}
],
"pagination": {
"previous": null,
"next": "https://api.spinupwp.app/v1/sites?page=2",
"per_page": 10,
"count": 15
}
}
GET /sites
Retrieves a list of sites. Optionally filtered by server. Returns a paginated list of Site objects.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
server_id |
integer | Filter by Server ID |
Create a site
Request
curl -X POST https://api.spinupwp.app/v1/sites \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'server_id'=1 \
-d 'domain'=turnipjuice.media \
-d 'site_user'=turnipjuicemedia \
-d 'installation_method'=wp \
-d 'page_cache[enabled]'=true \
-d 'database[name]'=turnipjuicemedia \
-d 'database[username]'=turnipjuicemedia \
-d 'wordpress[title]'="Turnip Juice Media" \
-d 'wordpress[admin_user]'=admin \
-d 'wordpress[admin_email]'=abraham@turnipjuice.media \
-d 'wordpress[admin_password]'=DK6Jrfj8gyWzL
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$site = $spinupwp->sites->create($serverId, [
'domain' => 'turnipjuice.media',
'site_user' => 'turnipjuicemedia',
'installation_method' => 'wp',
'page_cache' => [
'enabled' => true,
],
'database' => [
'name' => 'turnipjuicemedia',
'username' => 'turnipjuicemedia',
],
'wordpress' => [
'title' => 'Turnip Juice Media',
'admin_user' => 'admin',
'admin_email' => 'abraham@turnipjuice.media',
'admin_password' => 'DK6Jrfj8gyWzL',
]
]);
Response
{
"event_id": 1,
"data": {
"id": 0,
"server_id": 1,
"domain": "turnipjuice.media",
"additional_domains": [
{
"id": 1,
"domain": "www.turnipjuice.media",
"redirect": {
"enabled": true,
"type": 301,
"destination": "turnipjuice.media"
},
"created_at": "2024-07-01T12:00:00.000000Z"
}
],
"site_user": "turnipjuicemedia",
"php_version": "8.3",
"public_folder": "/",
"is_wordpress": true,
"page_cache": {
"enabled": true,
"duration": 1,
"duration_unit": "d",
"path_exclusions": "/wp-admin/|/wp-json/|...",
"cookie_exclusions": "comment_author|wordpress_logged_in|...",
"ignored_query_params": "utm_[a-zA-Z0-9_-]+|fbclid|gclid|..."
},
"https": {
"enabled": true
},
"nginx": {
"uploads_directory_protected": true,
"xmlrpc_protected": true,
"subdirectory_rewrite_in_place": false
},
"database": {
"id": 1,
"user_id": 1,
"table_prefix": "wp_"
},
"backups": {
"files": true,
"database": true,
"paths_to_exclude": "node_modules\\n/files/vendor",
"retention_period": 30,
"next_run_time": "2024-07-01T12:00:00.000000Z",
"storage_provider": {
"id": 1,
"region": "nyc3",
"bucket": "turnipjuice-media"
},
"schedule": {
"daily": {
"backup_database": true,
"backup_files": true,
"retention_period": 30,
"time_of_day": [
2
]
},
"weekly": {
"backup_database": true,
"backup_files": true,
"retention_period": 30,
"time_of_day": 3,
"day_of_week": [
0
]
},
"monthly": {
"backup_database": true,
"backup_files": true,
"retention_period": 90,
"time_of_day": 4,
"day_of_month": [
{
"week_of_month": "first",
"day_of_week": 1
}
]
}
}
},
"wp_core_update": true,
"wp_theme_updates": 0,
"wp_plugin_updates": 3,
"git": {
"repo": "git@github.com:spinupwp/spinupwp-composer-site.git",
"branch": "main",
"deploy_script": "composer install --optimize-autoload --no-dev",
"push_enabled": true,
"deployment_url": "https://api.spinupwp.app/git/jeJLdKrl63/deploy"
},
"basic_auth": {
"enabled": true,
"username": "turnipjuice"
},
"subdomain": {
"enabled": true,
"url": "https://5q2g62kzyn.xyz.spinupwp.site"
},
"created_at": "2024-07-01T12:00:00.000000Z",
"disabled_at": null,
"status": "deployed"
}
}
POST /sites
Creates a new site. Returns the event_id of the create site event along with the created Site object. You can check the events endpoint for the event_id every few minutes to find out when the site is ready.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
server_id* |
integer | The ID of the server where the site should be created. |
domain* |
string | The site’s primary domain. |
site_user* |
string | The username for the site user. |
php_version |
string | The site’s PHP version. Defaults to 8.3. |
public_folder |
string | The site’s public folder. Defaults to /. |
installation_method* |
string | The type of site. One of wp, wp_subdirectory, wp_subdomain, git or blank. |
deploy_script |
string | This script will run after the site has been deployed. The script is executed as the site user from the ~/files directory. |
page_cache.enabled |
boolean | Whether to enable page caching. |
database.name |
string | Database name. Only required if adding a database. |
database.username |
string | Database username. Only required if adding a database. |
database.password |
string | Database password. Leave blank to auto generate. |
database.table_prefix |
string | Table prefix for WordPress. Leave blank to auto generate. |
wordpress.title |
string | WordPress site title. Required when using a WordPress installation method. |
wordpress.admin_user |
string | WordPress admin username. Required when using a WordPress installation method. |
wordpress.admin_password |
string | WordPress admin password. Required when using a WordPress installation method. Must be at least 8 characters. |
wordpress.admin_email |
string | WordPress admin email. Required when using a WordPress installation method. |
git.repo |
string | Link to the git repository. Required when using the git installation method. |
git.branch |
string | Git repository branch to deploy from. Required when using the git installation method. |
git.always_run_deploy_script |
boolean | Run the site’s deploy script after each git deployment. If this is not true, the script will run once after the site has been created and will not be saved. |
git.push_to_deploy |
boolean | Enable push to deploy for git. Need to setup a webhook with your git provider to point to the site’s git_deployment_url. Defaults to false. |
git.deploy_key_enabled |
boolean | Whether to use a unique deploy key for git authentication. Otherwise the server’s key will be used. |
git.deploy_key.privatekey |
string | The private key for git authentication. Required if git.deploy_key_enabled is true. |
git.deploy_key.publickey |
string | The public key for git authentication. Required if git.deploy_key_enabled is true. |
Retrieve a site
Request
curl -X GET https://api.spinupwp.app/v1/sites/{id} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$site = $spinupwp->sites->get($siteId);
Response
{
"data": {
"id": 0,
"server_id": 1,
"domain": "turnipjuice.media",
"additional_domains": [
{
"id": 1,
"domain": "www.turnipjuice.media",
"redirect": {
"enabled": true,
"type": 301,
"destination": "turnipjuice.media"
},
"created_at": "2024-07-01T12:00:00.000000Z"
}
],
"site_user": "turnipjuicemedia",
"php_version": "8.3",
"public_folder": "/",
"is_wordpress": true,
"page_cache": {
"enabled": true,
"duration": 1,
"duration_unit": "d",
"path_exclusions": "/wp-admin/|/wp-json/|...",
"cookie_exclusions": "comment_author|wordpress_logged_in|...",
"ignored_query_params": "utm_[a-zA-Z0-9_-]+|fbclid|gclid|..."
},
"https": {
"enabled": true
},
"nginx": {
"uploads_directory_protected": true,
"xmlrpc_protected": true,
"subdirectory_rewrite_in_place": false
},
"database": {
"id": 1,
"user_id": 1,
"table_prefix": "wp_"
},
"backups": {
"files": true,
"database": true,
"paths_to_exclude": "node_modules\\n/files/vendor",
"retention_period": 30,
"next_run_time": "2024-07-01T12:00:00.000000Z",
"storage_provider": {
"id": 1,
"region": "nyc3",
"bucket": "turnipjuice-media"
},
"schedule": {
"daily": {
"backup_database": true,
"backup_files": true,
"retention_period": 30,
"time_of_day": [
2
]
},
"weekly": {
"backup_database": true,
"backup_files": true,
"retention_period": 30,
"time_of_day": 3,
"day_of_week": [
0
]
},
"monthly": {
"backup_database": true,
"backup_files": true,
"retention_period": 90,
"time_of_day": 4,
"day_of_month": [
{
"week_of_month": "first",
"day_of_week": 1
}
]
}
}
},
"wp_core_update": true,
"wp_theme_updates": 0,
"wp_plugin_updates": 3,
"git": {
"repo": "git@github.com:spinupwp/spinupwp-composer-site.git",
"branch": "main",
"deploy_script": "composer install --optimize-autoload --no-dev",
"push_enabled": true,
"deployment_url": "https://api.spinupwp.app/git/jeJLdKrl63/deploy"
},
"basic_auth": {
"enabled": true,
"username": "turnipjuice"
},
"subdomain": {
"enabled": true,
"url": "https://5q2g62kzyn.xyz.spinupwp.site"
},
"created_at": "2024-07-01T12:00:00.000000Z",
"disabled_at": null,
"status": "deployed"
}
}
GET /sites/{id}
Retrieves the details of a single site. Returns a Site object.
Delete a site
Request
curl -X DELETE https://api.spinupwp.app/v1/sites/{id} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d delete_database=true \
-d delete_backups=true \
-G
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->delete($siteId);
Response
{
"event_id": 1
}
DELETE /sites/{id}
Permanently deletes a site. This cannot be undone. Returns the event_id of the delete site event.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
delete_database |
boolean | Delete associated database |
delete_backups |
boolean | Delete associated backups |
Purge page cache
Request
curl -X POST https://api.spinupwp.app/v1/sites/{id}/page-cache/purge \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->purgePageCache($siteId);
Response
{
"event_id": 1
}
POST /sites/{id}/page-cache/purge
Purge the site’s page cache. Returns the event_id of the purge page cache event.
Purge object cache
Request
curl -X POST https://api.spinupwp.app/v1/sites/{id}/object-cache/purge \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->purgeObjectCache($siteId);
Response
{
"event_id": 1
}
POST /sites/{id}/object-cache/purge
Purge the site’s WordPress object cache. Returns the event_id of the purge object cache event.
Correct file permissions
Request
curl -X POST https://api.spinupwp.app/v1/sites/{id}/file-permissions/correct \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->correctFilePermissions($siteId);
Response
{
"event_id": 1
}
POST /sites/{id}/file-permissions/correct
Reset all file permissions so that the site’s system user owns the site’s file and folders. Returns the event_id of the correct file permissions event.
Disable a site
Request
curl -X POST https://api.spinupwp.app/v1/sites/{id}/disable \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->disable($siteId);
Response
{
"event_id": 1
}
POST /sites/{id}/disable
Disable a site so that it no longer serves traffic. The site’s files, database, configuration and SSL certificate are left intact, and the site can be re-enabled at any time. Returns the event_id of the disable site event.
Enable a site
Request
curl -X POST https://api.spinupwp.app/v1/sites/{id}/enable \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->enable($siteId);
Response
{
"event_id": 1
}
POST /sites/{id}/enable
Enable a previously disabled site so that it serves traffic again. Returns the event_id of the enable site event.
Run a Git deployment
Request
curl -X POST https://api.spinupwp.app/v1/sites/{id}/git/deploy \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->gitDeploy($siteId);
Response
{
"event_id": 1
}
POST /sites/{id}/git/deploy
Run a Git deployment which will pull the latest changes from your Git repository to the site on your server, and run your deployment script afterward (if you have one configured). Returns the event_id of the git deployment event.
Enable HTTPS
Request
curl -X POST https://api.spinupwp.app/v1/sites/{id}/https \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'type'=webroot
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->enableHttps($siteId, [
'type' => 'webroot',
]);
Response
{
"event_id": 1
}
POST /sites/{id}/https
Enable HTTPS for a site using either Let’s Encrypt (webroot) or a custom certificate. Returns the event_id of the enable HTTPS event.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
type* |
string | The type of HTTPS certificate. One of webroot (Let’s Encrypt) or custom. |
certificate |
string | The SSL certificate content. Required if type is custom. |
private_key |
string | The private key content. Required if type is custom. |
Update HTTPS
Request
curl -X PUT https://api.spinupwp.app/v1/sites/{id}/https \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'type'=custom \
--data-urlencode 'certificate'="-----BEGIN CERTIFICATE-----..." \
--data-urlencode 'private_key'="-----BEGIN PRIVATE KEY-----..."
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->updateHttps($siteId, [
'type' => 'custom',
'certificate' => '-----BEGIN CERTIFICATE-----...',
'private_key' => '-----BEGIN PRIVATE KEY-----...',
]);
Response
{
"event_id": 1
}
PUT /sites/{id}/https
Switch the certificate type between webroot or custom. Also used to update the custom certificate values. Returns the event_id of the update HTTPS event.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
type* |
string | The type of HTTPS certificate. One of webroot (Let’s Encrypt) or custom. |
certificate |
string | The SSL certificate content. Required if type is custom. |
private_key |
string | The private key content. Required if type is custom. |
Disable HTTPS
Request
curl -X DELETE https://api.spinupwp.app/v1/sites/{id}/https \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->disableHttps($siteId);
Response
{
"event_id": 1
}
DELETE /sites/{id}/https
Disable HTTPS for a site. Returns the event_id of the disable HTTPS event.
Update PHP version
Request
curl -X PUT https://api.spinupwp.app/v1/sites/{id}/php \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'php_version'=8.3
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->updatePhpSettings($siteId, [
'php_version' => '8.3',
]);
Response
{
"event_id": 1
}
PUT /sites/{id}/php
Update the PHP version for a site. Returns the event_id of the update PHP version event.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
php_version* |
string | The PHP version to use. |
Enable SpinupWP subdomain
Request
curl -X POST https://api.spinupwp.app/v1/sites/{id}/spinupwp-subdomain \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->enableSpinupwpSubdomain($siteId);
Response
{
"event_id": 1
}
POST /sites/{id}/spinupwp-subdomain
Enable the SpinupWP subdomain for a site. This provides a temporary URL for accessing your site before DNS is configured. Returns the event_id of the enable subdomain event.
Disable SpinupWP subdomain
Request
curl -X DELETE https://api.spinupwp.app/v1/sites/{id}/spinupwp-subdomain \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->removeSpinupwpSubdomain($siteId);
Response
{
"event_id": 1
}
DELETE /sites/{id}/spinupwp-subdomain
Remove the SpinupWP subdomain from a site. Returns the event_id of the remove subdomain event.
List additional domains
Request
curl -X GET https://api.spinupwp.app/v1/sites/{id}/domains \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$domains = $spinupwp->sites->listDomains($siteId);
Response
{
"data": [
{
"id": 1,
"domain": "www.turnipjuice.media",
"redirect": {
"enabled": true,
"type": 301,
"destination": "turnipjuice.media"
},
"created_at": "2024-07-01T12:00:00.000000Z"
}
]
}
GET /sites/{id}/domains
Retrieves a list of additional domains for a site.
Add additional domain
Request
curl -X POST https://api.spinupwp.app/v1/sites/{id}/domains \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'domain'=www.turnipjuice.media \
-d 'redirect[enabled]'=true \
-d 'redirect[type]'=301 \
-d 'redirect[destination]'=turnipjuice.media
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$domain = $spinupwp->sites->addDomain($siteId, [
'domain' => 'www.turnipjuice.media',
'redirect' => [
'enabled' => true,
'type' => 301,
'destination' => 'turnipjuice.media',
],
]);
Response
{
"event_id": 1,
"data": {
"id": 1,
"domain": "www.turnipjuice.media",
"redirect": {
"enabled": true,
"type": 301,
"destination": "turnipjuice.media"
},
"created_at": "2024-07-01T12:00:00.000000Z"
}
}
POST /sites/{id}/domains
Add an additional domain to a site. Returns the event_id of the add domain event along with the created domain object.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
domain* |
string | The domain name to add. Cannot be the same as the primary domain. |
redirect.enabled |
boolean | Whether to enable redirect for this domain. |
redirect.type |
integer | The redirect type. One of 301, 302, 307, or 308. Defaults to 301. |
redirect.destination |
string | The redirect destination URL or domain. Defaults to the primary domain. |
Update additional domain
Request
curl -X PUT https://api.spinupwp.app/v1/sites/{id}/domains/{domain} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'redirect[enabled]'=true \
-d 'redirect[type]'=301 \
-d 'redirect[destination]'=https://newsite.com
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$domain = $spinupwp->sites->updateDomain($siteId, $domainId, [
'redirect' => [
'enabled' => true,
'type' => 301,
'destination' => 'https://newsite.com',
],
]);
Response
{
"event_id": 1,
"data": {
"id": 1,
"domain": "www.turnipjuice.media",
"redirect": {
"enabled": true,
"type": 301,
"destination": "turnipjuice.media"
},
"created_at": "2024-07-01T12:00:00.000000Z"
}
}
PUT /sites/{id}/domains/{domain}
Update the redirect settings for an additional domain. Returns the event_id of the update domain event along with the updated domain object.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
domain* |
integer | The domain ID to update. |
redirect.enabled* |
boolean | Whether to enable redirect for this domain. |
redirect.type |
integer | The redirect type. One of 301, 302, 307, or 308. |
redirect.destination |
string | The redirect destination URL or domain. |
Delete additional domain
Request
curl -X DELETE https://api.spinupwp.app/v1/sites/{id}/domains/{domain} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->deleteDomain($siteId, $domainId);
Response
{
"event_id": 1
}
DELETE /sites/{id}/domains/{domain}
Delete an additional domain from a site. Returns the event_id of the delete domain event.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
domain* |
integer | The domain ID to delete. |
Connect Git
Request
curl -X POST https://api.spinupwp.app/v1/sites/{id}/git \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'repo'=git@github.com:spinupwp/spinupwp-composer-site.git \
-d 'branch'=main \
-d 'push_to_deploy'=true
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->connectGit($siteId, [
'repo' => 'git@github.com:spinupwp/spinupwp-composer-site.git',
'branch' => 'main',
'push_to_deploy' => true,
]);
Response
{
"event_id": 1
}
POST /sites/{id}/git
Connect a Git repository to a site. Returns the event_id of the connect git event.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
repo* |
string | The Git repository URL. |
branch* |
string | The Git branch to deploy from. |
deploy_script |
string | The script that will run after each Git deployment. The script is executed as the site user from the ~/files directory. |
push_to_deploy |
boolean | Enable push to deploy for Git. You will need to set up a webhook with your Git provider pointing to the site’s deployment_url. Defaults to false. |
deploy_key.privatekey |
string | The private key for Git authentication. Providing both deploy_key.privatekey and deploy_key.publickey enables a unique deploy key for this site. Otherwise the server’s key will be used. Required if deploy_key.publickey is provided. |
deploy_key.publickey |
string | The public key for Git authentication. Required if deploy_key.privatekey is provided. |
Update Git
Request
curl -X PUT https://api.spinupwp.app/v1/sites/{id}/git \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'branch'=production
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->updateGit($siteId, [
'branch' => 'production',
]);
Response
{
"event_id": 1
}
PUT /sites/{id}/git
Update the Git settings for a site. At least one field must be provided. Returns the event_id of the update git event, or null when the change requires no work on the server (for example updating only push_to_deploy or deploy_script).
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
repo |
string | The Git repository URL. |
branch |
string | The Git branch to deploy from. |
deploy_script |
string | The script that will run after each Git deployment. The script is executed as the site user from the ~/files directory. |
push_to_deploy |
boolean | Enable push to deploy for Git. |
Disconnect Git
Request
curl -X DELETE https://api.spinupwp.app/v1/sites/{id}/git \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->disconnectGit($siteId);
Response
{
"event_id": 1
}
DELETE /sites/{id}/git
Disconnect Git from a site. Returns the event_id of the disconnect git event.
Enable page cache
Request
curl -X POST https://api.spinupwp.app/v1/sites/{id}/page-cache \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->enablePageCache($siteId);
Response
{
"event_id": 1
}
POST /sites/{id}/page-cache
Enable page caching for a site. Returns the event_id of the enable page cache event.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
duration |
integer | The cache duration. Defaults to the site’s existing value. |
duration_unit |
string | The cache duration unit. One of s, m, h, d, w, M, or y. |
path_exclusions |
string | Newline-separated list of paths to exclude from caching. Cannot contain ", ` |
cookie_exclusions |
string | Newline-separated list of cookies that bypass the cache. Cannot contain ", ` |
ignored_query_params |
string | Newline-separated list of query parameters that should be ignored when caching. Cannot contain &, ", ` |
Update page cache
Request
curl -X PUT https://api.spinupwp.app/v1/sites/{id}/page-cache \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'duration'=1 \
-d 'duration_unit'=h \
--data-urlencode 'path_exclusions'="/wp-admin" \
--data-urlencode 'cookie_exclusions'="wordpress_logged_in_*"
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->updatePageCache($siteId, [
'duration' => 1,
'duration_unit' => 'h',
'path_exclusions' => '/wp-admin',
'cookie_exclusions' => 'wordpress_logged_in_*',
]);
Response
{
"event_id": 1
}
PUT /sites/{id}/page-cache
Update the page cache settings for a site. All fields are optional; omitted fields retain their current value. At least one field must be provided. Returns the event_id of the update page cache event.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
duration |
integer | The cache duration. |
duration_unit |
string | The cache duration unit. One of s, m, h, d, w, M, or y. |
path_exclusions |
string | Newline-separated list of paths to exclude from caching. Cannot contain ", ` |
cookie_exclusions |
string | Newline-separated list of cookies that bypass the cache. Cannot contain ", ` |
ignored_query_params |
string | Newline-separated list of query parameters that should be ignored when caching. Cannot contain &, ", ` |
Disable page cache
Request
curl -X DELETE https://api.spinupwp.app/v1/sites/{id}/page-cache \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->disablePageCache($siteId);
Response
{
"event_id": 1
}
DELETE /sites/{id}/page-cache
Disable page caching for a site. Returns the event_id of the disable page cache event.
Update Nginx settings
Request
curl -X PUT https://api.spinupwp.app/v1/sites/{id}/nginx \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'uploads_directory_protected'=true \
-d 'xmlrpc_protected'=true
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventIds = $spinupwp->sites->updateNginx($siteId, [
'uploads_directory_protected' => true,
'xmlrpc_protected' => true,
]);
Response
{
"event_ids": [
1,
2
]
}
PUT /sites/{id}/nginx
Update the Nginx settings for a site. At least one field must be provided. Returns an event_ids array containing the IDs of the events dispatched for each changed setting (empty if nothing changed).
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
uploads_directory_protected |
boolean | Disallow PHP execution in the uploads folder. |
xmlrpc_protected |
boolean | Disable xmlrpc.php. |
subdirectory_rewrite_in_place |
boolean | Enable rewrite rules for WordPress Multisite subdirectory installs. |
public_folder |
string | The site’s public folder, relative to the site’s files directory. Cannot contain spaces, ;, ., ~, or consecutive slashes. |
Enable WP cron
Request
curl -X POST https://api.spinupwp.app/v1/sites/{id}/cron \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'interval'=5
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->enableCron($siteId, [
'interval' => 5,
]);
Response
{
"event_id": 1
}
POST /sites/{id}/cron
Enable the server-level WordPress cron for a site. This replaces WordPress’s default cron with a system cron job running at the specified interval. Returns the event_id of the enable cron event.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
interval* |
integer | The cron interval in minutes. One of 1, 2, 5, 10, 15, 30, or 60. |
Update WP cron
Request
curl -X PUT https://api.spinupwp.app/v1/sites/{id}/cron \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'interval'=15
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->updateCron($siteId, [
'interval' => 15,
]);
Response
{
"event_id": 1
}
PUT /sites/{id}/cron
Update the WordPress cron interval for a site. Returns the event_id of the update cron event.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
interval* |
integer | The cron interval in minutes. One of 1, 2, 5, 10, 15, 30, or 60. |
Disable WP cron
Request
curl -X DELETE https://api.spinupwp.app/v1/sites/{id}/cron \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->disableCron($siteId);
Response
{
"event_id": 1
}
DELETE /sites/{id}/cron
Disable the server-level WordPress cron for a site. Returns the event_id of the disable cron event.
Enable basic auth
Request
curl -X POST https://api.spinupwp.app/v1/sites/{id}/basic-auth \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'username'=turnipjuice \
-d 'password'=DK6Jrfj8gyWzL
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->enableBasicAuth($siteId, [
'username' => 'turnipjuice',
'password' => 'DK6Jrfj8gyWzL',
]);
Response
{
"event_id": 1
}
POST /sites/{id}/basic-auth
Enable HTTP basic authentication for a site. Returns the event_id of the enable basic auth event.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
username* |
string | The basic auth username. Must contain at least 3 alpha-dash characters. |
password* |
string | The basic auth password. Must be at least 3 characters. |
Update basic auth
Request
curl -X PUT https://api.spinupwp.app/v1/sites/{id}/basic-auth \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'username'=newuser
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->updateBasicAuth($siteId, [
'username' => 'newuser',
]);
Response
{
"event_id": 1
}
PUT /sites/{id}/basic-auth
Update the basic auth credentials for a site. Leave password blank to keep the current password. At least one field must be provided. Returns the event_id of the update basic auth event, or null when nothing changed (the username is the same and no new password was provided).
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
username |
string | The basic auth username. |
password |
string | The basic auth password. Leave blank to keep the current password. |
Disable basic auth
Request
curl -X DELETE https://api.spinupwp.app/v1/sites/{id}/basic-auth \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->disableBasicAuth($siteId);
Response
{
"event_id": 1
}
DELETE /sites/{id}/basic-auth
Disable HTTP basic authentication for a site. Returns the event_id of the disable basic auth event.
List all path redirects
Request
curl -X GET https://api.spinupwp.app/v1/sites/{id}/path-redirects \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$redirects = $spinupwp->sites->listPathRedirects($siteId);
Response
{
"data": [
{
"from": "/old-path",
"to": "/new-path",
"type": "permanent",
"created_at": "2024-07-01T12:00:00.000000Z"
}
],
"pagination": {
"previous": null,
"next": "https://api.spinupwp.app/v1/sites/1/path-redirects?page=2",
"per_page": 10,
"count": 15
}
}
GET /sites/{id}/path-redirects
Retrieves a list of path redirects for a site. Returns a paginated list of PathRedirect objects.
Add path redirect
Request
curl -X POST https://api.spinupwp.app/v1/sites/{id}/path-redirects \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'from'=/old-path \
-d 'to'=/new-path \
-d 'type'=permanent
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->addPathRedirect($siteId, [
'from' => '/old-path',
'to' => '/new-path',
'type' => 'permanent',
]);
Response
{
"event_id": 1
}
POST /sites/{id}/path-redirects
Add a path redirect to a site. A redirect with the same from and to as an existing redirect on the site is rejected. Returns the event_id of the add path redirect event.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
from* |
string | The path to redirect from. Cannot contain spaces or any of {, }, #, ;. |
to* |
string | The path or URL to redirect to. Cannot contain spaces or any of {, }, #, ;. |
type* |
string | The redirect type. One of permanent (301) or redirect (302). |
Delete path redirect
Request
curl -X DELETE https://api.spinupwp.app/v1/sites/{id}/path-redirects \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'from'=/old-path \
-d 'to'=/new-path
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->deletePathRedirect($siteId, [
'from' => '/old-path',
'to' => '/new-path',
]);
Response
{
"event_id": 1
}
DELETE /sites/{id}/path-redirects
Delete a path redirect from a site, identified by its from and to. Returns the event_id of the delete path redirect event.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
from* |
string | The path the redirect redirects from. |
to* |
string | The path or URL the redirect redirects to. |
Update backup settings
Request
curl -X PUT https://api.spinupwp.app/v1/sites/{id}/backup-settings \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'storage_provider_id'=1 \
-d 'storage_provider_bucket'=turnipjuice-media \
-d 'storage_provider_region'=nyc3
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$site = $spinupwp->sites->updateBackupSettings($siteId, [
'storage_provider_id' => 1,
'storage_provider_bucket' => 'turnipjuice-media',
'storage_provider_region' => 'nyc3',
]);
Response
{
"data": {
"id": 0,
"server_id": 1,
"domain": "turnipjuice.media",
"additional_domains": [
{
"id": 1,
"domain": "www.turnipjuice.media",
"redirect": {
"enabled": true,
"type": 301,
"destination": "turnipjuice.media"
},
"created_at": "2024-07-01T12:00:00.000000Z"
}
],
"site_user": "turnipjuicemedia",
"php_version": "8.3",
"public_folder": "/",
"is_wordpress": true,
"page_cache": {
"enabled": true,
"duration": 1,
"duration_unit": "d",
"path_exclusions": "/wp-admin/|/wp-json/|...",
"cookie_exclusions": "comment_author|wordpress_logged_in|...",
"ignored_query_params": "utm_[a-zA-Z0-9_-]+|fbclid|gclid|..."
},
"https": {
"enabled": true
},
"nginx": {
"uploads_directory_protected": true,
"xmlrpc_protected": true,
"subdirectory_rewrite_in_place": false
},
"database": {
"id": 1,
"user_id": 1,
"table_prefix": "wp_"
},
"backups": {
"files": true,
"database": true,
"paths_to_exclude": "node_modules\\n/files/vendor",
"retention_period": 30,
"next_run_time": "2024-07-01T12:00:00.000000Z",
"storage_provider": {
"id": 1,
"region": "nyc3",
"bucket": "turnipjuice-media"
},
"schedule": {
"daily": {
"backup_database": true,
"backup_files": true,
"retention_period": 30,
"time_of_day": [
2
]
},
"weekly": {
"backup_database": true,
"backup_files": true,
"retention_period": 30,
"time_of_day": 3,
"day_of_week": [
0
]
},
"monthly": {
"backup_database": true,
"backup_files": true,
"retention_period": 90,
"time_of_day": 4,
"day_of_month": [
{
"week_of_month": "first",
"day_of_week": 1
}
]
}
}
},
"wp_core_update": true,
"wp_theme_updates": 0,
"wp_plugin_updates": 3,
"git": {
"repo": "git@github.com:spinupwp/spinupwp-composer-site.git",
"branch": "main",
"deploy_script": "composer install --optimize-autoload --no-dev",
"push_enabled": true,
"deployment_url": "https://api.spinupwp.app/git/jeJLdKrl63/deploy"
},
"basic_auth": {
"enabled": true,
"username": "turnipjuice"
},
"subdomain": {
"enabled": true,
"url": "https://5q2g62kzyn.xyz.spinupwp.site"
},
"created_at": "2024-07-01T12:00:00.000000Z",
"disabled_at": null,
"status": "deployed"
}
}
PUT /sites/{id}/backup-settings
Update the backup storage provider, database, and excluded paths for a site. At least one field must be provided. You can change the bucket, region, or storage class on its own to update the site’s current storage provider. Returns the updated Site object.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
storage_provider_id |
integer | The ID of a Storage Provider configured in SpinupWP. Required when setting a bucket, region, or storage class on a site that doesn’t have a storage provider yet. |
storage_provider_bucket |
string | The bucket (or filesystem path for SFTP) to store backups in. Required when switching to a different storage provider. |
storage_provider_region |
string | The region for the storage provider. Required for all storage providers except sftp, backblaze, and cloudflare. |
storage_provider_class |
string | The storage class. Required for aws-s3 storage providers. One of STANDARD, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, or GLACIER_IR. |
database |
integer | The ID of a database on the site’s server to back up. Pass null to clear it. |
paths_to_exclude |
string | Newline-separated list of paths to exclude from the site backups. |
Update backup schedule
Request
curl -X PUT https://api.spinupwp.app/v1/sites/{id}/backup-schedule \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'daily_schedule[time_of_day][]'=2 \
-d 'daily_schedule[backup_database]'=true \
-d 'daily_schedule[backup_files]'=true \
-d 'daily_schedule[retention_period]'=30 \
-d 'monthly_schedule[day_of_month][0][week_of_month]'=first \
-d 'monthly_schedule[day_of_month][0][day_of_week]'=1 \
-d 'monthly_schedule[time_of_day]'=4
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$site = $spinupwp->sites->updateBackupSchedule($siteId, [
'daily_schedule' => [
'time_of_day' => [2],
'backup_database' => true,
'backup_files' => true,
'retention_period' => 30,
],
'monthly_schedule' => [
'day_of_month' => [
['week_of_month' => 'first', 'day_of_week' => 1],
],
'time_of_day' => 4,
],
]);
Response
{
"data": {
"id": 0,
"server_id": 1,
"domain": "turnipjuice.media",
"additional_domains": [
{
"id": 1,
"domain": "www.turnipjuice.media",
"redirect": {
"enabled": true,
"type": 301,
"destination": "turnipjuice.media"
},
"created_at": "2024-07-01T12:00:00.000000Z"
}
],
"site_user": "turnipjuicemedia",
"php_version": "8.3",
"public_folder": "/",
"is_wordpress": true,
"page_cache": {
"enabled": true,
"duration": 1,
"duration_unit": "d",
"path_exclusions": "/wp-admin/|/wp-json/|...",
"cookie_exclusions": "comment_author|wordpress_logged_in|...",
"ignored_query_params": "utm_[a-zA-Z0-9_-]+|fbclid|gclid|..."
},
"https": {
"enabled": true
},
"nginx": {
"uploads_directory_protected": true,
"xmlrpc_protected": true,
"subdirectory_rewrite_in_place": false
},
"database": {
"id": 1,
"user_id": 1,
"table_prefix": "wp_"
},
"backups": {
"files": true,
"database": true,
"paths_to_exclude": "node_modules\\n/files/vendor",
"retention_period": 30,
"next_run_time": "2024-07-01T12:00:00.000000Z",
"storage_provider": {
"id": 1,
"region": "nyc3",
"bucket": "turnipjuice-media"
},
"schedule": {
"daily": {
"backup_database": true,
"backup_files": true,
"retention_period": 30,
"time_of_day": [
2
]
},
"weekly": {
"backup_database": true,
"backup_files": true,
"retention_period": 30,
"time_of_day": 3,
"day_of_week": [
0
]
},
"monthly": {
"backup_database": true,
"backup_files": true,
"retention_period": 90,
"time_of_day": 4,
"day_of_month": [
{
"week_of_month": "first",
"day_of_week": 1
}
]
}
}
},
"wp_core_update": true,
"wp_theme_updates": 0,
"wp_plugin_updates": 3,
"git": {
"repo": "git@github.com:spinupwp/spinupwp-composer-site.git",
"branch": "main",
"deploy_script": "composer install --optimize-autoload --no-dev",
"push_enabled": true,
"deployment_url": "https://api.spinupwp.app/git/jeJLdKrl63/deploy"
},
"basic_auth": {
"enabled": true,
"username": "turnipjuice"
},
"subdomain": {
"enabled": true,
"url": "https://5q2g62kzyn.xyz.spinupwp.site"
},
"created_at": "2024-07-01T12:00:00.000000Z",
"disabled_at": null,
"status": "deployed"
}
}
PUT /sites/{id}/backup-schedule
Update the site’s automated backup schedule. You can configure daily, weekly,
and/or monthly schedules in a single request by including the matching top-level keys.
All fields are optional — only the schedules and fields you include are updated.
At least one field must be provided.
Pass an empty time_of_day, day_of_week, or day_of_month array to disable that
schedule. Times of day are hours (0–23) in the server’s timezone.
How many daily, weekly, and monthly backup times you can set depends on your plan.
A schedule must back up your database, your files, or both, so backup_database and
backup_files can’t both be disabled for the same schedule. When you create a new schedule,
set at least one of them to true.
Enabling backup_database requires a backups database to be configured via the
Update backup settings endpoint first.
Returns the updated Site object.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
daily_schedule.time_of_day |
array[integer] | An array of hours (0–23) when daily backups should run. Pass an empty array to disable daily backups. |
daily_schedule.backup_database |
boolean | Whether to back up the database. |
daily_schedule.backup_files |
boolean | Whether to back up site files. |
daily_schedule.retention_period |
integer | Number of days to retain daily backups. Must be at least 1, or null to disable retention. |
weekly_schedule.day_of_week |
array[integer] | An array of weekdays (0 = Sunday through 6 = Saturday) when weekly backups should run. Pass an empty array to disable weekly backups. |
weekly_schedule.time_of_day |
integer | The hour (0–23) at which weekly backups run. |
weekly_schedule.backup_database |
boolean | Whether to back up the database. |
weekly_schedule.backup_files |
boolean | Whether to back up site files. |
weekly_schedule.retention_period |
integer | Number of days to retain weekly backups. Must be at least 1, or null to disable retention. |
monthly_schedule.day_of_month |
array[object] | An array of objects describing when monthly backups should run. Each object has a week_of_month (one of first, second, third, last) and a day_of_week (0 = Sunday through 6 = Saturday). Pass an empty array to disable monthly backups. |
monthly_schedule.time_of_day |
integer | The hour (0–23) at which monthly backups run. |
monthly_schedule.backup_database |
boolean | Whether to back up the database. |
monthly_schedule.backup_files |
boolean | Whether to back up site files. |
monthly_schedule.retention_period |
integer | Number of days to retain monthly backups. Must be at least 1, or null to disable retention. |
Update site user authentication
Request
curl -X PUT https://api.spinupwp.app/v1/sites/{id}/site-user \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d 'authentication'=publickey \
-d 'ssh_key_ids[]'=1
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$eventId = $spinupwp->sites->updateSiteUser($siteId, [
'authentication' => 'publickey',
'ssh_key_ids' => [1],
]);
Response
{
"event_id": 1
}
PUT /sites/{id}/site-user
Update the site user’s SSH authentication method. Returns the event_id of the update site user event.
Parameters
(* indicates a required field)
| Name | Type | Description |
|---|---|---|
authentication* |
string | The authentication method. One of publickey or password. |
ssh_key_ids |
array[integer] | An array of SSH key IDs to authorize for the site user. Required if authentication is publickey. |
password |
string | The site user’s password. Required if authentication is password. Must be at least 8 characters. |
Events
The Events endpoint allows you to view events.
List all events
Request
curl -X GET https://api.spinupwp.app/v1/events \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$events = $spinupwp->events->list();
Response
{
"data": [
{
"id": 0,
"initiated_by": "Abraham",
"server_id": 1,
"name": "Creating site turnipjuice.media",
"status": "deployed",
"output": null,
"created_at": "2024-07-01T12:00:00.000000Z",
"started_at": "2024-07-01T12:00:00.000000Z",
"finished_at": "2024-07-01T12:00:00.000000Z"
}
],
"pagination": {
"previous": null,
"next": "https://api.spinupwp.app/v1/events?page=2",
"per_page": 10,
"count": 15
}
}
GET /events
Retrieves a list of events. Returns a paginated list of Event objects.
Retrieve an event
Request
curl -X GET https://api.spinupwp.app/v1/events/{id} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$event = $spinupwp->events->get($eventId);
Response
{
"data": {
"id": 0,
"initiated_by": "Abraham",
"server_id": 1,
"name": "Creating site turnipjuice.media",
"status": "deployed",
"output": null,
"created_at": "2024-07-01T12:00:00.000000Z",
"started_at": "2024-07-01T12:00:00.000000Z",
"finished_at": "2024-07-01T12:00:00.000000Z"
}
}
GET /events/{id}
Retrieves the details of a single event. Returns an Event object. For operations that return an event_id you can use this endpoint to check the status of the event. A status of “deployed” means that the event was successfully completed. If the event fails, the output field will contain any error messages.
Storage Providers
The Storage Providers endpoint allows you to view the storage providers configured on your team.
List all storage providers
Request
curl -X GET https://api.spinupwp.app/v1/storage-providers \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
$spinupwp = new SpinupWp\SpinupWp('API_TOKEN');
$storageProviders = $spinupwp->storageProviders->list();
Response
{
"data": [
{
"id": 1,
"service": "aws-s3",
"name": "Production backups",
"created_at": "2024-07-01T12:00:00.000000Z"
}
],
"pagination": {
"previous": null,
"next": "https://api.spinupwp.app/v1/storage-providers?page=2",
"per_page": 10,
"count": 15
}
}
GET /storage-providers
Retrieves a list of storage providers. Returns a paginated list of StorageProvider objects.
Schemas
SSH Key
{
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD..."
}
Properties
| Name | Type | Description |
|---|---|---|
key |
string | SpinupWP’s SSH key |
Server
{
"id": 1,
"name": "turnipjuice-media",
"provider_name": "DigitalOcean",
"ubuntu_version": "24.04",
"ip_address": "10.0.0.1",
"ssh_port": 22,
"timezone": "UTC",
"region": "TOR1",
"size": "1 GB / 1 vCPU",
"disk_space": {
"total": 25210576000,
"available": 20966548000,
"used": 4244028000,
"updated_at": "2024-07-01T12:00:00.000000Z"
},
"database": {
"server": "mysql-8.0",
"host": "localhost",
"port": 3306
},
"ssh_publickey": "ssh-rsa AAAA....",
"git_publickey": "ssh-rsa AAAA....",
"connection_status": "connected",
"reboot_required": true,
"upgrade_required": false,
"install_notes": null,
"created_at": "2024-07-01T12:00:00.000000Z",
"status": "provisioned"
}
Properties
| Name | Type | Description |
|---|---|---|
id |
integer | Unique identifier for the server. |
name |
string | The server’s name. For display purposes only. |
provider_name |
string | The server’s provider name. |
ubuntu_version |
string | The version of Ubuntu on the server. One of 18.04, 20.04, 22.04, or 24.04. |
ip_address |
string | The server’s IP address. |
ssh_port |
integer | Port where the server accepts SSH connections. |
timezone |
string | The server’s timezone. |
region |
string | The server’s region. For display purposes only. |
size |
string | The server’s size. For display purposes only. |
disk_space |
object | Disk space details. |
» total |
integer | Total disk space detected on the server. (In bytes). |
» available |
integer | Available disk space detected on the server. (In bytes). |
» used |
integer | Used disk space detected on the server. (In bytes). |
» updated_at |
string(date-time) | The time that disk space was updated. |
database |
object | Database details. |
» server |
string | The database type on the server. |
» host |
string | The hostname for the database. |
» port |
integer | The port for the database. |
ssh_publickey |
string | The server’s public key. |
git_publickey |
string | The server’s public key for git connections. |
connection_status |
string | The server’s connection status. One of connected or disconnected. |
reboot_required |
boolean | If the server requires a reboot |
upgrade_required |
boolean | If the server has a pending SpinupWP upgrade. |
install_notes |
string | Notes about the server. |
created_at |
string(date-time) | The date the server was created. |
status |
string | The server’s status. One of provisioning, provisioned, or failed. |
Site
{
"id": 0,
"server_id": 1,
"domain": "turnipjuice.media",
"additional_domains": [
{
"id": 1,
"domain": "www.turnipjuice.media",
"redirect": {
"enabled": true,
"type": 301,
"destination": "turnipjuice.media"
},
"created_at": "2024-07-01T12:00:00.000000Z"
}
],
"site_user": "turnipjuicemedia",
"php_version": "8.3",
"public_folder": "/",
"is_wordpress": true,
"page_cache": {
"enabled": true,
"duration": 1,
"duration_unit": "d",
"path_exclusions": "/wp-admin/|/wp-json/|...",
"cookie_exclusions": "comment_author|wordpress_logged_in|...",
"ignored_query_params": "utm_[a-zA-Z0-9_-]+|fbclid|gclid|..."
},
"https": {
"enabled": true
},
"nginx": {
"uploads_directory_protected": true,
"xmlrpc_protected": true,
"subdirectory_rewrite_in_place": false
},
"database": {
"id": 1,
"user_id": 1,
"table_prefix": "wp_"
},
"backups": {
"files": true,
"database": true,
"paths_to_exclude": "node_modules\\n/files/vendor",
"retention_period": 30,
"next_run_time": "2024-07-01T12:00:00.000000Z",
"storage_provider": {
"id": 1,
"region": "nyc3",
"bucket": "turnipjuice-media"
},
"schedule": {
"daily": {
"backup_database": true,
"backup_files": true,
"retention_period": 30,
"time_of_day": [
2
]
},
"weekly": {
"backup_database": true,
"backup_files": true,
"retention_period": 30,
"time_of_day": 3,
"day_of_week": [
0
]
},
"monthly": {
"backup_database": true,
"backup_files": true,
"retention_period": 90,
"time_of_day": 4,
"day_of_month": [
{
"week_of_month": "first",
"day_of_week": 1
}
]
}
}
},
"wp_core_update": true,
"wp_theme_updates": 0,
"wp_plugin_updates": 3,
"git": {
"repo": "git@github.com:spinupwp/spinupwp-composer-site.git",
"branch": "main",
"deploy_script": "composer install --optimize-autoload --no-dev",
"push_enabled": true,
"deployment_url": "https://api.spinupwp.app/git/jeJLdKrl63/deploy"
},
"basic_auth": {
"enabled": true,
"username": "turnipjuice"
},
"subdomain": {
"enabled": true,
"url": "https://5q2g62kzyn.xyz.spinupwp.site"
},
"created_at": "2024-07-01T12:00:00.000000Z",
"disabled_at": null,
"status": "deployed"
}
Properties
| Name | Type | Description |
|---|---|---|
id |
integer | Unique identifier for the site. |
server_id |
integer | The site’s server ID. |
domain |
string | The site’s primary domain. |
additional_domains |
[AdditionalDomain] | The site’s additional domains. |
site_user |
string | The username for the site user. |
php_version |
string | The site’s PHP version. |
public_folder |
string | The site’s public folder. |
is_wordpress |
boolean | If a WordPress install was detected. |
page_cache |
object | Page cache details. |
» enabled |
boolean | If page caching is enabled. |
» duration |
integer | The cache duration. Only present when page caching is enabled. |
» duration_unit |
string | The cache duration unit. One of s, m, h, d, w, M, or y. Only present when page caching is enabled. |
» path_exclusions |
string | Pipe-separated list of paths excluded from caching. Only present when page caching is enabled. |
» cookie_exclusions |
string | Pipe-separated list of cookies that bypass the cache. Only present when page caching is enabled. |
» ignored_query_params |
string¦null | Pipe-separated list of query parameters ignored when caching. Only present when page caching is enabled. |
https |
object | HTTPS details. |
» enabled |
boolean | If https is enabled. |
nginx |
object | Nginx options. |
» uploads_directory_protected |
boolean | Disallow PHP execution in the uploads folder. |
» xmlrpc_protected |
boolean | Disable xmlrpc.php |
» subdirectory_rewrite_in_place |
boolean | If rewrite rules are enabled for a WordPress Multisite subdirectory install. |
database |
object | Database details. |
» id |
integer | The site’s database ID. |
» user_id |
integer | The site’s database user ID. |
» table_prefix |
string | The site’s WordPress table prefix. |
backups |
object | Backup details. |
» files |
boolean | If file backups are enabled. |
» database |
boolean | If database backups are enabled. |
» paths_to_exclude |
string | Paths to be excluded from the file backups. |
» retention_period |
integer¦null | Number of days to retain the site backups. null when retention is disabled. |
» next_run_time |
string(date-time) | The timestamp in UTC that the next automatically scheduled backup will run. |
» storage_provider |
object | Storage provider details. |
»» id |
integer | The site’s storage provider ID. |
»» region |
string | The site’s storage provider region. |
»» bucket |
string | The site’s storage provider bucket. |
» schedule |
object | The site’s automated backup schedule, broken out by frequency. Times of day are hours (0–23) in the server’s timezone. |
»» daily |
object | none |
»»» backup_database |
boolean | If daily database backups are enabled. |
»»» backup_files |
boolean | If daily file backups are enabled. |
»»» retention_period |
integer¦null | Number of days daily backups are retained. null when retention is disabled or no daily schedule is configured. |
»»» time_of_day |
[integer] | Hours (0–23) when daily backups run. |
»» weekly |
object | none |
»»» backup_database |
boolean | none |
»»» backup_files |
boolean | none |
»»» retention_period |
integer¦null | none |
»»» time_of_day |
integer¦null | Hour (0–23) when weekly backups run. null when no weekly schedule is configured. |
»»» day_of_week |
[integer] | Weekdays (0 = Sunday through 6 = Saturday) when weekly backups run. |
»» monthly |
object | none |
»»» backup_database |
boolean | none |
»»» backup_files |
boolean | none |
»»» retention_period |
integer¦null | none |
»»» time_of_day |
integer¦null | Hour (0–23) when monthly backups run. null when no monthly schedule is configured. |
»»» day_of_month |
[object] | Days of the month when monthly backups run. |
»»»» week_of_month |
string | One of first, second, third, or last. |
»»»» day_of_week |
integer | 0 = Sunday through 6 = Saturday. |
wp_core_update |
boolean | If WordPress core has updates available. |
wp_theme_updates |
integer | Number of WordPress themes that have updates available. |
wp_plugin_updates |
integer | Number of WordPress plugins that have updates available. |
git |
object | Git details. |
» repo |
string | The site’s git repository URL. |
» branch |
string | The site’s git branch. |
» deploy_script |
string | The script that will run after each git deployment. The script is executed as the site user from the ~/files directory. |
» push_enabled |
boolean | If git push to deploy is enabled. |
» deployment_url |
string | URL that git provider needs to make a POST request to for push to deploy. |
basic_auth |
object | Basic auth details. |
» enabled |
boolean | If basic authentication is enabled. |
» username |
string | The basic auth username. |
subdomain |
object | SpinupWP subdomain details. |
» enabled |
boolean | If the SpinupWP subdomain is enabled. |
» url |
string | The SpinupWP subdomain URL. |
created_at |
string(date-time) | The date the site was created. |
disabled_at |
string(date-time)¦null | The date the site was disabled, or null if the site is enabled. |
status |
string | The site’s status. One of deploying, deployed, or failed. |
Event
{
"id": 0,
"initiated_by": "Abraham",
"server_id": 1,
"name": "Creating site turnipjuice.media",
"status": "deployed",
"output": null,
"created_at": "2024-07-01T12:00:00.000000Z",
"started_at": "2024-07-01T12:00:00.000000Z",
"finished_at": "2024-07-01T12:00:00.000000Z"
}
Properties
| Name | Type | Description |
|---|---|---|
id |
integer | Unique identifier for the event. |
initiated_by |
string | The name of the person that initiated the event. |
server_id |
integer | The event’s server ID. |
name |
string | The name of the event. |
status |
string | The event’s status. One of queued,creating,updating,deleting,deployed, or failed. |
output |
string | The event’s output. |
created_at |
string(date-time) | The time that the event was created. |
started_at |
string(date-time) | The time that the event was started. |
finished_at |
string(date-time) | The time that the event finished. |
Additional Domain
{
"id": 1,
"domain": "www.turnipjuice.media",
"redirect": {
"enabled": true,
"type": 301,
"destination": "turnipjuice.media"
},
"created_at": "2024-07-01T12:00:00.000000Z"
}
Properties
| Name | Type | Description |
|---|---|---|
id |
integer | Unique identifier for the domain. |
domain |
string | Additional domain name. |
redirect |
object | The domain redirect details. |
» enabled |
boolean | If true the domain will redirect to the specified destination. |
» type |
integer | The redirect HTTP status code. One of 301, 302, 307, or 308. Defaults to 301. |
» destination |
string | The redirect destination URL or domain. Defaults to the primary domain. |
created_at |
string(date-time) | Date the domain was added. |
Path Redirect
{
"from": "/old-path",
"to": "/new-path",
"type": "permanent",
"created_at": "2024-07-01T12:00:00.000000Z"
}
Properties
| Name | Type | Description |
|---|---|---|
from |
string | The path to redirect from. |
to |
string | The path or URL to redirect to. |
type |
string | The redirect type. One of permanent (301) or redirect (302). |
created_at |
string(date-time) | Date the path redirect was created. |
SSH Key
{
"id": 1,
"name": "Vincent's laptop",
"fingerprint": "SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8",
"publickey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD...",
"created_at": "2024-07-01T12:00:00.000000Z"
}
Properties
| Name | Type | Description |
|---|---|---|
id |
integer | Unique identifier for the SSH key. |
name |
string | Friendly name for the SSH key. |
fingerprint |
string | SHA-256 fingerprint of the key. |
publickey |
string | The public key. |
created_at |
string(date-time) | Date the SSH key was added. |
Storage Provider
{
"id": 1,
"service": "aws-s3",
"name": "Production backups",
"created_at": "2024-07-01T12:00:00.000000Z"
}
Properties
| Name | Type | Description |
|---|---|---|
id |
integer | Unique identifier for the storage provider. |
service |
string | The storage service. One of aws-s3, backblaze, do-spaces, linode, vultr, wasabi, hetzner, cloudflare, google-cloud, or sftp. |
name |
string | Friendly name for the storage provider. |
created_at |
string(date-time) | Date the storage provider was added. |
Pagination
{
"previous": null,
"next": "https://api.spinupwp.app/v1/sites?page=2",
"per_page": 10,
"count": 15
}
Properties
| Name | Type | Description |
|---|---|---|
previous |
string | Link to the previous page. Null if the current page is the first page. |
next |
string | Link to the previous page. Null if the current page is the last page. |
per_page |
integer | Number of objects per page. |
count |
integer | Total number of objects. |
Errors
The SpinupWP API uses the following error codes:
| Error Code | Meaning |
|---|---|
| 400 | Bad Request – Your request is invalid. |
| 401 | Unauthorized – Your API token is wrong or no longer valid. |
| 402 | Payment Required – The team does not have a valid subscription. |
| 403 | Forbidden – You do not have permission to access the endpoint. |
| 404 | Not Found – The specified resource could not be found. |
| 405 | Method Not Allowed – You tried to access an endpoint with an invalid method. |
| 422 | Validation Error – Invalid or missing parameters. |
| 429 | Too Many Attempts – You’ve hit the rate limit on API requests. |
| 500 | Internal Server Error – We had a problem with our server. Try again later. |
| 503 | Service Unavailable – We’re temporarily offline for maintenance. Please try again later. |