# Overview

> Canonical URL: https://docs.mountaya.com/en/apis/map-studio/
> Last updated: 2026-11-27
> Rules for agents: https://docs.mountaya.com/llms.txt#rules-for-agents

The JSON API that writes your itineraries, segments, waypoints, segment groups, zones and collections.

Create, publish and share itineraries, zones and collections from your own code, over JSON.

The Map Studio API writes the content your maps show: itineraries with their segments, waypoints and segment groups, zones, and the collections that file them.

**Comes with an agreement:** its itineraries, zones and collections need one, so [talk to us](https://mountaya.com/en/contact/).

This call lists your published itineraries:

**cURL**

```bash
curl -s "https://api.mountaya.com/v1/itineraries?limit=2" \
  -H "X-API-Key: $MOUNTAYA_PUBLISHABLE_KEY"
```

**TypeScript**

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

const mountaya = new Mountaya({
  credential: { publishableKey: process.env.MOUNTAYA_PUBLISHABLE_KEY ?? "" },
});

const { data, extensions } = await mountaya.studio.itineraries.getItineraries({
  query: { limit: 2 },
});

console.log(data.map((itinerary) => itinerary.name), extensions?.metadata?.pagination);
```

**Python**

```python
import os

import requests

page = requests.get(
    "https://api.mountaya.com/v1/itineraries",
    headers={"X-API-Key": os.environ["MOUNTAYA_PUBLISHABLE_KEY"]},
    params={"limit": 2},
    timeout=30,
).json()

print([itinerary["name"] for itinerary in page["data"]])
```

**Response**

```json
{
  "data": [
    {
      "activity_id": "a1c4e7b2-3d59-4f08-8b6a-2e5c9d0f7134",
      "ascent": 941,
      "count": { "groups": 0, "segments": 2, "waypoints": 1 },
      "created_at": "2026-11-09T10:52:46.081072Z",
      "created_by": { "id": "7a4e1c98-3b52-4f60-9d81-c05e2f7a83b1" },
      "description": "Two stages from Les Houches.",
      "distance": 16152.93,
      "etag": "\"p3\"",
      "id": "0b6d1a4e-6d3f-4f7a-9c2e-1f0a5b8c3d21",
      "is_private": false,
      "is_verified": false,
      "name": "Tour du Mont-Blanc",
      "organization_id": "a5eec5f3-3463-4b20-9469-de3eeb870a7a",
      "revision": 3,
      "status": "published",
      "updated_at": "2026-11-09T10:53:23.814667Z"
    }
  ],
  "extensions": {
    "metadata": {
      "pagination": { "limit": 2, "next_cursor": null }
    }
  }
}
```

A key alone lists only what you publish. Add a member's session token to list drafts and private itineraries too.

## Who can call it

The Map Studio API comes with an agreement that includes Map Studio and Embedded Studio.

| You call | You send |
| --- | --- |
| A read | A publishable key with the `publishing` scope |
| A write | A publishable key with the `studio-embedded` scope, and a session token naming the member who writes |
| A publish | The same as a write, with Map Publishing in your agreement |

Your server mints the member's session token with your secret key. The [quickstart](https://docs.mountaya.com/en/apis/map-studio/quickstart.md) shows how.

- Every operation states its scope as `x-pkey-scope` and as a line in its description. Reads take a publishable key with the `publishing` scope in `X-API-Key`, the layer and activity catalogs included; `studio-embedded` includes `publishing`.
- Every operation that acts as a member (the writes, the AI agent, collaboration, the event streams, and the person's own memberships, preferences and invitations under `/v1/me`) takes `studio-embedded`. That scope needs Embedded Studio and Map Studio enabled for your organization, and Map Publishing to publish. A key carrying `studio-embedded` also carries `tiles` and `data`.
- The administration operations (keys, billing, members, invitations, settings, usage) take `management`, which a key carries alone.
- `POST /v1/sessions` mints session tokens, so it takes your **secret** key and no publishable-key scope.
- Every operation that acts as a member also requires a session token naming that member, which your backend mints with `POST /v1/sessions` and `user_id`. A `studio-embedded` operation takes only a token minted with `surface: "studio-embedded"`, and answers any other with `401`. The token is the only thing that names a user: no header does. Each operation states what it asks of that user as `x-acting-user`. A member whose role only reads is refused a write with `403`.
- The organization must hold Map Studio for any write to its itineraries, zones and collections, or the write answers `402`.

## Guides

- [Quickstart](https://docs.mountaya.com/en/apis/map-studio/quickstart.md): Create an itinerary, route a segment, and publish it.
- [Run Mountaya from your backend](https://docs.mountaya.com/en/apis/map-studio/server-integration.md): Your keys, tokens that renew, and writes as a member.
- [Edit an itinerary's route](https://docs.mountaya.com/en/apis/map-studio/edit-route.md): Insert, split, merge and group segments, and add waypoints.
- [Draw and update zones](https://docs.mountaya.com/en/apis/map-studio/zones.md): Closures and warnings, drawn or computed.
- [Publishing](https://docs.mountaya.com/en/apis/map-studio/publishing.md): Drafts, publications, and what stops a publish.
- [Collections and share links](https://docs.mountaya.com/en/apis/map-studio/sharing.md): Group content and share it by link.
- [Import and export](https://docs.mountaya.com/en/apis/map-studio/import-export.md): GPX, KML, FIT and TCX in, route files out.
- [Event streams and sync](https://docs.mountaya.com/en/apis/map-studio/sync.md): Keep a copy of your content up to date.
- [Import a GPX catalog](https://docs.mountaya.com/en/apis/map-studio/gpx-import.md): A script that turns a folder of GPX files into published itineraries.
- [Manage members, invitations and keys](https://docs.mountaya.com/en/apis/map-studio/members-and-keys.md): Invite people, change roles, rotate keys.

## Conventions

Every call shares the same rules: [errors](https://docs.mountaya.com/en/apis/conventions/errors.md), [rate limits](https://docs.mountaya.com/en/apis/conventions/rate-limits.md), [idempotency keys](https://docs.mountaya.com/en/apis/conventions/idempotency.md), [pagination](https://docs.mountaya.com/en/apis/conventions/pagination.md), [conditional writes](https://docs.mountaya.com/en/apis/conventions/conditional-writes.md), [request IDs and headers](https://docs.mountaya.com/en/apis/conventions/headers.md), and [versioning](https://docs.mountaya.com/en/apis/conventions/versioning.md). The [Map Studio API reference](https://docs.mountaya.com/en/apis/map-studio/reference.md) lists every operation.

- **Envelope.** A success carries the resource under `data`, with any response-scoped metadata under `extensions.metadata`. A failure replaces `data` with `errors`. Every API shares one envelope and one closed code vocabulary: see [errors](https://docs.mountaya.com/en/apis/conventions/errors.md).
- **Methods.** `GET`, `POST`, `PATCH`, and `DELETE`, and `HEAD` beside every `GET`. There is no `PUT`, and every update is a merge: a field you leave out keeps its value. A request body is closed: a field an object does not declare is a `400` naming it.
- **A state a resource is in is a resource of its own.** An itinerary's publication lives at `/v1/itineraries/{itinerary_id}/publication`, and its share link at `.../share-link`. A zone's publication lives at `/v1/zones/{zone_id}/publication`. `POST` sets the state or returns it as it stands, and `DELETE` removes it. A share link is also read with `GET`; a publication has no `GET`: read it from the resource's own `status`, `published_at` and `has_unpublished_changes`.
- **An action is a `POST` to a verb** under the resource it acts on: `/split`, `/merge`, and `/convert` on a segment, `/duplicate` on an itinerary, `/rotate` on a share link, `/accept` on an invitation, `/set-default` on a payment method.
- **An act on a state that is already so changes nothing and answers `200`.** Unpublishing what is not published, removing a share link that is not there, or revoking a revoked key all succeed. A `DELETE` of an id that does not exist stays a `404`.
- **A thing that may simply be absent reads as `data: null`.** An itinerary's share link or the organization's AI provider configuration answers `200` with `null` when there is none.
- **What a write answers.** A creation answers `201 Created`, with what it created under `data` and its address in the `Location` header. A write to part of an itinerary, a segment, a segment group, a waypoint, or its publication, answers the whole `ItineraryWithDetails`, so the route, its totals, and its profile come back in one answer; a part it created is named at `extensions.metadata.created.id`. A write to what a collection holds answers the `Collection`. A write that only removes something answers `data: null`; revoking a publishable key is the exception, answering the revoked key and its `ETag`. The agent's three writes (start, answer, rate a run) answer `202 Accepted`.
- **Idempotency.** Every write but `POST /v1/sessions`, `POST /v1/organizations/lookup`, and the two collaboration signals takes an `Idempotency-Key`, so a retry is answered from the first answer rather than run again, and a write that was made is never made twice under its key. See [idempotency](https://docs.mountaya.com/en/apis/conventions/idempotency.md).
- **Conditional writes.** The itineraries, zones, collections, organizations, their settings, publishable keys, and the AI provider configuration carry an `etag`, which a write sends back as `If-Match` to land only on the version it read; a stale tag is a `412`. See [conditional writes](https://docs.mountaya.com/en/apis/conventions/conditional-writes.md).
- **Listings.** `GET /v1/itineraries`, `GET /v1/zones`, and `GET /v1/collections` list your key's organization, always. `organization_id` may name it, which changes nothing, and naming any other organization is a `403`, whether or not it exists. A personal resource, owned by no organization, is never listed under a key.
- What a listing reaches depends on the credential, not on who holds it. A publishable key alone lists the organization's public resources, and an itinerary or a zone only while it is published, served as it was last published. The same key with a session token naming a member lists the private and unpublished ones as well, and serves each itinerary's and each zone's draft. A session token minted without `user_id`, whatever its surface, lists and serves as the key alone does. A caller that finds its own itineraries missing is almost always sending the key without a session naming a member.
- Itineraries filter by `status`, `is_private`, `activity_id`, `in_collection`, `updated_since`, and `q`. Zones filter by `status`, `is_private`, `level`, `mode`, `active_at`, `updated_since`, and `q`. Collections filter by `itinerary_id` or `zone_id`, which lists where one item is filed, and by `is_private`, `updated_since`, and `q`. An itinerary's and a zone's filters read it as it is served, so under a key alone, or with a token minted without `user_id`, `status=draft` and `is_private=true` list nothing.
- `GET /v1/collections/{collection_id}/itineraries` and `.../zones` list what one collection holds, the itineraries in the collection's own order unless you `sort` otherwise. Every listing answers its page at `extensions.metadata.pagination`, `{ limit, next_cursor }`: send `next_cursor` back as `cursor` until it reads `null`. See [pagination](https://docs.mountaya.com/en/apis/conventions/pagination.md).

## Next steps

- [Quickstart](https://docs.mountaya.com/en/apis/map-studio/quickstart.md): Create, route, and publish an itinerary.
- [API reference](https://docs.mountaya.com/en/apis/map-studio/reference.md): Every operation, with samples.
- [Webhooks](https://docs.mountaya.com/en/webhooks.md): Hear about every change in your organization.
