v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
WebApp
Web Apps

Update an application's configuration.

This function updates an application's configuration. Only the parameters you pass change; omitted parameters keep their current values.

Important:

The env parameter uses replace-all semantics — the value you pass becomes the application's complete set of environment variables. To change one variable, read the current set first and resubmit it with your change applied.

get/WebApp/configure

Query parameters

namestring required
Example:my-app

The application's unique name (slug).

appdirstring
Example:packages/web

The application root, relative to the top of the source, for a source whose application does not live at the top level (for example, packages/web in a monorepo).

Pass an empty value to reset the root back to the source top.

Changing this value re-runs the preflight against the new root, which re-detects the application's framework and category and re-seeds the suggested build defaults (any value you pass explicitly in the same call takes precedence). When it changes, the response also carries the confidence and defaults from the re-detection.

This parameter must be a relative path inside the source.

build_commandstring
Example:npm run build

The command that builds the application.

db'create' | 'link'
Example:create

The database action to perform.

  • create — Provision a new database and database user, and inject the credentials into the application's environment.
  • link — Link the existing database that the db_name parameter specifies.
db_namestring
Example:example_my_app

The name of the existing database to link.

Required when db is link.

deploynamestring
Example:my-app

The name (slug) used to name the deployment. When omitted, the deployment is named after the application.

domainstring domain
Example:my-app.example.com

The domain to bind the application to. Any domain the account owns is accepted — the main domain, an addon domain, a parked domain, or a manually created subdomain — and the application is served AT it. A domain that does not exist yet is created as a subdomain, provided the account owns its root. A domain another application is already serving is rejected; see the domain_in_use error_category value.

Pass an empty value to generate and bind a temporary domain automatically. Because that address is generated rather than chosen, it is held to a stricter rule: if a domain already exists there the call fails with domain_unavailable instead of adopting it.

envstring json
Example:{"NODE_ENV":"production","API_KEY":"abc123"}

A JSON-encoded object of the application's environment variables.

Warning: This replaces all existing environment variables with the set you provide.

Security note: These values are stored in plaintext. Do not use this parameter for sensitive secrets (API keys, database passwords, tokens, etc.).

mode'production' | 'development'
Example:production

The run mode for server category applications.

output_dirstring
Example:dist

The directory, relative to the application root, that the build writes its output to.

runtime_tagstring
Example:22

The runtime version tag to run the application under. Use WebApp::get_available to list the valid tags.

startup_commandstring
Example:npm run start

The command that starts the application's server process. Only meaningful for the server category.

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "configure",
  "module": "WebApp",
  "result": {
    "data": {
      "category": "server",
      "container_name": "my-app.bob.01",
      "confidence": "high",
      "defaults": {
        "build_command": "npm run build",
        "output_dir": ".next",
        "runtime_tag": "22",
        "startup_command": "npm run start"
      },
      "db": {
        "env_keys": [
          "DB_NAME",
          "DB_HOST",
          "DB_PORT"
        ],
        "host": "localhost",
        "name": "example_my_app",
        "port": 3306
      },
      "deployname": "my-site",
      "domain": "my-app.example.com",
      "env": {
        "API_KEY": "abc123",
        "NODE_ENV": "production"
      },
      "framework": "nextjs",
      "last_deploy": {
        "deploy_id": "dp-20260612-0001",
        "result": "success",
        "timestamp": "2026-06-12T14:03:22.000Z"
      },
      "mode": "production",
      "name": "my-app",
      "package_manager": "npm",
      "runtime": "nodejs",
      "runtime_tag": "22",
      "source": {
        "branch": "main",
        "type": "git",
        "url": "https://github.com/example/my-app.git"
      },
      "staged": true,
      "status": "created",
      "url": "https://my-app.example.com"
    },
    "status": 1
  }
}