# Inspect a repository

Detect the repository's framework and read its versioned Hoplite sandbox settings before creating a project.

`GET /api/source-control/github/repositories/{id}/inspect`

Required permission: `repo:read`.

## Parameters

| Name | In | Type | Required | Description |

| --- | --- | --- | --- | --- |

| `id` | path | `string` | Yes | The Hoplite repository ID. |

## Example request

```bash
curl --request GET \
  --url https://api.hoplite.sh/api/source-control/github/repositories/repo_987654321/inspect \
  --header "X-Api-Key: $HOPLITE_API_KEY"
```

## 200 response

Repository inspection result.

Content type: `application/json`. Response type: `RepositoryInspectionResponse`.

| Field | Type | Required | Constraints | Description |
| --- | --- | --- | --- | --- |
| `ok` | `boolean` | Yes | constant true | — |
| `inspection` | `RepositoryInspection` | Yes | — | — |
| `inspection.framework` | `string \| null` | Yes | — | — |
| `inspection.settings` | `object` | Yes | — | — |
| `inspection.settings.path` | `string` | Yes | — | — |
| `inspection.settings.previewPort` | `integer \| null` | Yes | — | — |
| `inspection.settings.invalid` | `boolean` | Yes | — | — |
| `inspection.settings.scripts` | `object \| null` | Yes | — | — |
| `inspection.settings.scripts.setup` | `ProjectScript` | No | — | — |
| `inspection.settings.scripts.setup.enabled` | `boolean` | Yes | — | — |
| `inspection.settings.scripts.setup.command` | `string \| null` | Yes | — | — |
| `inspection.settings.scripts.run` | `ProjectScript` | No | — | — |
| `inspection.settings.scripts.run.enabled` | `boolean` | Yes | — | — |
| `inspection.settings.scripts.run.command` | `string \| null` | Yes | — | — |
| `inspection.settings.scripts.archive` | `ProjectScript` | No | — | — |
| `inspection.settings.scripts.archive.enabled` | `boolean` | Yes | — | — |
| `inspection.settings.scripts.archive.command` | `string \| null` | Yes | — | — |

```json
{
  "ok": true,
  "inspection": {
    "framework": "turborepo",
    "settings": {
      "path": ".hoplite/settings.json",
      "previewPort": 3000,
      "invalid": false,
      "scripts": {
        "setup": {
          "enabled": true,
          "command": "pnpm install"
        },
        "run": {
          "enabled": true,
          "command": "pnpm dev"
        },
        "archive": {
          "enabled": false,
          "command": null
        }
      }
    }
  }
}
```

## Response headers

| Header | Type | Statuses | Description |

| --- | --- | --- | --- |

| `RateLimit` | `string` | `200`, `401`, `402`, `403`, `404`, `429`, `500`, `501`, `502`, `503` | Current ingress policy, remaining requests, and seconds until reset, for example `"ingress";r=599;t=60`. |

| `RateLimit-Policy` | `string` | `200`, `401`, `402`, `403`, `404`, `429`, `500`, `501`, `502`, `503` | Ingress quota and window, for example `"ingress";q=600;qu="requests";w=60`. |

| `X-RateLimit-Limit` | `integer` | `200`, `401`, `402`, `403`, `404`, `429`, `500`, `501`, `502`, `503` | Maximum requests allowed in the current rolling window. |

| `X-RateLimit-Remaining` | `integer` | `200`, `401`, `402`, `403`, `404`, `429`, `500`, `501`, `502`, `503` | Requests remaining in the current rolling window. |

| `X-RateLimit-Reset` | `integer` | `200`, `401`, `402`, `403`, `404`, `429`, `500`, `501`, `502`, `503` | Unix timestamp when the current rolling window resets. |

| `x-request-id` | `string` | `200`, `401`, `402`, `403`, `404`, `429`, `500`, `501`, `502`, `503` | Request correlation ID. |

| `Retry-After` | `integer` | `429`, `503` | Seconds until another request should be attempted. |

| `X-Retry-After` | `integer` | `429`, `503` | Legacy retry delay in seconds. |

## Status codes

- `200` — Repository inspection result.

- `401` — The API key is missing, invalid, or lacks the operation's permission.

- `402` — The organization does not have access to the requested product capability.

- `403` — The key's current user no longer has the required organization membership or role.

- `404` — The repository is not connected to the organization.

- `429` — The API-key rate limit has been exceeded.

- `500` — The API encountered an unexpected failure.

- `501` — The deployment has not configured the requested capability.

- `502` — GitHub could not be reached.

- `503` — A required API dependency, including the rate limiter, is unavailable.