Skip to main content

POST /api/domain/mark-step-complete/

Marks a connection step as complete after Entri confirms DNS records were added successfully.

Purpose

This endpoint is called by the frontend after Entri confirms successful DNS configuration:
  • Step 1: SSL CNAME added β†’ status becomes SSL_VALIDATING
  • Step 2: www CNAME switched β†’ status becomes DEPLOYED + triggers background tasks

Architecture

Internal Services

_background_acm_upgrade

Upgrades from Let’s Encrypt certificate to ACM-native certificate for auto-renewal. Triggered: After Step 2 completes (60 second delay) Location: src/app/apis/domain/mark_step_complete/routes.py

_background_google_verify_and_submit

Orchestrates Google verification polling, then triggers search engine submissions. Triggered: After Step 2 completes Flow:
  1. Poll Google verification every 10 seconds for 2 minutes (12 attempts)
  2. Once verified β†’ update DB status to β€œVERIFIED”
  3. Add site to Google Search Console
  4. Run IndexNow submission (always, regardless of Google verification)
  5. Run GSC sitemap submission (only if Google verified)
Location: src/app/apis/domain/mark_step_complete/routes.py

_background_indexnow_submission

Submits all AI site URLs to IndexNow for search engine indexing. Triggered: By _background_google_verify_and_submit after polling completes Location: src/app/apis/domain/mark_step_complete/routes.py

_background_gsc_submission

Submits sitemap to Google Search Console. Triggered: By _background_google_verify_and_submit only if Google verification succeeds Location: src/app/apis/domain/mark_step_complete/routes.py

Request Body

FieldTypeDescription
stepinteger1 or 2

Response Fields

FieldTypeDescription
statusstring”success”
proxy_statusstringNew status (SSL_VALIDATING or DEPLOYED)

Background Task Details

ACM Upgrade

  • Waits 60 seconds before starting
  • Requests new ACM certificate with DNS validation
  • ACM certificates auto-renew (unlike Let’s Encrypt)
  • User doesn’t wait for this

Google Verification + Search Engine Submission

  • Polls Google verification every 10 seconds for up to 2 minutes
  • This gives DNS time to propagate after user adds TXT record in Step 1
  • IndexNow runs regardless of Google verification result
  • GSC sitemap only submits if Google verification succeeds

Why Poll in Step 2?

The Google TXT record is added during Step 1 (via Entri), but verification is checked in Step 2 because:
  1. DNS Propagation Time: TXT records need time to propagate globally
  2. More Time: By Step 2, the TXT record has had time to propagate
  3. Resilience: Polling handles slow DNS propagation gracefully
  4. Non-blocking: User doesn’t wait - it runs in background

Code Location

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