---
title: "`POST /styles/{id}`: publish a new immutable version of an existing style (existing versions are never modified)."
method: POST
path: "/styles/{spec}"
tags: ["styles"]
---

# \`POST /styles/{id}\`: publish a new immutable version of an existing style (existing versions are never modified).

`POST /styles/{spec}`

## Request

- Base URL: `https://api.mapmap.ai`
- URL: `https://api.mapmap.ai/styles/{spec}`
- Auth: one of:
  - HTTP bearer
  - API key in query parameter `api_key`

## Path parameters

- `spec` string, required

## Request body

- UpdateStyleRequest: Body for `POST /styles/{id}`.
  - `theme` unknown, required

## Response `200`

New version published

- StyleVersionResponse: Response for `POST /styles/{id}`.
  - `id` string, required: Style id.
  - `style_url` string, required: Immutable URL of the compiled style at this version.
  - `version` integer, required: The newly published, immutable version.

## Other responses

- `400`: Malformed request
- `404`: Hosted styles not configured or unknown style
- `422`: Theme failed sn-style validation; the body's `problems` list names the offending slot or layer

---

[API](https://skmtc.dev/mapmap/apis/sn-gateway.md) · [All operations](https://skmtc.dev/mapmap/apis/sn-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/mapmap/apis/sn-gateway/revisions/2293be8b4c38?raw)
