---
title: "Get on-demand TLS certificate status for a hostname"
method: GET
path: "/domains/by-host/{hostname}/cert-status"
tags: ["Domains"]
---

# Get on-demand TLS certificate status for a hostname

`GET /domains/by-host/{hostname}/cert-status`

## Request

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

Returns the current cert lifecycle state for a single hostname (from the
`domains` row) plus the most recent on-demand issuance attempt (from the
`on_demand_cert_attempts` audit log). This is the operator's first-line
diagnostic, surfaced by `temps domain cert-status` (ADR-018 §5). Returns the
hostname with `None` fields when no on-demand activity exists for it (never a
404, so the CLI can render "no attempts recorded").

## Path parameters

- `hostname` string, required

## Response `200`

On-demand cert status retrieved successfully

- CertStatusResponse: Current on-demand cert status for a single hostname (ADR-018 §5). Backs `GET /domains/by-host/{hostname}/cert-status`.
  - `backoff_until` string, date-time, nullable: On-demand negative-cache deadline (ISO 8601, UTC), when in backoff.
  - `hostname` string, required: SNI hostname.
  - `last_attempt` OnDemandCertAttemptResponse, nullable: A single on-demand HTTP-01 issuance attempt from the append-only `on_demand_cert_attempts` audit log. Carries the full forensic detail for one attempt; the current cert state lives on the enclosing row's domain fields. Contains no private-key or certificate material — only audit metadata — so it is safe to return without masking.
    - `acme_request_sent` boolean, nullable: Did we reach the Let's Encrypt API?
    - `acme_response_status` string, nullable: HTTP status or ACME error type returned by Let's Encrypt, when known.
    - `challenge_served` boolean, nullable: Did the proxy serve the `/.well-known/acme-challenge/` request?
    - `created_at` string, date-time, required: When the attempt was recorded (ISO 8601, UTC).
    - `duration_ms` integer, nullable: End-to-end issuance duration in milliseconds (0/None for skipped).
    - `error_category` string, nullable: Coarse error category for UI labelling: `"rate_limited"`, `"dns_failure"`, `"acme_order_expired"`, `"challenge_mismatch"`, `"timeout"`, `"internal"`.
    - `error_chain` string, nullable: Full `Display` chain of the error (all `source()` levels), when failed.
    - `hostname` string, required: SNI hostname that triggered the attempt.
    - `id` integer, required
    - `outcome` string, required: Final outcome: `"issued"`, `"failed"`, `"skipped_duplicate"`, `"skipped_gate"`, `"skipped_rate_limit"`, or `"skipped_no_route"`.
    - `trigger` string, required: What triggered the attempt (always `"tls_callback"` today).
  - `status` string, nullable: Current cert lifecycle status from the `domains` row, when one exists.

## Other responses

- `401`: Unauthorized
- `403`: Insufficient permissions
- `500`: Internal server error

## Changes

- **2026-11-26** `e1864d950604`: 2 breaking
  - the `backoff_until` response's property type changed from `integer, null` to `string, null`, and format from `int64` to `date-time` for status `200`
  - the `last_attempt/oneOf[#/components/schemas/OnDemandCertAttemptResponse]/created_at` response's property type changed from `integer` to `string`, and format from `int64` to `date-time` for status `200`
- **2026-07-01** `d83dcb738585`: 1 info
  - endpoint added

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