> Index of every page on this site: [llms.txt](https://docs.a-line.cloud/llms.txt)

# Apps

> The apps operations of the v1 API.

## List the apps of a cluster

`GET /v1/clusters/{cluster_id}/apps` (operation ID `list_apps`)

Ordered by creation time, oldest first. Cursor paginated.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cursor` (query, `string`): Opaque cursor from the previous page's `next_cursor`.
- `limit` (query, `integer`): Page size, 1 to 100 (default 25).
- `cluster_id` (path, required, `string`): The cluster UUID

**Responses**

- `200`: A page of apps. Body: [`V1Page_for_V1App`](/api/reference/schemas#v1page_for_v1app).
- `400`: Invalid limit or cursor, or a malformed cluster id.
- `401`: Missing, invalid or revoked API key.
- `403`: The key's user cannot read this cluster.
- `404`: Cluster not found.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Create an app in a cluster from a container image or a catalog template

`POST /v1/clusters/{cluster_id}/apps` (operation ID `create_app`)

The app is deployed right away. Send an `Idempotency-Key` to make a retry safe.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `Idempotency-Key` (header, `string`): Optional client-chosen key (1-255 visible ASCII characters). A retry with the same key and body within 24 hours replays the first response instead of creating again; the same key with a different body is a 422, and a retry while the first request still runs is a 409.
- `cluster_id` (path, required, `string`): The cluster UUID

**Request body**: [`V1CreateApp`](/api/reference/schemas#v1createapp) (required): An app to create from a container image or a catalog template.

**Responses**

- `201`: The created app. Body: [`V1App`](/api/reference/schemas#v1app).
- `400`: Invalid name, image, port or environment, or malformed JSON.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or its user is not a member of the project's environment.
- `404`: Cluster, project or template not found.
- `409`: The name is taken in the project, or a request with the same Idempotency-Key is in progress.
- `422`: Missing or unknown body fields, an invalid setting, or an Idempotency-Key reused with a different body.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X POST 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key' \
  -H 'Content-Type: application/json' \
  -d '{"name":"example","project_id":"00000000-0000-4000-8000-000000000001"}'
```

## Get one app

`GET /v1/clusters/{cluster_id}/apps/{app_id}` (operation ID `get_app`)

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID

**Responses**

- `200`: The app. Body: [`V1App`](/api/reference/schemas#v1app).
- `400`: Malformed cluster or app id.
- `401`: Missing, invalid or revoked API key.
- `403`: The key cannot read this cluster.
- `404`: App not found.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Update an app's image, port or health check path

`PATCH /v1/clusters/{cluster_id}/apps/{app_id}` (operation ID `update_app`)

A new image redeploys the app.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID

**Request body**: [`V1UpdateApp`](/api/reference/schemas#v1updateapp) (required): App settings to change; omitted fields stay as they are.

**Responses**

- `200`: The updated app. Body: [`V1App`](/api/reference/schemas#v1app).
- `400`: Invalid image, port or health path, or malformed JSON.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or its user is not a member of the app's environment.
- `404`: App not found.
- `409`: A field is managed in git.
- `422`: Unknown body fields, or an invalid setting.
- `423`: The cluster is suspended.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X PATCH 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key' \
  -H 'Content-Type: application/json' \
  -d '{"batch":"example","health_path":"example","image":"example","port":1}'
```

## Delete an app

`DELETE /v1/clusters/{cluster_id}/apps/{app_id}` (operation ID `delete_app`)

Undeploys the app. Its backups are kept until their retention runs out and its buckets are kept.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID

**Responses**

- `204`: App deletion started.
- `400`: Malformed cluster or app id.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or its user is not a member of the app's environment.
- `404`: App not found or already being deleted.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X DELETE 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Run a backup of the app now

`POST /v1/clusters/{cluster_id}/apps/{app_id}/backups` (operation ID `trigger_backup`)

Backs up with the app's enabled backup policies. Send an `Idempotency-Key` to make a retry safe.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `Idempotency-Key` (header, `string`): Optional client-chosen key (1-255 visible ASCII characters). A retry with the same key and body within 24 hours replays the first response instead of creating again; the same key with a different body is a 422, and a retry while the first request still runs is a 409.
- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID

**Request body**: [`V1TriggerBackup`](/api/reference/schemas#v1triggerbackup): A backup to run now.

**Responses**

- `202`: The run that was queued. Body: [`V1BackupRunQueued`](/api/reference/schemas#v1backuprunqueued).
- `400`: Malformed id or JSON.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or its user is not a member of the app's environment.
- `404`: App not found.
- `409`: Backups are not enabled for the app, it has no backup target, or a request with the same Idempotency-Key is in progress.
- `422`: Unknown body fields, a target that is not the app's, or an Idempotency-Key reused with a different body.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X POST 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002/backups' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key' \
  -H 'Content-Type: application/json' \
  -d '{"target_ids":[]}'
```

## Get where an on-demand backup run stands

`GET /v1/clusters/{cluster_id}/apps/{app_id}/backups/runs/{run_id}` (operation ID `get_backup_run`)

`pending` until the worker records the run, then `running`, `succeeded` or `failed` (any target failing fails the run). A run that stays `pending` never started.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID
- `run_id` (path, required, `string`): The run UUID

**Responses**

- `200`: The run. Body: [`RunProgress`](/api/reference/schemas#runprogress).
- `400`: Malformed id.
- `401`: Missing, invalid or revoked API key.
- `403`: The key cannot read this cluster.
- `404`: App not found.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002/backups/runs/00000000-0000-4000-8000-000000000003' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## List an app's deploys

`GET /v1/clusters/{cluster_id}/apps/{app_id}/deploys` (operation ID `list_deploys`)

Newest first. Cursor paginated. `status` keeps only deploys in that stored status.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cursor` (query, `string`): Cursor from the previous page.
- `limit` (query, `integer`): Page size (1 to 100).
- `status` (query, `string`): Keep only deploys in this status, e.g. `failed`.
- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID

**Responses**

- `200`: A page of deploys. Body: [`V1Page_for_V1Deploy`](/api/reference/schemas#v1page_for_v1deploy).
- `400`: Invalid limit, cursor or status, or a malformed id.
- `401`: Missing, invalid or revoked API key.
- `403`: The key cannot read this cluster.
- `404`: App not found.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002/deploys' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Deploy the app's current image again

`POST /v1/clusters/{cluster_id}/apps/{app_id}/deploys` (operation ID `trigger_deploy`)

Send an `Idempotency-Key` to make a retry safe.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `Idempotency-Key` (header, `string`): Optional client-chosen key (1-255 visible ASCII characters). A retry with the same key and body within 24 hours replays the first response instead of creating again; the same key with a different body is a 422, and a retry while the first request still runs is a 409.
- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID

**Request body**: [`V1TriggerDeploy`](/api/reference/schemas#v1triggerdeploy) (required): A deploy to start.

**Responses**

- `202`: The deploy that started. Body: [`V1Deploy`](/api/reference/schemas#v1deploy).
- `400`: Unknown strategy, or malformed JSON.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or its user is not a member of the app's environment.
- `404`: App not found.
- `409`: The app is stopped, or a request with the same Idempotency-Key is in progress.
- `422`: Unknown body fields, a strategy the app does not support, or an Idempotency-Key reused with a different body.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X POST 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002/deploys' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key' \
  -H 'Content-Type: application/json' \
  -d '{"strategy":"example"}'
```

## Cancel the app's running deploy

`POST /v1/clusters/{cluster_id}/apps/{app_id}/deploys/cancel` (operation ID `cancel_deploy`)

The worker stops it and rolls the app back to what ran before.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID

**Responses**

- `202`: The cancelled deploy. Body: [`V1Deploy`](/api/reference/schemas#v1deploy).
- `400`: Malformed id.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or its user is not a member of the app's environment.
- `404`: App not found.
- `409`: No deploy is in progress.
- `422`: Deploys of managed templates can't be cancelled.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X POST 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002/deploys/cancel' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Get one deploy of an app

`GET /v1/clusters/{cluster_id}/apps/{app_id}/deploys/{deploy_id}` (operation ID `get_deploy`)

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID
- `deploy_id` (path, required, `string`): The deploy UUID

**Responses**

- `200`: The deploy. Body: [`V1Deploy`](/api/reference/schemas#v1deploy).
- `400`: Malformed id.
- `401`: Missing, invalid or revoked API key.
- `403`: The key cannot read this cluster.
- `404`: App or deploy not found.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002/deploys/00000000-0000-4000-8000-000000000003' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Roll the app back to what a past deploy released

`POST /v1/clusters/{cluster_id}/apps/{app_id}/deploys/{deploy_id}/rollback` (operation ID `rollback_deploy`)

Redeploys that deploy's image by digest. Send an `Idempotency-Key` to make a retry safe.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `Idempotency-Key` (header, `string`): Optional client-chosen key (1-255 visible ASCII characters). A retry with the same key and body within 24 hours replays the first response instead of creating again; the same key with a different body is a 422, and a retry while the first request still runs is a 409.
- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID
- `deploy_id` (path, required, `string`): The past deploy UUID

**Responses**

- `202`: The rollback deploy that started. Body: [`V1Deploy`](/api/reference/schemas#v1deploy).
- `400`: Malformed id.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or its user is not a member of the app's environment.
- `404`: App or deploy not found, or the deploy released nothing to roll back to.
- `409`: The image is gone from the registry, the app is stopped or busy, or a request with the same Idempotency-Key is in progress.
- `422`: An Idempotency-Key reused with a different request.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X POST 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002/deploys/00000000-0000-4000-8000-000000000003/rollback' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Get an app's outbound settings

`GET /v1/clusters/{cluster_id}/apps/{app_id}/egress` (operation ID `get_app_egress`)

Get an app's outbound settings: its own mode and rules plus what it inherits from its project.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID

**Responses**

- `200`: The app's outbound settings. Body: [`AppEgressResponse`](/api/reference/schemas#appegressresponse).
- `400`: Malformed cluster or app id.
- `401`: Missing, invalid or revoked API key.
- `404`: App not found.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002/egress' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Replace an app's own outbound mode and rules

`PUT /v1/clusters/{cluster_id}/apps/{app_id}/egress` (operation ID `update_app_egress`)

Replace an app's own outbound mode (`null` follows the project) and rules.

Re-applies the app's network policies.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID

**Request body**: [`UpdateEgressRequest`](/api/reference/schemas#updateegressrequest) (required): The whole new setting of a scope.

**Responses**

- `200`: The app's outbound settings now. Body: [`AppEgressResponse`](/api/reference/schemas#appegressresponse).
- `400`: Malformed ids or JSON.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only.
- `404`: App not found.
- `409`: The app's egress is managed in git.
- `422`: Invalid settings; `details.errors` lists every problem.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X PUT 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002/egress' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key' \
  -H 'Content-Type: application/json' \
  -d '{"mode":"example","rules":[]}'
```

## List the destinations an app's egress policy blocked in the last 24 hours

`GET /v1/clusters/{cluster_id}/apps/{app_id}/egress/blocked` (operation ID `get_app_blocked_egress`)

List the destinations an app's egress policy blocked in the last 24 hours, most recent first (at most 20).

Built from the app's blocked-connection log lines, so it follows the cluster's log retention and the app's log access.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID

**Responses**

- `200`: The recently blocked destinations. Body: [`BlockedEgressResponse`](/api/reference/schemas#blockedegressresponse).
- `400`: Malformed cluster or app id.
- `401`: Missing, invalid or revoked API key.
- `404`: App not found.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002/egress/blocked' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Get an app's environment variables

`GET /v1/clusters/{cluster_id}/apps/{app_id}/env` (operation ID `get_app_env`)

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID

**Responses**

- `200`: The app's environment variables. Body: [`V1Env`](/api/reference/schemas#v1env).
- `400`: Malformed cluster or app id.
- `401`: Missing, invalid or revoked API key.
- `403`: The key cannot read this cluster.
- `404`: App not found.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002/env' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Replace an app's environment variables

`PUT /v1/clusters/{cluster_id}/apps/{app_id}/env` (operation ID `replace_app_env`)

Sets exactly the given variables (others are removed) and redeploys the app.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID

**Request body**: [`V1Env`](/api/reference/schemas#v1env) (required): An app's environment variables.

**Responses**

- `200`: The app's environment variables now. Body: [`V1Env`](/api/reference/schemas#v1env).
- `400`: An invalid variable name or value, or malformed JSON.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or its user is not a member of the app's environment.
- `404`: App not found.
- `409`: The environment is managed in git.
- `422`: Missing or unknown body fields.
- `423`: The cluster is suspended.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X PUT 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002/env' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key' \
  -H 'Content-Type: application/json' \
  -d '{"env":{}}'
```

## Get an app's HTTP settings

`GET /v1/clusters/{cluster_id}/apps/{app_id}/http-settings` (operation ID `get_app_http_settings`)

Get an app's HTTP settings (defaults until changed).

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID

**Responses**

- `200`: The app's HTTP settings. Body: [`HttpSettingsResponse`](/api/reference/schemas#httpsettingsresponse).
- `400`: Malformed cluster or app id.
- `401`: Missing, invalid or revoked API key.
- `404`: App not found.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002/http-settings' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Change some of an app's HTTP settings

`PATCH /v1/clusters/{cluster_id}/apps/{app_id}/http-settings` (operation ID `update_app_http_settings`)

Change some of an app's HTTP settings; omitted fields keep their value.

A deployed app's HTTP routes are re-applied right away (no redeploy).

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID

**Request body**: [`UpdateHttpSettingsRequest`](/api/reference/schemas#updatehttpsettingsrequest) (required): The settings to change; omitted fields keep their value.

**Responses**

- `200`: The app's HTTP settings now. Body: [`HttpSettingsResponse`](/api/reference/schemas#httpsettingsresponse).
- `400`: Malformed ids or JSON.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only.
- `404`: App not found.
- `422`: Invalid settings.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X PATCH 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002/http-settings' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key' \
  -H 'Content-Type: application/json' \
  -d '{"compression":false,"content_negotiation":{"enabled":false,"markdown_tokens":true,"types":["markdown","json","yaml","text"]},"coop":"off","csp_mode":"off","csp_policy":"example","csp_preset":"basic","csp_report_uri":"example","csrf_exempt_paths":[],"csrf_mode":"off","csrf_trusted_origins":[],"custom_headers":[],"header_frame_options":false,"header_nosniff":false,"header_referrer_policy":false,"hsts":false,"hsts_include_subdomains":false,"hsts_max_age":1,"https_redirect":false,"max_body_bytes":1,"permissions_policy":"off","permissions_policy_custom":"example","www_redirect":"off"}'
```

## Scale an app to a number of pods

`PUT /v1/clusters/{cluster_id}/apps/{app_id}/scale` (operation ID `scale_app`)

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `cluster_id` (path, required, `string`): The cluster UUID
- `app_id` (path, required, `string`): The app UUID

**Request body**: [`V1Scale`](/api/reference/schemas#v1scale) (required): How many pods an app runs.

**Responses**

- `200`: The scaled app. Body: [`V1App`](/api/reference/schemas#v1app).
- `400`: Malformed JSON.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or its user is not a member of the app's environment.
- `404`: App not found.
- `409`: The scale is managed in git.
- `422`: Missing or unknown body fields, or replicas out of range.
- `423`: The cluster is suspended (it can only scale down).
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X PUT 'https://api.a-line.cloud/v1/clusters/00000000-0000-4000-8000-000000000001/apps/00000000-0000-4000-8000-000000000002/scale' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key' \
  -H 'Content-Type: application/json' \
  -d '{"replicas":1}'
```
