---
title: "Inspect Import For Project"
method: POST
path: "/api/v1/import/{project_id}/inspect"
tags: ["import"]
---

# Inspect Import For Project

`POST /api/v1/import/{project_id}/inspect`

Door 2 inspect: same parse + detection, fenced against the project's county.

Geometry files additionally report how many features fall inside vs outside
``projects.county_fips`` so the dialog can preview the out-of-scope bucket
before commit.

## Response `200`

Successful Response

- ImportInspectResponse — Everything the detection card and downstream flow need from one parse. ``rows`` is populated only for address-eligible files at or under the address cap (or after truncation consent) — geometry and plain-table routes commit by re-sending the file blob, so their rows never ship. All cell values are stringified; ``None`` marks a genuinely empty cell. ``upload_token`` accompanies ``rows`` and redeems the SERVER's copy of that same row set at commit. The client's ``rows`` drive the column mapper and the resolve queries; they are never sent back as data.
  - `filename` string, required
  - `columns` string[], required
  - `row_count` integer, required
  - `input_rows` integer, required
  - `truncated` boolean, required
  - `caps` ImportCaps, required — Row caps the client renders and gates on — served here so the numbers have exactly one home (the server) and can't drift across surfaces.
    - `address_rows` integer, required
    - `layer_rows` integer, required
  - `geometry_mode` 'geojson' | 'lat_lon' | 'wkt' | 'vector' | 'none', required
  - `detection` ImportDetection, required — Detected route plus the address-like columns that motivated it. The route is a heuristic first offer — the card's manual override is the escape hatch, so a wrong guess costs one click.
    - `route` 'address' | 'geometry' | 'table' | 'both', required
    - `address_candidates` string[], required
    - `header_candidates` string[], required
  - `preview_rows` object[], required
  - `rows` object[], nullable
  - `upload_token` string, nullable
  - `county` ImportCountyScope — County derivation for geometry files: per-county feature counts and the dominant (modal) county to pre-select. ``derivable`` is False when no feature landed in any county. ``located_count`` counts rows carrying ANY geometry — it can exceed ``sum(breakdown)`` when points fall outside every county, and those rows are still fenced (dropped) at upload, so clients must predict fence outcomes from it, never from the breakdown sum. The scope counts are present only when the inspect ran against an existing project (Door 2), fencing against that project's county.
    - `breakdown` object, required
    - `dominant` string, nullable, required
    - `derivable` boolean, required
    - `located_count` integer, required
    - `in_scope_count` integer, nullable
    - `out_of_scope_count` integer, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/maia-analytics/apis/maia-api.md) · [All operations](https://skmtc.net/maia-analytics/apis/maia-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/maia-analytics/maia-api/versions/ba2b8d962161/schema)
