---
title: "Move a domain between projects without deleting its route or certificate."
method: PUT
path: "/projects/{source_project_id}/custom-domains/{domain_id}/assignment"
tags: ["Custom Domains"]
---

# Move a domain between projects without deleting its route or certificate.

`PUT /projects/{source_project_id}/custom-domains/{domain_id}/assignment`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{source_project_id}/custom-domains/{domain_id}/assignment`
- Auth: HTTP bearer

## Path parameters

- `source_project_id` integer, required
- `domain_id` integer, required

## Request body

- ReassignCustomDomainRequest
  - `target_environment_id` integer, required
  - `target_project_id` integer, required

## Response `200`

Domain assignment updated atomically

- CustomDomainResponse
  - `branch` string, nullable
  - `created_at` string, date-time, required
  - `domain` string, required
  - `domain_id` integer, nullable
  - `environment` DomainEnvironmentResponse, nullable
    - `id` integer, required
    - `name` string, required
    - `slug` string, required
  - `expiration_time` string, date-time, nullable
  - `id` integer, required
  - `last_renewed` string, date-time, nullable
  - `message` string, nullable
  - `project_id` integer, required
  - `redirect_to` string, nullable
  - `service_name` string, nullable: Docker Compose service name this domain routes to
  - `status` string, required
  - `status_code` integer, nullable
  - `updated_at` string, date-time, required

## Other responses

- `401`: Unauthorized
- `403`: Write access required for both projects
- `404`: Custom domain or target environment not found in the authorized project scopes
- `409`: Domain assignment changed; refresh and retry

## Changes

- **2026-11-26** `e1864d950604`: 4 breaking
  - the `created_at` response's property type changed from `integer` to `string`, and format from `int64` to `date-time` for status `200`
  - the `expiration_time` response's property type changed from `integer, null` to `string, null`, and format from `int64` to `date-time` for status `200`
  - the `last_renewed` response's property type changed from `integer, null` to `string, null`, and format from `int64` to `date-time` for status `200`
  - the `updated_at` response's property type changed from `integer` to `string`, and format from `int64` to `date-time` for status `200`
- **2026-09-07** `cdc1afae1752`: 1 info
  - endpoint added
- **2026-09-07** `f7404eb7ac98`: 1 breaking
  - api path removed without deprecation
- **2026-08-17** `7c1de3f22bca`: 1 info
  - removed the non-success response with the status `400`
- **2026-08-16** `f5dd8196a076`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/:source_project_id/custom-domains/:domain_id/assignment/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/3b040526eb43?raw)
