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

# Production apps

> Manage production app lifecycle, subdomains, and OAuth credentials

A production app is the deployed instance of an entity. It represents the running application with a subdomain, database, and deployment history.

## List production apps

```bash theme={null}
GET /api/production-apps
```

| Parameter  | Type  | Description                  |
| ---------- | ----- | ---------------------------- |
| `entityId` | query | Filter by entity             |
| `page`     | query | Page number (default: 1)     |
| `pageSize` | query | Items per page (default: 20) |

**Authentication:** User authentication required.

## Create production app

```bash theme={null}
POST /api/production-apps
```

| Parameter   | Type | Required | Description                                                      |
| ----------- | ---- | -------- | ---------------------------------------------------------------- |
| `entityId`  | body | Yes      | Entity to create a production app for                            |
| `subdomain` | body | Yes      | Subdomain for the app (e.g., `my-app` → `my-app.synthetiq.link`) |

Creates the production app record and assigns a cloud identifier for deployment infrastructure.

**Authentication:** Organization member + `entities:deploy` scope + entity publisher.

## Get production app

```bash theme={null}
GET /api/production-apps/{id}
```

Returns production app details including recent deployments.

**Authentication:** User authentication required.

## Update production app

```bash theme={null}
PATCH /api/production-apps/{id}
```

| Parameter      | Type | Description                                              |
| -------------- | ---- | -------------------------------------------------------- |
| `subdomain`    | body | Updated subdomain                                        |
| `workerConfig` | body | Worker service configuration                             |
| `appUrl`       | body | Vanity frontend origin; `null` or `""` clears it         |
| `apiUrl`       | body | Vanity API base / OAuth issuer; `null` or `""` clears it |

`appUrl` and `apiUrl` must be absolute `http(s)` URLs with no query string or fragment. Values are normalized (trailing slash stripped, path preserved); an invalid value returns `400`.

**Authentication:** Organization member + `entities:deploy` scope + entity publisher.

## Vanity URLs

Production app responses carry four URL fields:

| Field              | Meaning                                              |
| ------------------ | ---------------------------------------------------- |
| `app_url`          | Configured vanity frontend origin                    |
| `api_url`          | Configured vanity API base / OAuth issuer            |
| `deployed_app_url` | The `app_url` the current live deploy was built with |
| `deployed_api_url` | The `api_url` the current live deploy was built with |

Vanity URLs are baked in at deploy time, so the `deployed_*` fields update only when a deployment completes. A configured value that differs from its deployed counterpart means a redeploy is required. Setup (proxying your domain, CORS, and OAuth callbacks) is covered in [Vanity URLs](/docs/platform-docs/deployments/vanity-urls).

## Delete production app

```bash theme={null}
DELETE /api/production-apps/{id}
```

Deletes the production app and tears down all associated cloud resources (compute, CDN, database connections).

**Authentication:** Organization member + `entities:deploy` scope + entity publisher.

## Subdomain availability

```bash theme={null}
GET /api/subdomains/check
```

| Parameter   | Type  | Required | Description                                |
| ----------- | ----- | -------- | ------------------------------------------ |
| `value`     | query | Yes      | Subdomain to check                         |
| `excludeId` | query | No       | Production app ID to exclude (for updates) |

Returns whether the subdomain is available and the normalized form.

**Authentication:** User authentication required.
