---
title: "Choose which address a root domain leads with"
method: PATCH
path: "/client/domains/{id}/primary"
tags: ["Apps"]
---

# Choose which address a root domain leads with

`PATCH /client/domains/{id}/primary`

## Request

- Base URL: `https://api.roar-ai.com`
- URL: `https://api.roar-ai.com/client/domains/{id}/primary`
- Auth: HTTP bearer

For a root domain (`example.com`), which of its two names people should use — `example.com` itself or `www.example.com`. Body: `{ "primary": "www.example.com" }`, and it must be one of those two.

The other name redirects to the one you pick, and this decides which DNS record is presented as required and which as optional. Nothing is redeployed. A subdomain has no second name and is refused. To choose which of your app’s DOMAINS is its main address, use `POST /client/domains/{id}/make-primary`. `id` is a DOMAIN id, from `GET /client/services/{id}/domains`. Requires `apps:deploy`.

## Path parameters

- `id` string, uuid, required

## Response `200`

The updated domain

## Other responses

- `400`: Not a root domain, or not one of its two names
- `403`: Key lacks apps:deploy
- `404`: No such domain

---

[API](https://skmtc.dev/roar-ai/apis/roar-ai-api.md) · [All operations](https://skmtc.dev/roar-ai/apis/roar-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/roar-ai/apis/roar-ai-api/revisions/37e4d0d5a7fe?raw)
