Move a domain to its application's current routing, or back to the edge
retarget connection: reference page for this CustomDomain™ API operation in the connections group. Covers parameters, request body, responses and error codes.
A connected domain keeps the routing it connected with when its application's routing changes (domains still waiting for DNS follow the change). This moves one: the domain's expected records become those of the application's current routing, or with {"to": "edge"} those of the CustomDomain™ edge whatever the application's routing (the way back for a domain moved off the edge by mistake). The body is optional.
The customer's DNS is not changed. A moved domain goes back to pending with a fresh verification clock, is checked at once (a domain whose DNS already names the new place is live again in the response's status), and otherwise waits for its records (returned in records); drift is not reported while it waits. Moving a live domain off the edge stops edge serving at once (stops_edge_serving).
A domain whose records were written through a connected provider account that holds a usable key is moved by rewriting them, when the move_rewrite flag is on: the response carries rewriting: true and customer_action_required: false, the new records are written in the background and the domain is verified on them (propagating); if the write fails twice the customer is told as for any other move.
A no-op (moved: false) when the domain already points there. Refused (409) when the domain's records are stored and no rewrite is possible: records your backend supplied (change them with PUT /connections/{id}/records) or records written into the customer's DNS during setup by a rail that cannot rewrite them (disconnect and reconnect to move it). A server-side API key or an agent token only: a widget token is refused (403). Recorded in the audit log as connection.retargeted.
Long-lived tenant API key, cd_live_… (production) or cd_test_… (staging, development), stored hashed. Keys created before the switch to cd_ start with sk_live_… / sk_test_… and are still accepted. Scoped to the owning application's tenant.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/connections/string:retarget" \ -H "Content-Type: application/json" \ -d '{}'{ "connection_id": "string", "moved": true, "routing": { "mode": "edge", "cname_target": "string", "apex_ipv4": [ "string" ], "set_at": "2019-08-24T14:15:22Z" }, "previous_routing": { "mode": "edge", "cname_target": "string", "apex_ipv4": [ "string" ], "set_at": "2019-08-24T14:15:22Z" }, "records": [ { "type": "CNAME", "host": "string", "value": "string", "ttl": 3600, "priority": 0, "applied": true, "change": "created", "prior": [ { "type": "string", "value": "string", "ttl": 0, "priority": 0 } ], "prior_source": "provider" } ], "customer_action_required": true, "rewriting": true, "stops_edge_serving": true, "status": "pending"}{ "code": "account_not_verifiable", "title": "string", "details": "string", "request_id": "string", "challenge": { "value": "string", "bits": 1, "expires_at": "2019-08-24T14:15:22Z" }}{ "code": "account_not_verifiable", "title": "string", "details": "string", "request_id": "string", "challenge": { "value": "string", "bits": 1, "expires_at": "2019-08-24T14:15:22Z" }}{ "code": "account_not_verifiable", "title": "string", "details": "string", "request_id": "string", "challenge": { "value": "string", "bits": 1, "expires_at": "2019-08-24T14:15:22Z" }}{ "code": "account_not_verifiable", "title": "string", "details": "string", "request_id": "string", "challenge": { "value": "string", "bits": 1, "expires_at": "2019-08-24T14:15:22Z" }}{ "code": "account_not_verifiable", "title": "string", "details": "string", "request_id": "string", "challenge": { "value": "string", "bits": 1, "expires_at": "2019-08-24T14:15:22Z" }}