> For the complete documentation index, see [llms.txt](https://docs.carto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carto.com/carto-for-agents/cli/command-reference/imports.md).

# import

Import a geospatial file into your data warehouse from a local file or URL. Waits for completion by default.

**Supported formats:** CSV, GeoJSON, GeoPackage, GeoParquet, FlatGeobuf (`.fgb`), File Geodatabase (`.gdb.zip`), KML, KMZ, TAB, Shapefile (zip), and ArcGIS Feature/Map Service layer URLs.\
**Size limit:** 5 GB per file.\
**Supported warehouses:** CARTO DW, BigQuery, Snowflake, PostgreSQL, Redshift, Databricks, Oracle.

```bash
carto import --file <path> --connection <name> --destination <table>
carto import --url <url> --connection <name> --destination <table>
carto import status <jobId>                     # Fetch status of an async import job
```

An import that finished but lost rows ends with the status `completed_with_warnings`. The table exists and the CLI exits successfully, printing how many rows were dropped and why: rows without a readable location are in the table without geometry, rows with formatting errors were not imported. With `--json`, the counts are in `metadata.droppedRows`, `metadata.droppedRowReasons` and `metadata.droppedRowsByReason`.

## Options

| Option                | Description                                                              |
| --------------------- | ------------------------------------------------------------------------ |
| `--file <path>`       | Local file to upload (mutually exclusive with `--url`).                  |
| `--url <url>`         | Remote file URL to import (mutually exclusive with `--file`).            |
| `--connection <name>` | (Required) Connection name.                                              |
| `--destination <fqn>` | (Required) Fully qualified table name.                                   |
| `--overwrite`         | Overwrite an existing table (default: false).                            |
| `--no-autoguessing`   | Disable automatic column type detection (default: autoguessing enabled). |
| `--async`             | Return immediately with the job ID instead of polling to completion.     |

## Examples

```bash
# Import local CSV
carto import --file ./data.csv --connection carto_dw --destination project.dataset.my_table

# Import from URL with overwrite
carto import \
  --url https://example.com/data.geojson \
  --connection carto_dw \
  --destination project.dataset.table \
  --overwrite

# Kick off async, then poll status separately
carto import --file ./big.csv --connection carto_dw --destination my.table --async
carto import status <jobId>

# JSON output (for scripts)
carto import --file ./data.geojson --connection carto_dw --destination project.dataset.table --json
```

## CSV auto-detection

For CSV files, CARTO automatically detects geometry columns or builds geometries from lat/lon columns:

* **Geometry columns:** `geom`, `Geom`, `geometry`, `the_geom`, `wkt`, `wkb`.
* **Latitude columns:** `latitude`, `lat`, `Latitude`.
* **Longitude columns:** `longitude`, `lon`, `Lon`, `Longitude`, `lng`, `Lng`.

Disable with `--no-autoguessing` if you need full control over the schema.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.carto.com/carto-for-agents/cli/command-reference/imports.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
