---
title: Rescue Site
description: "Queues a site rescue job with the selected repair options. Supported options depend on the site type and server stack. Poll GET /sites/{uuid}/events to track completion. Requires the write:sites scope."
url: "https://betterdocs.shahrear.msf.bd/index.php/docs/hell0-boys-docs/hell0-boys/sites/rescue-site/"
updated: "2026-08-20"
category: hell0 boys / Sites
---

# Rescue Site

POST`/sites/{uuid}/rescue`

## Code Samples

```curl

                curl --request POST \
  --url 'https://app.xcloud.host/api/v1/sites/{uuid}/rescue' \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "isolate_user": true,
    "directory_permissions": true,
    "reinstall_php": true,
    "regenerate_nginx": true,
    "restart_nginx": true
}'

                const response = await fetch('https://app.xcloud.host/api/v1/sites/{uuid}/rescue', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "isolate_user": true,
    "directory_permissions": true,
    "reinstall_php": true,
    "regenerate_nginx": true,
    "restart_nginx": true
})
});

const data = await response.json();
console.log(data);

                import requests

headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json"
}

payload = {
    "isolate_user": true,
    "directory_permissions": true,
    "reinstall_php": true,
    "regenerate_nginx": true,
    "restart_nginx": true
}

response = requests.post("https://app.xcloud.host/api/v1/sites/{uuid}/rescue", headers=headers, json=payload)

print(response.json())

                <?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://app.xcloud.host/api/v1/sites/{uuid}/rescue',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => [
  'Authorization: Bearer YOUR_TOKEN',
  'Content-Type: application/json'
  ],
  CURLOPT_POSTFIELDS => '{
    "isolate_user": true,
    "directory_permissions": true,
    "reinstall_php": true,
    "regenerate_nginx": true,
    "restart_nginx": true
}',
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;

                using System.Net.Http;
using System.Text;

var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://app.xcloud.host/api/v1/sites/{uuid}/rescue");
request.Headers.Add("Authorization", "Bearer YOUR_TOKEN");
request.Content = new StringContent(@"{
    ""isolate_user"": true,
    ""directory_permissions"": true,
    ""reinstall_php"": true,
    ""regenerate_nginx"": true,
    ""restart_nginx"": true
}", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);

                import java.net.URI;
import java.net.http.*;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.xcloud.host/api/v1/sites/{uuid}/rescue"))
    .header("Authorization", "Bearer YOUR_TOKEN")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
{
    "isolate_user": true,
    "directory_permissions": true,
    "reinstall_php": true,
    "regenerate_nginx": true,
    "restart_nginx": true
}
"""))
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Response

```json

                {
    "success": true,
    "message": "Site rescue job has been queued.",
    "data": {
        "site_uuid": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
        "requested_options": {
            "isolate_user": true,
            "directory_permissions": true,
            "regenerate_nginx": true,
            "restart_nginx": true,
            "reinstall_php": true,
            "repair_node": false,
            "repair_pm2": false,
            "restart_pm2": false,
            "repair_openclaw": false
        },
        "supported_options": [
            "isolate_user",
            "directory_permissions",
            "regenerate_nginx",
            "restart_nginx",
            "reinstall_php"
        ]
    }
}

                {
    "success": false,
    "message": "Unauthenticated.",
    "data": null
}

                {
    "success": false,
    "message": "This action is unauthorized. Your token is missing the required scope.",
    "data": null
}

                {
    "success": false,
    "message": "Not found.",
    "data": null
}

                {
    "success": false,
    "message": "The given data was invalid.",
    "data": null,
    "errors": {
        "domain": [
            "The domain field is required when mode is live."
        ]
    }
}
```

Queues a site rescue job with the selected repair options. Supported options depend on the site type and [Server](https://betterdocs.shahrear.msf.bd/encyclopedia/server/) stack. Poll `GET /sites/{uuid}/events` to track completion. Requires the `write:sites` scope.

## Path Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `uuid` | string (uuid) | **Required** | UUID of the site |

## Request Body

Content type: `application/json` — **required**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `isolate_user` | boolean | Optional | Repair the site user. Unsupported for OpenClaw sites. |
| `directory_permissions` | boolean | Optional | Reset site directory permissions. Unsupported for OpenClaw sites. |
| `regenerate_nginx` | boolean | Optional | Regenerate the site web [Server](https://betterdocs.shahrear.msf.bd/encyclopedia/server/) configuration. |
| `restart_nginx` | boolean | Optional | Restart nginx after regenerating config. Requires regenerate_nginx and is unsupported for OpenLiteSpeed/OpenClaw sites. |
| `reinstall_php` | boolean | Optional | Repair the site's PHP runtime. Unsupported for Node sites and Docker nginx stacks. |
| `repair_node` | boolean | Optional | Repair the site's Node runtime. Supported for Node-based sites, including OpenClaw. |
| `repair_pm2` | boolean | Optional | Repair the PM2 process and ecosystem config. Unsupported for static Node sites and OpenClaw sites. |
| `restart_pm2` | boolean | Optional | Restart the PM2 process. Unsupported for static Node sites and OpenClaw sites. |
| `repair_openclaw` | boolean | Optional | Run the OpenClaw-specific repair flow. Supported only for OpenClaw sites. |

```json

                {
    "isolate_user": true,
    "directory_permissions": true,
    "reinstall_php": true,
    "regenerate_nginx": true,
    "restart_nginx": true
}
```

## Responses

### 202 — Rescue queued successfully

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | boolean | Optional |  |
| `message` | string | Optional |  |
| `data` | object | Optional |  |
| `data` | object | Optional |  |
| `data.site_uuid` | string (uuid) | Optional |  |
| `data.requested_options` | object | Optional |  |
| `data.supported_options` | array of string | Optional |  |

```json

                {
    "success": true,
    "message": "Site rescue job has been queued.",
    "data": {
        "site_uuid": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
        "requested_options": {
            "isolate_user": true,
            "directory_permissions": true,
            "regenerate_nginx": true,
            "restart_nginx": true,
            "reinstall_php": true,
            "repair_node": false,
            "repair_pm2": false,
            "restart_pm2": false,
            "repair_openclaw": false
        },
        "supported_options": [
            "isolate_user",
            "directory_permissions",
            "regenerate_nginx",
            "restart_nginx",
            "reinstall_php"
        ]
    }
}
```

### 401 — Missing or invalid authentication token

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | boolean | Optional |  |
| `message` | string | Optional |  |
| `data` | object | Optional |  |

```json

                {
    "success": false,
    "message": "Unauthenticated.",
    "data": null
}
```

### 403 — Token lacks the required scope

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | boolean | Optional |  |
| `message` | string | Optional |  |
| `data` | object | Optional |  |

```json

                {
    "success": false,
    "message": "This action is unauthorized. Your token is missing the required scope.",
    "data": null
}
```

### 404 — Resource not found or not accessible to your [Team](https://betterdocs.shahrear.msf.bd/encyclopedia/team/)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | boolean | Optional |  |
| `message` | string | Optional |  |
| `data` | object | Optional |  |

```json

                {
    "success": false,
    "message": "Not found.",
    "data": null
}
```

### 422 — Request validation failed

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | boolean | Optional |  |
| `message` | string | Optional |  |
| `data` | object | Optional |  |
| `errors` | object | Optional |  |

```json

                {
    "success": false,
    "message": "The given data was invalid.",
    "data": null,
    "errors": {
        "domain": [
            "The domain field is required when mode is live."
        ]
    }
}
```
