openapi: 3.1.0
info:
  title: Places
  version: 2.5.0
  description: |
    The Places API is the Motionworks library of points of interest (POIs) — the named stores, restaurants, venues, stations and other places that every Motionworks product measures against. Each record is one POI with its name, category, address geography (city, state, county, CBSA, DMA) and coordinates. When a POI corresponds to a Motionworks measured place, the record also carries that place's identifier, type and status in its `measured_*` fields; several POIs can map to the same measured place (a mall and the stores inside it, for example), and that is information rather than duplication.

    Four lookups:

    - **Autocomplete** — keystroke suggestions for a search box: brands first, then individual places, with a similar-name fallback. Free, no API key required.
    - **List and filter** — full-text search combined with location, state, DMA, place-type and mapped-to-measured filters, with cursor pagination. 1 credit per page.
    - **Place detail** — one POI by `poi_id`. 1 credit.
    - **Brand footprint** — how many POIs a brand has, how many map to measured places, where they concentrate (top states, top DMAs, H3 cells) and their centroid. 1 credit.

    **Places Maptiles** deliver the same library as Mapbox Vector Tiles. Places publishes two point layers, both serving zoom 0–14: `points` (one feature per Motionworks measured place) and `poi_points` (one feature per point of interest in the library). Mint a grant scoped to your web origins, hand the TileJSON URL to MapLibre, Mapbox GL JS or any TileJSON-aware client, and it fetches tiles for you. Grant management is free; tile traffic is metered at **1 credit per 1,000 tiles served**.

    Authenticate with an org-scoped API key (`X-API-Key: mw_…`); grant management also accepts a signed-in session (`Authorization: Bearer <jwt>`). A successful library response normally carries an `X-MW-Places-Snapshot` header (`YYYYMMDD`) naming the library snapshot it was served from. The Places reference guide is at [Places](https://www.mworks.com/docs/reference-libraries/places/).
  contact:
    name: Motionworks AI
    url: https://mworks.com
    email: api@mworks.com
servers:
  - url: https://api2.mworks.com/v2
    description: Production
security:
  - apiKey: []
tags:
  - name: Places
    description: |
      Look up points of interest: autocomplete for a search box (free), list and filter with full-text search and location filters, one POI by id, and a brand's footprint. 1 credit per call except autocomplete.
  - name: Tile Grants
    description: |
      Mint, list, read and revoke tile-delivery grants. A grant belongs to your organization and names the web origins allowed to fetch tiles. Free.
  - name: Tile Discovery
    description: |
      The public tile catalog: every layer Places publishes, with its title, zoom range and field schema. No authentication, no charge.
  - name: Tile TileJSON
    description: |
      The TileJSON manifest for a grant — the URL you hand to your map library. It carries a short-lived tile token, so it needs no separate auth header.
  - name: Tile Data
    description: |
      The tile bytes themselves (Mapbox Vector Tile, binary). Your map library requests these with the token from the TileJSON manifest; you will not normally call this endpoint yourself.
components:
  securitySchemes:
    apiKey:
      type: apiKey
      name: X-API-Key
      in: header
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        A signed-in user session (`Authorization: Bearer <jwt>`), as used by the Motionworks console and account flows to manage tile grants for your organization.
    tileTokenAuth:
      type: apiKey
      in: query
      name: token
      description: |
        Opaque per-grant tile-token (24-hour TTL) minted by `GET /v2/places/tiles/grants/{id}/tilejson`. Accepted ONLY as the `?token=` query parameter — header form is rejected. Treat as a short-lived bearer credential.
  schemas:
    Brand:
      type: object
      description: |
        A brand's footprint across the Places library, aggregated from every open POI whose name is the brand name (ignoring case). `brand_id` is the brand's name in lowercase today; a name-independent identifier and chain hierarchy (`parent_brand`, `chain_id`, `footprint_polygon`) are planned and always null for now.
      x-motionworks-status: production
      x-motionworks-source: places-library
      x-motionworks-source-doc: https://docs.mworks.com/docs/places
      properties:
        brand_id:
          type: string
          description: |
            Brand identifier — the brand's display name in lowercase. URL-encode reserved characters when you use it in a path (`taco%20bell`).
          example: starbucks
        name:
          type: string
          nullable: true
          description: 'The brand''s display name: the most common spelling of the name across its POIs.'
        poi_count:
          type: integer
          nullable: true
          description: Open POIs in the library carrying this brand.
        measured_poi_count:
          type: integer
          nullable: true
          description: How many of the brand's POIs map to a Motionworks measured place.
        distinct_measured_places:
          type: integer
          nullable: true
          description: How many distinct measured places the brand's POIs map to.
        top_states:
          type: array
          maxItems: 10
          items:
            type: object
            required:
              - id
              - name
              - count
            properties:
              id:
                type: string
                description: USPS state code (e.g. "CA"); the state or province name for one outside the US.
              name:
                type: string
                description: Full state name (e.g. "California").
              count:
                type: integer
                nullable: true
                description: POIs in this state for this brand.
            additionalProperties: false
          description: |
            Up to ten states with the most POIs for this brand, highest first. Each entry is `{id, name, count}`: the USPS state code, the state name and the brand's POI count there.
        top_dmas:
          type: array
          maxItems: 10
          items:
            type: object
            required:
              - id
              - name
              - count
            properties:
              id:
                type: string
                description: Nielsen DMA geoid (e.g. "803").
              name:
                type: string
                description: Human-readable DMA name (e.g. "Los Angeles").
              count:
                type: integer
                nullable: true
                description: POIs in this DMA for this brand.
            additionalProperties: false
          description: |
            Up to ten Nielsen DMAs (Designated Market Areas) with the most POIs for this brand, highest first. Each entry is `{id, name, count}`: the DMA identifier, the DMA name and the brand's POI count there. Empty (never null) when no DMA counts are available.
        centroid:
          type: object
          nullable: true
          description: Geographic centroid of the brand's POIs.
          properties:
            lat:
              type: number
              format: double
              description: Latitude of the centroid (WGS84 degrees).
            lon:
              type: number
              format: double
              description: Longitude of the centroid (WGS84 degrees).
        parent_brand:
          type: string
          nullable: true
          description: Reserved for a future release (parent brand / chain hierarchy). Always null today.
        chain_id:
          type: string
          nullable: true
          description: Reserved for a future release (chain identifier). Always null today.
        footprint_polygon:
          type: object
          nullable: true
          description: Reserved for a future release (GeoJSON polygon of the brand footprint). Always null today.
        sample_poi_id:
          type: string
          nullable: true
          description: One of the brand's POI ids, handy for a spot-check with `GET /v2/places/{poi_id}`.
        h3_counts:
          type: array
          maxItems: 256
          items:
            $ref: '#/components/schemas/H3CellEntry'
          description: |
            The brand's POI counts in its busiest H3 resolution-2 cells (up to 256), highest first. Each entry is `{id, count}` — H3 cells have no name. Always present; empty when no POI has a location.
        h3_drilldown:
          $ref: '#/components/schemas/H3Drilldown'
          description: 'Present only when you pass `h3_res`: the brand''s POI counts per H3 cell at that resolution.'
      required:
        - brand_id
        - name
        - poi_count
        - measured_poi_count
        - distinct_measured_places
        - top_states
        - top_dmas
        - h3_counts
        - centroid
        - parent_brand
        - chain_id
        - footprint_polygon
        - sample_poi_id
    H3CellEntry:
      type: object
      description: |
        Per-entry shape for `h3_counts` and `h3_drilldown.cells`. H3 cells have no human name source, so the shape is `{id, count}` only (not `{id, name, count}` like top_states / top_dmas).
      required:
        - id
        - count
      additionalProperties: false
      properties:
        id:
          type: string
          description: H3 cell id (15-character hex index).
          example: 82268ffffffffff
        count:
          type: integer
          minimum: 0
          description: POI count in this cell for this brand.
    H3Drilldown:
      type: object
      description: |
        H3 drill-down result: the brand's POI counts per cell at the requested resolution, highest first. Resolution 2 repeats `h3_counts`; resolutions 3–8 count the POIs inside the parent cells you pass in `h3_cells`. A POI is placed by the parent cell's boundary, so near a cell edge a child cell can appear under a neighbouring parent. Same 1-credit cost as the brand call.
      required:
        - resolution
        - cells
      additionalProperties: false
      properties:
        resolution:
          type: integer
          minimum: 2
          maximum: 8
          description: H3 resolution of the cells in the result.
        cells:
          type: array
          items:
            $ref: '#/components/schemas/H3CellEntry'
          description: Cells at `resolution`, count-desc.
    Place:
      type: object
      x-motionworks-status: production
      x-motionworks-source: places-library
      x-motionworks-source-doc: https://docs.mworks.com/docs/places
      properties:
        poi_id:
          type: string
          description: |
            Stable identifier for the POI, `<source prefix>_<native id>` (for example `dp_a1b2c3`). It survives library refreshes as long as the source keeps its native id.
          example: dp_a1b2c3
        poi_native_id:
          type: string
          description: The POI's identifier in its source dataset.
        poi_source:
          type: string
          description: Name of the source dataset the POI came from; `MW` for a Motionworks place with no third-party POI.
        name:
          type: string
          nullable: true
          description: Name of the POI.
        name_lower:
          type: string
          nullable: true
          description: Lowercase form of `name`, as used for brand matching.
        poi_category:
          type: string
          nullable: true
          description: Category of the POI as classified by its source.
        naics_category:
          type: string
          nullable: true
          description: NAICS (North American Industry Classification System) category of the POI.
        city:
          type: string
          nullable: true
          description: City of the POI's address.
        st_usps:
          type: string
          minLength: 2
          maxLength: 2
          nullable: true
          description: Two-letter USPS state code (for example `CA`).
        st_name:
          type: string
          nullable: true
          description: State name (for example `California`).
        co_geoid:
          type: string
          nullable: true
          description: Census GEOID of the county (or county equivalent) the POI is in.
        cbsa_geoid:
          type: string
          nullable: true
          description: Identifier of the Core-Based Statistical Area (metropolitan or micropolitan) the POI is in.
        dma_geoid:
          type: string
          nullable: true
          description: Identifier of the Nielsen DMA (Designated Market Area) the POI is in (for example `501`).
        dma_name:
          type: string
          nullable: true
          description: Name of the DMA the POI is in (for example `New York, NY`).
        is_mapped_to_measured:
          type: boolean
          description: |
            True when this POI is mapped to a Motionworks measured place. Use it as a filter; the `measured_*` fields are populated only when it is true.
        measured_place_id:
          type: string
          nullable: true
          description: |
            Identifier of the Motionworks measured place this POI maps to — the `place_id` used across Placecast, Viewcast and Pathcast. Several POIs can share one measured place.
        measured_short_name:
          type: string
          nullable: true
          description: Abbreviated name of the measured place.
        place_type_id_v2:
          type: integer
          nullable: true
          description: Motionworks place-type identifier, when the POI is classified (the value the `place_type_id_v2` filter takes).
        place_type:
          type: string
          nullable: true
          description: Motionworks place type (for example `Shopping Mall`), when the POI is classified.
        sub_type:
          type: string
          nullable: true
          description: Motionworks place sub-type (for example `Regional Mall`), when the POI is classified.
        measured_parent_place_id:
          type: string
          nullable: true
          description: |
            Identifier of the measured place's parent place, when it sits inside a larger place (a store inside a mall, for example).
        measured_audit_status:
          type: string
          nullable: true
          description: Audit status of the measured place record (for example `Certified`).
        measured_is_focused:
          type: boolean
          nullable: true
          description: |
            Whether the measured place is directly measured (`true`) rather than estimated from its peer group (`false`).
        market_id:
          type: string
          nullable: true
          description: Motionworks market identifier (for example `mkt-nyc`), when assigned.
        poi_count_for_measured_place:
          type: integer
          nullable: true
          description: |
            How many POIs share this `measured_place_id`. A value above 1 means several POIs sit inside one measured place — useful when judging what a measurement of that place covers.
        lat:
          type: number
          format: double
          nullable: true
          description: Latitude of the POI (WGS84 degrees).
        lon:
          type: number
          format: double
          nullable: true
          description: Longitude of the POI (WGS84 degrees).
      description: |
        One point of interest in the Places library. The `measured_*` fields are populated when the POI maps to a Motionworks measured place; otherwise they are null.
    AutocompleteResult:
      type: object
      description: |
        One suggestion. `kind` tells you what it is: `brand` (a brand whose name has a word starting with each word you typed), `place` (a POI matching your query, best matches first) or `brand_fuzzy` (a brand with a close spelling, returned only when no brand matches by prefix).
      x-motionworks-status: production
      properties:
        kind:
          type: string
          enum:
            - brand
            - place
            - brand_fuzzy
          description: 'What the suggestion is: `brand`, `place` or `brand_fuzzy`.'
        name:
          type: string
          description: Display name of the brand or place.
        poi_id:
          type: string
          nullable: true
          description: 'The POI identifier for `kind: place`; null for brand kinds.'
        place_type:
          type: string
          nullable: true
          description: 'Motionworks place type for `kind: place`, when known; null for brand kinds.'
        city:
          type: string
          nullable: true
          description: 'City for `kind: place`; null for brand kinds.'
        st_usps:
          type: string
          nullable: true
          description: 'Two-letter USPS state code for `kind: place`; null for brand kinds.'
        poi_count:
          type: integer
          nullable: true
          description: 'The brand''s POI count for brand kinds; null for `kind: place`.'
        match_score:
          type: number
          format: double
          nullable: true
          description: 'How closely the suggestion matched, in [0, 1]: 1 for an exact name, 0.5 when the name starts with your query, 0.3 when its words start with the words you typed, 0.1 for a close spelling. Brands score 0.3 (`brand`) or 0.1 (`brand_fuzzy`).'
        match_highlights:
          type: array
          items:
            type: object
            required:
              - field
              - start
              - end
            additionalProperties: false
            properties:
              field:
                type: string
                enum:
                  - name
                description: The field the span refers to. Only `name` is highlighted today.
              start:
                type: integer
                minimum: 0
                description: |
                  Inclusive character offset into `name` (a character index, not a byte offset — safe with accented names).
              end:
                type: integer
                minimum: 0
                description: Exclusive character offset into `name` (`start ≤ end ≤ name.length`).
          description: |
            Where your query appears inside `name`, as character spans you can bold. Always present, never null; empty for `kind: brand_fuzzy` (no exact substring) and whenever the query does not occur inside `name`.
    Pagination:
      type: object
      properties:
        cursor:
          type: string
          nullable: true
          description: Opaque cursor for the next page. Pass it back as `cursor` to continue; null on the last page.
        has_more:
          type: boolean
          description: Whether another page follows.
    Provenance:
      type: object
      description: |
        Where the result came from: the dataset, methodology version, data vintage and refresh cadence. Included in `meta` on every library response.
      if:
        required:
          - is_focused
          - measurement_method
      then:
        oneOf:
          - properties:
              is_focused:
                const: true
              measurement_method:
                const: direct
          - properties:
              is_focused:
                const: false
              measurement_method:
                const: estimated
      properties:
        source:
          type: string
          description: The Motionworks dataset or model the result came from.
        source_doc:
          type: string
          format: uri
          description: Link to the methodology or dataset documentation for this result.
        methodology_version:
          type: string
          description: Version of the methodology that produced the result.
        data_vintage:
          type: string
          format: date
          description: The date the underlying data represents.
        data_freshness:
          type: string
          enum:
            - hourly
            - daily
            - weekly
            - monthly
            - annually
            - on-demand
            - static
          description: How often the underlying data is refreshed (for example `daily`, `monthly`, `static`).
        data_latency_days:
          type: integer
          description: Typical days between an observation and its availability in the API.
        data_maturity:
          type: string
          enum:
            - production
            - research-preview
            - synthetic-only
            - roadmap
          description: |
            Maturity of the data behind the result: `production` (supported and stable), `research-preview` (available, subject to change), `synthetic-only` or `roadmap` (not yet backed by production data).
        is_focused:
          type: boolean
          description: |
            Whether the place is directly measured (`true`) rather than estimated from its peer group (`false`). When present alongside `measurement_method`, the two agree.
        measurement_method:
          type: string
          enum:
            - direct
            - estimated
          description: |
            `direct` when the place is measured directly; `estimated` when its statistics come from peer-group inference. When present alongside `is_focused`, the two agree (`true` ↔ `direct`).
    Meta:
      type: object
      properties:
        request_id:
          type: string
          description: Unique id for this request. Quote it when contacting support.
        credits_used:
          type: integer
          description: Credits charged for this call.
        credits_remaining:
          type: integer
          description: Credits remaining on your account after this call.
        product:
          type: string
          description: Always `places`.
        operation_id:
          type: string
          description: Identifier of the billed operation (for example `places_reference_call`).
        version:
          type: string
          description: API version that served the call.
        provenance:
          $ref: '#/components/schemas/Provenance'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            status:
              type: integer
            request_id:
              type: string
            product:
              type: string
            docs_url:
              type: string
            context:
              type: object
              additionalProperties: true
          description: 'The error: a stable `code`, a human-readable `message`, and optional `context` with the specifics.'
    TileMeta:
      type: object
      description: |
        Response metadata on the tile grant and TileJSON endpoints. Unlike `Meta`, it carries no `provenance`: these endpoints deliver and control tiles rather than return data.
      required:
        - request_id
        - credits_used
        - product
      properties:
        request_id:
          type: string
          description: Unique id for this request.
        credits_used:
          type: integer
          description: Always 0 — grant management is free; tile traffic is metered separately at 1 credit per 1,000 tiles.
        product:
          type: string
          enum:
            - places
          description: Always `places`.
    TilesetCatalogLayer:
      type: object
      x-motionworks-status: production
      description: TileJSON 3.0.0 `vector_layers[]` entry — one per MVT layer inside the tiles.
      required:
        - id
        - fields
      properties:
        id:
          type: string
          description: |
            Layer id inside the tile bytes (the MVT `source-layer`). `default` for both Places layers — not the URL slug.
        description:
          type: string
          description: What the layer contains.
        minzoom:
          type: integer
          minimum: 0
          description: Lowest zoom level the layer serves.
        maxzoom:
          type: integer
          minimum: 0
          description: Highest zoom level the layer serves.
        fields:
          type: object
          description: Map of MVT feature property → TileJSON field type (`String` | `Number` | `Boolean`).
          additionalProperties:
            type: string
            enum:
              - String
              - Number
              - Boolean
    TilesetCatalogEntry:
      type: object
      x-motionworks-status: production
      required:
        - slug
        - title
        - minzoom
        - maxzoom
        - bounds
        - layers
      properties:
        slug:
          type: string
          description: Customer-facing layer slug. Matches the `{layer}` URL path segment used in `GET /v2/places/tiles/{layer}/{z}/{x}/{y}.mvt` and the values accepted in `TileGrantCreateRequest.tilesets`.
        title:
          type: string
          description: Human-readable display title for this tileset.
        minzoom:
          type: integer
          minimum: 0
          description: Lowest zoom level the tileset serves.
        maxzoom:
          type: integer
          minimum: 0
          description: Highest zoom level the tileset serves.
        bounds:
          type: array
          description: TileJSON `bounds` — `[west, south, east, north]`, WGS84.
          items:
            type: number
          minItems: 4
          maxItems: 4
        layers:
          type: array
          items:
            $ref: '#/components/schemas/TilesetCatalogLayer'
          description: The MVT layers inside the tiles, with their field schemas.
    TilesetCatalogResponse:
      type: object
      x-motionworks-status: production
      required:
        - tilesets
      properties:
        tilesets:
          type: array
          items:
            $ref: '#/components/schemas/TilesetCatalogEntry'
          description: Every tileset Places publishes.
    TileGrantCreateRequest:
      type: object
      x-motionworks-status: production
      required:
        - name
        - tilesets
        - allowed_origins
        - expires_at
      properties:
        name:
          type: string
          maxLength: 120
          description: Human-readable label for this grant (shown in the developer dashboard).
        tilesets:
          type: array
          minItems: 1
          items:
            type: string
            enum:
              - points
              - poi_points
          description: |
            Tileset slugs to include. Places publishes two point layers, both serving zoom 0–14: `points` (one feature per Motionworks measured place) and `poi_points` (one feature per point of interest in the library). Any other slug returns 403 `TILE_LAYER_NOT_LICENSED`.
        allowed_origins:
          type: array
          items:
            type: string
          description: |
            Browser `Origin` allowlist for the TileJSON and tile requests made with this grant. Requests must carry an `Origin` header that matches one entry. To test from curl or a native app, include the literal string `null` in `allowed_origins`. A request without an `Origin` header is otherwise refused (403 `ORIGIN_NOT_ALLOWED`, `error.context.reason: origin_required`). Wildcards are not supported — list each origin literally.
        expires_at:
          type: string
          format: date-time
          description: |
            ISO 8601 timestamp at which this grant expires. The tile-token JWT minted by `/tilejson` independently expires 24h after each mint — re-fetch TileJSON before then.
    TileGrant:
      type: object
      x-motionworks-status: production
      description: |
        A Places tile-delivery grant. The `grant_id` is a Crockford-base32 ULID and is itself a bearer credential — anyone who knows it can fetch the TileJSON capability URL from an allowed origin.
      properties:
        grant_id:
          type: string
          description: Opaque ULID. Treat as a secret.
        org_id:
          type: string
          format: uuid
          description: The organization that owns the grant.
        product:
          type: string
          enum:
            - places
          description: Always `places`.
        name:
          type: string
          description: The label you gave the grant.
        tilesets:
          type: array
          items:
            type: string
            enum:
              - points
              - poi_points
          description: Tileset slugs the grant covers.
        allowed_origins:
          type: array
          items:
            type: string
          description: Browser origins allowed to fetch TileJSON and tiles with this grant.
        expires_at:
          type: string
          format: date-time
          description: When the grant expires (ISO 8601).
        revoked_at:
          type: string
          format: date-time
          nullable: true
          description: When the grant was revoked, or null while it is active.
        created_at:
          type: string
          format: date-time
          description: When the grant was created (ISO 8601).
        created_by:
          type: string
          format: uuid
          nullable: true
          description: |
            The user who created the grant. For a grant minted with an API key, this is the user who created that key.
        usage_30d:
          type: integer
          description: 30-day tile fetch count. Reported as 0 today; usage aggregation is coming.
    TileGrantCreateResponse:
      type: object
      x-motionworks-status: production
      properties:
        grant_id:
          type: string
          description: Opaque ULID. Treat as a secret.
        tile_json_url:
          type: string
          format: uri
          description: |
            Capability URL — drop this into MapLibre as the `url` for a vector source. The opaque `grant_id` segment IS the credential, so treat the URL like an AWS S3 presigned URL.
        tilesets:
          type: array
          items:
            type: string
          description: Tileset slugs the grant covers.
        allowed_origins:
          type: array
          items:
            type: string
          description: Browser origins allowed to fetch TileJSON and tiles with this grant.
        expires_at:
          type: string
          format: date-time
          description: When the grant expires (ISO 8601).
        created_at:
          type: string
          format: date-time
          description: When the grant was created (ISO 8601).
    TileJsonManifest:
      type: object
      x-motionworks-status: production
      description: |
        TileJSON 3.0.0 manifest with a freshly-minted 24-hour tile-token embedded in `tiles[]`. Standard TileJSON consumers (MapLibre, Mapbox GL JS, deck.gl `MVTLayer`) handle the rest transparently.
      properties:
        tilejson:
          type: string
          example: 3.0.0
          description: TileJSON specification version (`3.0.0`).
        name:
          type: string
          description: Name of the tileset.
        tiles:
          type: array
          items:
            type: string
            format: uri
          description: Tile URL templates with the tile token already embedded. Your map library substitutes `{z}/{x}/{y}`.
        minzoom:
          type: integer
          description: Lowest zoom level served.
        maxzoom:
          type: integer
          description: Highest zoom level served.
        bounds:
          type: array
          items:
            type: number
          minItems: 4
          maxItems: 4
          description: Geographic extent `[west, south, east, north]` in WGS84.
        attribution:
          type: string
          description: Attribution text to show on the map.
        vector_layers:
          type: array
          items:
            type: object
          description: The MVT layers in the tiles and their field schemas.
        x-mw:
          type: object
          description: 'Motionworks-specific metadata: the grant, the tilesets served, token expiry and refresh guidance.'
          properties:
            grant_id:
              type: string
              description: The grant this manifest was minted for.
            product:
              type: string
              enum:
                - places
              description: Always `places`.
            tilesets:
              type: array
              items:
                type: string
              description: Tileset slugs this manifest serves.
            token_expires_at:
              type: string
              format: date-time
              description: When the embedded tile token expires (ISO 8601). Re-fetch the TileJSON before then.
            refresh_after:
              type: integer
              description: |
                Seconds after minting at which to re-fetch this TileJSON — one hour before the tile token expires (82,800).
paths:
  /places/autocomplete:
    get:
      operationId: placesAutocomplete
      summary: Suggest brands and places as the user types
      description: |
        Returns up to `limit` suggestions for a search box. Brands whose name has a word starting with each word you typed come first (up to five, largest footprint first; `Starbucks` and `STARBUCKS` are one brand), then places, best matches first: an exact name, then names starting with your query, then names whose words start with your words, then close spellings (`starbcks` finds Starbucks). When no brand matches by prefix, brands with a close spelling come back as `kind: brand_fuzzy`. A single character, or a `poi_id` typed into the box, returns places only (a `poi_id` finds that place). Matching is case-insensitive, and permanently closed places are left out.

        Each suggestion carries `match_highlights` — the character span of your query inside `name` — so you can bold the match. Follow a `brand` suggestion with `GET /v2/places/brands/{brand_id}` (the brand's name in lowercase) and a `place` suggestion with `GET /v2/places/{poi_id}`.

        Free — 0 credits, no API key required.
      tags:
        - Places
      x-credit-cost: 0
      x-motionworks-status: production
      x-motionworks-source-doc: https://docs.mworks.com/docs/places
      x-motionworks-snapshot-header: X-MW-Places-Snapshot
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
          description: The text typed so far (up to 256 characters). Matched case-insensitively against brand and place names.
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 20
            default: 10
          description: Maximum suggestions to return (1–20).
        - name: near
          in: query
          schema:
            type: string
          description: |
            Optional `lon,lat` hint. Validated but not yet used to rank results; reserved for a future proximity boost.
      responses:
        '200':
          description: Suggestions, brands first.
          headers:
            X-MW-Places-Snapshot:
              schema:
                type: string
                pattern: ^[0-9]{8}$
              description: Release date (YYYYMMDD) of the newest row in the response; omitted when no row carries one.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AutocompleteResult'
                  meta:
                    $ref: '#/components/schemas/Meta'
        '400':
          description: '`q` is missing, blank or longer than 256 characters, or `near` is not `lon,lat`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: The places library is temporarily unavailable. Retry shortly; quote `request_id` if it persists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: The places library is not available on this deployment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /places/brands/{brand_id}:
    get:
      operationId: getPlacesBrand
      summary: Read a brand's footprint
      tags:
        - Places
      x-credit-cost: 1
      x-motionworks-status: production
      x-motionworks-source-doc: https://docs.mworks.com/docs/places
      x-motionworks-snapshot-header: X-MW-Places-Snapshot
      description: |
        Returns a brand's footprint across the library's open POIs: total POIs, how many map to Motionworks measured places, the top ten states and DMAs by POI count, the geographic centroid, one sample POI and `h3_counts` (the brand's busiest H3 resolution-2 cells). Pass `h3_res` to drill into finer H3 cells; resolutions 3–8 also need the parent cells in `h3_cells`.

        `brand_id` is the brand's name in lowercase, URL-encoded (`starbucks`, `taco%20bell`); take it from an autocomplete `brand` suggestion. `parent_brand`, `chain_id` and `footprint_polygon` are reserved for a future release and always return null today.

        1 credit per call, whatever the drill-down resolution.
      parameters:
        - name: brand_id
          in: path
          required: true
          schema:
            type: string
          description: The brand's name in lowercase, URL-encoded (for example `starbucks` or `taco%20bell`).
        - name: h3_res
          in: query
          required: false
          schema:
            type: integer
            minimum: 2
            maximum: 8
          description: |
            Target H3 resolution (2–8) for a hierarchical drill-down. When set, the response includes `h3_drilldown` with the brand's POI counts per cell at that resolution. Resolution 2 needs no parents; for 3–8 pass the parent cells in `h3_cells`. The 1-credit cost is the same at every resolution.
        - name: h3_cells
          in: query
          required: false
          schema:
            type: string
          description: |
            Comma-separated H3 cell ids of the parent cells to drill into, each at resolution `h3_res - 1`. Required when `h3_res` is 3 or higher; ignored when `h3_res` is 2. Up to 64 cells per call.
      responses:
        '200':
          description: The brand footprint.
          headers:
            X-MW-Places-Snapshot:
              schema:
                type: string
                pattern: ^[0-9]{8}$
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Brand'
                  meta:
                    $ref: '#/components/schemas/Meta'
        '400':
          description: Invalid `brand_id`, `h3_res` or `h3_cells` (out of range, wrong resolution, or more than 64 cells).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No open POI with that brand name in the library.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: The places library is temporarily unavailable. Retry shortly; quote `request_id` if it persists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: The places library is not available on this deployment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /places/{poi_id}:
    get:
      operationId: getPlace
      summary: Read one place
      description: |
        Returns the full record for one point of interest by `poi_id`, including its `measured_*` fields when it maps to a Motionworks measured place. A permanently closed POI is still returned here, though search leaves it out. 1 credit per call.
      tags:
        - Places
      x-credit-cost: 1
      x-motionworks-status: production
      x-motionworks-source-doc: https://docs.mworks.com/docs/places
      x-motionworks-snapshot-header: X-MW-Places-Snapshot
      parameters:
        - name: poi_id
          in: path
          required: true
          schema:
            type: string
          description: |
            The POI identifier, for example `dp_a1b2c3`, from a list response or an autocomplete `place` suggestion.
      responses:
        '200':
          description: The place record.
          headers:
            X-MW-Places-Snapshot:
              schema:
                type: string
                pattern: ^[0-9]{8}$
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Place'
                  meta:
                    $ref: '#/components/schemas/Meta'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No POI with that `poi_id`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded. Back off and retry.
        '502':
          description: The places library is temporarily unavailable. Retry shortly; quote `request_id` if it persists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: The places library is not available on this deployment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /places:
    get:
      operationId: searchPlaces
      summary: List and filter places
      description: |
        Returns points of interest matching your filters, paged by cursor. Combine any of `q` (search by name), `near` + `radius_m` (within a distance of a point), `bbox` (inside a bounding box), `place_type_id_v2`, `st_usps`, `dma_geoid`, `is_mapped_to_measured` and `brand_id`; filters compose as AND. With `near` or `bbox`, results are ordered by distance (to the point, or to the box's centre); otherwise by how well they match `q`, best first; otherwise in a stable library order. Permanently closed POIs are left out.

        1 credit per page.
      tags:
        - Places
      x-credit-cost: 1
      x-motionworks-status: production
      x-motionworks-source-doc: https://docs.mworks.com/docs/places
      x-motionworks-snapshot-header: X-MW-Places-Snapshot
      parameters:
        - name: q
          in: query
          description: |
            Name to search for, up to 256 characters, matched case-insensitively: an exact name ranks first, then names starting with it, then names whose words start with your words, then close spellings. `taco bel` finds Taco Bell locations. A `poi_id` finds that place.
          schema:
            type: string
        - name: bbox
          in: query
          schema:
            type: string
          description: |
            Bounding box `west,south,east,north` in WGS84 degrees. Restricts results to the box and orders them by distance from its centre (unless `near` is also given, which then controls the ordering).
        - name: near
          in: query
          schema:
            type: string
          description: |
            Anchor point `lon,lat` in WGS84 degrees. Orders results by distance from the point; with `radius_m` it also restricts results to that distance. Pair it with `radius_m` for the fastest queries.
        - name: radius_m
          in: query
          schema:
            type: number
            minimum: 0
          description: Search radius in metres around `near`. Only POIs within this distance are returned.
        - name: place_type_id_v2
          in: query
          schema:
            type: integer
          description: Only POIs with this Motionworks place-type identifier (a POI's `place_type_id_v2`).
        - name: st_usps
          in: query
          schema:
            type: string
            minLength: 2
            maxLength: 2
          description: Only POIs in this state (two-letter USPS code, for example `CA`).
        - name: dma_geoid
          in: query
          schema:
            type: string
          description: Only POIs in this Nielsen DMA (Designated Market Area), by DMA identifier (for example `501`).
        - name: is_mapped_to_measured
          in: query
          schema:
            type: boolean
          description: '`true` for only POIs that map to a Motionworks measured place; `false` for only those that do not.'
        - name: brand_id
          in: query
          schema:
            type: string
            maxLength: 256
          description: 'Only POIs of this brand: the brand''s name, matched ignoring case (a `brand_id` from autocomplete or `GET /v2/places/brands/{brand_id}`).'
        - name: cursor
          in: query
          schema:
            type: string
          description: |
            Cursor from the previous page's `pagination.cursor`. Omit for the first page, and reuse a cursor only with the same filters (`limit` may change); a cursor from other filters, or one issued before 2026-11, returns 400. The library refreshes daily, so a page boundary that spans a refresh can occasionally skip or repeat a row.
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          description: Results per page (1–100).
      responses:
        '200':
          description: A page of place records.
          headers:
            X-MW-Places-Snapshot:
              schema:
                type: string
                pattern: ^[0-9]{8}$
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Place'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                  meta:
                    $ref: '#/components/schemas/Meta'
        '400':
          description: |
            A filter is malformed: `bbox` not four numbers (or out of range, or south above north), `near` not `lon,lat` (or out of range), `radius_m` not positive, `place_type_id_v2` not an integer, `st_usps` not a USPS state code, `is_mapped_to_measured` not `true`/`false`, `q` or `brand_id` too long or `brand_id` blank, or a `cursor` that does not belong to these filters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: The places library is temporarily unavailable. Retry shortly; quote `request_id` if it persists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: The places library is not available on this deployment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /places/tiles/tilesets:
    get:
      tags:
        - Tile Discovery
      operationId: listPlacesTilesets
      summary: List the tilesets Places publishes
      description: |
        Returns the public tile catalog for Places: every layer slug with its title, zoom range, geographic bounds and TileJSON `vector_layers[]` field schema. Use it to choose the `tilesets[]` for a grant, or to build a layer picker without hardcoding the catalog.

        No authentication required and no charge. Responses are not cached (`Cache-Control: private, no-store`).
      x-credit-cost: 0
      x-motionworks-status: production
      security: []
      responses:
        '200':
          description: Tile catalog.
          headers:
            Cache-Control:
              schema:
                type: string
                example: private, no-store
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/TilesetCatalogResponse'
                  meta:
                    $ref: '#/components/schemas/TileMeta'
  /places/tiles/grants:
    post:
      tags:
        - Tile Grants
      operationId: createPlacesTileGrant
      summary: Mint a Places vector-tile grant
      description: |
        Creates a tile-delivery grant for your organization and returns its capability `tile_json_url`. Hand that URL to MapLibre, Mapbox GL JS or any TileJSON-aware client and it starts rendering. Free — grant management costs 0 credits; only tile traffic is metered.

        Authenticate with an org-scoped API key (`X-API-Key: mw_…`) or a signed-in session (`Authorization: Bearer <jwt>`); anonymous callers cannot mint grants. Your organization must be licensed for Places tiles; the license is included for signed-in and pay-as-you-go accounts. Tile traffic is charged to your organization at 1 credit per 1,000 tiles served. If your organization's billing setup cannot carry tile traffic you receive `403 TILE_GRANTS_REQUIRE_METERED`; contact sales to enable tile delivery.
      x-credit-cost: 0
      x-motionworks-status: production
      security:
        - bearerAuth: []
        - apiKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TileGrantCreateRequest'
      responses:
        '201':
          description: Grant created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/TileGrantCreateResponse'
                  meta:
                    $ref: '#/components/schemas/TileMeta'
        '400':
          description: Invalid request body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: |
            Common cases:
              * `FEATURE_NOT_LICENSED` — your organization is not licensed for Places vector tiles. Contact sales.
              * `TILE_GRANTS_REQUIRE_METERED` — tile delivery for your organization requires pay-as-you-go (metered) billing, which is not enabled. Contact sales to enable tile delivery.
              * `TILE_LAYER_NOT_LICENSED` — one or more `tilesets[]` entries name a layer Places does not publish.
              * `API_KEY_NO_AUDIT_USER` — the API key is not tied to a user. Mint with a signed-in session, or with a key created by a user.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                tile_layer_not_licensed:
                  summary: A tileset slug is not published by Places
                  value:
                    error:
                      code: TILE_LAYER_NOT_LICENSED
                      message: One or more tilesets are not published by Places.
                      status: 403
                      request_id: req_abc123
                      product: places
                      context:
                        missing:
                          - made_up_layer
                        supported:
                          - points
                          - poi_points
    get:
      tags:
        - Tile Grants
      operationId: listPlacesTileGrants
      summary: List your organization's grants
      description: Returns your organization's Places tile grants, most recent first. Free.
      x-credit-cost: 0
      x-motionworks-status: production
      security:
        - bearerAuth: []
        - apiKey: []
      responses:
        '200':
          description: Grant list.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/TileGrant'
                  meta:
                    $ref: '#/components/schemas/TileMeta'
        '401':
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /places/tiles/grants/{id}:
    get:
      tags:
        - Tile Grants
      operationId: getPlacesTileGrant
      summary: Read one grant
      description: Returns one grant by id, scoped to your organization. Free.
      x-credit-cost: 0
      x-motionworks-status: production
      security:
        - bearerAuth: []
        - apiKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Grant ULID returned by `POST /v2/places/tiles/grants`.
      responses:
        '200':
          description: Grant.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/TileGrant'
                  meta:
                    $ref: '#/components/schemas/TileMeta'
        '401':
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: |
            No grant with this id in your organization. Expired and revoked grants are still returned so you can inspect them.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /places/tiles/grants/{id}/revoke:
    post:
      tags:
        - Tile Grants
      operationId: revokePlacesTileGrant
      summary: Revoke a grant immediately
      description: |
        Revokes the grant immediately: new TileJSON requests for it fail with 404. Tile requests that use tokens already minted from it are refused as well (401 `UNAUTHORIZED` with `error.context.reason: grant_revoked`), so revoking is the instant cutoff for a leaked URL. Revoking an already-revoked grant returns 200 with the unchanged record. Free.
      x-credit-cost: 0
      x-motionworks-status: production
      security:
        - bearerAuth: []
        - apiKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Grant ULID returned by `POST /v2/places/tiles/grants`.
      responses:
        '200':
          description: Grant revoked.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/TileGrant'
                  meta:
                    $ref: '#/components/schemas/TileMeta'
        '401':
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No grant with this id in your organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /places/tiles/grants/{id}/tilejson:
    get:
      tags:
        - Tile TileJSON
      operationId: getPlacesTileJson
      summary: Get the TileJSON manifest for a grant (capability URL, no auth header)
      description: |
        Returns a TileJSON 3.0.0 manifest with a freshly minted 24-hour tile token embedded in `tiles[]`. This is the URL you hand to MapLibre, Mapbox GL JS or any TileJSON-aware client.

        **This URL is a capability — treat it like a secret.** It carries the credential needed to fetch tiles inside the URL itself, like a presigned object-storage URL: anyone who has it can render your map until the grant expires or is revoked. That is by design — your front-end code can pass it straight to the map library without a separate auth header. Two safety nets are built in: the grant's `allowed_origins` pins which sites can fetch tiles, and `POST /v2/places/tiles/grants/{id}/revoke` ends the grant.

        Free — the tile bytes themselves are metered on `GET .../{layer}/{z}/{x}/{y}.mvt`.
      x-credit-cost: 0
      x-motionworks-status: production
      security: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Grant ULID. Opaque bearer credential — treat as secret.
      responses:
        '200':
          description: TileJSON 3.0.0 manifest.
          headers:
            Cache-Control:
              schema:
                type: string
                example: private, max-age=3600, must-revalidate
            Vary:
              schema:
                type: string
                example: Origin
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TileJsonManifest'
        '403':
          description: |
            `error.code` tells you which:
              * `ORIGIN_NOT_ALLOWED` — the request `Origin` is not in the grant's `allowed_origins` (`error.context.reason: origin_not_allowed`), or the request carried no `Origin` header at all (`origin_required`). Requests must carry an `Origin` header that matches one entry. To test from curl or a native app, include the literal string `null` in `allowed_origins`.
              * `FEATURE_NOT_LICENSED` — your organization is not licensed for Places vector tiles. Contact sales.
              * `TILE_GRANTS_REQUIRE_METERED` — tile delivery for your organization requires pay-as-you-go (metered) billing, which is not enabled. Contact sales to enable tile delivery.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Grant not found, expired, or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /places/tiles/{layer}/{z}/{x}/{y}.mvt:
    get:
      tags:
        - Tile Data
      operationId: getPlacesTileMvt
      summary: Fetch a single Places vector tile (binary MVT)
      description: |
        **Your map library calls this for you.** MapLibre, Mapbox GL JS and deck.gl's `MVTLayer` read the `?token=` from the TileJSON manifest and append it to every tile request.

        Returns a Mapbox Vector Tile (binary protobuf) for one Places layer. The only accepted credential is the `?token=` query parameter — header-based auth is rejected by design, so the TileJSON URL alone is enough for a browser to render. Metered at **1 credit per 1,000 tiles served**. Responses may be gzip-encoded; respect `Content-Encoding`. A tile with no features returns HTTP 204.

        Places publishes two point layers, both serving zoom 0–14: `points` (one feature per Motionworks measured place) and `poi_points` (one feature per point of interest in the library). Each layer carries a single MVT source-layer named `default`. `points` features carry `place_id`, `place_name`, `brand_name` and `place_type`; `poi_points` features carry `poi_id`, `poi_name`, `measured_place_id` (when the POI maps to a measured place) and `place_type`. Both layers always serve the latest published release, so the `X-MW-Snapshot` response header reads `static`.
      x-credit-cost: 1
      x-motionworks-status: production
      x-motionworks-source-doc: https://docs.mworks.com/docs/places-tiles
      security:
        - tileTokenAuth: []
      externalDocs:
        description: MapLibre vector source spec — explains how MapLibre fetches this endpoint for you.
        url: https://maplibre.org/maplibre-style-spec/sources/#vector
      parameters:
        - name: layer
          in: path
          required: true
          schema:
            type: string
            enum:
              - points
              - poi_points
          description: |
            Tileset slug. Places publishes two point layers, both serving zoom 0–14: `points` (one feature per Motionworks measured place) and `poi_points` (one feature per point of interest in the library). A slug the token does not cover returns 401 `layer_not_in_tilesets`.
        - name: z
          in: path
          required: true
          schema:
            type: integer
            minimum: 0
            maximum: 14
          description: |
            Tile zoom level. Both Places layers serve z 0–14; a zoom outside that range returns 400 `INVALID_REQUEST`.
        - name: x
          in: path
          required: true
          schema:
            type: integer
            minimum: 0
          description: Tile column.
        - name: 'y'
          in: path
          required: true
          schema:
            type: integer
            minimum: 0
          description: Tile row.
        - name: token
          in: query
          required: true
          schema:
            type: string
          description: Opaque tile-token JWT extracted from TileJSON. Treat as secret.
      responses:
        '200':
          description: Vector tile bytes.
          headers:
            Cache-Control:
              schema:
                type: string
                example: private, max-age=300
            Content-Encoding:
              schema:
                type: string
                example: gzip
              description: Present when the tile bytes are gzip-encoded. Decode accordingly.
            Vary:
              schema:
                type: string
                example: Accept-Encoding, Origin
            X-MW-Tileset:
              schema:
                type: string
              description: Resolved upstream tileset id (e.g. `places.points`).
            X-MW-Snapshot:
              schema:
                type: string
                format: date
              description: |
                Data snapshot the tile was served from. Both Places layers always serve the latest published release, so this reads `static`.
          content:
            application/vnd.mapbox-vector-tile:
              schema:
                type: string
                format: binary
        '204':
          description: Empty tile — no features intersect this z/x/y. No body, no `Content-Encoding`.
        '400':
          description: '`error.code: INVALID_REQUEST` — zoom outside 0–14, or non-integer `x`/`y`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: |
            `error.code: UNAUTHORIZED`. Disambiguated by `error.context.reason`:
              * (no reason) — `?token=` missing.
              * `expired` / `malformed` / `signature_mismatch` — the token is invalid or expired; fetch the TileJSON again.
              * `layer_not_in_tilesets` — the token does not authorize the requested layer.
              * `grant_revoked` — the backing grant has been revoked.
              * `tile_grant_exhausted` — your organization's credits are exhausted (a billing signal, not an auth failure).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: |
            `error.code: ORIGIN_NOT_ALLOWED` — the request `Origin` is not in the grant's `allowed_origins` (`error.context.reason: origin_not_allowed`), or the request carried no `Origin` header (`origin_required`). Map libraries send `Origin` automatically; to test from curl or a native app, include the literal string `null` in the grant's `allowed_origins`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: |
            The grant behind the token no longer exists, or the layer is no longer published. (A slug the token does not cover returns 401, not 404.)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
x-tagGroups:
  - name: Places library
    tags:
      - Places
  - name: Maptiles
    tags:
      - Tile Discovery
      - Tile Grants
      - Tile TileJSON
      - Tile Data
x-customer-voice: true
