---
title: "Upload file as layer"
method: POST
path: "/api/maps/{original_map_id}/layers"
tags: ["Maps"]
---

# Upload file as layer

`POST /api/maps/{original_map_id}/layers`

Uploads spatial data, processes it, and adds it as a layer to the specified map.

Supported formats:
- Vector: Shapefile (as .zip), GeoJSON, GeoPackage, FlatGeobuf
- Raster: GeoTIFF, DEM
- [Point cloud](/guides/visualizing-point-clouds-las-laz/): LAZ, LAS

Once uploaded, Mundi transforms, reprojects, styles, and creates optimized formats for display in the browser.
Vector data is converted to [PMTiles](https://docs.protomaps.com/pmtiles/) while raster data is converted to
[cloud-optimized GeoTIFFs](https://cogeo.org/). Point cloud data is compressed to LAZ 1.3.

Returns the new layer details including its unique layer ID. The layer can optionally not be added to the map,
but will be faster to add to an existing map later.

```py
with open("brazil_watersheds.gpkg", "rb") as f:
    # project ID is PGJSkB1zj7fT, previous map ID is M4NzE8rk4FZS
    result = httpx.post(
        f"https://app.mundi.ai/api/maps/M4NzE8rk4FZS/layers",
        files={"file": ("brazil_watersheds.gpkg", f, "application/octet-stream")},
        data={"layer_name": "Amazon Basin Watersheds", "add_layer_to_map": True},
        headers={"Authorization": f"Bearer {os.environ['MUNDI_API_KEY']}"}
    ).json()

assert result["name"] == "Amazon Basin Watersheds"
assert result["dag_child_map_id"] == "M4NzE8rk4FZS"
# use result["dag_child_map_id"] as the new map id, and view this new uploaded layer
# by navigating to https://app.mundi.ai/project/PGJSkB1zj7fT/M4NzE8rk4FZS
subprocess.run(["open", "https://app.mundi.ai/project/PGJSkB1zj7fT/M4NzE8rk4FZS"])
```

## Path parameters

- `original_map_id` string, required

## Response `200`

Successful Response

- LayerUploadResponse
  - `dag_child_map_id` string, required — The ID of the new map created that contains the changes. Use this ID for further operations on the modified map.
  - `dag_parent_map_id` string, required — The ID of the original map which was copied to create the new map.
  - `id` string, required — Unique identifier for the newly uploaded layer
  - `name` string, required — Display name of the layer as it appears in the map
  - `type` string, required — Layer type (vector, raster, or point_cloud)
  - `url` string, required — Direct URL to access the layer data (PMTiles for vector, COG for raster)
  - `message` string — Status message confirming successful upload

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/buntinglabs/apis/mundi-ai-developer-api.md) · [All operations](https://skmtc.net/buntinglabs/apis/mundi-ai-developer-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/buntinglabs/mundi-ai-developer-api/versions/a74491e93dab/schema)
