Skip to main content
For the complete documentation index, see llms.txt.

Styles

Map styles and their drafts. Every style carries a published version and a draft; Mapbox Studio edits the draft, and the three draft commands read and write it. A style's sprite sits at the same URLs but has a command group of its own. Every command also takes the common flags — --username/-u, --token/-t, --profile, --id — described in Shared parameters.

mapbox styles list

Metadata for every style in an account.

Parameters:

ParameterDescription
--draftWhen present, includes draft styles in the listing.
--startStyle ID to use as a pagination cursor (exclusive).
--limitMaximum number of styles to return.
--deletedWhen true, returns recently deleted styles instead of active ones.

Examples:

mapbox styles list
mapbox styles list --limit 5

mapbox styles get

One style document, conforming to the Mapbox Style Specification.

Parameters:

ParameterDescription
<style-id>Unique identifier for the style.
--downloadWhen present, returns the style as a downloadable JSON file attachment.
--optimizeWhen true, rewrites vector source URLs for cache optimization.

Examples:

mapbox styles get ckstyle00000000000000001a
mapbox styles get ckstyle00000000000000001a -o json > style.json

mapbox styles create

Adds a new style. The server fills in created, id, modified, owner and the sprite URL; name defaults to the style ID if the body omits it.

Parameters:

ParameterDescription
--data/-dRequest body as JSON string

Examples:

mapbox styles create \
-d '{"name":"My Style","version":8,"sources":{},"layers":[]}'

mapbox styles update

Modifies an existing style. The body needs name, and must not carry created or modified. A cross-version update — v7 to v8 — fails.

Parameters:

ParameterDescription
<style-id>Unique identifier for the style.
--data/-dRequest body as JSON string

Examples:

mapbox styles update ckstyle00000000000000004d \
-d '{"name":"Renamed","version":8,"sources":{},"layers":[]}'

mapbox styles delete

Removes a style and its sprites. Mapbox keeps a deleted style recoverable for 30 days, but the CLI has no command to bring one back.

Parameters:

ParameterDescription
<style-id>Unique identifier for the style.

Examples:

mapbox styles delete ckstyle00000000000000003c

mapbox styles draft get

The draft version of a style. With no draft, the published style comes back instead — which is also how you can tell a draft was discarded.

Parameters:

ParameterDescription
<style-id>Unique identifier for the style.

Examples:

mapbox styles draft get ckstyle00000000000000004d

mapbox styles draft update

Updates the draft, creating one from the published version if none exists. The published style stays as it was until Studio publishes the draft.

Parameters:

ParameterDescription
<style-id>Unique identifier for the style.
--data/-dRequest body as JSON string

Examples:

mapbox styles draft update ckstyle00000000000000004d \
-d '{"name":"Work in progress","version":8,"sources":{},"layers":[]}'

mapbox styles draft delete

Discards the draft, reverting the style to its published version.

Parameters:

ParameterDescription
<style-id>Unique identifier for the style.

Examples:

mapbox styles draft delete ckstyle00000000000000004d
Was this page helpful?