---
title: "Set Primary Domain"
method: POST
path: "/api/apps/{name}/domains/primary"
tags: ["deploy"]
---

# Set Primary Domain

`POST /api/apps/{name}/domains/primary`

## Request

- Base URL: `https://softkiln.com` (the document declares no server; this is the origin it was published from)
- URL: `https://softkiln.com/api/apps/{name}/domains/primary`
- Auth: none declared

Promote a verified custom domain to be the env's primary.

For prod, this also swings the status subdomain: tear down
``status.<old_primary>`` and provision ``status.<new_primary>`` on the
app-manager Railway service. Both steps are best-effort — DB primary swap
commits regardless so the UI isn't blocked by a Railway/Cloudflare flake.

## Path parameters

- `name` string, required

## Request body

- SetPrimaryDomainRequest
  - `domain` string, required
  - `env` 'prod' | 'dev'

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/softkiln/apis/app-manager-api.md) · [All operations](https://skmtc.dev/softkiln/apis/app-manager-api/llms.txt) · [OpenAPI document](https://skmtc.dev/softkiln/apis/app-manager-api/revisions/de2b674a7f21?raw)
