Skip to content

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 and the source definition.

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

layer_id
required
Layer Id
string
request
Request
SetStyleRequest
object
maplibre_json_layers
required
Maplibre Json Layers

Array of MapLibre layer objects like fill, line, symbol (style spec v8)

Array
map_id
required
Map Id

Map ID where this new style will be applied

string

Successful Response

SetStyleResponse
object
style_id
required
Style Id

ID of the created style

string
layer_id
required
Layer Id

ID of the layer the style was applied to

string

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string