---
title: "Choose how a hostname reaches visitors."
method: PUT
path: "/ingress/hostnames/{hostname}"
tags: ["Ingress"]
---

# Choose how a hostname reaches visitors.

`PUT /ingress/hostnames/{hostname}`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/ingress/hostnames/{hostname}`
- Auth: HTTP bearer

`automatic` lets the most specific tunnel covering it publish it;
`tunnel` with `connector_id` pins it to that tunnel (adding a domain
"through a tunnel"); `off` keeps every tunnel away from it, for DNS
managed elsewhere. It is published once an environment serves it.

## Path parameters

- `hostname` string, required

## Request body

- SetHostnameChoiceRequest
  - `connector_id` integer, nullable: Required with mode `tunnel`.
  - `mode` 'automatic' | 'tunnel' | 'off', required: How one hostname reaches visitors, as the operator chose it (ADR 058 D9).

## Response `200`

- HostnameView: Where a hostname stands with the tunnels, and why.
  - `candidates` HostnameCandidate[], required: The tunnels whose domain covers it.
    - `auto_publish` boolean, required
    - `connector_id` integer, required
    - `domain` string, required
    - `name` string, required
  - `chosen_connector_id` integer, nullable: The tunnel chosen for it, with mode `tunnel`.
  - `connector_id` integer, nullable: The tunnel that publishes it, or would once `detail` is dealt with.
  - `connector_name` string, nullable
  - `detail` string, required: What is happening; when it is not published, why and what to do.
  - `hostname` string, required
  - `mode` 'automatic' | 'tunnel' | 'off', required: How one hostname reaches visitors, as the operator chose it (ADR 058 D9).
  - `published_at` string, date-time, nullable
  - `served_by_workers` boolean, required: Whether workers serve it. A tunnel only publishes those.
  - `state` string, required: `published`, `pending`, `error` or `not_published`.

## Other responses

- `400`: Invalid hostname, or the tunnel cannot publish it
- `404`: No such tunnel

## Changes

> 98 revisions in range; 1 not diffed.

- **2026-10-22** `d8a717162ef5`: 1 info
  - endpoint added
- **2026-10-22** `06005615b19e`: 1 breaking
  - api path removed without deprecation
- **2026-10-22** `7d41b820a372`: 1 info
  - endpoint added
- **2026-10-22** `add7f7b41ae2`: 1 breaking
  - api path removed without deprecation
- **2026-10-21** `842d42ed4659`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/ingress/hostnames/:hostname/put.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/fdfa2df06ae7?raw)
