---
title: "Preview an import"
method: POST
path: "/v3/imports/preview"
tags: ["Imports"]
---

# Preview an import

`POST /v3/imports/preview`

Inspects a file and returns the schema CARTO would use to import it,
without importing anything.

Use the returned `columns` as a starting point for the `schema` of a
manual import.

## Request body

- object
  - `connection` string, required — Name of the connection to import through.
  - `url` string, uri, required — Public URL of the file to inspect.

## Response `201`

The detected schema.

- ImportPreview
  - `columns` ImportColumn[] — The columns CARTO detected.
    - `name` string, required
    - `type` string, required — A data type supported by the destination data warehouse.
    - `nullable` boolean
    - `width` integer
    - `precision` integer
    - `scale` integer
  - `options` object[] — Data types available in the destination data warehouse.
    - `name` string
  - `raster` boolean
  - `source` object — Details about the source file.

## Other responses

- `400` — The request is malformed or a parameter failed validation.
- `401` — The token is missing, malformed or expired.
- `403` — The token doesn't grant access to this resource.
- `404` — The connection doesn't exist.
- `429` — You went over the [rate limit](#rate-limits) for this API.

---

[API](https://skmtc.net/gitbookio/apis/carto-api.md) · [All operations](https://skmtc.net/gitbookio/apis/carto-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gitbookio/carto-api/revisions/019f79ecdd6c/schema)
