---
title: "Reindex Repo"
method: POST
path: "/repos/{repo_id}/reindex"
tags: ["repos"]
---

# Reindex Repo

`POST /repos/{repo_id}/reindex`

Force a fresh re-index of a repo against its current HEAD.

The optional body lets the caller opt into regenerating AI docs on
this re-index — same `generate_docs` / `docs_file_percentage` knobs
as ``POST /repos/index``. When ``generate_docs=True`` the credit-hold
gate from the initial-index path runs unchanged: free → 403, Pro →
atomic credit hold, admin → no hold.

## Path parameters

- `repo_id` string, required

## Request body

- ReindexRequest — Body for POST /repos/{repo_id}/reindex. Mirrors the LLM-generation fields of ``IndexRepoRequest`` so users can choose to regenerate AI docs on a re-index without having to delete the repo and re-submit the URL through the dashboard form. Every field defaults to ``None`` = inherit from the repo's most recent snapshot, so a bare reindex (empty body — e.g. the overview Sync button) behaves like ``repowise update``: it keeps regenerating docs at the coverage / voice / language the user originally chose instead of silently reverting to static-only or the comprehensive/English/10% defaults. An explicit value is always honored, so the dashboard dialog can still force docs on/off and pick a coverage. The router resolves ``None`` against the prior snapshot before the credit-hold gate runs, so the estimate is billed against the effective settings.
  - `generate_docs` boolean, nullable
  - `docs_file_percentage` number, nullable
  - `wiki_style` 'comprehensive' | 'caveman' | 'reference' | 'tutorial', nullable
  - `docs_language` 'en' | 'ru' | 'es' | 'fr' | 'de' | 'zh' | 'ja' | 'ko' | 'it' | 'pt' | 'nl' | 'pl' | 'tr' | 'ar' | 'hi', nullable

## Response `200`

Successful Response

- IndexRepoResponse
  - `snapshot_id` string, required
  - `short_id` string, required
  - `status` 'queued' | 'indexing' | 'ready' | 'failed', required
  - `cached` boolean, required
  - `repo` RepoResponse, required
    - `id` string, required
    - `canonical_url` string, required
    - `owner` string, required
    - `name` string, required
    - `default_branch` string, required
    - `latest_known_head_sha` string, nullable
    - `is_public` boolean, required
    - `file_count` integer, nullable
    - `last_checked_at` string, date-time, nullable
    - `auto_sync_enabled` boolean
    - `github_checks_enabled` boolean
    - `last_webhook_at` string, date-time, nullable
    - `last_polled_at` string, date-time, nullable
    - `exclude_patterns` string[]
    - `max_file_pages` integer, nullable
    - `prose_refresh` string
    - `prose_daily_cap_cents` integer
    - `repowise_managed` boolean
    - `description` string, nullable
    - `primary_language` string, nullable
    - `stars` integer, nullable
    - `badge_detected_at` string, date-time, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/repowise/apis/repowise-hosted-api.md) · [All operations](https://skmtc.dev/repowise/apis/repowise-hosted-api/llms.txt) · [OpenAPI document](https://skmtc.dev/repowise/apis/repowise-hosted-api/revisions/d1694e41a8a1?raw)
