---
title: "Import certificates from a Traefik `acme.json` document (Path B)."
method: POST
path: "/traefik-discovery/tls/import"
tags: ["Traefik Discovery"]
---

# Import certificates from a Traefik \`acme.json\` document (Path B).

`POST /traefik-discovery/tls/import`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/traefik-discovery/tls/import`
- Auth: HTTP bearer

Upload the raw contents of Traefik's `acme.json` and a list of hosts to
import. Each host is independently validated (8-step chain from ADR-041 §5)
and a per-host verdict is returned. `dry_run: true` runs all validation
without writing anything, so the operator can preview before committing.

The request body is capped at 1 MiB. Do **not** add a decompression layer
to this route — the 1 MiB cap's security properties depend on the absence
of decompression here (ADR-041 §4).

## Request body

- ImportTraefikAcmeJsonRequest: Request body for Path B: import from Traefik's `acme.json`. `Debug` is hand-written: `acme_json` contains Traefik's private keys and must never appear in logs. Only the host list, renewal method, dry-run flag, and byte length are logged.
  - `acknowledge_manual_dns_renewal` boolean: Required when `renewal_method` is `"dns-01"` and no auto-manage zone covers the host.
  - `acme_json` string, required: Raw contents of the Traefik `acme.json` file (uploaded by the CLI or pasted in the console). **Never** a server-side file path. Redacted in `Debug` output — the field holds private key material.
  - `dry_run` boolean: `true` → full parse and validation, no writes. The identical per-host verdicts are returned, giving the operator a preview before committing.
  - `hosts` string[], required: Hosts to import. Only hosts that appear in the document's certificates (by X.509 SAN, not JSON `domain.main`) are accepted.
  - `renewal_method` string, required: `"http-01"` or `"dns-01"`. Stored as `verification_method` so the renewal scheduler knows how to renew.

## Response `200`

Import results (per-host verdicts)

- ImportTraefikAcmeJsonResponse: Response body for the Path B import endpoint.
  - `dry_run` boolean, required
  - `failed` integer, required
  - `succeeded` integer, required
  - `total_requested` integer, required
  - `verdicts` ImportedHostVerdict[], required
    - `error` string, nullable: Human-readable failure reason when `success` is `false`.
    - `host` string, required
    - `not_after` string, nullable: ISO 8601 expiry of the imported certificate.
    - `sans` string[], required: DNS SANs carried in the imported certificate.
    - `success` boolean, required: Whether the cert was written (or would be written on `dry_run: false`).

## Other responses

- `400`: Validation error (malformed JSON, unsupported renewal_method)
- `401`: Unauthorized
- `403`: Insufficient permissions
- `413`: Request body exceeds the 1 MiB limit
- `500`: Internal server error

## Changes

- **2026-11-09** `12896146b193`: 5 breaking
  - removed the required property `extensions` from the response with the `400` status
  - removed the required property `extensions` from the response with the `401` status
  - removed the required property `extensions` from the response with the `403` status
  - removed the required property `extensions` from the response with the `413` status
  - …1 more
- **2026-10-05** `4b228ebed583`: 5 info
  - added the optional property `status` to the response with the `400` status
  - added the optional property `status` to the response with the `401` status
  - added the optional property `status` to the response with the `403` status
  - added the optional property `status` to the response with the `413` status
  - …1 more
- **2026-10-05** `63a80791dc58`: 5 warning
  - removed the optional property `status` from the response with the `400` status
  - removed the optional property `status` from the response with the `401` status
  - removed the optional property `status` from the response with the `403` status
  - removed the optional property `status` from the response with the `413` status
  - …1 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/traefik-discovery/tls/import/post.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)
