---
title: "Point this application's customer domains at your own infrastructure"
method: PUT
path: "/applications/{id}/connect-target"
tags: ["Applications"]
---

# Point this application's customer domains at your own infrastructure

`PUT /applications/{id}/connect-target`

## Request

- Base URL: `https://api.customdomain.ai/v1`
- URL: `https://api.customdomain.ai/v1/applications/{id}/connect-target`
- Auth: HTTP bearer

Available on every plan (it is how a Connect-only plan gets domains that serve). `cname_target` must be a public hostname that is not the platform edge; send `""` to go back to the edge. `apex_ipv4` (up to 4 public IPv4 addresses) is what root domains get on DNS providers with no ALIAS-style record; without it such roots cannot be pointed at a hostname and `POST /domains:check` reports `apex_strategy: unsupported`.

Applies to new connections and to domains still waiting for DNS (pending or failed, with no records supplied or written for them). Connected domains keep the routing they connected with (their `routing` field); move one with `POST /v1/connections/{id}:retarget`. `existing_domains` in the response counts both.

Refused (400) when `cname_target` resolves to the platform edge (a CNAME to it, or one of its addresses), or when `apex_ipv4` lists an edge address: such domains would verify but never be served. A `cname_target` that does not resolve yet, or a target with no `apex_ipv4`, is accepted with a `warnings` entry. Every change is recorded in the audit log (`app.routing_set`, `app.routing_cleared`).

## Path parameters

- `id` string, required

## Request body

- object
  - `cname_target` string, required: Hostname, or "" for the edge.
  - `apex_ipv4` string[]

## Response `200`

Connection target

- ConnectTargetView
  - `application_id` string, required
  - `mode` 'edge' | 'custom', required
  - `connect_target` ConnectTarget
    - `cname_target` string, required
    - `apex_ipv4` string[]
  - `edge` object, required
    - `cname_target` string
    - `apex_ipv4` string[]
  - `warnings` string[]: Advisory notes on a target just saved (PUT only): that `cname_target` does not resolve yet, or that with no `apex_ipv4` root domains at providers with no ALIAS-style record cannot connect.
  - `existing_domains` object: What a PUT did to the application's existing domains (PUT only). Domains already on the new routing are in neither count.
    - `moved` integer, required: Domains still waiting for DNS that took the new routing.
    - `kept` integer, required: Connected domains (and domains whose records were supplied or written) that keep pointing where they do.

## Other responses

- `400`: Error envelope: {code, title, details}.
- `401`: Error envelope: {code, title, details}.
- `403`: Error envelope: {code, title, details}.
- `404`: Error envelope: {code, title, details}.

---

[API](https://skmtc.dev/customdomain/apis/customdomain-control-plane-api.md) · [All operations](https://skmtc.dev/customdomain/apis/customdomain-control-plane-api/llms.txt) · [OpenAPI document](https://skmtc.dev/customdomain/apis/customdomain-control-plane-api/revisions/34d89cb7a7cd?raw)
