Skip to content
WasFor
Back to home
Documentation/Developer API

User API

The user API manages resources that belong to the authenticated customer. Every path is scoped: a token for one account cannot read or write another account's data, even with a guessed identifier.

Endpoints

MethodPathPurpose
GET/api/user/sitesList sites
POST/api/user/sitesCreate a site
GET/api/user/sites/{id}Site detail
PATCH/api/user/sites/{id}Update settings
DELETE/api/user/sites/{id}Delete a site
GET/api/user/sites/{id}/php/settingsRead PHP configuration
PUT/api/user/sites/{id}/php/settingsUpdate overrides
POST/api/user/sites/{id}/php/settings/resetReset overrides
GET/api/user/sites/{id}/php/extensionsList extensions
GET/api/user/databasesList databases
POST/api/user/databasesCreate a database
GET/api/user/backupsList snapshots
POST/api/user/backups/runTrigger a backup
GET/api/user/ticketsList tickets
POST/api/user/ticketsOpen a ticket

List sites

http
GET /api/user/sites?page=1&per_page=25
Authorization: Bearer <token>
json
{
  "ok": true,
  "data": [
    {
      "id": 42,
      "domain": "app.example.com",
      "document_root": "/home/acme/sites/app.example.com/public",
      "php_version": "8.3",
      "ssl": { "status": "active", "expires_at": "2027-02-18T00:00:00Z" },
      "disk_used_mb": 1840,
      "status": "active"
    }
  ],
  "meta": { "page": 1, "per_page": 25, "total": 1 }
}

Create a site

http
POST /api/user/sites
Content-Type: application/json

{
  "domain": "shop.example.com",
  "php_version": "8.3",
  "document_root": "/home/acme/sites/shop.example.com/public"
}

Validation rejects a domain that is already used in the account, a document root outside the account home and an unsupported PHP version. A successful create returns 201 with the site object.

Read PHP settings

http
GET /api/user/sites/42/php/settings
json
{
  "ok": true,
  "data": {
    "php_version": "8.3",
    "runtime": "fpm",
    "supported": [
      "memory_limit", "max_execution_time", "max_input_time",
      "upload_max_filesize", "post_max_size", "max_input_vars",
      "display_errors", "error_reporting", "date.timezone",
      "session.gc_maxlifetime"
    ],
    "inherited": {
      "memory_limit": "128M",
      "max_execution_time": "60",
      "post_max_size": "64M"
    },
    "overrides": {
      "memory_limit": "256M"
    },
    "effective": {
      "memory_limit": "256M",
      "max_execution_time": "60",
      "post_max_size": "64M"
    },
    "limits": {
      "memory_limit": { "min": "64M", "max": "1G" },
      "max_execution_time": { "min": 30, "max": 300 }
    },
    "warnings": []
  }
}

Update overrides

Send only the directives you want to change. Omitted keys keep their current value; null removes an override and restores inheritance.

http
PUT /api/user/sites/42/php/settings
Content-Type: application/json

{
  "overrides": {
    "memory_limit": "256M",
    "upload_max_filesize": "128M",
    "post_max_size": "128M",
    "date.timezone": "Asia/Shanghai"
  }
}

Invalid values fail atomically — nothing is written unless every directive passes validation:

json
{
  "ok": false,
  "error": {
    "code": "validation_failed",
    "message": "post_max_size must be greater than or equal to upload_max_filesize",
    "fields": { "post_max_size": "lt_upload_max_filesize" },
    "request_id": "req_01J8Z4A2"
  }
}

Reset all overrides:

http
POST /api/user/sites/42/php/settings/reset

Extensions

http
GET /api/user/sites/42/php/extensions
json
{
  "ok": true,
  "data": {
    "php_version": "8.3",
    "loaded": ["bcmath", "curl", "gd", "intl", "mbstring", "opcache", "openssl", "pdo_mysql", "redis", "zip"],
    "available": ["imagick", "sodium", "xdebug"]
  }
}

Extension changes require an administrator when they need system packages; request them through a ticket.

Databases and backups

http
POST /api/user/databases
{
  "name": "shop_prod",
  "user": "shop_user",
  "charset": "utf8mb4"
}
http
POST /api/user/backups/run
{
  "scope": ["files", "database"],
  "site_id": 42
}

Backup jobs return a job identifier; poll GET /api/user/backups for status rather than blocking the request.

Errors

CodeMeaning
validation_failedOne or more fields rejected
quota_exceededPackage limit reached
duplicate_domainDomain already exists in scope
not_foundResource outside the token's account
php_reload_failedConfiguration valid but reload failed
Last updated: 2026-12-01