---
title: "Apply a hostname mode to a managed domain (persist + optional DNS sync + route reload)."
method: POST
path: "/dns-providers/{provider_id}/domains/{domain}/apply-hostname-mode"
tags: ["DNS Providers"]
---

# Apply a hostname mode to a managed domain (persist + optional DNS sync + route reload).

`POST /dns-providers/{provider_id}/domains/{domain}/apply-hostname-mode`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/dns-providers/{provider_id}/domains/{domain}/apply-hostname-mode`
- Auth: HTTP bearer

## Path parameters

- `provider_id` integer, required
- `domain` string, required

## Request body

- ApplyHostnameModeRequest: Request to apply a hostname mode (recompute + optional DNS sync).
  - `adopt_records` AdoptHostnameRecord[]: Conflicting records, from the preview's `conflicts`, that the user confirmed the sync may adopt — one entry per record, each only where the conflict is `adoptable`. Requires `sync_dns`.
    - `name` string, required: The conflict's `name`.
    - `record_type` string, required: The conflict's `record_type`.
    - `revision` string, required: The conflict's `revision`, from the preview the user reviewed.
  - `mode` string, required: Target mode to apply: `"standard"` or `"flat"`.
  - `skip_records` SkipHostnameRecord[]: Conflicting hostnames, from the preview's `conflicts`, that the user chose to leave untouched: the sync writes everything else. Requires `sync_dns`.
    - `name` string, required: The conflict's `name`.
    - `record_type` string, required: The conflict's `record_type`.
    - `revision` string, required: The conflict's `revision`, from the preview the user reviewed.
  - `sync_dns` boolean: Also reconcile the provider's DNS zone for the affected hostnames.

## Response `200`

Hostname mode applied

- HostnamePreviewResponse: Combined preview of a hostname-mode change.
  - `conflicts` DnsRecordConflict[], required: Generated hostnames whose records the sync may not write until the apply adopts or skips each one. Only a preview reports them: an apply with any left unresolved changes nothing and fails.
    - `adoptable` boolean, required: Whether the record at this name can be adopted. Records another Temps workflow or installation owns, and ambiguous states, cannot: skip them, or resolve them at the provider and preview again.
    - `current_proxied` boolean, nullable: Whether that record is proxied.
    - `current_value` string, nullable: Value of the record at this name and type, when there is exactly one.
    - `name` string, required: Fully-qualified generated hostname.
    - `proxied` boolean, required: Whether the sync would write the record proxied.
    - `reason` string, required: Why the sync may not write the record, and what resolves it.
    - `record_type` string, required: Record type the sync publishes the hostname as.
    - `revision` string, required: Identifies what this preview showed about the conflict. Send it with the adopt or skip decision: the apply refuses a decision whose conflict changed after the preview (the record's value, proxy status or owner, a record next to it, or the value the sync would write).
    - `value` string, required: Value the sync would write.
  - `dns_changes` DnsRecordChange[], required
    - `action` string, required: `"create"`, `"update"` or `"delete"`; `"adopt"` for a record the user confirmed adopting (`value` is its value before any update); `"skip"` for a hostname the user chose to leave untouched; `"conflict"` for one nobody decided on yet (see `conflicts`), which makes an apply change nothing; `"restore"` for a record written back after its replacement failed.
    - `name` string, required
    - `record_type` string, required: Record type, e.g. `"A"` or `"CNAME"`.
    - `value` string, required
  - `hostname_changes` HostnameChange[], required
    - `id` integer, required: Row id of the affected record.
    - `kind` string, required: `"deployment"` or `"environment"`.
    - `new` string, required
    - `old` string, required
  - `total` integer, required
  - `zone_access_ok` boolean, nullable: Whether the provider token can manage this zone (None if not checked).

## Other responses

- `400`: Invalid mode, or adopt/skip decisions that are duplicated, name a record type the sync never publishes, or were sent without sync_dns
- `401`: Unauthorized
- `403`: Insufficient permissions or token lacks zone access
- `404`: Domain not found
- `409`: Nothing was changed: a generated hostname's record conflicts and no decision adopts or skips it, an adopt or skip decision no longer matches the zone (preview again), or another generated-hostname operation is running on the zone (retry when it completes)

## Changes

- **2026-11-09** `12896146b193`: 2 breaking
  - removed the required property `extensions` from the response with the `400` status
  - removed the required property `extensions` from the response with the `409` status
- **2026-10-05** `4b228ebed583`: 5 info
  - added the new optional request property `adopt_records`
  - added the new optional request property `skip_records`
  - added the non-success response with the status `400`
  - added the non-success response with the status `409`
  - …1 more
- **2026-10-05** `63a80791dc58`: 1 breaking, 2 warning, 2 info
  - removed the required property `conflicts` from the response with the `200` status
  - removed the request property `adopt_records`
  - removed the request property `skip_records`
  - removed the non-success response with the status `400`
  - …1 more
- **2026-10-03** `de8387218c0b`: 5 info
  - added the new optional request property `adopt_records`
  - added the new optional request property `skip_records`
  - added the non-success response with the status `400`
  - added the non-success response with the status `409`
  - …1 more
- **2026-07-27** `1b060c0a4ba3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/dns-providers/:provider_id/domains/:domain/apply-hostname-mode/post.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/3b040526eb43?raw)
