---
title: "Set layer style"
method: POST
path: "/api/layers/{layer_id}/style"
tags: ["Layers"]
---

# Set layer style

`POST /api/layers/{layer_id}/style`

Sets a layer's active style in the map to a MapLibre JSON layer list.

This operation will fail if the style is invalid according to the
[style spec](https://maplibre.org/maplibre-style-spec/layers/) and the source
definition.

Returns the created style_id and confirmation that it has been applied.

## Path parameters

- `layer_id` string, required

## Request body

- SetStyleRequest
  - `maplibre_json_layers` unknown[], required — Array of MapLibre layer objects like fill, line, symbol [(style spec v8)](https://maplibre.org/maplibre-style-spec/)
    - unknown
  - `map_id` string, required — Map ID where this new style will be applied

## Response `200`

Successful Response

- SetStyleResponse
  - `style_id` string, required — ID of the created style
  - `layer_id` string, required — ID of the layer the style was applied to

## Other responses

- `422` — Validation Error

## Changes

- **2025-08-30** `012ea1e4fbf8` — 1 warning
  - deleted the `query` request parameter `request`
- **2025-08-01** `6abed2737dbb` — 1 info
  - endpoint added
- **2025-07-30** `61b2addd3ef0` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/buntinglabs/apis/mundi-ai-developer-api/changes/api/layers/:layer_id/style/post.md)

---

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