### Install New Git Project Source: https://forge.laravel.com/api-documentation Install a new git project by providing the repository details, branch, and optional database name. Composer dependencies can also be installed. ```json { "provider": "github", "repository": "username/repository", "branch": "master", "composer": true, "database": "database" } ``` -------------------------------- ### Start Service Source: https://forge.laravel.com/api-documentation Starts a specified service on a server. ```APIDOC ## Start Service ### Description Starts a specified service on a server. ### Method POST ### Endpoint /api/v1/servers/{id}/services/start ### Request Body - **service** (string) - Required - The name of the service to start. ``` -------------------------------- ### Install Papertrail Source: https://forge.laravel.com/api-documentation Installs the Papertrail log management service on a server. ```APIDOC ## Install Papertrail ### Description Installs the Papertrail log management service on a server. ### Method POST ### Endpoint /api/v1/servers/{id}/papertrail/install ### Request Body - **host** (string) - Required - The hostname or IP address for Papertrail. ``` -------------------------------- ### Get Monitor Response Source: https://forge.laravel.com/api-documentation Example response when retrieving a specific monitor's details. Shows the monitor's configuration and current state. ```json { "monitor": { "id": 3, "status": "installed", "type": "free_memory", "operator": "lte", "threshold": 70, "minutes": 5, "state": "ALERT", "state_changed_at": "2020-03-01 12:45:00" } } ``` -------------------------------- ### Install Blackfire Source: https://forge.laravel.com/api-documentation Installs the Blackfire profiler on a server. ```APIDOC ## Install Blackfire ### Description Installs the Blackfire profiler on a server. ### Method POST ### Endpoint /api/v1/servers/{id}/blackfire/install ### Request Body - **server_id** (string) - Required - The ID of the server. - **server_token** (string) - Required - The Blackfire server token. ``` -------------------------------- ### Install WordPress Source: https://forge.laravel.com/api-documentation Install WordPress on a specific site. Requires specifying the database to use and the user ID. ```json { "database": "forge", "user": 1 } ``` -------------------------------- ### Install phpMyAdmin Source: https://forge.laravel.com/api-documentation Installs phpMyAdmin for a specific site. Requires a JSON payload specifying the database and user. ```APIDOC ## Install phpMyAdmin ### Description Installs phpMyAdmin for a specific site. ### Method POST ### Endpoint `/api/v1/servers/{serverId}/sites/{siteId}/phpmyadmin` ### Request Body - **database** (string) - Required - The name of the database to associate with phpMyAdmin. - **user** (integer) - Required - The ID of the user to associate with phpMyAdmin. ``` -------------------------------- ### Install PHP Version Source: https://forge.laravel.com/api-documentation Installs a specified PHP version on the server. ```APIDOC ## Install PHP Version ### Description Installs a specified PHP version on the server. ### Method POST ### Endpoint `/api/v1/servers/{serverId}/php` ### Parameters #### Request Body - **version** (string) - Required - The PHP version to install (e.g., "php74"). ### Available Versions Key | Description ---|--- `php84` | PHP 8.4 `php83` | PHP 8.3 `php82` | PHP 8.2 `php81` | PHP 8.1 `php80` | PHP 8.0 `php74` | PHP 7.4 `php73` | PHP 7.3 `php72` | PHP 7.2 `php71` | PHP 7.1 `php70` | PHP 7.0 `php56` | PHP 5.6 ``` -------------------------------- ### Install New Git Project Source: https://forge.laravel.com/api-documentation Installs a new git project on a specific site. Requires a JSON payload with repository details. ```APIDOC ## Install New Git Project ### Description Installs a new git project on a specific site. ### Method POST ### Endpoint `/api/v1/servers/{serverId}/sites/{siteId}/git` ### Parameters #### Request Body - **provider** (string) - Required - The repository provider. Valid values are `github`, `gitlab`, `gitlab-custom`, `bitbucket`, and `custom`. - **repository** (string) - Required - The name of the repository to install. - **branch** (string) - Required - The branch of the repository to install. - **composer** (boolean) - Required - Whether to install Composer dependencies. Valid values are `true` or `false`. - **database** (string) - Optional - The name of the database to be used on the site. ``` -------------------------------- ### Install WordPress Source: https://forge.laravel.com/api-documentation Installs WordPress on a specific site. Requires a JSON payload specifying the database and user. ```APIDOC ## Install WordPress ### Description Installs WordPress on a specific site. ### Method POST ### Endpoint `/api/v1/servers/{serverId}/sites/{siteId}/wordpress` ### Request Body - **database** (string) - Required - The name of the database to use for WordPress. - **user** (integer) - Required - The ID of the user to associate with the WordPress installation. ``` -------------------------------- ### Install Certificate Source: https://forge.laravel.com/api-documentation Installs a previously obtained SSL certificate onto the site. ```APIDOC ## Install Certificate Installs a previously obtained SSL certificate onto the site. ### HTTP Request `POST /api/v1/servers/{serverId}/sites/{siteId}/certificates/{id}/install` ### Parameters #### Path Parameters - **serverId** (string) - Required - The ID of the server. - **siteId** (string) - Required - The ID of the site. - **id** (string) - Required - The ID of the certificate. #### Request Body - **certificate** (string) - Required - The content of the certificate. - **add_intermediates** (boolean) - Optional - Whether to add intermediate certificates. Defaults to false. ### Request Example ```json { "certificate": "certificate content", "add_intermediates": false } ``` ``` -------------------------------- ### List PHP Versions Source: https://forge.laravel.com/api-documentation Lists all available PHP versions installed on a server. ```APIDOC ## List PHP Versions ### Description Lists all available PHP versions installed on a server. ### Method GET ### Endpoint `/api/v1/servers/{serverId}/php` ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the PHP version. - **version** (string) - The version string (e.g., "php74"). - **status** (string) - The installation status of the PHP version. - **displayable_version** (string) - A human-readable version string (e.g., "PHP 7.4"). - **binary_name** (string) - The name of the PHP binary. - **used_as_default** (boolean) - Indicates if this version is used as the default. - **used_on_cli** (boolean) - Indicates if this version is used on the command line. ``` -------------------------------- ### Start Service Payload Source: https://forge.laravel.com/api-documentation Payload to start a specific service on a server. ```json { "service": "service-name" } ``` -------------------------------- ### Install Certificate Payload Source: https://forge.laravel.com/api-documentation This payload is used to install a certificate. Provide the certificate content and optionally include intermediate certificates. ```json { "certificate": "certificate content", "add_intermediates": false } ``` -------------------------------- ### Create Monitor Response Source: https://forge.laravel.com/api-documentation Example response after successfully creating a monitor. It includes the monitor's ID, status, type, and current state. ```json { "monitor": { "id": 8, "status": "installed", "type": "disk", "operator": "lte", "threshold": 25, "minutes": 0, "state": "OK", "state_changed_at": "2020-03-01 12:45:00" } } ``` -------------------------------- ### List Certificates Response Source: https://forge.laravel.com/api-documentation This is an example response when listing all certificates for a site. It provides a summary of each certificate. ```json { "certificates": [ { "domain": "domain.com", "request_status": "creating", "created_at": "2016-12-17 07:02:35", "id": 3, "existing": false, "active": false } ] } ``` -------------------------------- ### Activate Certificate Source: https://forge.laravel.com/api-documentation Activates an installed SSL certificate, making it live for the site. ```APIDOC ## Activate Certificate Activates an installed SSL certificate, making it live for the site. ### HTTP Request `POST /api/v1/servers/{serverId}/sites/{siteId}/certificates/{id}/activate` ### Parameters #### Path Parameters - **serverId** (string) - Required - The ID of the server. - **siteId** (string) - Required - The ID of the site. - **id** (string) - Required - The ID of the certificate. ``` -------------------------------- ### Create Worker Response Source: https://forge.laravel.com/api-documentation This is an example response after creating a worker. It details the worker's configuration, including the command to be executed and its status. ```json { "worker": { "id": 1, "connection": "rule", "command": "php7.2 /home/forge/default/artisan queue:work rule --sleep=60 --daemon --quiet --timeout=90", "queue": null, "timeout": 90, "sleep": 60, "tries": null, "processes": 1, "stopwaitsecs": 600, "environment": null, "php_version": "php72", "daemon": 1, "force": 0, "status": "installing", "created_at": "2016-12-17 07:15:03" } } ``` -------------------------------- ### Enable/Create Horizon Daemon Response Source: https://forge.laravel.com/api-documentation Response after successfully enabling or creating a Horizon daemon. It shows the daemon's configuration and its initial 'installing' status. ```json { "daemon": { "command": "php8.3 artisan horizon", "user": "forge", "directory": "\/home\/forge\/foo.com", "processes": 1, "startsecs": 1, "stopwaitsecs": 5, "stopsignal": "SIGTERM", "status": "installing", "created_at": "2024-07-04 08:34:26", "id": 2 } } ``` -------------------------------- ### Site Aliases Response Source: https://forge.laravel.com/api-documentation Example response showing site details including aliases. ```json { "site": { "id": 2, "name": "site.com", "aliases": ["alias1.com", "alias2.com"], "username": "laravel", "directory": "/", "wildcards": false, "status": "installing", "repository": null, "repository_provider": null, "repository_branch": null, "repository_status": null, "quick_deploy": false, "project_type": "php", "app": null, "app_status": null, "slack_channel": null, "telegram_chat_id": null, "telegram_chat_title": null, "deployment_url": "...", "created_at": "2016-12-16 16:38:08", "tags": [], "web_directory": "/home/forge/torphy.com/public" } } ``` -------------------------------- ### Get Deployment Log Source: https://forge.laravel.com/api-documentation Retrieves the deployment log for a site. The response is a string containing the log output. ```http GET /api/v1/servers/{serverId}/sites/{siteId}/deployment/log ``` -------------------------------- ### Get Site Source: https://forge.laravel.com/api-documentation Retrieves the details of a specific site on a given server. ```APIDOC ## Get Site ### Description Retrieves the details of a specific site on a given server. ### Method GET ### Endpoint `/api/v1/servers/{serverId}/sites/{siteId}` ### Response #### Success Response (200) - **site** (object) - Contains the details of the site. - **id** (integer) - The unique identifier of the site. - **name** (string) - The domain name of the site. - **aliases** (array) - An array of domain aliases. - **username** (string) - The username for the site's owner. - **directory** (string) - The directory for the site's files. - **wildcards** (boolean) - Whether wildcard domains are enabled. - **status** (string) - The current status of the site. - **repository** (string or null) - The repository associated with the site. - **repository_provider** (string or null) - The provider of the repository. - **repository_branch** (string or null) - The branch of the repository. - **repository_status** (string or null) - The status of the repository deployment. - **quick_deploy** (boolean) - Whether quick deploy is enabled. - **project_type** (string) - The type of project. - **app** (string or null) - The application associated with the site. - **php_version** (string) - The PHP version used by the site. - **app_status** (string or null) - The status of the application. - **slack_channel** (string or null) - The Slack channel for notifications. - **telegram_chat_id** (string or null) - The Telegram chat ID for notifications. - **telegram_chat_title** (string or null) - The Telegram chat title for notifications. - **created_at** (string) - The timestamp when the site was created. - **deployment_url** (string) - The URL for deployment. - **tags** (array) - An array of tags associated with the site. - **web_directory** (string) - The web directory for the site. ### Response Example ```json { "site": { "id": 2, "name": "site.com", "aliases": ["alias1.com"], "username": "laravel", "directory": "/test", "wildcards": false, "status": "installing", "repository": null, "repository_provider": null, "repository_branch": null, "repository_status": null, "quick_deploy": false, "project_type": "php", "app": null, "php_version": "php81", "app_status": null, "slack_channel": null, "telegram_chat_id": null, "telegram_chat_title": null, "deployment_url": "...", "created_at": "2016-12-16 16:38:08", "tags": [], "web_directory": "/home/forge/torphy.com/public" } } ``` ``` -------------------------------- ### Create SSH Key Response Source: https://forge.laravel.com/api-documentation This is an example response after successfully creating an SSH key. It includes the key's ID, name, and current status. ```json { "key": { "id": 9, "name": "test-key", "username": "forge", "status": "installing", "created_at": "2016-12-16 16:31:16" } } ``` -------------------------------- ### Get Deployment Source: https://forge.laravel.com/api-documentation Retrieves details of a specific deployment for a given server and site. ```APIDOC ## Get Deployment ### Description Retrieves details of a specific deployment for a given server and site. ### Method GET ### Endpoint `/api/v1/servers/{serverId}/sites/{siteId}/deployment-history/{deploymentId}` ### Response #### Success Response (200) - **deployment** (object) - Contains the details of a specific deployment. - **id** (integer) - The unique identifier for the deployment. - **server_id** (integer) - The ID of the server. - **site_id** (integer) - The ID of the site. - **type** (integer) - The type of deployment. - **commit_hash** (string) - The Git commit hash. - **commit_author** (string) - The author of the commit. - **commit_message** (string) - The commit message. - **started_at** (string) - The timestamp when the deployment started. - **ended_at** (string) - The timestamp when the deployment ended. - **status** (string) - The status of the deployment (e.g., 'failed'). - **displayable_type** (string) - A human-readable type of the deployment. ### Response Example ```json { "deployment": { "id": 71, "server_id": 196, "site_id": 110, "type": 4, "commit_hash": "1aa50f0e4c49fed3a2335e866b03d4178ab93c4e", "commit_author": "Dries Vints", "commit_message": "Merge branch '8.x'\n\n# Conflicts:\n#\tCHANGELOG.md", "started_at": "2020-11-05 12:56:05", "ended_at": "2020-11-05 12:56:11", "status": "failed", "displayable_type": "Deployment API" } } ``` ``` -------------------------------- ### Get Deployment Log Source: https://forge.laravel.com/api-documentation Retrieves the deployment log for a specific server and site. The response is a string. ```APIDOC ## Get Deployment Log ### Description Retrieves the deployment log for a specific server and site. The response is a string. ### Method GET ### Endpoint `/api/v1/servers/{serverId}/sites/{siteId}/deployment/log` ``` -------------------------------- ### Obtain Let's Encrypt Certificate Response Source: https://forge.laravel.com/api-documentation This is an example response when requesting a Let's Encrypt certificate. It indicates the status of the certificate request. ```json { "certificate": { "domain": "www.test.com", "type": "letsencrypt", "request_status": "created", "status": "installing", "created_at": "2017-02-09 17:14:34", "id": 1, "existing": true, "active": false } } ``` -------------------------------- ### Get .env File Source: https://forge.laravel.com/api-documentation Retrieves the content of the .env file for a specific site. The response is a string. ```APIDOC ## Get .env File ### Description Retrieves the content of the .env file for a specific site. ### Method GET ### Endpoint `/api/v1/servers/{serverId}/sites/{siteId}/env` ### Response #### Success Response (200) - **content** (string) - The .env file content. ``` -------------------------------- ### Get Deployment Output Source: https://forge.laravel.com/api-documentation Retrieves the output of a specific deployment for a given server and site. The response is a string. ```APIDOC ## Get Deployment Output ### Description Retrieves the output of a specific deployment for a given server and site. The response is a string. ### Method GET ### Endpoint `/api/v1/servers/{serverId}/sites/{siteId}/deployment-history/{deploymentId}/output` ### Response #### Success Response (200) - **output** (string) - The deployment output log. ### Response Example ```json { "output": "Thu 05 Nov 2020 12:42:30 PM UTC\nFrom github.com:laravel\/laravel\n * branch master -> FETCH_HEAD\nAlready up to date!\nInstalling dependencies from lock file (including require-dev)\nVerifying lock file contents can be installed on current platform.\nNothing to install, update or remove\nGenerating optimized autoload files\n> Illuminate\Foundation\ComposerScripts::postAutoloadDump\n> @php artisan package:discover --ansi\nDiscovered Package: [32mfideloper\/proxy[39m\nDiscovered Package: [32mfruitcake\/laravel-cors[39m\nDiscovered Package: [32mlaravel\/tinker[39m\nDiscovered Package: [32mnesbot\/carbon[39m\nDiscovered Package: [32mnunomaduro\/collision[39m\n[32mPackage manifest generated successfully.[39m\n73 packages you are using are looking for funding.\nUse the `composer fund` command to find out more!\nReloading PHP FPM...\n\n Illuminate\Database\QueryException \n\n SQLSTATE[HY000] [1049] Unknown database 'laravel' (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')\n\n at vendor\/laravel\/framework\/src\/Illuminate\/Database\/Connection.php:671\n 667▕ \/\/ If an exception occurs when attempting to run a query, we'll format the error\n 668▕ \/\/ message to include the bindings with SQL, which will make this exception a\n 669▕ \/\/ lot more helpful to the developer instead of just the database's errors.\n 670▕ catch (Exception $e) {\n ➜ 671▕ throw new QueryException(\n 672▕ $query, $this->prepareBindings($bindings), $e\n 673▕ );\n 674▕ }\n 675▕\n\n [2m+33 vendor frames [22m\n 34 artisan:37\n Illuminate\Foundation\Console\Kernel::handle()\n" } ``` ``` -------------------------------- ### Deploy Now Source: https://forge.laravel.com/api-documentation Initiates an immediate deployment for a site. This is an HTTP POST request. ```http POST /api/v1/servers/{serverId}/sites/{siteId}/deployment/deploy ``` -------------------------------- ### Get Deployment Output Source: https://forge.laravel.com/api-documentation Retrieves the output log for a specific deployment. The response is a string containing the log details. ```json { "output": "Thu 05 Nov 2020 12:42:30 PM UTC\nFrom github.com:laravel\/laravel\n * branch master -> FETCH_HEAD\nAlready up to date.\nInstalling dependencies from lock file (including require-dev)\nVerifying lock file contents can be installed on current platform.\nNothing to install, update or remove\nGenerating optimized autoload files\n> Illuminate\Foundation\ComposerScripts::postAutoloadDump\n> @php artisan package:discover --ansi\nDiscovered Package: [32mfideloper\/proxy[39m\nDiscovered Package: [32mfruitcake\/laravel-cors[39m\nDiscovered Package: [32mlaravel\/tinker[39m\nDiscovered Package: [32mnesbot\/carbon[39m\nDiscovered Package: [32mnunomaduro\/collision[39m\n[32mPackage manifest generated successfully.[39m\n73 packages you are using are looking for funding.\nUse the `composer fund` command to find out more!\nReloading PHP FPM...\n\n Illuminate\Database\QueryException \n\n SQLSTATE[HY000] [1049] Unknown database 'laravel' (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')\n\n at vendor\/laravel\/framework\/src\/Illuminate\/Database\/Connection.php:671\n 667▕ \/\/ If an exception occurs when attempting to run a query, we'll format the error\n 668▕ \/\/ message to include the bindings with SQL, which will make this exception a\n 669▕ \/\/ lot more helpful to the developer instead of just the database's errors.\n 670▕ catch (Exception $e) {\n ➜ 671▕ throw new QueryException(\n 672▕ $query, $this->prepareBindings($bindings), $e\n 673▕ );\n 674▕ }\n 675▕\n\n [2m+33 vendor frames [22m\n 34 artisan:37\n Illuminate\Foundation\Console\Kernel::handle()\n" } ``` -------------------------------- ### Get Deployment Script Source: https://forge.laravel.com/api-documentation Retrieves the deployment script for a site. The response is a string containing the script content. ```http GET /api/v1/servers/{serverId}/sites/{siteId}/deployment/script ``` -------------------------------- ### Get Recipe Source: https://forge.laravel.com/api-documentation Fetches the details of a specific recipe using its ID. The response includes the recipe's name, user, script, and creation date. ```json { "recipe": { "id": 1, "name": "Recipe Name", "user": "root", "script": "SCRIPT_CONTENT", "created_at": "2016-12-16 16:24:05" } } ``` ```http GET /api/v1/recipes/{recipeId} ``` -------------------------------- ### Get Deployment Source: https://forge.laravel.com/api-documentation Retrieves details for a specific deployment by its ID. Requires server, site, and deployment IDs. ```json { "deployment": { "id": 71, "server_id": 196, "site_id": 110, "type": 4, "commit_hash": "1aa50f0e4c49fed3a2335e866b03d4178ab93c4e", "commit_author": "Dries Vints", "commit_message": "Merge branch '8.x'\n\n# Conflicts:\n#\tCHANGELOG.md", "started_at": "2020-11-05 12:56:05", "ended_at": "2020-11-05 12:56:11", "status": "failed", "displayable_type": "Deployment API" } } ``` -------------------------------- ### Get Deployment Script Source: https://forge.laravel.com/api-documentation Retrieves the deployment script for a specific server and site. The response is a string. ```APIDOC ## Get Deployment Script ### Description Retrieves the deployment script for a specific server and site. The response is a string. ### Method GET ### Endpoint `/api/v1/servers/{serverId}/sites/{siteId}/deployment/script` ``` -------------------------------- ### Deploy Now Source: https://forge.laravel.com/api-documentation Initiates an immediate deployment for a specific server and site. ```APIDOC ## Deploy Now ### Description Initiates an immediate deployment for a specific server and site. ### Method POST ### Endpoint `/api/v1/servers/{serverId}/sites/{siteId}/deployment/deploy` ``` -------------------------------- ### Get Default Nginx Template Source: https://forge.laravel.com/api-documentation Retrieve the default Nginx configuration used when no custom template is selected during site creation. ```http GET /api/v1/servers/{serverId}/nginx/templates/{templateId} ``` -------------------------------- ### Get Composer Packages Authentication Source: https://forge.laravel.com/api-documentation Get the Composer packages authentication for the site. ```APIDOC ## Get Composer Packages Authentication Get the Composer packages authentication for the site. ### HTTP Request `GET /api/v1/servers/{serverId}/sites/{siteId}/packages` ### Response #### Success Response (200) - **credentials** (object) - Composer package authentication credentials. - **http-basic** (object) - Basic HTTP authentication details. - **repository_url** (object) - Repository URL as key. - **username** (string) - The username for authentication. - **password** (string) - The password for authentication. ### Response Example ```json { "credentials": { "http-basic": { "packages.laravel.com": { "username": "oliver", "password": "secret" } } } } ``` ``` -------------------------------- ### Install Papertrail Payload Source: https://forge.laravel.com/api-documentation Payload to install Papertrail, specifying the host IP address. ```json { "host": "192.241.143.108" } ``` -------------------------------- ### Get Site Response Source: https://forge.laravel.com/api-documentation Retrieves detailed information about a specific site, including its configuration, status, and associated details. ```json { "site": { "id": 2, "name": "site.com", "aliases": ["alias1.com"], "username": "laravel", "directory": "/test", "wildcards": false, "status": "installing", "repository": null, "repository_provider": null, "repository_branch": null, "repository_status": null, "quick_deploy": false, "project_type": "php", "app": null, "php_version": "php81", "app_status": null, "slack_channel": null, "telegram_chat_id": null, "telegram_chat_title": null, "deployment_url": "...", "created_at": "2016-12-16 16:38:08", "tags": [], "web_directory": "/home/forge/torphy.com/public" } } ``` -------------------------------- ### Create Site Source: https://forge.laravel.com/api-documentation Creates a new site on a specified server. ```APIDOC ## Create Site ### Description Creates a new site on a specified server. ### Method POST ### Endpoint `/api/v1/servers/{serverId}/sites` ### Parameters #### Request Body - **domain** (string) - Required - The domain name for the new site. - **project_type** (string) - Required - The type of project (e.g., `php`, `html`). - **aliases** (array) - Optional - An array of domain aliases. - **directory** (string) - Optional - The directory for the site's files. - **isolated** (boolean) - Optional - Whether to isolate the site. - **username** (string) - Optional - The username for the site's owner. - **database** (string) - Optional - The name of the database to create. - **php_version** (string) - Optional - The PHP version to use for the site. - **nginx_template** (integer or string) - Optional - The ID or name of the Nginx template to use. Defaults to 'default'. ### Request Example ```json { "domain": "site.com", "project_type": "php", "aliases": ["alias1.com", "alias2.com"], "directory": "/test", "isolated": true, "username": "laravel", "database": "site-com-db", "php_version": "php81", "nginx_template": 1 } ``` ### Response #### Success Response (200) - **site** (object) - Contains the details of the newly created site. - **id** (integer) - The unique identifier of the site. - **name** (string) - The domain name of the site. - **aliases** (array) - An array of domain aliases. - **directory** (string) - The directory for the site's files. - **wildcards** (boolean) - Whether wildcard domains are enabled. - **isolated** (boolean) - Whether the site is isolated. - **username** (string) - The username for the site's owner. - **status** (string) - The current status of the site. - **repository** (string or null) - The repository associated with the site. - **repository_provider** (string or null) - The provider of the repository. - **repository_branch** (string or null) - The branch of the repository. - **repository_status** (string or null) - The status of the repository deployment. - **quick_deploy** (boolean) - Whether quick deploy is enabled. - **project_type** (string) - The type of project. - **app** (string or null) - The application associated with the site. - **php_version** (string) - The PHP version used by the site. - **app_status** (string or null) - The status of the application. - **slack_channel** (string or null) - The Slack channel for notifications. - **telegram_chat_id** (string or null) - The Telegram chat ID for notifications. - **telegram_chat_title** (string or null) - The Telegram chat title for notifications. - **created_at** (string) - The timestamp when the site was created. - **deployment_url** (string) - The URL for deployment. - **tags** (array) - An array of tags associated with the site. - **web_directory** (string) - The web directory for the site. ### Response Example ```json { "site": { "id": 2, "name": "site.com", "aliases": ["alias1.com", "alias2.com"], "directory": "/test", "wildcards": false, "isolated": true, "username": "forge", "status": "installing", "repository": null, "repository_provider": null, "repository_branch": null, "repository_status": null, "quick_deploy": false, "project_type": "php", "app": null, "php_version": "php81", "app_status": null, "slack_channel": null, "telegram_chat_id": null, "telegram_chat_title": null, "created_at": "2016-12-16 16:38:08", "deployment_url": "...", "tags": [], "web_directory": "/home/forge/torphy.com/public" } } ``` ### Available site types Key | Description ---|--- `php` | PHP / Laravel / Symfony `html` | Static HTML / Nuxt.js / Next.js ### Nginx Templates You may leave the `nginx_template` key off to use the `default` template, or supply `nginx_template: "default"`. ``` -------------------------------- ### Enable Quick Deployment Source: https://forge.laravel.com/api-documentation Enables quick deployment for a specific server and site. ```APIDOC ## Enable Quick Deployment ### Description Enables quick deployment for a specific server and site. ### Method POST ### Endpoint `/api/v1/servers/{serverId}/sites/{siteId}/deployment` ``` -------------------------------- ### Install Blackfire Payload Source: https://forge.laravel.com/api-documentation Payload required to install Blackfire on a server, including server ID and token. ```json { "server_id": "...", "server_token": "..." } ``` -------------------------------- ### Get Server Logs Source: https://forge.laravel.com/api-documentation Retrieves server logs. You can specify the file type to get specific logs. ```APIDOC ## Get Log ### Description Retrieves server logs. You can specify the file type to get specific logs. ### Method GET ### Endpoint `/api/v1/servers/{serverId}/logs` ### Parameters #### Query Parameters - **file** (string) - Required - The type of log file to retrieve (e.g., `nginx_access`, `nginx_error`, `database`, `php7x`, `php56`). ### Response #### Success Response (200) - **path** (string) - The path to the log file. - **content** (string) - The content of the log file. ### Response Example ```json { "path": "\/var\/log\/mysql\/error.log", "content": "2020-08-18T10:22:01.238990Z 0 [System] [MY-010931] [Server] \/usr\/sbin\/mysqld: ready for connections. Version: '8.0.21' socket: '\/var\/run\/mysqld\/mysqld.sock' port: 3306 MySQL Community Server - GPL.\n2020-08-18T10:22:01.359309Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user . Shutting down mysqld (Version: 8.0.21).\n2020-08-18T10:22:03.644177Z 0 [System] [MY-010910] [Server] \/usr\/sbin\/mysqld: Shutdown complete (mysqld 8.0.21) MySQL Community Server - GPL.\n2020-08-18T10:22:04.183385Z 0 [System] [MY-010116] [Server] \/usr\/sbin\/mysqld (mysqld 8.0.21) starting as process 42752\n2020-08-18T10:22:04.193962Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.\n2020-08-18T10:22:04.530305Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.\n2020-08-18T10:22:04.662877Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: \/var\/run\/mysqld\/mysqlx.sock\n2020-08-18T10:22:04.749019Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.\n2020-08-18T10:22:04.749453Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.\n2020-08-18T10:22:04.775994Z 0 [System] [MY-010931] [Server] \/usr\/sbin\/mysqld: ready for connections. Version: '8.0.21' socket: '\/var\/run\/mysqld\/mysqld.sock' port: 3306 MySQL Community Server - GPL.\n" } ``` ### File Types You must specify one of the below `file` types: * `nginx_access` * `nginx_error` * `database` * `php7x` (where `x` is a valid version number, e.g. `php71`) or `php56` ``` -------------------------------- ### Enable Quick Deployment Source: https://forge.laravel.com/api-documentation Enables quick deployment for a site. This is an HTTP POST request to the deployment endpoint. ```http POST /api/v1/servers/{serverId}/sites/{siteId}/deployment ``` -------------------------------- ### Install Existing Certificate Payload Source: https://forge.laravel.com/api-documentation Payload for installing an existing SSL certificate. Requires the private key and certificate content. ```json { "type": "existing", "key": "PRIVATE_KEY_HERE", "certificate": "CERTIFICATE_HERE" } ``` -------------------------------- ### List PHP Versions Source: https://forge.laravel.com/api-documentation Lists all available PHP versions installed on the server. This response includes details such as version number, status, and whether it's the default or CLI version. ```json [ { "id": 29, "version": "php74", "status": "installed", "displayable_version": "PHP 7.4", "binary_name": "php7.4", "used_as_default": false, "used_on_cli": false }, { "id": 30, "version": "php73", "status": "installed", "displayable_version": "PHP 7.3", "binary_name": "php7.3", "used_as_default": true, "used_on_cli": true }, { "id": 31, "version": "php72", "status": "installed", "displayable_version": "PHP 7.2", "binary_name": "php7.2", "used_as_default": false, "used_on_cli": false }, { "id": 32, "version": "php71", "status": "installed", "displayable_version": "PHP 7.1", "binary_name": "php7.1", "used_as_default": false, "used_on_cli": false }, { "id": 33, "version": "php56", "status": "installed", "displayable_version": "PHP 5.6", "binary_name": "php5.6", "used_as_default": false, "used_on_cli": false } ] ``` -------------------------------- ### Get Server API Response Source: https://forge.laravel.com/api-documentation The response structure for the Get Server endpoint, detailing a specific server's attributes. ```json { "server": { "id": 1, "credential_id": 1, "name": "test-via-api", "size": "s-1vcpu-1gb", "region": "Amsterdam 2", "php_version": "php82", "php_cli_version": "php82", "opcache_status": "enabled", "database_type": "mysql8", "ip_address": "37.139.3.148", "private_ip_address": "10.129.3.252", "blackfire_status": null, "papertrail_status": null, "revoked": false, "created_at": "2016-12-15 18:38:18", "is_ready": true, "network": [] } } ``` -------------------------------- ### Get Worker Source: https://forge.laravel.com/api-documentation Retrieves details for a specific worker. ```APIDOC ## Get Worker ### Description Retrieves details for a specific worker. ### Method GET ### Endpoint `/api/v1/servers/{serverId}/sites/{siteId}/workers/{id}` ### Response #### Success Response (200) - **worker** (object) - The worker object. - **id** (integer) - **connection** (string) - **command** (string) - **queue** (string | null) - **timeout** (integer) - **sleep** (integer) - **tries** (integer | null) - **processes** (integer) - **stopwaitsecs** (integer | null) - **environment** (string | null) - **php_version** (string) - **daemon** (integer) - **force** (integer) - **status** (string) - **created_at** (string) ### Response Example ```json { "worker": { "id": 1, "connection": "rule", "command": "php7.2 /home/forge/default/artisan queue:work rule --sleep=60 --daemon --quiet --timeout=90", "queue": null, "timeout": 90, "sleep": 60, "tries": null, "processes": 1, "stopwaitsecs": null, "environment": null, "php_version": "php72", "daemon": 1, "force": 0, "status": "installing", "created_at": "2016-12-17 07:15:03" } } ``` ``` -------------------------------- ### List Sites Response Source: https://forge.laravel.com/api-documentation Returns a list of all sites configured on the server, including their basic details and status. ```json { "sites": [ { "id": 2, "name": "site.com", "username": "laravel", "directory": "/test", "wildcards": false, "status": "installing", "repository": null, "repository_provider": null, "repository_branch": null, "repository_status": null, "quick_deploy": false, "project_type": "php", "app": null, "php_version": "php81", "app_status": null, "slack_channel": null, "telegram_chat_id": null, "telegram_chat_title": null, "deployment_url": "...", "created_at": "2016-12-16 16:38:08", "tags": [], "web_directory": "/home/forge/torphy.com/public" } ] } ``` -------------------------------- ### Get Monitor Source: https://forge.laravel.com/api-documentation Retrieves the details of a specific server monitor. ```APIDOC ## Get Monitor ### Description Retrieves the details of a specific server monitor. ### Method GET ### Endpoint `/api/v1/servers/{serverId}/monitors/{monitorId}` ### Response #### Success Response (200) - **monitor** (object) - Details of the monitor. - **id** (integer) - The unique identifier for the monitor. - **status** (string) - The status of the monitor. - **type** (string) - The type of the monitor. - **operator** (string) - The operator used for the threshold. - **threshold** (integer) - The threshold value. - **minutes** (integer) - The duration in minutes. - **state** (string) - The current state of the monitor. - **state_changed_at** (string) - The timestamp when the state last changed. ### Response Example ```json { "monitor": { "id": 3, "status": "installed", "type": "free_memory", "operator": "lte", "threshold": 70, "minutes": 5, "state": "ALERT", "state_changed_at": "2020-03-01 12:45:00" } } ``` ```