> ## 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.

# Update All Timestamps

> Refresh timestamps on all AI website pages (core files + AI articles)

Internal endpoint for the Cron service to update timestamps on ALL pages for a business.

<Info>
  This signals **freshness** to AI search engines like Bing, which favor recently updated content.
  Updates core AI site files (llms.txt, data.json, next.config.js) AND all AI articles.
</Info>

<Note>
  This is **Job 2** in the cron sequence, running BEFORE new AI articles are created.
  It ensures existing content appears fresh to crawlers.
</Note>

## What Gets Updated

### Core AI Site Files

| File             | Update                                  |
| ---------------- | --------------------------------------- |
| `llms.txt`       | "Last updated: \[date]" at bottom       |
| `data.json`      | `dateModified` field                    |
| `next.config.js` | `Last-Modified` and `ETag` HTTP headers |

### AI Articles

For **every** existing AI article:

| Element                                   | Update                            |
| ----------------------------------------- | --------------------------------- |
| `<meta property="article:modified_time">` | Current ISO timestamp             |
| Year in title                             | "2025" → "2026" (if year changed) |
| Year in `<h1>`                            | Same as title                     |
| Footer                                    | "Last updated: December 24, 2025" |

## Request Body

<ParamField body="business_id" type="string" required>
  Business identifier (org\_slug)
</ParamField>

## Response

<ResponseField name="status" type="string">
  "success" or "error"
</ResponseField>

<ResponseField name="core_files_updated" type="number">
  Number of core AI site files updated (llms.txt, data.json, next.config.js)
</ResponseField>

<ResponseField name="pages_updated" type="number">
  Number of AI articles successfully updated
</ResponseField>

<ResponseField name="pages_failed" type="number">
  Number of AI articles that failed to update
</ResponseField>

<ResponseField name="files" type="array">
  Array of updated files to deploy. Each file has `path` and `content`.
</ResponseField>

<ResponseField name="project_name" type="string">
  Vercel project name for deployment
</ResponseField>

<ResponseField name="ai_site_url" type="string">
  AI site URL (e.g. "[https://nike.searchcompany.dev](https://nike.searchcompany.dev)")
</ResponseField>

<ResponseField name="updated_paths" type="array">
  List of URL paths that were updated
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://searchcompany-main.up.railway.app/api/cron/update-all-timestamps \
    -H "Content-Type: application/json" \
    -d '{"business_id": "nike"}'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "status": "success",
    "core_files_updated": 3,
    "pages_updated": 47,
    "pages_failed": 0,
    "files": [
      {"path": "public/llms.txt", "content": "..."},
      {"path": "public/data.json", "content": "..."},
      {"path": "next.config.js", "content": "..."},
      {"path": "pages/top-10-sneakers-2025.js", "content": "..."}
    ],
    "project_name": "ai-nike",
    "ai_site_url": "https://nike.searchcompany.dev",
    "updated_paths": [
      "/llms.txt",
      "/data.json",
      "/top-10-sneakers-2025"
    ]
  }
  ```
</ResponseExample>

## Workflow

This endpoint returns files but does NOT deploy. The cron service handles deployment:

```
1. update-all-timestamps → Returns updated files
   └── Updates core files + all AI articles

2. deploy-to-vercel → Deploys all updated files at once
   └── Single deployment with all changes

3. submit-indexnow → Notifies search engines
   └── Tells Bing, Yandex, etc. that pages were updated
```

## Why This Matters

From Bing's AI Search documentation:

> "Bing's crawl frequency and its AI tend to favor fresh content. Update your content regularly –
> even minor tweaks with a 'Last updated' note can signal freshness. Bing might include a date
> in the citation (e.g., 'source: yoursite.com (Dec 2025)'), which can influence user trust."

By updating timestamps daily, your pages:

* Appear fresh to AI crawlers
* Get higher priority in crawl scheduling
* Show recent dates in AI citations
* Compete better against newer content
