> ## Documentation Index
> Fetch the complete documentation index at: https://docs.searchcompany.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Technical overview of the Mark Disconnect Complete endpoint

# POST /api/domain/mark-disconnect-complete/{org_id}

Marks the domain disconnect as complete after Entri restores the original DNS configuration.

## Purpose

This endpoint:

1. Updates proxy\_status to `DISCONNECTED`
2. Preserves CloudFront distribution and ACM certificate for fast reconnection

## Architecture

```mermaid theme={null}
flowchart TD
    A[Entri Success Callback] --> B[Mark Disconnect Complete]
    B --> C[Verify Proxy Exists]
    C --> D{Has CloudFront?}
    D -->|No| E[Return 404]
    D -->|Yes| F[Update Status: DISCONNECTED]
    F --> G[Return Success]
```

## Response Fields

| Field           | Type    | Description                            |
| --------------- | ------- | -------------------------------------- |
| `status`        | string  | "success"                              |
| `proxy_status`  | string  | "DISCONNECTED"                         |
| `message`       | string  | Confirmation message                   |
| `can_reconnect` | boolean | Always true (infrastructure preserved) |

## Infrastructure Preservation

When a domain is disconnected:

* CloudFront distribution remains active
* ACM certificate remains valid
* DNS records are restored to original

This allows fast reconnection without recreating infrastructure.

## Reconnection Flow

To reconnect after disconnecting:

1. Call `/start-certificate` (may reuse existing cert)
2. Add DNS records via Entri
3. Call `/mark-step-complete` with step 2

## Code Location

```
src/app/apis/domain/mark_disconnect_complete/routes.py
```
