> ## 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 Resubmit Sitemap endpoint

# POST /api/domain/resubmit-sitemap/{org_id}

Resubmits the sitemap to Google Search Console. Used after deploying new boosted pages.

## Purpose

This endpoint notifies Google that the sitemap has been updated, typically called:

* After new boosted pages are deployed
* After site content is regenerated
* As part of cron job workflows

## Architecture

```mermaid theme={null}
flowchart TD
    A[Request] --> B[Resubmit Sitemap Endpoint]
    B --> C{Lookup by clerk_org_id}
    C -->|Found| E[Get Site Info]
    C -->|Not Found| D{Lookup by org_slug}
    D -->|Found| E
    D -->|Not Found| F[Return Skipped]
    E --> G{Domain Verified?}
    G -->|No| H[Return Skipped]
    G -->|Yes| I[Submit Sitemap]
    I --> J[Update Timestamp]
    J --> K[Return Success]
```

## Flexible ID Lookup

The `org_id` parameter can be either:

* `clerk_org_id` - Used by frontend
* `org_slug` (business\_id) - Used by cron services

The endpoint tries both lookups to support different callers.

## Internal Services

### submit\_sitemap

Submits the sitemap URL to Google Search Console API.

**Location:** `src/app/shared/google_search_console.py`

## Response Fields

| Field               | Type    | Description                      |
| ------------------- | ------- | -------------------------------- |
| `status`            | string  | "success", "skipped", or "error" |
| `sitemap_submitted` | boolean | Whether sitemap was submitted    |
| `message`           | string  | Human-readable status            |

## Non-Blocking Behavior

This endpoint returns "skipped" (not error) when:

* Domain is not verified
* Organization not found

This allows cron jobs to call it without failing on unverified domains.

## Code Location

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