# Overlays

> Canonical URL: https://docs.mountaya.com/en/apis/tiles/reference/overlays/
> Last updated: 2026-11-26
> Rules for agents: https://docs.mountaya.com/llms.txt#rules-for-agents

Raster and vector overlays (slope, aspect, weather, points of interest) as tiles and as the specification a client needs to style and read them.

## The Overlay object

A built-in overlay layer drawn on top of a terrain base map, such as slope steepness or snow depth. Carries everything needed to add it to a map: the tile sources to register and which side of the wire handles each optional capability.

- `capabilities` (object, required): Which of this overlay's options each side of the wire resolves, so read this before building the control. Where `server.timestamp` is true, a tile's `timestamp` selects the instant it depicts. Where it is false, the instant sent is ignored, and any change over time is the client's to draw from what it already holds. Two settings are refused. A `timestamp` that is not an RFC 3339 instant, or that lies more than three days before or six days after the request, is a `400` on every overlay tile, whether or not the overlay has a time dimension. Where `server.timestamp` is true, an instant more than 15 minutes from the current one is a `403` unless the organization's `with_overlays_control` safety rule allows it, a share-token request included.
  - `client` (object, required): Which of the optional behaviours the CLIENT is expected to provide for this overlay, such as restyling data it already holds when the moment changes.
    - `timestamp` (boolean, required): Whether this side of the wire resolves the moment the overlay depicts.
  - `server` (object, required): Which of the optional behaviours the SERVER provides for this overlay, such as serving the tile for a requested instant.
    - `timestamp` (boolean, required): Whether this side of the wire resolves the moment the overlay depicts.

- `content_type` (string, required, one of: `image/png`, `application/x-protobuf`, `image/webp`): What the overlay's tiles carry, which decides how they are drawn: a raster overlay is an image layer, a vector one is styled by the layers its specification declares. For a raster overlay it names the format of the tiles within its source's zoom range; a tile asked for deeper than that is cut from its ancestor and is always PNG, so read each tile's `Content-Type` header rather than this.

- `id` (string (uuid), required): Identifier of the overlay. `slug` is the value the Tile API takes; this is the one the catalog keys on.

- `locales` (object, required): The overlay's display name and blurb per language. A language absent here is null rather than missing, which is the case to fall back from.
  - `de` (LocaleMap | null, required): The German strings for this legend. Null when the legend carries no German translation, which is the case a client falls back from rather than renders.
  - `en` (LocaleMap | null, required): The English strings for this legend. Null when the legend carries no English translation, which is the case a client falls back from rather than renders.
  - `es` (LocaleMap | null, required): The Spanish strings for this legend. Null when the legend carries no Spanish translation, which is the case a client falls back from rather than renders.
  - `fr` (LocaleMap | null, required): The French strings for this legend. Null when the legend carries no French translation, which is the case a client falls back from rather than renders.
  - `it` (LocaleMap | null, required): The Italian strings for this legend. Null when the legend carries no Italian translation, which is the case a client falls back from rather than renders.
  - `ja` (LocaleMap | null, required): The Japanese strings for this legend. Null when the legend carries no Japanese translation, which is the case a client falls back from rather than renders.
  - `zh` (LocaleMap | null, required): The Chinese strings for this legend. Null when the legend carries no Chinese translation, which is the case a client falls back from rather than renders.

- `slug` (string, required): Stable, URL-safe identifier of the overlay, and the value the Tile API takes in `/v1/overlays/{overlay}/...`. Lowercase letters, digits and single hyphens, so it is safe in a path segment without escaping. The shape is declared here and on that path parameter identically, because a value this read hands a client is a value that client sends straight back.

- `sources` (array of TileSource, required): Tile sources to register with the map renderer before this overlay can be drawn.
  - `attribution` (string): Attribution HTML to display on the map for this source: the credit of whoever supplies its data, Mountaya for a resource source and the data provider for an overlay. Pass through to the `attribution` option of `map.addSource()`.
  - `id` (string, required): Unique source identifier. Use it as the first argument to `map.addSource()` and as the `source` of every layer that draws from it.

    Declared as a string rather than a UUID so that it stays opaque: a resource source is named by the resource's id, and an overlay or aggregate source by a fixed identifier of its own. Every one of them is spelled as a UUID, but that shape is not part of this contract, so treat it as an opaque string and match it against a layer's `source` rather than parsing it.
  - `layers` (array of TileLayer, required): Render-layers to draw from this source, in paint order. Each becomes one `map.addLayer()` call.
    - `filter` (array of any): Optional MapLibre/Mapbox filter expression restricting which features the layer renders. Pass through to the `filter` option of `map.addLayer()`. Omitted when no filter applies; never null and never an empty array.
    - `id` (string, required): Unique layer identifier. Use it as the first argument to `map.addLayer()`.

      A composite path rather than a UUID, for example `itineraries/<itinerary_id>/lines`. Treat it as an opaque string: the shape is a rendering detail and is free to change, and it is the only kind of `id` on this surface that a UUID parser would reject.
    - `key` (string, required): Stable, human-readable concept slug grouping render-layers that depict the same map concept (e.g. "parking", "hillshade"). Unlike `id`, which is the per-layer unique identifier, `key` MAY repeat across several layers of the same overlay when one concept is rendered with multiple layers (a fill plus a symbol, for instance). Clients group and toggle layers by `key`; `id` remains the uniqueness guarantee.

      The empty string is a real value, and means this layer belongs to no named concept: an itinerary's own line layers carry it. Group by `key` only after discarding the empty ones, or every unnamed layer collapses into one group.
    - `layout` (object | null, required): MapLibre/Mapbox layout properties for this layer (e.g. `visibility`, symbol placement). Pass through to the `layout` option of `map.addLayer()`. Null when the layer needs no layout overrides.
    - `legend` (object): Optional legend describing how to read the layer's colors or scale. Drives the map UI legend; not consumed by `map.addLayer()`. Omitted when the layer has no legend; never null.
      - `kind` (string, one of: `row`, `compass`): How the legend is laid out: `row` draws the steps below as an ordered row of color swatches, and `compass` as a compass dial, for a directional overlay such as aspect/slope.
      - `locales` (object, required): The legend's title and step labels per language. A language absent here is null rather than missing, which is the case to fall back from.
        - `de` (LocaleMap | null, required): The German strings for this legend. Null when the legend carries no German translation, which is the case a client falls back from rather than renders.
        - `en` (LocaleMap | null, required): The English strings for this legend. Null when the legend carries no English translation, which is the case a client falls back from rather than renders.
        - `es` (LocaleMap | null, required): The Spanish strings for this legend. Null when the legend carries no Spanish translation, which is the case a client falls back from rather than renders.
        - `fr` (LocaleMap | null, required): The French strings for this legend. Null when the legend carries no French translation, which is the case a client falls back from rather than renders.
        - `it` (LocaleMap | null, required): The Italian strings for this legend. Null when the legend carries no Italian translation, which is the case a client falls back from rather than renders.
        - `ja` (LocaleMap | null, required): The Japanese strings for this legend. Null when the legend carries no Japanese translation, which is the case a client falls back from rather than renders.
        - `zh` (LocaleMap | null, required): The Chinese strings for this legend. Null when the legend carries no Chinese translation, which is the case a client falls back from rather than renders.
      - `steps` (array of TileLegendStep): Ordered color stops mapping a value (or bucket) to the color the layer paints for it, from low to high. Drives a graduated or categorical legend.
        - `color` (string, required): CSS color the layer paints for this step (e.g. "#1c7ed6"). Matches the color used in the layer's paint expression.

          Case-insensitive, unlike the colors on an itinerary's segments, waypoints and segment groups. Those are values a caller wrote, normalized to the six-digit lowercase form on the way in; this one is read from the layer's own palette and served in whatever case that palette is written in. Compare these case-insensitively rather than by string equality.
        - `step` (string, required): Label for the value or bucket this color represents, such as a threshold like "20" or a range like "25 - 30". It is the same in every language: the legend's translated text is in its `locales`.
      - `unit` (string, one of: `km/h`, `degrees`, `m`, `cm`, `celsius`, `percent`): The unit the step values are measured in, for the suffix a legend prints beside each one. Absent when the steps are categories rather than quantities.
    - `paint` (object | null, required): MapLibre/Mapbox paint properties for this layer (colors, opacity, widths, data-driven expressions). Pass through to the `paint` option of `map.addLayer()`. Null when the layer relies on style defaults.
    - `source` (string): Identifier of the source this layer draws from. Matches the `id` of the enclosing tile source.
    - `source_layer` (string, required): Name of the layer within a vector tile to render (e.g. "fills", "points", "lines"). Pass through to the `source-layer` option of `map.addLayer()`. Only meaningful for vector sources.
    - `type` (string, required, one of: `raster`, `hillshade`, `fill`, `line`, `circle`, `symbol`): How this layer draws, and what `paint` may carry: a map library maps it onto its own layer type, so pass it through rather than inferring one from the source.
    - `zoom_max` (integer (int32), required): Highest zoom level at which the layer is drawn. Pass to the `maxzoom` option of `map.addLayer()`.
    - `zoom_min` (integer (int32), required): Lowest zoom level at which the layer is drawn. Pass to the `minzoom` option of `map.addLayer()`.
  - `size` (integer (int32), one of: `256`, `512`): Edge length in pixels of one raster tile, for `map.addSource()`'s `tileSize`. Omitted for vector sources, which have no pixel size of their own.
  - `tiles` (array of string, required): Tile URL templates with `{z}`, `{x}`, and `{y}` placeholders that the map library expands per tile. Usually a single entry pointing at the matching `{z}/{x}/{y}` endpoint. Hand the template to the map library with its placeholders intact: the library substitutes them as it pans and zooms, so a template expanded before it is handed over produces one tile rather than a map. An overlay's template, and in a layer catalog the itinerary and zone layers' templates, carry the `organization_id` the specification or the catalog was asked for with, when one was sent, as a query string of its own, so a credential added to such a template joins it with `&` rather than starting a second `?`.
  - `type` (string, required, one of: `vector`, `raster`, `raster-dem`): What kind of data the source serves, which decides how a map library reads its tiles. A `raster-dem` source carries elevation rather than pixels, so it feeds terrain and hillshade rather than being drawn directly.
  - `zoom_max` (integer (int32), required): Deepest zoom a map library requests this source's tiles at. A layer drawn from the source can reach deeper, and a map overzooms the source's tiles for it. It says where to ask rather than what is refused: a tile asked for deeper is still served, and on a specification served to a publishable key the value is brought within the organization's zoom bounds.
  - `zoom_min` (integer (int32), required): Shallowest zoom a map library requests this source's tiles at. Like `zoom_max`, it says where to ask rather than what is refused, and on a specification served to a publishable key it is brought within the organization's zoom bounds.

### An example Overlay

```json
{
  "id": "5e1de8a6-7930-445a-8145-5301cf3c25f7",
  "slug": "wind",
  "content_type": "application/x-protobuf",
  "capabilities": {
    "client": {
      "timestamp": false
    },
    "server": {
      "timestamp": true
    }
  },
  "locales": {
    "de": null,
    "en": {
      "name": "Wind"
    },
    "es": null,
    "fr": {
      "name": "Vent"
    },
    "it": null,
    "ja": null,
    "zh": null
  },
  "sources": [
    {
      "id": "5e1de8a6-7930-445a-8145-5301cf3c25f7",
      "type": "vector",
      "attribution": "<a href=\"https://www.meteoblue.com/\" target=\"_blank\">&copy; meteoblue</a>",
      "tiles": [
        "https://tiles.mountaya.com/v1/overlays/wind/{z}/{x}/{y}"
      ],
      "zoom_min": 7,
      "zoom_max": 18,
      "layers": [
        {
          "id": "overlay/b2618568-38a1-449b-8318-386b9b42cb4e",
          "key": "wind",
          "type": "fill",
          "source": "5e1de8a6-7930-445a-8145-5301cf3c25f7",
          "source_layer": "windLayer",
          "zoom_min": 7,
          "zoom_max": 18,
          "layout": null,
          "paint": {
            "fill-color": "#5D8DBD",
            "fill-opacity": 0.6
          }
        }
      ]
    }
  ]
}
```

## Retrieve the tile specification for a map overlay

### GET /v1/overlays/{overlay}/specification

- Operation: `getOverlaySpecification`
- Requires: scope `tiles`
- Behavior: idempotent, safe to retry · answers within 30000 ms or times out

Returns the tile specification (sources and layers) for rendering a map overlay on a MapLibre GL map. The response includes tile URLs, layer configuration, paint properties, legend data with units, and zoom range constraints needed to add the overlay as a source.

Overlays can be either vector or raster sources depending on the data type. The specification includes legend information with color scales and unit labels (e.g., km/h for wind speed, meters for snow depth).

The optional `organization_id` names the studio scope the overlay is drawn for, and the URL templates the specification returns carry it on to every tile.

A publishable key needs the `tiles` scope, or `publishing` on a request from a page on Mountaya's own domain. A share token carries its own authority and needs none.

**Path parameters**

- `overlay` (string, in path, required): Overlay slug, such as `wind` or `snowdepth`. It is the `slug` this API's `getTileLayers`, and the Map Studio API's `getLayers`, report for each overlay, and it carries that field's shape exactly: lowercase letters, digits and single hyphens. Which overlays a publishable key or a share token may draw is set by the organization's overlay allowlist safety rule, and an overlay outside it answers 403 rather than 404. The allowlist starts empty on a new organization, which admits no overlay, so every slug answers 403 under a key until the allowlist names slugs or `*`, which Mountaya sets as the organization's agreement states. From Mountaya's web application the studio scope `organization_id` names decides instead, and an overlay outside it answers 403 as well. Read the matching specification endpoint for the ones it serves.

**Query parameters**

- `organization_id` (string (uuid), in query, optional): The studio scope the map draws in, named by the organization's identifier. A value that is not a UUID in its canonical form, or the nil UUID, is a `400` naming `organization_id`.

  Under a publishable key or a share token it may name only the credential's own organization: any other identifier is a `403`, whether or not it exists. It changes nothing but being echoed, so a request sending it is answered as one that omits it, and every URL template an answer returns under `sources[].tiles` for a layer that takes it carries the same `organization_id`.

  A request from Mountaya's web application, which carries the person's own session rather than a key or a share token, uses it to choose the scope it draws in. Omitted, the scope is the person's own space, which has no identifier of its own to send. Naming an organization the person is a member of makes that organization the scope. Any other identifier, an organization the person is not a member of or one that does not exist, is a `404`, so the parameter cannot be used to learn which organizations exist.

  What a scope draws depends on the layer. The overlays served under a key or a share token are the ones the organization's overlay allowlist admits. From Mountaya's web application, the person's own space draws the points of interest alone, and an organization draws every overlay when it holds Map Studio and the points of interest alone when it does not, an overlay outside the scope being a `403`. The itinerary and zone tiles draw what the scope holds: in the person's own space, their own itineraries and zones, which belong to no organization, and in an organization, its itineraries and zones, never those of another space the person belongs to.

Also takes `Accept-Language`, as every operation of this API does: the [overview](https://docs.mountaya.com/en/apis/tiles/reference.md) describes it.

**Response** `200`

Tile specification: the sources and render-layers to register before the map starts fetching this overlay's `{z}/{x}/{y}` tiles. When the request named an `organization_id`, every URL template under `sources[].tiles` carries the same `organization_id`, so the tiles a map fetches are drawn in the scope the specification was served for.

- `extensions` (object): Top-level extensions map for 2xx responses. Mirrors the GraphQL-spec response extensions: a free-form map for response-scoped metadata.
  - `metadata` (object): Response-scoped metadata. Its shape is per-operation: the operation that emits it names the schema, and an operation that documents none never emits this field.

- `data` (TileSpecification, required): Rendering specification for a tile resource. Returned by every `/specification` endpoint and consumed once while a map is initializing: iterate `sources` and call `map.addSource()` for each, then iterate the `layers` inside each source and call `map.addLayer()` for each. The map library then fetches the `{z}/{x}/{y}` tiles automatically. A collection's specification also carries `bbox`, the extent of the itineraries its tiles draw, which is where to fit the camera once the sources are registered.

  Served to a publishable key, every `zoom_min` and `zoom_max` in it is already narrowed to the organization's zoom-bounds safety rule, so a map that follows it asks only for tiles that rule serves. A layer's range is intersected with the bounds, and a layer whose range lies wholly outside them is left out, as is a source left with no layer. A source's own range is clamped into the bounds rather than intersected, so a source whose tiles stop below the bounds still reports a range inside them, and the tiles past its own ceiling are cut from their ancestors.

  See [the TileSpecification object](https://docs.mountaya.com/en/apis/tiles/reference/itineraries.md#tile-specification-object).

**Errors** `400`, `401`, `402`, `403`, `404`, `405`, `429`, `500`, `504`. See [Errors](https://docs.mountaya.com/en/apis/conventions/errors.md).

- `400`: Bad Request
- `401`: Unauthorized
- `402`: A publishable-key request from an organization whose entitlements do not grant the capability the request needs: `tiles`, or `publishing` on a request from a page on Mountaya's own domain. Both are granted by the organization's agreement with Mountaya, so this clears when the agreement changes rather than when the request does. No tile and no specification is served for it. The capability is checked before the key's scope, so a key that lacks the scope as well is answered this rather than a `403`. It is not a permissions failure and does not clear by changing the request. A share-token request is never answered with this status: a share link is never refused for a capability.
- `403`: The credential is valid and this operation is not open to it: the key does not carry the scope the request needs (`tiles`, or `publishing` on a request from a page on Mountaya's own domain), or the request's page is not an allowed one: under a key, one outside the organization's allowed domains, and under a share token, any page not on Mountaya's own domain. An overlay outside the organization's overlay allowlist is refused here as well, under a key or a share token. The allowlist starts empty on a new organization, which admits no overlay, so every overlay is refused here until it names slugs or `*`, which Mountaya sets as the organization's agreement states. So is an `organization_id` naming an organization other than the credential's own, whether or not it exists, and, from Mountaya's web application, an overlay outside the studio scope `organization_id` names: every overlay but the points of interest in the person's own space, or in an organization that does not hold Map Studio.
- `404`: No overlay is published under that slug. An overlay that exists but is not on the organization's allowlist is a 403 rather than this, so the two questions stay apart. From Mountaya's web application, an `organization_id` naming an organization the person is not a member of, or one that does not exist, is answered this as well.
- `405`: The path takes `GET`, `HEAD`, which answers the headers a `GET` would with no body, and `OPTIONS` as a CORS preflight, and nothing else. Every route on this surface reads, so a write method is refused before the credential is even looked at, which is why this answers ahead of `401`. The `Allow` response header names the methods the path does take.
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
# The specification is JSON in the usual envelope: register everything under
# .data.sources, then the layers inside each source.
curl -s "https://tiles.mountaya.com/v1/overlays/snowdepth/specification" \
  -H "X-API-Key: pk_your_publishable_key" | jq '.data.sources[] | {id, type, tiles, zoom_min, zoom_max}'
```

**TypeScript**

```typescript
import { Mountaya } from "@mountaya/client";

const mountaya = new Mountaya({
  credential: { publishableKey },
});

const { data } = await mountaya.tiles.getOverlaySpecification({ overlay: "snowdepth" });

console.log(data);
```

**Python**

```python
import requests

response = requests.get(
    "https://tiles.mountaya.com/v1/overlays/snowdepth/specification",
    headers={
        "X-API-Key": "pk_your_publishable_key",
    },
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 200:

```json
{
  "data": {
    "sources": [
      {
        "id": "fc79978a-0e9c-4491-a5e4-b0de35a8b508",
        "type": "vector",
        "attribution": "<a href=\"https://mountaya.com/\" target=\"_blank\">&copy; Mountaya</a>",
        "tiles": [
          "https://tiles.mountaya.com/v1/zones/{z}/{x}/{y}"
        ],
        "zoom_min": 5,
        "zoom_max": 18,
        "layers": [
          {
            "id": "zones/fc79978a-0e9c-4491-a5e4-b0de35a8b508/fills",
            "key": "",
            "type": "fill",
            "source": "fc79978a-0e9c-4491-a5e4-b0de35a8b508",
            "source_layer": "fills",
            "zoom_min": 5,
            "zoom_max": 18,
            "layout": null,
            "paint": {
              "fill-color": [
                "match",
                [
                  "get",
                  "level"
                ],
                "info",
                "#1c7ed6",
                "warning",
                "#f59f00",
                "danger",
                "#f03e3e",
                "resolved",
                "#37b24d",
                "#1c7ed6"
              ],
              "fill-opacity": 0.3
            }
          }
        ]
      }
    ]
  }
}
```

## Retrieve a tile of a map overlay

### GET /v1/overlays/{overlay}/{z}/{x}/{y}

- Operation: `getOverlayTile`
- Requires: scope `tiles`
- Behavior: idempotent, safe to retry · answers within 30000 ms or times out

Returns a tile (raster or vector) for a map overlay at the given zoom level, x, and y coordinates. Overlays include weather layers such as wind speed and snow depth, terrain analyses such as slope steepness, and points of interest.

The weather, snow and points-of-interest overlays return Mapbox Vector Tile (MVT) binary data and must be used as a `vector` source. The terrain overlays return raster images, WebP or PNG as the `Content-Type` header says: hillshade must be used as a `raster-dem` source with a `hillshade` layer, and slope steepness and aspect/slope as a `raster` source with a `raster` layer. A tile asked for past its source's `zoom_max` is cut from the source's tile at that zoom, as a map library overzooms it on its own, so no `z` from 0 to 22 is refused for its depth: a raster overlay's cut is always PNG, and a vector overlay's is a vector tile.

Details for consuming an overlay can be found in [the specification endpoint](https://docs.mountaya.com/en/apis/tiles/reference/overlays.md#getOverlaySpecification).

This route is consumed as a URL template rather than called directly. The matching specification endpoint returns it under `sources[].tiles` with the `{z}`, `{x}` and `{y}` placeholders intact, and a map library (MapLibre GL JS, Mapbox GL JS, or `@mountaya/elements`) expands and fetches them on its own schedule. The generated SDKs bind no method for it.

Every overlay starts at zoom 7; the ceiling is what differs, and it is 18 for the weather overlays, 14 for hillshade, and 22 for the terrain analyses and POIs. Those are the layers' ceilings: the sources of the terrain analyses stop at 14 and that of the POIs at 15, and a map overzooms their tiles past it. Read the specification endpoint for the exact `zoom_min` and `zoom_max` of each layer rather than those figures: they say where a map should ask for tiles, and a specification served to a publishable key reports them already narrowed to the organization's zoom-bounds safety rule. What refuses a `z` is that rule: a publishable-key request for a tile outside the organization's zoom bounds or geographic boundaries is a `400`.

The optional `organization_id` names the studio scope the tile is drawn for. A map that follows the specification sends the value the specification was served for, because its URL templates carry it.

A publishable key needs the `tiles` scope, or `publishing` on a request from a page on Mountaya's own domain. A share token carries its own authority and needs none.

**Path parameters**

- `overlay` (string, in path, required): Overlay slug, such as `wind` or `snowdepth`. It is the `slug` this API's `getTileLayers`, and the Map Studio API's `getLayers`, report for each overlay, and it carries that field's shape exactly: lowercase letters, digits and single hyphens. Which overlays a publishable key or a share token may draw is set by the organization's overlay allowlist safety rule, and an overlay outside it answers 403 rather than 404. The allowlist starts empty on a new organization, which admits no overlay, so every slug answers 403 under a key until the allowlist names slugs or `*`, which Mountaya sets as the organization's agreement states. From Mountaya's web application the studio scope `organization_id` names decides instead, and an overlay outside it answers 403 as well. Read the matching specification endpoint for the ones it serves.

- `z` (integer (int32), in path, required): Zoom level. Higher values show more detail over a smaller area. On a publishable-key request for anything but the base map (a terrain's tiles, the tiles of the sources its style draws and the elevation raster's), the organization's zoom-bounds safety rule narrows the accepted range, and a `z` outside it is a 400 naming `z`, so a structurally valid value can still be refused. Each layer's `zoom_min` and `zoom_max` in the specification say where a map should ask for tiles; they are not a refusal. A specification served to a publishable key reports them already narrowed to that rule, so a map that follows it asks only for a `z` the rule accepts.

- `x` (integer (int32), in path, required): Tile column index at the given zoom level, from 0 to 2^z - 1 inclusive. An index at or past 2^z addresses no tile and is a `400` naming `x`, as a negative or non-integer one is, so an index computed wrongly is refused before anything is drawn or fetched for it.

- `y` (integer (int32), in path, required): Tile row index at the given zoom level, from 0 to 2^z - 1 inclusive. An index at or past 2^z addresses no tile and is a `400` naming `y`, as a negative or non-integer one is, so an index computed wrongly is refused before anything is drawn or fetched for it.

**Query parameters**

- `organization_id` (string (uuid), in query, optional): The studio scope the map draws in, named by the organization's identifier. A value that is not a UUID in its canonical form, or the nil UUID, is a `400` naming `organization_id`.

  Under a publishable key or a share token it may name only the credential's own organization: any other identifier is a `403`, whether or not it exists. It changes nothing but being echoed, so a request sending it is answered as one that omits it, and every URL template an answer returns under `sources[].tiles` for a layer that takes it carries the same `organization_id`.

  A request from Mountaya's web application, which carries the person's own session rather than a key or a share token, uses it to choose the scope it draws in. Omitted, the scope is the person's own space, which has no identifier of its own to send. Naming an organization the person is a member of makes that organization the scope. Any other identifier, an organization the person is not a member of or one that does not exist, is a `404`, so the parameter cannot be used to learn which organizations exist.

  What a scope draws depends on the layer. The overlays served under a key or a share token are the ones the organization's overlay allowlist admits. From Mountaya's web application, the person's own space draws the points of interest alone, and an organization draws every overlay when it holds Map Studio and the points of interest alone when it does not, an overlay outside the scope being a `403`. The itinerary and zone tiles draw what the scope holds: in the person's own space, their own itineraries and zones, which belong to no organization, and in an organization, its itineraries and zones, never those of another space the person belongs to.

- `timestamp` (string (date-time), in query, optional): Selects the instant the tile is drawn for. When absent it is NOW: an overlay is a field of values over time, so there is no such thing as drawing one outside time, and this is where the parameter reads differently from the zone routes, where absence disables a filter instead.

  The window it accepts is 3 days into the past and 6 days into the future, measured from the moment the request arrives. It is relative rather than fixed, which is why it is stated here and not as a `minimum` and `maximum`: a value outside it is a 400 naming `timestamp`. On an overlay whose `capabilities.server.timestamp` is true, an instant inside the window but more than 15 minutes from the current one, either way, is a `403` under a publishable key or a share token unless the organization's overlay time control safety rule allows it. A request from Mountaya's web application is held to no time control and is drawn for any instant inside the window. That comparison is made on the instant sent; the tile itself is drawn for that instant rounded down to the hour, in UTC.

  It only changes what is drawn on the overlays whose `capabilities.server.timestamp` is true, which are the weather and snow ones, and only those are held to the overlay time control. A static overlay is drawn the same whatever instant is sent, though a malformed value or one outside the window is a `400` on every overlay.

Also takes `Accept-Language`, as every operation of this API does: the [overview](https://docs.mountaya.com/en/apis/tiles/reference.md) describes it.

**Response** `200` `application/x-protobuf`, `image/png`, `image/webp`

Tile data for the requested `{z}/{x}/{y}` tile. Vector overlays (weather, snow and POIs) return a Mapbox Vector Tile (`application/x-protobuf`); raster overlays (hillshade, slope steepness and aspect/slope) return an image, WebP (`image/webp`) or PNG (`image/png`) as the `Content-Type` header says. Which kind an overlay serves is given by its source `type` in the specification. A square its upstream holds no tile on is a zero-length vector tile for a vector overlay, which is a valid empty one, and a `404` for a raster one.

**Errors** `400`, `401`, `402`, `403`, `404`, `405`, `429`, `500`, `504`. See [Errors](https://docs.mountaya.com/en/apis/conventions/errors.md).

- `400`: Bad Request
- `401`: Unauthorized
- `402`: A publishable-key request from an organization whose entitlements do not grant the capability the request needs: `tiles`, or `publishing` on a request from a page on Mountaya's own domain. Both are granted by the organization's agreement with Mountaya, so this clears when the agreement changes rather than when the request does. No tile and no specification is served for it. The capability is checked before the key's scope, so a key that lacks the scope as well is answered this rather than a `403`. It is not a permissions failure and does not clear by changing the request. A share-token request is never answered with this status: a share link is never refused for a capability.
- `403`: The credential is valid and this operation is not open to it: the key does not carry the scope the request needs (`tiles`, or `publishing` on a request from a page on Mountaya's own domain), or the request's page is not an allowed one: under a key, one outside the organization's allowed domains, and under a share token, any page not on Mountaya's own domain. An overlay outside the organization's overlay allowlist is refused here as well, under a key or a share token. The allowlist starts empty on a new organization, which admits no overlay, so every overlay is refused here until it names slugs or `*`, which Mountaya sets as the organization's agreement states. So is an `organization_id` naming an organization other than the credential's own, whether or not it exists, and, from Mountaya's web application, an overlay outside the studio scope `organization_id` names: every overlay but the points of interest in the person's own space, or in an organization that does not hold Map Studio. On an overlay that varies with time, so is a `timestamp` more than 15 minutes from the current instant when the organization's overlay time control does not allow one, a refusal that holds for a publishable key and a share token alike. A request from Mountaya's web application, drawing in a space the person belongs to, is held to no time control.
- `404`: No overlay is published under that slug, or the slug names a raster overlay whose upstream holds no tile on that square, in whose place a renderer draws the parent tile. An overlay that exists but is not on the organization's allowlist is a 403 rather than this, so the two questions stay apart. From Mountaya's web application, an `organization_id` naming an organization the person is not a member of, or one that does not exist, is answered this as well. The tile coordinates, the `timestamp` and, under a key, the organization's zoom bounds and geographic boundaries are checked before the slug, so a request failing one of those is a `400` even when the slug names no overlay.
- `405`: The path takes `GET`, `HEAD`, which answers the headers a `GET` would with no body, and `OPTIONS` as a CORS preflight, and nothing else. Every route on this surface reads, so a write method is refused before the credential is even looked at, which is why this answers ahead of `401`. The `Allow` response header names the methods the path does take.
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
# The body is the tile's bytes, not JSON. A map library fetches these URLs
# itself and cannot set a header, so a browser sends ?publishable_key= instead.
curl -s "https://tiles.mountaya.com/v1/overlays/snowdepth/12/2126/1458" \
  -H "X-API-Key: pk_your_publishable_key" -o tile.mvt
```

**TypeScript**

```typescript
// A map library requests each tile itself and cannot set a header, so the credential rides the query.
const tiles = `https://tiles.mountaya.com/v1/overlays/snowdepth/{z}/{x}/{y}?publishable_key=${publishableKey}`;
```

**Python**

```python
import requests

response = requests.get(
    "https://tiles.mountaya.com/v1/overlays/snowdepth/12/2126/1458",
    headers={
        "X-API-Key": "pk_your_publishable_key",
    },
    timeout=30,
)
response.raise_for_status()
with open("tile.mvt", "wb") as file:
    file.write(response.content)
```

**Error answers the operations of this page share**

- `TooManyRequests` (`429`): A bound the request's surface is held to is spent: for the organization's own clients and its hosted embed, the organization's per-minute limit or its monthly allowance, or, under a key sent without a session token or with one minted without `user_id`, the bound on the client's IP address, an IPv6 address counted by its `/64` prefix; for an Embedded Studio, the bound of the member its session names, or of its client IP address for a session minted without `user_id`, or its organization's; for a share link, the bound on the client's IP address or the bound of the organization that owns the link; for Mountaya's web application, the 6,000 a minute of the person signed in to it, which carries no rate-limit fields. Or the client's IP address has had 60 unknown share tokens refused within the minute, or 60 unknown publishable keys, a key refused again within seconds counted once, and the token or the key it sends was not resolved moments earlier. Every one carries `Retry-After`: for a per-minute bound, the seconds left in the minute; for a spent monthly allowance, the whole seconds until the organization's next billing period begins, until which every request of the organization's own clients and of its hosted embed, specifications included, is refused; for a share token or a publishable key refused because its address had 60 unknown ones refused, the seconds left in that minute. A share token or a publishable key resolved moments earlier is never refused that last way. `RateLimit-Policy` and `RateLimit` say which bound was spent, except on the refusal of an unknown share token or of an unknown publishable key, which no bound of the organization's counts: that answer carries no `RateLimit-Policy` or `RateLimit` field.
