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.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” layer_id
required
Layer Id
string
Query Parameters
Section titled “Query Parameters ” request
Request
Request Body required
Section titled “Request Body required ” 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
Responses
Section titled “ Responses ”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>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string