Skip to main content
Returns the DNS configuration needed to restore the original DNS records and disconnect from the Search Company proxy. Supports:
  • Apex domains (example.com) - restores A records
  • Any subdomain (www, shop, blog, etc.) - restores CNAME

When to Use

Call this endpoint when a user wants to disconnect their domain from the Search Company proxy. This returns the Entri-compatible configuration to restore their domain back to its original DNS configuration. Important: After Entri completes the DNS restore, call /mark-disconnect-complete to update the proxy status.

What This Does

  1. Looks up the original DNS records stored when the proxy was first set up
  2. Returns DNS records that restore the domain to its original configuration
  3. Optionally returns the SSL TXT record for cleanup (harmless to leave, but tidy to remove)
  4. Does NOT delete CloudFront or SSL resources (they remain for fast reconnection)

Example Request

curl -X POST https://searchcompany-main.up.railway.app/api/domain/disconnect-proxy/org_xxx \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response (WWW Subdomain)

{
  "success": true,
  "custom_domain": "www.example.com",
  "domain_type": "subdomain",
  "subdomain_label": "www",
  "original_www_cname": "cname.vercel-dns.com",
  "original_apex_a_records": null,
  "original_apex_cname": null,
  "dns_records": [
    {
      "name": "www",
      "type": "CNAME",
      "value": "cname.vercel-dns.com"
    }
  ],
  "ssl_txt_record_to_delete": {
    "name": "_acme-challenge.www",
    "type": "TXT",
    "value": "abc123xyz789_validation_token"
  }
}

Example Response (Apex Domain)

{
  "success": true,
  "custom_domain": "example.com",
  "domain_type": "apex",
  "subdomain_label": "@",
  "original_www_cname": null,
  "original_apex_a_records": ["104.20.22.37", "172.66.165.95"],
  "original_apex_cname": null,
  "dns_records": [
    {
      "name": "@",
      "type": "A",
      "value": "104.20.22.37"
    },
    {
      "name": "@",
      "type": "A",
      "value": "172.66.165.95"
    }
  ],
  "ssl_txt_record_to_delete": null
}

Response Fields

FieldTypeDescription
successbooleanWhether the request succeeded
custom_domainstringThe domain being disconnected
domain_typestringapex or subdomain
subdomain_labelstringwww, shop, @ for apex
original_www_cnamestringOriginal CNAME (for subdomains)
original_apex_a_recordsstring[]Original A records (for apex domains)
original_apex_cnamestringOriginal CNAME if using flattening (rare)
dns_recordsarrayDNS records to restore via Entri
ssl_txt_record_to_deleteobjectOptional TXT record to clean up

Frontend Integration

Use the response to configure Entri for the disconnect flow:
// Get disconnect config
const response = await disconnectProxy(orgId, token);

// Launch Entri with the restore DNS records
const entriConfig = {
  applicationId: ENTRI_APP_ID,
  token: entriToken,
  prefilledDomain: response.custom_domain.replace(/^[^.]+\./, ''),
  dnsRecords: response.dns_records.map(record => ({
    type: record.type,
    host: record.name,
    value: record.value,
    ttl: 300
  }))
};

Entri.showEntri(entriConfig);

// After Entri completes successfully
const onEntriClose = async (success: boolean) => {
  if (success) {
    await markDisconnectComplete(orgId, token);
  }
};

Complete Disconnect Flow

  1. User clicks β€œDisconnect Domain”
  2. Frontend calls /disconnect-proxy β†’ gets restore DNS records
  3. Entri restores www CNAME to original
  4. Frontend calls /mark-disconnect-complete β†’ sets proxy_status = β€œDISCONNECTED”
  5. CloudFront + ACM stay intact (for fast relink later)

After Disconnect

After the user completes the disconnect flow:
  1. Their domain points back to the original host
  2. The CloudFront distribution remains but receives no traffic
  3. The SSL certificate remains (auto-renews via ACM)
  4. User can reconnect instantly by going through the 2-step DNS flow again (no CloudFront recreation needed)

Error Responses

Organization Not Found

{
  "detail": "Organization not found"
}

No Proxy Configuration

{
  "detail": "No proxy configuration found"
}

Missing Original DNS

{
  "detail": "Missing original CNAME for www. Cannot restore."
}