Skip to main content

POST /api/domain/start-certificate/

Initiates a Let’s Encrypt certificate request for a custom domain. This is Step 1 of the zero-downtime SSL flow.

Purpose

This endpoint starts the ACME DNS-01 challenge process:
  1. Creates a new certificate order with Let’s Encrypt
  2. Returns a TXT record the user must add to their DNS
  3. Stores the challenge data for later completion

Architecture

Internal Services

start_certificate_request

Creates a new Let’s Encrypt certificate order using the ACME protocol. Location: src/app/apis/domain/shared/letsencrypt/certificate_service.py Returns:
  • order_url - URL to check order status
  • authorization_url - URL for authorization
  • challenge_url - URL to respond to challenge
  • finalize_url - URL to finalize order
  • txt_record_name - DNS TXT record name (e.g., _acme-challenge.example.com)
  • txt_record_value - DNS TXT record value

Response Fields

FieldTypeDescription
txt_record_namestringTXT record name to add to DNS
txt_record_valuestringTXT record value
order_urlstringACME order URL
authorization_urlstringACME authorization URL
challenge_urlstringACME challenge URL
finalize_urlstringACME finalize URL

Code Location

src/app/apis/domain/start_certificate/routes.py