---
title: "Inspect a website before importing it"
method: POST
path: "/api/v1/sites/{slug}/import/url/preflight"
tags: ["Import"]
---

# Inspect a website before importing it

`POST /api/v1/sites/{slug}/import/url/preflight`

## Request

- Base URL: `https://api.dotsy.ai`
- URL: `https://api.dotsy.ai/api/v1/sites/{slug}/import/url/preflight`
- Auth: HTTP bearer

Fetches a few sample pages of the source site and recommends a capture mode for each part of it. It changes nothing and does not need `{slug}` to exist yet. Run it before an import when you are not sure whether the site builds its content with JavaScript.

## Path parameters

- `slug` string, required

## Request body

- ImportPreflightRequest: The site to inspect.
  - `sourceUrl` string, uri, required: The website you plan to import.
  - `samplePaths` string[]: Paths to sample. Default: the home page and the first path segment of `sourceUrl`.
  - `mode` 'auto' | 'mirror' | 'render': The capture mode you intend to use. Default `auto`.

## Response `200`

The recommendation.

- ImportPreflightResult
  - `sourceUrl` string, required
  - `mode` 'auto' | 'mirror' | 'render', required
  - `segments` object[], required: The parts of the site that were sampled, each with a recommended capture mode.
    - `pathPrefix` string, required
    - `mode` 'mirror' | 'render', required: The capture mode Dotsy recommends for this part of the site.
    - `confidence` number, required: 0 to 1: how sure the recommendation is.
    - `signals` string[], required: What was detected (frameworks, empty shells, …).
    - `estimatedRenderPages` number
  - `warnings` string[], required: Pages that could not be fetched (`preflight_404:/path`), automatic switches to render, and framework hints.

## Other responses

- `400`: `sourceUrl` is missing (`invalid_preflight`).
- `401`: Missing or invalid credentials.
- `403`: The role or token cannot use imports (guest token, viewer, read-only key, or a key scoped to other sites).

---

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