---
title: "Find the project assignment for a certificate hostname."
method: GET
path: "/projects/custom-domains/by-host/{hostname}"
tags: ["Custom Domains"]
---

# Find the project assignment for a certificate hostname.

`GET /projects/custom-domains/by-host/{hostname}`

## Request

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

A hostname that is not assigned to a project (or is assigned to a project
the caller cannot see) is a normal state, so it answers 200 with
`custom_domain: null` rather than a 404.

## Path parameters

- `hostname` string, required

## Response `200`

Lookup result; `custom_domain` is null when the hostname is not assigned to a visible project

- CustomDomainLookupResponse: Result of looking a hostname up among the custom domains the caller can see. "Not assigned to any project" is a normal state for a certificate that has not been attached yet, so it is expressed as `custom_domain: null` with a 200 rather than a 404. A hostname that belongs to a project the caller cannot see is deliberately reported the same way.
  - `custom_domain` CustomDomainResponse, nullable
    - `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

- `400`: Hostname is not a valid domain name
- `401`: Unauthorized
- `403`: Project access denied

## Changes

- **2026-11-26** `e1864d950604`: 4 breaking
  - the `custom_domain/oneOf[#/components/schemas/CustomDomainResponse]/created_at` response's property type changed from `integer` to `string`, and format from `int64` to `date-time` for status `200`
  - the `custom_domain/oneOf[#/components/schemas/CustomDomainResponse]/expiration_time` response's property type changed from `integer, null` to `string, null`, and format from `int64` to `date-time` for status `200`
  - the `custom_domain/oneOf[#/components/schemas/CustomDomainResponse]/last_renewed` response's property type changed from `integer, null` to `string, null`, and format from `int64` to `date-time` for status `200`
  - the `custom_domain/oneOf[#/components/schemas/CustomDomainResponse]/updated_at` response's property type changed from `integer` to `string`, and format from `int64` to `date-time` for status `200`
- **2026-10-13** `dd766bfd1f06`: 6 breaking, 9 warning, 3 info
  - removed the required property `created_at` from the response with the `200` status
  - removed the required property `domain` from the response with the `200` status
  - removed the required property `id` from the response with the `200` status
  - removed the required property `project_id` from the response with the `200` status
  - …14 more
- **2026-09-07** `cdc1afae1752`: 1 info
  - endpoint added
- **2026-09-07** `f7404eb7ac98`: 1 breaking
  - api path removed without deprecation
- **2026-08-16** `f5dd8196a076`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/custom-domains/by-host/:hostname/get.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)
