> Documentation index: https://developers.google.com/maps/documentation/llms.txt

The Map Management API is a RESTful API for programmatically managing Cloud-based maps styling resources. It lets you define map styles (`StyleConfig`), manage map IDs (`MapConfig`), and associate styles and datasets with map variants (`MapContextConfig`) without using the Cloud Console.

## Map Management API: key facts

- **Product:** Map Management API
- **Also known as:** Maps Management API
- **Category:** Maps
- **Platform:** Web service (REST)
- **Runs on:** Server (backend code)
- **Launch stage:** GA
- **Lifecycle:** Active
- **Overview:** [Map Management API overview](https://developers.google.com/maps/documentation/mapmanagement/overview.md.txt)

## Map Management API: when to use it

**Use Map Management API when:**

- You need to create, list, update, or delete map IDs (`MapConfig`) programmatically instead of in the Cloud Console.
- You need to manage many map styles or map configurations at scale, such as in automated workflows or internal tools.
- You need to link a style and optional datasets to specific map variants such as `ROADMAP` or `SATELLITE` for a map ID.
- You need a no-charge, OAuth-authenticated REST or gRPC API to manage Cloud-based maps styling resources.
**Don't use Map Management API when:**

- You can only authenticate with an API key; the Map Management API supports OAuth 2.0 only.
- You need to manage Google Maps Platform configurations other than Cloud-based maps styling resources; those may still need the Cloud Console.
- You need to display or render a styled map in a web page. Use [Maps JavaScript API](https://developers.google.com/maps/documentation/javascript/quick-reference.md.txt) instead.

## Map Management API: setup

- **Service to enable:** `mapmanagement.googleapis.com`
- **Authentication:** OAuth 2.0, Service account (API keys, including Maps Demo Keys, aren't supported)
- **Get started:** [Set up Map Management API](https://developers.google.com/maps/documentation/mapmanagement/cloud-setup.md.txt)
- **Reference:** [Map Management API reference](https://developers.google.com/maps/documentation/mapmanagement/reference/rest.md.txt)
- **Pricing:** [Map Management API usage and billing](https://developers.google.com/maps/documentation/mapmanagement/usage-and-billing.md.txt)
- **Policies:** [Map Management API policies](https://developers.google.com/maps/documentation/mapmanagement/policies.md.txt)
- **Release notes:** [Map Management API release notes](https://developers.google.com/maps/documentation/mapmanagement/release-notes.md.txt)

## Map Management API: related products

- **Often used with:** [Maps Datasets API](https://developers.google.com/maps/documentation/datasets/quick-reference.md.txt)

## Map Management API: common mistakes

- **Problem:** Requests authenticated with an API key fail with HTTP 401; the Map Management API supports OAuth 2.0 and service accounts only. **Fix:** Authenticate with an OAuth 2.0 token that has the `https://www.googleapis.com/auth/cloud-platform` scope, for example from Application Default Credentials or a service account. See [/maps/documentation/mapmanagement/oauth_token](https://developers.google.com/maps/documentation/mapmanagement/oauth_token.md.txt).
- **Problem:** A new `MapConfig` defaults to the `RASTER` map type, so you get a raster map if you don't set the type. **Fix:** Set `map_type` to `VECTOR` explicitly in the `MapConfig` when you need a vector map. See [/maps/documentation/mapmanagement/guide-and-examples](https://developers.google.com/maps/documentation/mapmanagement/guide-and-examples.md.txt).
- **Problem:** Omitting `map_variants` on `MapContextConfig` fails with `INVALID_ARGUMENT` (at least one styled variant is required), and an empty or unset style sheet in `StyleConfig` falls back to the unstyled base map. **Fix:** Always list every map variant you need in `map_variants` (light and dark variants can't be mixed in one `MapContextConfig`), and provide a style in `StyleConfig` (`json_style_sheet` as a string, or `style_sheet` as a JSON object; `style_sheet` takes precedence if you set both). See [/maps/documentation/mapmanagement/guide-and-examples](https://developers.google.com/maps/documentation/mapmanagement/guide-and-examples.md.txt).
- **Problem:** Requests made with user credentials need the `X-Goog-User-Project` header, which sets the project used for billing and quota. **Fix:** Send `X-Goog-User-Project` with your project number or ID. You can omit it when you authenticate with a service account. See [/maps/documentation/mapmanagement/request](https://developers.google.com/maps/documentation/mapmanagement/request.md.txt).

## What you can do with Map Management API

See the guides linked below for each task, or compare across products in the
[Capabilities Explorer](https://developers.google.com/maps/documentation/capabilities-explorer.md.txt).

- [Create, get, list, update, and delete Cloud-based map IDs programmatically.](https://developers.google.com/maps/documentation/mapmanagement/guide-and-examples.md.txt#working_with_mapconfigs) **Note:** Requires OAuth 2.0 or service account authentication (API keys aren't supported). Manages `MapConfig` resources; defaults to `RASTER` unless `map_type` is set to `VECTOR`, and supports map features such as building flattening and POI boost level.
- [Create, get, list, update, and delete Cloud-based JSON map style configurations programmatically.](https://developers.google.com/maps/documentation/mapmanagement/guide-and-examples.md.txt#working_with_styleconfigs) **Note:** Requires OAuth 2.0 or service account authentication (API keys aren't supported). Manages `StyleConfig` resources; an empty or unset style sheet falls back to the unstyled base map.
- [Associate Cloud-based map styles and datasets with specific map variants for a map ID.](https://developers.google.com/maps/documentation/mapmanagement/guide-and-examples.md.txt#working_with_mapcontextconfigs) **Note:** Requires OAuth 2.0 or service account authentication (API keys aren't supported). Manages `MapContextConfig` child resources under a `MapConfig` (create, get, list, update, and delete); requires at least one map variant and can't mix light and dark variants.