---
title: "`POST /styles`; create a style: validate and compile the theme, store it as version 1 under a freshly generated id."
method: POST
path: "/styles"
tags: ["styles"]
---

# \`POST /styles\`; create a style: validate and compile the theme, store it as version 1 under a freshly generated id.

`POST /styles`

## Request

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

## Request body

- CreateStyleRequest: Body for `POST /styles`.
  - `name` string, required: Human-readable style name (1–120 characters); its kebab-case slug seeds the style id.
  - `theme` unknown

## Response `201`

Style created as version 1

- CreatedStyleResponse: Response for `POST /styles`.
  - `id` string, required: The generated style id.
  - `style_url` string, required: Immutable URL of the compiled style.
  - `theme` unknown, required
  - `version` integer, required: The published version (always 1 on create).

## Other responses

- `400`: Malformed request or name
- `404`: Hosted styles not configured on this gateway
- `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)
