> ## Documentation Index
> Fetch the complete documentation index at: https://docs.servbase.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Applications

> List apps, read deployments and build logs, deploy, rebuild, restart, stop and start applications.

| Method | Path | Scope |
| - | - | - |
| `GET` | [`/app/list`](#list-applications) | `apps:read` |
| `GET` | [`/app/apps/{app_id}`](#get-an-application) | `apps:read` |
| `GET` | [`/app/apps/{app_id}/deployments`](#list-deployments) | `apps:read` |
| `GET` | [`/app/apps/{app_id}/deployments/{deployment_id}`](#get-a-deployment) | `apps:read` |
| `GET` | [`/app/apps/{app_id}/deployments/{deployment_id}/log`](#get-a-build-log) | `apps:read` |
| `GET` | [`/app/apps/{app_id}/stats`](#request-statistics) | `apps:read` |
| `POST` | [`/app/apps/{app_id}/deploy`](#deploy) | `apps:deploy` |
| `POST` | [`/app/apps/{app_id}/redeploy`](#redeploy-and-rebuild) | `apps:deploy` |
| `POST` | [`/app/apps/{app_id}/rebuild`](#redeploy-and-rebuild) | `apps:deploy` |
| `POST` | [`/app/apps/{app_id}/restart`](#restart) | `apps:restart` |
| `POST` | [`/app/apps/{app_id}/stop`](#stop-and-start) | `apps:power` |
| `POST` | [`/app/apps/{app_id}/start`](#stop-and-start) | `apps:power` |

`app_id` is the app's UUID. It is shown in the dashboard and returned as `app_uid` by the list.

## List applications

`GET /app/list`

**page** `integer` (default: 1)

Page number, from 1.

**page\_size** `integer` (default: 8)

Apps per page, up to 50.

**search** `string`

Filters by app name or domain (up to 120 characters).

```bash cURL theme={null}
curl "https://api.servbase.net/app/list?page=1&page_size=20" \
  -H "Authorization: Bearer $SERVBASE_API_KEY"
```

```javascript JavaScript theme={null}
const res = await fetch("https://api.servbase.net/app/list?page_size=20", {
  headers: { Authorization: `Bearer ${process.env.SERVBASE_API_KEY}` },
});
const { items, total } = await res.json();
```

```python Python theme={null}
res = requests.get(
    "https://api.servbase.net/app/list",
    params={"page_size": 20},
    headers={"Authorization": f"Bearer {API_KEY}"},
    timeout=30,
)
apps = res.json()["items"]
```

```json Response theme={null}
{
  "items": [
    {
      "app_uid": "6f1c2a9e-3b7d-4c1e-9a2f-5d8e7b6a4c31",
      "name": "shop",
      "type": "python",
      "assigned_domain": "shop.servbase.site",
      "state": "running",
      "plan_name": "Starter",
      "latest_deployment_status": "success",
      "latest_deployment_message": "Deployment completed",
      "latest_deployment_at": "2026-11-15T08:30:00"
    }
  ],
  "page": 1,
  "page_size": 20,
  "total": 1,
  "total_pages": 1,
  "search": ""
}
```

`state` is one of `running`, `deploying`, `stopped`, `failed` or `paused` (offline for an unpaid renewal).

## Get an application

`GET /app/apps/{app_id}`

```bash theme={null}
curl https://api.servbase.net/app/apps/$APP_ID -H "Authorization: Bearer $SERVBASE_API_KEY"
```

```json Response theme={null}
{
  "app_uid": "6f1c2a9e-3b7d-4c1e-9a2f-5d8e7b6a4c31",
  "name": "shop",
  "type": "python",
  "assigned_domain": "shop.servbase.site",
  "state": "running",
  "stopped_at": null,
  "plan_name": "Starter",
  "config": {
    "source_type": "github",
    "repo_full_name": "acme/shop",
    "branch": "main",
    "env": { "DATABASE_URL": "", "DEBUG": "" },
    "secret_keys": ["STRIPE_SECRET_KEY"]
  },
  "latest_deployment_id": 1842,
  "latest_deployment_status": "success",
  "latest_deployment_at": "2026-11-15T08:30:00",
  "latest_deployment_finished_at": "2026-11-15T08:31:12",
  "created_at": "2026-10-02T03:11:45"
}
```

> [!NOTE]
>
> For an API key, `config.env` lists the app's variable **names** with empty values, and `secret_keys` lists the names of its secrets. Values are never returned to a key.

## List deployments

`GET /app/apps/{app_id}/deployments`

Newest first.

**limit** `integer` (default: 20)

Deployments per page, up to 100.

**before** `integer`

Return deployments older than this deployment `id` (the last `id` of the previous page).

```bash theme={null}
curl "https://api.servbase.net/app/apps/$APP_ID/deployments?limit=5" \
  -H "Authorization: Bearer $SERVBASE_API_KEY"
```

```json Response theme={null}
{
  "has_more": true,
  "deployments": [
    {
      "id": 1842,
      "environment": "production",
      "source": "github",
      "deployment_ref": "dep_9c2e41a07b3f",
      "status": "success",
      "message": "Deployment completed",
      "created_at": "2026-11-15T08:30:00",
      "app_type": "python",
      "source_ref": "github:acme/shop@main"
    }
  ]
}
```

A deployment's `status` moves through `queued`, `preparing`, `uploading`, `deploying` and `verifying`, and ends as `success` or `failed`.

## Get a deployment

`GET /app/apps/{app_id}/deployments/{deployment_id}`

Returns one deployment, including `started_at`, `finished_at` and the build log in `deploy_log`:

```json Response theme={null}
{
  "deployment": {
    "id": 1842,
    "status": "success",
    "message": "Deployment completed",
    "source_ref": "github:acme/shop@main",
    "started_at": "2026-11-15T08:30:02",
    "finished_at": "2026-11-15T08:31:12",
    "deploy_log": "[2026-11-15T08:30:02Z] deployment started\n..."
  }
}
```

## Get a build log

`GET /app/apps/{app_id}/deployments/{deployment_id}/log`

```bash theme={null}
curl https://api.servbase.net/app/apps/$APP_ID/deployments/1842/log \
  -H "Authorization: Bearer $SERVBASE_API_KEY" | jq -r .log
```

```json Response theme={null}
{ "app_uid": "6f1c2a9e-...", "deployment_id": 1842, "status": "success", "log": "[2026-11-15T08:30:02Z] deployment started\n..." }
```

## Request statistics

`GET /app/apps/{app_id}/stats`

Requests and server errors per hour, and deployment results per day, as shown on the app's Overview.

**days** `integer` (default: 7)

How many days of requests to return, from 1 to 30.

```json Response theme={null}
{
  "days": 7,
  "requests": [{ "ts": 1763193600, "requests": 412, "errors": 3 }],
  "deployments": [{ "ts": 1763164800, "success": 2, "failed": 0 }],
  "requests_tracked": true
}
```

## Deploy

`POST /app/apps/{app_id}/deploy`

Starts a deployment from the app's source, for example its GitHub branch. The call returns as soon as the deployment is queued; [follow it](#get-a-deployment) until it finishes.

```bash cURL theme={null}
curl -X POST https://api.servbase.net/app/apps/$APP_ID/deploy \
  -H "Authorization: Bearer $SERVBASE_API_KEY"
```

```javascript JavaScript theme={null}
const res = await fetch(`https://api.servbase.net/app/apps/${appId}/deploy`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.SERVBASE_API_KEY}` },
});
const { deployment_id } = await res.json();
```

```python Python theme={null}
res = requests.post(
    f"https://api.servbase.net/app/apps/{app_id}/deploy",
    headers={"Authorization": f"Bearer {API_KEY}"},
    timeout=30,
)
deployment_id = res.json()["deployment_id"]
```

```json Response theme={null}
{
  "success": true,
  "app_uid": "6f1c2a9e-3b7d-4c1e-9a2f-5d8e7b6a4c31",
  "deployment_id": 1843,
  "deployment_ref": "dep_a17f03c95d21",
  "state": "deploying",
  "status": "queued"
}
```

| Error | When |
| - | - |
| `409` | A deployment is already in progress, the app is stopped, or a static HTML or PHP app (not connected to GitHub) was already deployed: edit its files live instead. |
| `423` | The app is held for a policy review. |

## Redeploy and rebuild

* `POST /app/apps/{app_id}/redeploy` deploys the app again from its source. Static HTML and PHP apps not connected to GitHub are edited live and cannot be redeployed.
* `POST /app/apps/{app_id}/rebuild` rebuilds a Python or Node.js app, reinstalling its dependencies. Pass `source_preference` as `auto` (default), `github` or `workspace` (the app's current files).

```bash theme={null}
curl -X POST "https://api.servbase.net/app/apps/$APP_ID/rebuild?source_preference=workspace" \
  -H "Authorization: Bearer $SERVBASE_API_KEY"
```

Both return the same response as [Deploy](#deploy).

## Restart

`POST /app/apps/{app_id}/restart`

Restarts a running Python or Node.js app without rebuilding it, for example after changing variables.

```bash theme={null}
curl -X POST https://api.servbase.net/app/apps/$APP_ID/restart -H "Authorization: Bearer $SERVBASE_API_KEY"
```

## Stop and start

* `POST /app/apps/{app_id}/stop` takes the app offline and stops its process. Its files and subdomain are kept. Only a running app with a successful build can be stopped.
* `POST /app/apps/{app_id}/start` brings a stopped app back online.

```bash theme={null}
curl -X POST https://api.servbase.net/app/apps/$APP_ID/stop -H "Authorization: Bearer $SERVBASE_API_KEY"
```

```json Response theme={null}
{ "success": true, "state": "stopped" }
```

Starting returns `{"success": true, "state": "running"}`. If the app has no successful build yet, start only clears the stop and returns its current state, for example `failed`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.