# Waypoints

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

The named places along a route: a hut, a summit, a water point, a cut-off time.

 Waypoints are ordered against the route rather than positioned independently, so one that moves keeps its place in the sequence.

## Create a new waypoint within an itinerary

### POST /v1/itineraries/{itinerary_id}/waypoints

- Operation: `postItineraryWaypoint`
- Requires: scope `studio-embedded` · acting user required (a session token naming a member) · an `Idempotency-Key` header, the same on every retry
- Behavior: answers within 30000 ms or times out

Creates a new waypoint within the specified itinerary. Its `position` is stored as the request gives it: a waypoint's order is the author's choice rather than something the route derives.

Returns the whole itinerary with its segments, waypoints, and groups, as every write to an itinerary's parts does. `Location` and `extensions.metadata.created.id` name the waypoint created.

A create meets no lock, unlike `patchItineraryWaypoint` and `deleteItineraryWaypoint`: a waypoint that does not exist yet cannot be locked by a collaborator, so its one `409` is a request whose `Idempotency-Key` is still in use. Send the itinerary's `ETag` as `If-Match` to make the create conditional on nobody having changed the itinerary since you read it; a stale tag is refused with `412` and nothing is created.

Requires a publishable key with the `studio-embedded` scope AND a session token minted for `studio-embedded` naming a user, a member with a write role, whom the request acts as. A publishable key without a session token minted for `studio-embedded` naming a user, a token minted for another surface included, is refused with **401**.

**Webhook events** [`itinerary.waypoint.created`](https://docs.mountaya.com/en/webhooks/events/itinerary-waypoint.md#itinerary-waypoint-created), recorded by the task `itinerary.waypoint.create`.

**Path parameters**

- `itinerary_id` (string (uuid), in path, required): Identifier of the itinerary the operation acts on. An itinerary this credential does not reach is a 404 rather than a 403, and so is one that does not exist, so the parameter cannot be used to learn which itinerary ids exist.

**Headers**

- `Idempotency-Key` (string, in header, optional): A value the caller chooses once per logical write and sends again, unchanged, on every retry of it, so a write whose answer was lost runs at most once. A UUID is the usual choice; any 1 to 255 printable ASCII characters without a space are accepted. The key is held for 12 hours, for the credential that sent it (the publishable key and the user its session token names) and for this operation.

  The first request runs. A request repeating the key with the same method, path, query and body, sent as the same media type, is answered with the first one's stored status and body, its `Location` and `ETag` included, and carries `Idempotent-Replayed: true`; nothing runs a second time and no limit is charged again. `Content-Type` is compared as the media type it names, with its `charset`, rather than as the header was written, so the letter case of the type and the spacing around its parameters do not make two requests different. `If-Match` is not compared: a key sent again after a `412`, with a fresh tag, is answered with that same `412`, so a write retried with a new tag takes a new key. Every answer below `500` other than a `429` is stored that way, a refusal included, so a retried request that was refused is refused again in the same words. A request refused before the write is reached stores nothing, and a retry with the same key runs again: every `401`, and every `413` refusing a body over the operation's ceiling. The `413` that `postItineraryPreview` answers for the source it has read, a file or a track too large, is stored as any other refusal is.

  A `5xx` answered before anything was written stores nothing and releases the key: a retry with the same key runs again. A `5xx` answered after the write was made keeps the key, and a request repeating it is a `409` whose entry is coded `IDEMPOTENCY_ANSWER_UNAVAILABLE`, as is a request repeating the key of an answer too large to store whole. Either way the write was made: the `409` carries no `Location`, and its `extensions.metadata` (`ResponseMetadataIdempotentAnswer`) names the `status` the first request was answered with and, where that answer carried them, its `location` and `etag`. Read the resource again rather than sending the write once more, which is answered the same way.

  The same key with a different request is a `400` at `["request", "headers", "Idempotency-Key"]`, and nothing runs, whether the first request is still running or was answered. The same request while its first one is still running is a `409` whose entry is coded `IDEMPOTENCY_KEY_IN_USE`, carrying `Retry-After`: send it again once that has passed. Without the header a write runs every time it is sent, which is harmless on the writes `x-idempotent` marks safe to repeat and creates a second resource on the others. A stream's answer is never stored.

  Keys are kept on a best-effort basis. While Mountaya cannot read or record them, a write runs as if it carried no key, so a retry sent in that moment can run it a second time.

- `If-Match` (string, in header, optional): Makes the write conditional on the resource still being the version the caller read: the `ETag` an earlier answer carried, which is also that resource's `etag` field, or `*` for any version. When the resource has changed since, the write is refused with `412` `PRECONDITION_FAILED`, nothing is changed, and the answer carries the current `ETag`, so the caller reads the resource again and decides. Omitted, the write is unconditional and the last write wins.

  One strong tag in double quotes, or `*`. A list of tags, a weak tag (`W/`) or any other spelling is a `400` naming the header. A resource the caller cannot see is answered `404` before the condition is asked, so a stale tag never tells a caller anything a read would not.

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

**Body**

The new waypoint: its location, its mode, and the presentation and contact detail carried with it.

- `amenities` (array of string, in body, optional): Services and facilities available at this waypoint. Duplicates are rejected. Optional and not nullable: omit it for none.

- `color` (string, in body, optional): Hex color code for rendering this waypoint on the map. Both the three-digit and the six-digit forms are accepted, in either case, and either is stored as six lowercase digits (`#F60` and `#FF6600` both as `#ff6600`), which is the form every read returns.

  Optional and not nullable: omit it to use the default activity color.

- `contact` (object, in body, optional): How to reach the place this waypoint marks. An object whose members are all null or absent is stored as none, and reads back as `null`.

  Optional and not nullable: omit it for none.
  - `address` (string | null, optional): Postal address on a single line, as it would be written on an envelope or typed into a navigation app. Null when not provided.
  - `booking_url` (string (uri) | null, optional): Absolute `http` or `https` URL where a stay, table or slot at this place can be booked. Any other scheme is rejected: a renderer turns this into a link a reader clicks, so `javascript:` and `data:` are refused at the API rather than left for each client to remember. Null when not provided.
  - `email` (string (email) | null, optional): Contact email address for this place, parsed as an RFC 5322 address; a value that does not parse as one is a 400. Null when not provided.
  - `opening_hours` (string | null, optional): Opening hours in free text, as published by the place itself: seasons, days and hours vary too much between huts, shops and aid stations to be worth structuring. Null when not provided.
  - `phone` (string | null, optional): Contact phone number, in international format where known. Digits, spaces and the punctuation a printed number uses (`+ - . ( ) /`), starting with a digit, a `+` or a `(` and carrying at least three digits. Free text is refused: a renderer turns this into a `tel:` link, and a number that cannot be dialled is worse than no number at all. Null when not provided.
  - `website` (string (uri) | null, optional): Absolute `http` or `https` URL of this place's website. Any other scheme is rejected, for the reason `booking_url` states. Null when not provided.

- `description` (string, in body, optional): Free-text description of the waypoint, at most 100 characters as sent, leading and trailing whitespace included; that whitespace is then trimmed. Omit it, or send one that trims to nothing, to create the waypoint without one.

- `geojson` (GeoJSONPoint | GeoJSONMultiPoint | GeoJSONLineString | GeoJSONMultiLineString | GeoJSONPolygon | GeoJSONMultiPolygon | GeoJSONGeometryCollection, in body, required): A bare GeoJSON Point representing the waypoint location, the shape a waypoint's `geojson` is read in. Any other geometry, a GeometryCollection holding a Point included, is a 400 naming `geojson`. Both modes require it, so omitting it is a 400. A position outside the longitude and latitude ranges, or one of more than three numbers, is a 400 naming the position at fault, for example `geojson[0]`.

- `icon` (string, in body, optional, one of: `circle-warning`, `megaphone`, `bed`, `apartment-building`, `camper-van`, `circle-check`, `parking-sign`, `medical-cross`, `droplet`, `eye`, `flag`, `flag-start`, `flag-end`, `hut`, `circle-info`, `map-pin`, `camping`, `trophy`, `cutlery`, `bus`, `train`, `cable-car`, `charging-station`, `gate`, `toilet`, `shower`, `trash`, `shop`, `picnic`, `helicopter`, `signal`, `climbing`, `ladder`): Icon displayed on the waypoint. Required for a `poi`, which sent without one is a `400` naming `icon`; optional for a `point`, which shows it when set. `flag-start` and `flag-end` are refused on every write (400). Not nullable: omit it for a `point` without one.

- `media` (object, in body, optional): Photos and external links attached to this waypoint. An object whose members are all null, absent or empty lists is stored as none, and reads back as `null`.

  Optional and not nullable: omit it for none.
  - `links` (array of WaypointLink | null, optional): Labelled external links, in the order they should be shown. Null when none are attached. Never an empty array. At most 10: the server enforces the ceiling, and a list over it is a validation error rather than a truncation.
    - `label` (string, required): Text shown for the link. Trimmed of leading and trailing whitespace, and refused with a 400 when nothing is left.
    - `url` (string (uri), required): Absolute `http` or `https` URL the link points to. Any other scheme is rejected: a renderer turns this into a link a reader clicks or an image a browser loads, so `javascript:` and `data:` are refused at the API rather than left for each client to remember.
  - `photos` (array of WaypointPhoto | null, optional): Photographs of the place, in the order they should be shown. Null when none are attached. Never an empty array. At most 10: the server enforces the ceiling, and a list over it is a validation error rather than a truncation.
    - `caption` (string | null, optional): Short caption describing the photo. Null when not provided.
    - `url` (string (uri), required): Absolute `http` or `https` URL of the image. Any other scheme is rejected: a renderer turns this into a link a reader clicks or an image a browser loads, so `javascript:` and `data:` are refused at the API rather than left for each client to remember.

- `mode` (string, in body, required, one of: `poi`, `point`): Whether the waypoint is a point of interest, which carries a name and an icon, or a standalone point marker, which may be unnamed.

- `name` (string, in body, optional): Display name of the waypoint, 2 to 30 characters as sent. Leading and trailing whitespace is then trimmed, and what remains must still be at least 2 characters. Required when `mode` is `poi`; a `point` may omit it. A `poi` sent without one is a `400` naming `name`. A name is one line: a tab, a line break or a line separator between two of its characters is a `400`, and one at either end is trimmed with the whitespace there.

- `position` (integer (int32), in body, required): Zero-based position of the waypoint within its parent itinerary, stored as given: a waypoint's order is the author's choice, and no other waypoint moves to make room. Between 0 and 9999.

- `properties` (array of WaypointProperty, in body, optional): Customer-defined fields for this waypoint, in the order they should be shown. Keys must be unique within the waypoint. At most 20: the server enforces the ceiling, and a list over it is a validation error rather than a truncation.

  Optional and not nullable: omit it for none.
  - `format` (string | null, optional, one of: `text`, `number`, `duration`, `distance`, `url`, `date`): How `value` should be rendered. Null is equivalent to `text`, and is what a client sends when it has no opinion.
  - `key` (string, required): Stable machine-readable identifier for this field, as a lowercase slug. Unique within a waypoint. Reuse the same key across waypoints so readers can line the field up into a column.
  - `label` (string, required): Human-readable name of this field, shown to readers. Trimmed of leading and trailing whitespace, and refused with a 400 when nothing is left.
  - `value` (string, required): The field's value, always carried as a string.

    `format` says how to interpret it, and IS ENFORCED: a value declared `number` must parse as a finite number written in base ten, one declared `distance` or `duration` as such a number of zero or more, since no length or span is negative, one declared `date` must be an RFC 3339 instant, and one declared `url` must be an absolute `http` or `https` address. A renderer links that last one, so the same scheme rule the contact URLs keep applies here. `text` accepts anything within the length ceiling. An empty value passes whatever the format.

    A `date` carries a TIME as well as a day, like every other instant on this API, and is written as a full `date-time`. A bare `YYYY-MM-DD` is accepted on write too, because it is a well-formed RFC 3339 date; a renderer reads one as midnight.

    The two measured formats carry the same BASE UNITS every other measure on this API does, so a reader formats them into the units their audience prefers rather than guessing: `distance` is METERS and `duration` is SECONDS. A field declared `distance` with the value `12000` is twelve kilometers.

    A value that does not match the format it declares is refused rather than coerced: a renderer told the field is a distance and handed `soon` has no honest way to draw it, and silently printing the text makes the format a suggestion.

- `timing` (object, in body, optional): Cut-off and expected-arrival timing for this waypoint. An object whose members are all null or absent is stored as none, and reads back as `null`.

  Optional and not nullable: omit it for none.
  - `cutoff_at` (string (date-time) | null, optional): Absolute wall-clock instant by which this waypoint must be left. Null when the waypoint has no cut-off.
  - `stop_duration` (integer (int32) | null, optional): Time expected to be spent at this waypoint, in seconds: a hut stop, an aid station or a scheduled break, at most thirty days. Null when no stop is planned.

**Response** `201`

The whole itinerary, with the new waypoint among its waypoints. `Location` names the waypoint, `/v1/itineraries/{itinerary_id}/waypoints/{waypoint_id}`, and `extensions.metadata.created.id` is its identifier. `ETag` carries the itinerary's new version.

- `extensions` (object, required): The envelope's second half, everything the answer carries that is not the answer itself. Here that is `metadata.created`, the waypoint this request created.
  - `metadata` (ResponseMetadataCreatedPart, required): What a write that created a part of an itinerary created, at `extensions.metadata` of its `201`. The answer's `data` is the whole itinerary, as every write to one answers it, so this is how a client finds the part it just made without searching for it; `Location` names the same part.
    - `created` (object, required): The part created.
      - `id` (string (uuid), required): Identifier of the segment, segment group or waypoint created. On a split, the second of the two segments, the one the split made.

- `data` (ItineraryWithDetails, required): An itinerary with its full list of segments, waypoints, and segment groups included, plus its derived publication state.

  See [the ItineraryWithDetails object](https://docs.mountaya.com/en/apis/map-studio/reference/itineraries.md#itinerary-with-details-object).

Response headers:

- `Location`: The path of what the request created, relative to this host. A part of an itinerary is addressed under its itinerary, so a new segment's is `/v1/itineraries/{itinerary_id}/segments/{segment_id}`.
- `ETag`: The version of the resource this answer returns, an opaque strong tag in double quotes, equal to that resource's `etag` field. Send it back as `If-Match` to make a write conditional on nobody having changed the resource since. It changes whenever what this read returns changes; compare it whole and never parse it. Present on every answer that returns the resource, and on the `412` that refuses a stale `If-Match`.
- `Idempotent-Replayed`: `true` when this answer is the stored answer to an earlier request carrying the same `Idempotency-Key`, replayed rather than run again. Absent on an answer that ran.

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

- `400`: The request was malformed, or a field failed validation: each entry names what, a field-level one at its `path`. The same `Idempotency-Key` sent with another request is refused here too, at `["request", "headers", "Idempotency-Key"]`. A refusal the write itself made is stored for its key, so a repeat of the key is refused again in the same words, marked `Idempotent-Replayed: true`.
- `401`: Unauthorized
- `402`: A plain `PAYMENT_REQUIRED`, with no per-entry refinement: the organization does not hold Embedded Studio, the product the `studio-embedded` scope belongs to and the one a publishable key needs to act as a member. It is agreed rather than bought, so it clears when the organization's agreement changes rather than when the request does. The product is checked before the key's scopes, so a key that lacks the scope as well is answered this rather than a `403`. The reads that take `publishing` are unaffected. It is also a plain `PAYMENT_REQUIRED` when the organization the itinerary belongs to does not hold Map Studio, which every change to an organization's itineraries, collections and zones needs. Map Studio is granted by the organization's agreement, so this too clears when the agreement changes rather than when the request does.
- `403`: The credential is valid and this operation is not open to it: the key does not carry the `studio-embedded` scope, or the user the session token names is not a member of the key's organization, or holds a role there that reads only, or the itinerary is one this credential can read and not edit, such as another organization's public itinerary while its publication is served. A user outside the organization and a member without the role answer alike. The blanket refusal in the [order of checks](https://docs.mountaya.com/en/apis/conventions/errors.md#which-refusal-you-get-first), an `Origin` or `Referer` the organization does not allow, answers here as well.
- `404`: No itinerary with that identifier is reachable: either none exists, or this credential cannot view it. The two answer alike, so this status cannot be used to learn which itinerary ids exist. So does an itinerary that has never been published, or has been taken down, or whose organization's agreement does not include Map Publishing, when this credential reads it as published rather than as its draft: a write answers it as a read does.
- `409`: `IdempotencyKeyInUse`, given in full at the end of this page.
- `412`: `PreconditionFailed`, given in full at the end of this page.
- `413`: Payload Too Large
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
curl -s https://api.mountaya.com/v1/itineraries/0b6d1a4e-6d3f-4f7a-9c2e-1f0a5b8c3d21/waypoints \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "poi",
    "position": 0,
    "name": "Refuge du Fioux",
    "icon": "hut",
    "geojson": {"type": "Point", "coordinates": [6.7612, 45.8479]}
  }'
```

**TypeScript**

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

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

const { data } = await mountaya.studio.itineraries.postItineraryWaypoint({
  itinerary_id: "0b6d1a4e-6d3f-4f7a-9c2e-1f0a5b8c3d21",
  body: {
    mode: "poi",
    position: 0,
    name: "Refuge du Fioux",
    icon: "hut",
    geojson: { type: "Point", coordinates: [6.7612, 45.8479] },
  },
});

console.log(data);
```

**Python**

```python
import requests
import uuid

response = requests.post(
    "https://api.mountaya.com/v1/itineraries/0b6d1a4e-6d3f-4f7a-9c2e-1f0a5b8c3d21/waypoints",
    headers={
        "X-API-Key": "pk_your_publishable_key",
        "X-Session-Token": "sess_your_session_token",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "mode": "poi",
        "position": 0,
        "name": "Refuge du Fioux",
        "icon": "hut",
        "geojson": {"type": "Point", "coordinates": [6.7612, 45.8479]},
    },
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 201:

```json
{
  "data": {
    "id": "9c2a7f60-1d4b-4e83-a5c7-6f0b8e91d245",
    "organization_id": "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
    "activity_id": "a1c4e7b2-3d59-4f08-8b6a-2e5c9d0f7134",
    "name": "Tour du Mont-Blanc",
    "description": "Ten stages from Les Houches, anticlockwise.",
    "is_private": false,
    "is_verified": true,
    "distance": 169800,
    "ascent": 9800,
    "count": {
      "groups": 3,
      "segments": 10,
      "waypoints": 24
    },
    "revision": 42,
    "etag": "\"d118\"",
    "created_by": {
      "id": "7a3e5d18-4c60-49b2-8f75-e2d1c9a4b607"
    },
    "created_at": "2026-05-12T09:14:00Z",
    "updated_at": "2026-06-28T16:02:00Z",
    "status": "published",
    "published_at": "2026-06-28T16:05:00Z",
    "has_unpublished_changes": false,
    "groups": [
      {
        "id": "5c6e2a71-3f84-4b9d-90e5-8a1c7b4f6d23",
        "itinerary_id": "9c2a7f60-1d4b-4e83-a5c7-6f0b8e91d245",
        "name": "Days 1-2",
        "color": "#2f80ed",
        "speed": 4.5,
        "revision": 2,
        "created_by": {
          "id": "7a3e5d18-4c60-49b2-8f75-e2d1c9a4b607"
        },
        "created_at": "2026-05-12T09:14:00Z"
      }
    ],
    "segments": [
      {
        "id": "2b8d4f19-6a05-4e73-8c1f-9d3b7e05a24c",
        "itinerary_id": "9c2a7f60-1d4b-4e83-a5c7-6f0b8e91d245",
        "group_id": "5c6e2a71-3f84-4b9d-90e5-8a1c7b4f6d23",
        "name": "Day 1: Col de Voza",
        "description": "From Les Houches over the Col de Voza, down the Bon Nant valley.",
        "mode": "directions",
        "position": 0,
        "color": "#2f80ed",
        "speed": 4.5,
        "start_at": "2026-07-04T07:30:00Z",
        "distance": 17400,
        "duration": 14760,
        "ascent": 1080,
        "descent": 720,
        "altitude_min": 942,
        "altitude_max": 1653,
        "gradient_min": -18.4,
        "gradient_max": 21.7,
        "geojson": {
          "type": "GeometryCollection",
          "geometries": [
            {
              "type": "LineString",
              "coordinates": [
                [
                  6.7986,
                  45.8918
                ],
                [
                  6.7621,
                  45.8842
                ],
                [
                  6.728,
                  45.8215
                ]
              ]
            },
            {
              "type": "MultiPoint",
              "coordinates": [
                [
                  6.7986,
                  45.8918
                ],
                [
                  6.728,
                  45.8215
                ]
              ]
            }
          ]
        },
        "slope_info": [
          {
            "from_index": 0,
            "to_index": 1,
            "value": 12.4
          },
          {
            "from_index": 1,
            "to_index": 2,
            "value": -8.1
          }
        ],
        "speed_info": [
          {
            "from_index": 0,
            "to_index": 1,
            "value": 2.9
          },
          {
            "from_index": 1,
            "to_index": 2,
            "value": 5.6
          }
        ],
        "surface_info": [
          {
            "from_index": 0,
            "to_index": 1,
            "value": "compacted-gravel"
          },
          {
            "from_index": 1,
            "to_index": 2,
            "value": "dirt"
          }
        ],
        "way_type_info": [
          {
            "from_index": 0,
            "to_index": 2,
            "value": "path"
          }
        ],
        "trail_difficulty_info": [
          {
            "from_index": 0,
            "to_index": 2,
            "value": "mountain-hiking"
          }
        ],
        "steps": [
          {
            "from_index": 0,
            "to_index": 1,
            "type": "depart",
            "name": "Route des Chavants",
            "distance": 8400,
            "duration": 7200,
            "exit_number": null
          },
          {
            "from_index": 1,
            "to_index": 2,
            "type": "goal",
            "name": "-",
            "distance": 9000,
            "duration": 7560,
            "exit_number": null
          }
        ],
        "road_access_info": [
          {
            "from_index": 1,
            "to_index": 2,
            "values": [
              "private"
            ]
          }
        ],
        "revision": 7,
        "created_by": {
          "id": "7a3e5d18-4c60-49b2-8f75-e2d1c9a4b607"
        },
        "created_at": "2026-05-12T09:14:00Z"
      }
    ],
    "waypoints": [
      {
        "id": "e8b1d740-2a96-4c53-b7f8-15d0a3c69e42",
        "itinerary_id": "9c2a7f60-1d4b-4e83-a5c7-6f0b8e91d245",
        "mode": "poi",
        "position": 0,
        "name": "Refuge du Fioux",
        "description": "Half-board, book ahead in July.",
        "icon": "hut",
        "color": "#f2994a",
        "geojson": {
          "type": "Point",
          "coordinates": [
            6.7612,
            45.8479
          ]
        },
        "amenities": [
          "water",
          "hot-meal",
          "accommodation",
          "toilets",
          "timing-checkpoint"
        ],
        "timing": {
          "cutoff_at": "2026-08-28T21:30:00Z",
          "stop_duration": 900
        },
        "contact": {
          "website": "https://www.example.com/refuge",
          "phone": "+33 4 50 12 34 56",
          "email": "contact@example.com",
          "address": "74170 Les Contamines-Montjoie, France",
          "opening_hours": "Mid-June to mid-September, 07:00-21:00 daily.",
          "booking_url": "https://www.example.com/refuge/reserver"
        },
        "media": {
          "photos": [
            {
              "url": "https://cdn.example.com/refuge-du-fioux/terrace.jpg",
              "caption": "The terrace at sunrise."
            }
          ],
          "links": [
            {
              "label": "Access from Les Contamines",
              "url": "https://www.example.com/access/les-contamines"
            }
          ]
        },
        "properties": [
          {
            "key": "bib-check",
            "label": "Bib check",
            "value": "Mandatory, both sides",
            "format": "text"
          }
        ],
        "revision": 3,
        "created_by": {
          "id": "7a3e5d18-4c60-49b2-8f75-e2d1c9a4b607"
        },
        "created_at": "2026-05-12T09:14:00Z"
      }
    ]
  },
  "extensions": {
    "metadata": {
      "created": {
        "id": "2c8e5f13-7a94-4b06-8d21-9e3f0a6c7b58"
      }
    }
  }
}
```

## Update an existing waypoint

### PATCH /v1/itineraries/{itinerary_id}/waypoints/{waypoint_id}

- Operation: `patchItineraryWaypoint`
- Requires: scope `studio-embedded` · acting user required (a session token naming a member) · an `Idempotency-Key` header, the same on every retry
- Behavior: idempotent, safe to retry · answers within 30000 ms or times out

Updates an existing waypoint within the itinerary. Every field is optional: an omitted field keeps its current value, and `null` clears a nullable one. A `contact`, `media` or `timing` object whose members are all null or absent (a `media` with empty lists included) is stored as none, so sending one clears the field.

Returns the whole itinerary with its segments, waypoints, and groups, as every write to an itinerary's parts does. Send the itinerary's `ETag` as `If-Match` to make the update conditional on nobody having changed the itinerary since you read it; a stale tag is refused with `412` and nothing is changed.

Requires a publishable key with the `studio-embedded` scope AND a session token minted for `studio-embedded` naming a user, a member with a write role, whom the request acts as. A publishable key without a session token minted for `studio-embedded` naming a user, a token minted for another surface included, is refused with **401**.

**Webhook events** [`itinerary.waypoint.updated`](https://docs.mountaya.com/en/webhooks/events/itinerary-waypoint.md#itinerary-waypoint-updated), recorded by the task `itinerary.waypoint.update`.

**Path parameters**

- `itinerary_id` (string (uuid), in path, required): Identifier of the itinerary the operation acts on. An itinerary this credential does not reach is a 404 rather than a 403, and so is one that does not exist, so the parameter cannot be used to learn which itinerary ids exist.

- `waypoint_id` (string (uuid), in path, required): Identifier of the waypoint within the itinerary named by `itinerary_id`. A waypoint belonging to another itinerary is a 404.

**Headers**

- `Idempotency-Key` (string, in header, optional): A value the caller chooses once per logical write and sends again, unchanged, on every retry of it, so a write whose answer was lost runs at most once. A UUID is the usual choice; any 1 to 255 printable ASCII characters without a space are accepted. The key is held for 12 hours, for the credential that sent it (the publishable key and the user its session token names) and for this operation.

  The first request runs. A request repeating the key with the same method, path, query and body, sent as the same media type, is answered with the first one's stored status and body, its `Location` and `ETag` included, and carries `Idempotent-Replayed: true`; nothing runs a second time and no limit is charged again. `Content-Type` is compared as the media type it names, with its `charset`, rather than as the header was written, so the letter case of the type and the spacing around its parameters do not make two requests different. `If-Match` is not compared: a key sent again after a `412`, with a fresh tag, is answered with that same `412`, so a write retried with a new tag takes a new key. Every answer below `500` other than a `429` is stored that way, a refusal included, so a retried request that was refused is refused again in the same words. A request refused before the write is reached stores nothing, and a retry with the same key runs again: every `401`, and every `413` refusing a body over the operation's ceiling. The `413` that `postItineraryPreview` answers for the source it has read, a file or a track too large, is stored as any other refusal is.

  A `5xx` answered before anything was written stores nothing and releases the key: a retry with the same key runs again. A `5xx` answered after the write was made keeps the key, and a request repeating it is a `409` whose entry is coded `IDEMPOTENCY_ANSWER_UNAVAILABLE`, as is a request repeating the key of an answer too large to store whole. Either way the write was made: the `409` carries no `Location`, and its `extensions.metadata` (`ResponseMetadataIdempotentAnswer`) names the `status` the first request was answered with and, where that answer carried them, its `location` and `etag`. Read the resource again rather than sending the write once more, which is answered the same way.

  The same key with a different request is a `400` at `["request", "headers", "Idempotency-Key"]`, and nothing runs, whether the first request is still running or was answered. The same request while its first one is still running is a `409` whose entry is coded `IDEMPOTENCY_KEY_IN_USE`, carrying `Retry-After`: send it again once that has passed. Without the header a write runs every time it is sent, which is harmless on the writes `x-idempotent` marks safe to repeat and creates a second resource on the others. A stream's answer is never stored.

  Keys are kept on a best-effort basis. While Mountaya cannot read or record them, a write runs as if it carried no key, so a retry sent in that moment can run it a second time.

- `If-Match` (string, in header, optional): Makes the write conditional on the resource still being the version the caller read: the `ETag` an earlier answer carried, which is also that resource's `etag` field, or `*` for any version. When the resource has changed since, the write is refused with `412` `PRECONDITION_FAILED`, nothing is changed, and the answer carries the current `ETag`, so the caller reads the resource again and decides. Omitted, the write is unconditional and the last write wins.

  One strong tag in double quotes, or `*`. A list of tags, a weak tag (`W/`) or any other spelling is a `400` naming the header. A resource the caller cannot see is answered `404` before the condition is asked, so a stale tag never tells a caller anything a read would not.

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

**Body**

The fields to change. A field you omit keeps its stored value, and a nullable field sent as `null` is cleared. A field the body does not declare, such as `mode`, is a `400` naming it: a waypoint's mode is set when it is created.

- `amenities` (array of string | null, in body, optional): Services and facilities available at this waypoint. Replaces the stored list wholesale rather than merging into it. Duplicates are rejected. Omit it to keep the current list; `null` or an empty array clears it.

- `color` (string | null, in body, optional): Hex color code for rendering this waypoint on the map. Both the three-digit and the six-digit forms are accepted, in either case, and either is stored as six lowercase digits (`#F60` and `#FF6600` both as `#ff6600`), which is the form every read returns. Omit it to keep the current value; `null` returns the waypoint to the default activity color.

- `contact` (WaypointContact | null, in body, optional): How to reach the place this waypoint marks. Replaces the stored object wholesale rather than merging into it. Omit it to keep the current value; `null`, or an object whose members are all null or absent, clears it.
  - `address` (string | null, optional): Postal address on a single line, as it would be written on an envelope or typed into a navigation app. Null when not provided.
  - `booking_url` (string (uri) | null, optional): Absolute `http` or `https` URL where a stay, table or slot at this place can be booked. Any other scheme is rejected: a renderer turns this into a link a reader clicks, so `javascript:` and `data:` are refused at the API rather than left for each client to remember. Null when not provided.
  - `email` (string (email) | null, optional): Contact email address for this place, parsed as an RFC 5322 address; a value that does not parse as one is a 400. Null when not provided.
  - `opening_hours` (string | null, optional): Opening hours in free text, as published by the place itself: seasons, days and hours vary too much between huts, shops and aid stations to be worth structuring. Null when not provided.
  - `phone` (string | null, optional): Contact phone number, in international format where known. Digits, spaces and the punctuation a printed number uses (`+ - . ( ) /`), starting with a digit, a `+` or a `(` and carrying at least three digits. Free text is refused: a renderer turns this into a `tel:` link, and a number that cannot be dialled is worse than no number at all. Null when not provided.
  - `website` (string (uri) | null, optional): Absolute `http` or `https` URL of this place's website. Any other scheme is rejected, for the reason `booking_url` states. Null when not provided.

- `description` (string | null, in body, optional): Free-text description of the waypoint, at most 100 characters as sent, leading and trailing whitespace included; that whitespace is then trimmed. Omit to keep the current value; `null`, or a value that trims to nothing, clears it.

- `geojson` (GeoJSONPoint | GeoJSONMultiPoint | GeoJSONLineString | GeoJSONMultiLineString | GeoJSONPolygon | GeoJSONMultiPolygon | GeoJSONGeometryCollection, in body, optional): A bare GeoJSON Point representing the waypoint location, the shape a waypoint's `geojson` is read in, so a location read can be sent back as it is. Any other geometry, a GeometryCollection holding a Point included, is a 400 naming `geojson`. Optional and not nullable: omit it to leave the stored location untouched; a `null` is a 400. A position outside the longitude and latitude ranges, or one of more than three numbers, is a 400 naming the position at fault, for example `geojson[0]`.

- `icon` (string, in body, optional, one of: `circle-warning`, `megaphone`, `bed`, `apartment-building`, `camper-van`, `circle-check`, `parking-sign`, `medical-cross`, `droplet`, `eye`, `flag`, `flag-start`, `flag-end`, `hut`, `circle-info`, `map-pin`, `camping`, `trophy`, `cutlery`, `bus`, `train`, `cable-car`, `charging-station`, `gate`, `toilet`, `shower`, `trash`, `shop`, `picnic`, `helicopter`, `signal`, `climbing`, `ladder`): Icon displayed on the waypoint. Required for a `poi`; optional for a `point`, which shows it when set. `flag-start` and `flag-end` are refused on every write (400). Optional and not nullable: omit it to leave the stored icon untouched. Unlike `name`, `description` and `color`, which are nullable here, an icon cannot be cleared through this operation.

- `media` (WaypointMedia | null, in body, optional): Photos and external links attached to this waypoint. Replaces the stored object wholesale rather than merging into it. Omit it to keep the current value; `null`, or an object whose members are all null, absent or empty lists, clears it.
  - `links` (array of WaypointLink | null, optional): Labelled external links, in the order they should be shown. Null when none are attached. Never an empty array. At most 10: the server enforces the ceiling, and a list over it is a validation error rather than a truncation.
    - `label` (string, required): Text shown for the link. Trimmed of leading and trailing whitespace, and refused with a 400 when nothing is left.
    - `url` (string (uri), required): Absolute `http` or `https` URL the link points to. Any other scheme is rejected: a renderer turns this into a link a reader clicks or an image a browser loads, so `javascript:` and `data:` are refused at the API rather than left for each client to remember.
  - `photos` (array of WaypointPhoto | null, optional): Photographs of the place, in the order they should be shown. Null when none are attached. Never an empty array. At most 10: the server enforces the ceiling, and a list over it is a validation error rather than a truncation.
    - `caption` (string | null, optional): Short caption describing the photo. Null when not provided.
    - `url` (string (uri), required): Absolute `http` or `https` URL of the image. Any other scheme is rejected: a renderer turns this into a link a reader clicks or an image a browser loads, so `javascript:` and `data:` are refused at the API rather than left for each client to remember.

- `name` (string | null, in body, optional): Display name of the waypoint, 2 to 30 characters as sent. Leading and trailing whitespace is then trimmed, and what remains must still be at least 2 characters. Omit to keep the current value; `null` clears it. A `poi` requires a name, so clearing a `poi`'s name is a `400` naming `name`; a `point` may be unnamed. A name is one line: a tab, a line break or a line separator between two of its characters is a `400`, and one at either end is trimmed with the whitespace there.

- `position` (integer (int32), in body, optional): Zero-based position of the waypoint within its parent itinerary, stored as given: no other waypoint moves to make room. Optional and not nullable: omit it to keep the current position. Between 0 and 9999.

- `properties` (array of WaypointProperty | null, in body, optional): Customer-defined fields for this waypoint. Replaces the stored list wholesale rather than merging into it. Keys must be unique within the waypoint. Omit it to keep the current list; `null` or an empty array clears it. At most 20: the server enforces the ceiling, and a list over it is a validation error rather than a truncation.
  - `format` (string | null, optional, one of: `text`, `number`, `duration`, `distance`, `url`, `date`): How `value` should be rendered. Null is equivalent to `text`, and is what a client sends when it has no opinion.
  - `key` (string, required): Stable machine-readable identifier for this field, as a lowercase slug. Unique within a waypoint. Reuse the same key across waypoints so readers can line the field up into a column.
  - `label` (string, required): Human-readable name of this field, shown to readers. Trimmed of leading and trailing whitespace, and refused with a 400 when nothing is left.
  - `value` (string, required): The field's value, always carried as a string.

    `format` says how to interpret it, and IS ENFORCED: a value declared `number` must parse as a finite number written in base ten, one declared `distance` or `duration` as such a number of zero or more, since no length or span is negative, one declared `date` must be an RFC 3339 instant, and one declared `url` must be an absolute `http` or `https` address. A renderer links that last one, so the same scheme rule the contact URLs keep applies here. `text` accepts anything within the length ceiling. An empty value passes whatever the format.

    A `date` carries a TIME as well as a day, like every other instant on this API, and is written as a full `date-time`. A bare `YYYY-MM-DD` is accepted on write too, because it is a well-formed RFC 3339 date; a renderer reads one as midnight.

    The two measured formats carry the same BASE UNITS every other measure on this API does, so a reader formats them into the units their audience prefers rather than guessing: `distance` is METERS and `duration` is SECONDS. A field declared `distance` with the value `12000` is twelve kilometers.

    A value that does not match the format it declares is refused rather than coerced: a renderer told the field is a distance and handed `soon` has no honest way to draw it, and silently printing the text makes the format a suggestion.

- `timing` (WaypointTiming | null, in body, optional): Cut-off and expected-arrival timing for this waypoint. Replaces the stored object wholesale rather than merging into it. Omit it to keep the current value; `null`, or an object whose members are all null or absent, clears it.
  - `cutoff_at` (string (date-time) | null, optional): Absolute wall-clock instant by which this waypoint must be left. Null when the waypoint has no cut-off.
  - `stop_duration` (integer (int32) | null, optional): Time expected to be spent at this waypoint, in seconds: a hut stop, an aid station or a scheduled break, at most thirty days. Null when no stop is planned.

**Response** `200`

The whole itinerary after the update, and its new `ETag`.

- `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` (ItineraryWithDetails, required): An itinerary with its full list of segments, waypoints, and segment groups included, plus its derived publication state.

  See [the ItineraryWithDetails object](https://docs.mountaya.com/en/apis/map-studio/reference/itineraries.md#itinerary-with-details-object).

Response headers:

- `ETag`: The version of the resource this answer returns, an opaque strong tag in double quotes, equal to that resource's `etag` field. Send it back as `If-Match` to make a write conditional on nobody having changed the resource since. It changes whenever what this read returns changes; compare it whole and never parse it. Present on every answer that returns the resource, and on the `412` that refuses a stale `If-Match`.
- `Idempotent-Replayed`: `true` when this answer is the stored answer to an earlier request carrying the same `Idempotency-Key`, replayed rather than run again. Absent on an answer that ran.

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

- `400`: The request was malformed, or a field failed validation: each entry names what, a field-level one at its `path`. The same `Idempotency-Key` sent with another request is refused here too, at `["request", "headers", "Idempotency-Key"]`. A refusal the write itself made is stored for its key, so a repeat of the key is refused again in the same words, marked `Idempotent-Replayed: true`.
- `401`: Unauthorized
- `402`: A plain `PAYMENT_REQUIRED`, with no per-entry refinement: the organization does not hold Embedded Studio, the product the `studio-embedded` scope belongs to and the one a publishable key needs to act as a member. It is agreed rather than bought, so it clears when the organization's agreement changes rather than when the request does. The product is checked before the key's scopes, so a key that lacks the scope as well is answered this rather than a `403`. The reads that take `publishing` are unaffected. It is also a plain `PAYMENT_REQUIRED` when the organization the itinerary belongs to does not hold Map Studio, which every change to an organization's itineraries, collections and zones needs. Map Studio is granted by the organization's agreement, so this too clears when the agreement changes rather than when the request does.
- `403`: The credential is valid and this operation is not open to it: the key does not carry the `studio-embedded` scope, or the user the session token names is not a member of the key's organization, or holds a role there that reads only, or the itinerary is one this credential can read and not edit, such as another organization's public itinerary while its publication is served. A user outside the organization and a member without the role answer alike. The blanket refusal in the [order of checks](https://docs.mountaya.com/en/apis/conventions/errors.md#which-refusal-you-get-first), an `Origin` or `Referer` the organization does not allow, answers here as well.
- `404`: Either no itinerary with that identifier is reachable, because none exists or this credential cannot view it, or that itinerary holds no waypoint with the identifier given. A waypoint that belongs to another itinerary answers the same way as one that does not exist, so neither identifier can be probed here. So does an itinerary that has never been published, or has been taken down, or whose organization's agreement does not include Map Publishing, when this credential reads it as published rather than as its draft: a write answers it as a read does.
- `409`: Conflict. Another member of the collaboration session holds the edit lock on the waypoint. The holder is carried at `extensions.metadata.holder.id`. A body this operation refuses is answered with its `400` before any lock is looked at, so a peer's lock is reported only for a request that is otherwise well formed. A request carrying the same `Idempotency-Key` as one still running is refused here too: its entry is coded `IDEMPOTENCY_KEY_IN_USE` and it carries `Retry-After`, after which the same request is answered with the first one's outcome. A request repeating the key of one whose answer cannot be replayed is refused here as well, its entry coded `IDEMPOTENCY_ANSWER_UNAVAILABLE`: the answer was too large to keep whole, or the request failed with a `5xx` after its write was made. Either way that write was made, and `extensions.metadata` is the `ResponseMetadataIdempotentAnswer` naming how it was answered, so read the resource again rather than sending the write once more.
- `412`: `PreconditionFailed`, given in full at the end of this page.
- `413`: Payload Too Large
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
# A field you omit keeps its stored value. A field you send replaces it whole:
# `amenities` is the complete new list, not the entries to add.
curl -s -X PATCH https://api.mountaya.com/v1/itineraries/0b6d1a4e-6d3f-4f7a-9c2e-1f0a5b8c3d21/waypoints/e8b1d740-2a96-4c53-b7f8-15d0a3c69e42 \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Refuge du Fioux",
    "description": "Half-board, book ahead. Water point at the door.",
    "icon": "hut",
    "position": 1,
    "amenities": [
      "water",
      "hot-meal",
      "accommodation",
      "toilets",
      "timing-checkpoint"
    ],
    "timing": {
      "cutoff_at": "2026-08-28T21:30:00Z",
      "stop_duration": 900
    }
  }'
```

**TypeScript**

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

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

const { data } = await mountaya.studio.itineraries.patchItineraryWaypoint({
  itinerary_id: "0b6d1a4e-6d3f-4f7a-9c2e-1f0a5b8c3d21",
  waypoint_id: "e8b1d740-2a96-4c53-b7f8-15d0a3c69e42",
  body: {
    name: "Refuge du Fioux",
    description: "Half-board, book ahead. Water point at the door.",
    icon: "hut",
    position: 1,
    amenities: [
      "water",
      "hot-meal",
      "accommodation",
      "toilets",
      "timing-checkpoint",
    ],
    timing: {
      cutoff_at: new Date("2026-08-28T21:30:00Z"),
      stop_duration: 900,
    },
  },
});

console.log(data);
```

**Python**

```python
import requests
import uuid

response = requests.patch(
    "https://api.mountaya.com/v1/itineraries/0b6d1a4e-6d3f-4f7a-9c2e-1f0a5b8c3d21/waypoints/e8b1d740-2a96-4c53-b7f8-15d0a3c69e42",
    headers={
        "X-API-Key": "pk_your_publishable_key",
        "X-Session-Token": "sess_your_session_token",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "name": "Refuge du Fioux",
        "description": "Half-board, book ahead. Water point at the door.",
        "icon": "hut",
        "position": 1,
        "amenities": [
            "water",
            "hot-meal",
            "accommodation",
            "toilets",
            "timing-checkpoint",
        ],
        "timing": {"cutoff_at": "2026-08-28T21:30:00Z", "stop_duration": 900},
    },
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 200:

```json
{
  "data": {
    "id": "9c2a7f60-1d4b-4e83-a5c7-6f0b8e91d245",
    "organization_id": "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
    "activity_id": "a1c4e7b2-3d59-4f08-8b6a-2e5c9d0f7134",
    "name": "Tour du Mont-Blanc",
    "description": "Ten stages from Les Houches, anticlockwise.",
    "is_private": false,
    "is_verified": true,
    "distance": 169800,
    "ascent": 9800,
    "count": {
      "groups": 3,
      "segments": 10,
      "waypoints": 24
    },
    "revision": 42,
    "etag": "\"d118\"",
    "created_by": {
      "id": "7a3e5d18-4c60-49b2-8f75-e2d1c9a4b607"
    },
    "created_at": "2026-05-12T09:14:00Z",
    "updated_at": "2026-06-28T16:02:00Z",
    "status": "published",
    "published_at": "2026-06-28T16:05:00Z",
    "has_unpublished_changes": false,
    "groups": [
      {
        "id": "5c6e2a71-3f84-4b9d-90e5-8a1c7b4f6d23",
        "itinerary_id": "9c2a7f60-1d4b-4e83-a5c7-6f0b8e91d245",
        "name": "Days 1-2",
        "color": "#2f80ed",
        "speed": 4.5,
        "revision": 2,
        "created_by": {
          "id": "7a3e5d18-4c60-49b2-8f75-e2d1c9a4b607"
        },
        "created_at": "2026-05-12T09:14:00Z"
      }
    ],
    "segments": [
      {
        "id": "2b8d4f19-6a05-4e73-8c1f-9d3b7e05a24c",
        "itinerary_id": "9c2a7f60-1d4b-4e83-a5c7-6f0b8e91d245",
        "group_id": "5c6e2a71-3f84-4b9d-90e5-8a1c7b4f6d23",
        "name": "Day 1: Col de Voza",
        "description": "From Les Houches over the Col de Voza, down the Bon Nant valley.",
        "mode": "directions",
        "position": 0,
        "color": "#2f80ed",
        "speed": 4.5,
        "start_at": "2026-07-04T07:30:00Z",
        "distance": 17400,
        "duration": 14760,
        "ascent": 1080,
        "descent": 720,
        "altitude_min": 942,
        "altitude_max": 1653,
        "gradient_min": -18.4,
        "gradient_max": 21.7,
        "geojson": {
          "type": "GeometryCollection",
          "geometries": [
            {
              "type": "LineString",
              "coordinates": [
                [
                  6.7986,
                  45.8918
                ],
                [
                  6.7621,
                  45.8842
                ],
                [
                  6.728,
                  45.8215
                ]
              ]
            },
            {
              "type": "MultiPoint",
              "coordinates": [
                [
                  6.7986,
                  45.8918
                ],
                [
                  6.728,
                  45.8215
                ]
              ]
            }
          ]
        },
        "slope_info": [
          {
            "from_index": 0,
            "to_index": 1,
            "value": 12.4
          },
          {
            "from_index": 1,
            "to_index": 2,
            "value": -8.1
          }
        ],
        "speed_info": [
          {
            "from_index": 0,
            "to_index": 1,
            "value": 2.9
          },
          {
            "from_index": 1,
            "to_index": 2,
            "value": 5.6
          }
        ],
        "surface_info": [
          {
            "from_index": 0,
            "to_index": 1,
            "value": "compacted-gravel"
          },
          {
            "from_index": 1,
            "to_index": 2,
            "value": "dirt"
          }
        ],
        "way_type_info": [
          {
            "from_index": 0,
            "to_index": 2,
            "value": "path"
          }
        ],
        "trail_difficulty_info": [
          {
            "from_index": 0,
            "to_index": 2,
            "value": "mountain-hiking"
          }
        ],
        "steps": [
          {
            "from_index": 0,
            "to_index": 1,
            "type": "depart",
            "name": "Route des Chavants",
            "distance": 8400,
            "duration": 7200,
            "exit_number": null
          },
          {
            "from_index": 1,
            "to_index": 2,
            "type": "goal",
            "name": "-",
            "distance": 9000,
            "duration": 7560,
            "exit_number": null
          }
        ],
        "road_access_info": [
          {
            "from_index": 1,
            "to_index": 2,
            "values": [
              "private"
            ]
          }
        ],
        "revision": 7,
        "created_by": {
          "id": "7a3e5d18-4c60-49b2-8f75-e2d1c9a4b607"
        },
        "created_at": "2026-05-12T09:14:00Z"
      }
    ],
    "waypoints": [
      {
        "id": "e8b1d740-2a96-4c53-b7f8-15d0a3c69e42",
        "itinerary_id": "9c2a7f60-1d4b-4e83-a5c7-6f0b8e91d245",
        "mode": "poi",
        "position": 0,
        "name": "Refuge du Fioux",
        "description": "Half-board, book ahead in July.",
        "icon": "hut",
        "color": "#f2994a",
        "geojson": {
          "type": "Point",
          "coordinates": [
            6.7612,
            45.8479
          ]
        },
        "amenities": [
          "water",
          "hot-meal",
          "accommodation",
          "toilets",
          "timing-checkpoint"
        ],
        "timing": {
          "cutoff_at": "2026-08-28T21:30:00Z",
          "stop_duration": 900
        },
        "contact": {
          "website": "https://www.example.com/refuge",
          "phone": "+33 4 50 12 34 56",
          "email": "contact@example.com",
          "address": "74170 Les Contamines-Montjoie, France",
          "opening_hours": "Mid-June to mid-September, 07:00-21:00 daily.",
          "booking_url": "https://www.example.com/refuge/reserver"
        },
        "media": {
          "photos": [
            {
              "url": "https://cdn.example.com/refuge-du-fioux/terrace.jpg",
              "caption": "The terrace at sunrise."
            }
          ],
          "links": [
            {
              "label": "Access from Les Contamines",
              "url": "https://www.example.com/access/les-contamines"
            }
          ]
        },
        "properties": [
          {
            "key": "bib-check",
            "label": "Bib check",
            "value": "Mandatory, both sides",
            "format": "text"
          }
        ],
        "revision": 3,
        "created_by": {
          "id": "7a3e5d18-4c60-49b2-8f75-e2d1c9a4b607"
        },
        "created_at": "2026-05-12T09:14:00Z"
      }
    ]
  }
}
```

## Delete a waypoint from an itinerary

### DELETE /v1/itineraries/{itinerary_id}/waypoints/{waypoint_id}

- Operation: `deleteItineraryWaypoint`
- Requires: scope `studio-embedded` · acting user required (a session token naming a member) · an `Idempotency-Key` header, the same on every retry
- Behavior: idempotent, safe to retry · answers within 30000 ms or times out

Permanently deletes the waypoint. This action cannot be undone. The remaining waypoints keep their positions: nothing is renumbered.

Returns the whole itinerary with its segments, waypoints, and groups, as every write to an itinerary's parts does. Send the itinerary's `ETag` as `If-Match` to make the delete conditional on nobody having changed the itinerary since you read it; a stale tag is refused with `412` and nothing is deleted.

Requires a publishable key with the `studio-embedded` scope AND a session token minted for `studio-embedded` naming a user, a member with a write role, whom the request acts as. A publishable key without a session token minted for `studio-embedded` naming a user, a token minted for another surface included, is refused with **401**.

**Webhook events** [`itinerary.waypoint.deleted`](https://docs.mountaya.com/en/webhooks/events/itinerary-waypoint.md#itinerary-waypoint-deleted), recorded by the task `itinerary.waypoint.delete`.

**Path parameters**

- `itinerary_id` (string (uuid), in path, required): Identifier of the itinerary the operation acts on. An itinerary this credential does not reach is a 404 rather than a 403, and so is one that does not exist, so the parameter cannot be used to learn which itinerary ids exist.

- `waypoint_id` (string (uuid), in path, required): Identifier of the waypoint within the itinerary named by `itinerary_id`. A waypoint belonging to another itinerary is a 404.

**Headers**

- `Idempotency-Key` (string, in header, optional): A value the caller chooses once per logical write and sends again, unchanged, on every retry of it, so a write whose answer was lost runs at most once. A UUID is the usual choice; any 1 to 255 printable ASCII characters without a space are accepted. The key is held for 12 hours, for the credential that sent it (the publishable key and the user its session token names) and for this operation.

  The first request runs. A request repeating the key with the same method, path, query and body, sent as the same media type, is answered with the first one's stored status and body, its `Location` and `ETag` included, and carries `Idempotent-Replayed: true`; nothing runs a second time and no limit is charged again. `Content-Type` is compared as the media type it names, with its `charset`, rather than as the header was written, so the letter case of the type and the spacing around its parameters do not make two requests different. `If-Match` is not compared: a key sent again after a `412`, with a fresh tag, is answered with that same `412`, so a write retried with a new tag takes a new key. Every answer below `500` other than a `429` is stored that way, a refusal included, so a retried request that was refused is refused again in the same words. A request refused before the write is reached stores nothing, and a retry with the same key runs again: every `401`, and every `413` refusing a body over the operation's ceiling. The `413` that `postItineraryPreview` answers for the source it has read, a file or a track too large, is stored as any other refusal is.

  A `5xx` answered before anything was written stores nothing and releases the key: a retry with the same key runs again. A `5xx` answered after the write was made keeps the key, and a request repeating it is a `409` whose entry is coded `IDEMPOTENCY_ANSWER_UNAVAILABLE`, as is a request repeating the key of an answer too large to store whole. Either way the write was made: the `409` carries no `Location`, and its `extensions.metadata` (`ResponseMetadataIdempotentAnswer`) names the `status` the first request was answered with and, where that answer carried them, its `location` and `etag`. Read the resource again rather than sending the write once more, which is answered the same way.

  The same key with a different request is a `400` at `["request", "headers", "Idempotency-Key"]`, and nothing runs, whether the first request is still running or was answered. The same request while its first one is still running is a `409` whose entry is coded `IDEMPOTENCY_KEY_IN_USE`, carrying `Retry-After`: send it again once that has passed. Without the header a write runs every time it is sent, which is harmless on the writes `x-idempotent` marks safe to repeat and creates a second resource on the others. A stream's answer is never stored.

  Keys are kept on a best-effort basis. While Mountaya cannot read or record them, a write runs as if it carried no key, so a retry sent in that moment can run it a second time.

- `If-Match` (string, in header, optional): Makes the write conditional on the resource still being the version the caller read: the `ETag` an earlier answer carried, which is also that resource's `etag` field, or `*` for any version. When the resource has changed since, the write is refused with `412` `PRECONDITION_FAILED`, nothing is changed, and the answer carries the current `ETag`, so the caller reads the resource again and decides. Omitted, the write is unconditional and the last write wins.

  One strong tag in double quotes, or `*`. A list of tags, a weak tag (`W/`) or any other spelling is a `400` naming the header. A resource the caller cannot see is answered `404` before the condition is asked, so a stale tag never tells a caller anything a read would not.

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

**Response** `200`

The whole itinerary after the delete, and its new `ETag`. The remaining waypoints keep their positions.

- `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` (ItineraryWithDetails, required): An itinerary with its full list of segments, waypoints, and segment groups included, plus its derived publication state.

  See [the ItineraryWithDetails object](https://docs.mountaya.com/en/apis/map-studio/reference/itineraries.md#itinerary-with-details-object).

Response headers:

- `ETag`: The version of the resource this answer returns, an opaque strong tag in double quotes, equal to that resource's `etag` field. Send it back as `If-Match` to make a write conditional on nobody having changed the resource since. It changes whenever what this read returns changes; compare it whole and never parse it. Present on every answer that returns the resource, and on the `412` that refuses a stale `If-Match`.
- `Idempotent-Replayed`: `true` when this answer is the stored answer to an earlier request carrying the same `Idempotency-Key`, replayed rather than run again. Absent on an answer that ran.

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

- `400`: The request was malformed, or a field failed validation: each entry names what, a field-level one at its `path`. The same `Idempotency-Key` sent with another request is refused here too, at `["request", "headers", "Idempotency-Key"]`. A refusal the write itself made is stored for its key, so a repeat of the key is refused again in the same words, marked `Idempotent-Replayed: true`.
- `401`: Unauthorized
- `402`: A plain `PAYMENT_REQUIRED`, with no per-entry refinement: the organization does not hold Embedded Studio, the product the `studio-embedded` scope belongs to and the one a publishable key needs to act as a member. It is agreed rather than bought, so it clears when the organization's agreement changes rather than when the request does. The product is checked before the key's scopes, so a key that lacks the scope as well is answered this rather than a `403`. The reads that take `publishing` are unaffected. It is also a plain `PAYMENT_REQUIRED` when the organization the itinerary belongs to does not hold Map Studio, which every change to an organization's itineraries, collections and zones needs. Map Studio is granted by the organization's agreement, so this too clears when the agreement changes rather than when the request does.
- `403`: The credential is valid and this operation is not open to it: the key does not carry the `studio-embedded` scope, or the user the session token names is not a member of the key's organization, or holds a role there that reads only, or the itinerary is one this credential can read and not edit, such as another organization's public itinerary while its publication is served. A user outside the organization and a member without the role answer alike. The blanket refusal in the [order of checks](https://docs.mountaya.com/en/apis/conventions/errors.md#which-refusal-you-get-first), an `Origin` or `Referer` the organization does not allow, answers here as well.
- `404`: Either no itinerary with that identifier is reachable, because none exists or this credential cannot view it, or that itinerary holds no waypoint with the identifier given. A waypoint that belongs to another itinerary answers the same way as one that does not exist, so neither identifier can be probed here. So does an itinerary that has never been published, or has been taken down, or whose organization's agreement does not include Map Publishing, when this credential reads it as published rather than as its draft: a write answers it as a read does. A second delete of the same waypoint answers here too: send a retried delete with the same `Idempotency-Key` and it is answered with the first one's

1. 

- `409`: Conflict. Another member of the collaboration session holds the edit lock on the waypoint. The holder is carried at `extensions.metadata.holder.id`. A request carrying the same `Idempotency-Key` as one still running is refused here too: its entry is coded `IDEMPOTENCY_KEY_IN_USE` and it carries `Retry-After`, after which the same request is answered with the first one's outcome. A request repeating the key of one whose answer cannot be replayed is refused here as well, its entry coded `IDEMPOTENCY_ANSWER_UNAVAILABLE`: the answer was too large to keep whole, or the request failed with a `5xx` after its write was made. Either way that write was made, and `extensions.metadata` is the `ResponseMetadataIdempotentAnswer` naming how it was answered, so read the resource again rather than sending the write once more.
- `412`: `PreconditionFailed`, given in full at the end of this page.
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
# The remaining waypoints keep their positions: nothing is renumbered.
curl -s -X DELETE https://api.mountaya.com/v1/itineraries/0b6d1a4e-6d3f-4f7a-9c2e-1f0a5b8c3d21/waypoints/e8b1d740-2a96-4c53-b7f8-15d0a3c69e42 \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token"
```

**TypeScript**

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

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

const { data } = await mountaya.studio.itineraries.deleteItineraryWaypoint({
  itinerary_id: "0b6d1a4e-6d3f-4f7a-9c2e-1f0a5b8c3d21",
  waypoint_id: "e8b1d740-2a96-4c53-b7f8-15d0a3c69e42",
});

console.log(data);
```

**Python**

```python
import requests
import uuid

response = requests.delete(
    "https://api.mountaya.com/v1/itineraries/0b6d1a4e-6d3f-4f7a-9c2e-1f0a5b8c3d21/waypoints/e8b1d740-2a96-4c53-b7f8-15d0a3c69e42",
    headers={
        "X-API-Key": "pk_your_publishable_key",
        "X-Session-Token": "sess_your_session_token",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 200:

```json
{
  "data": {
    "id": "9c2a7f60-1d4b-4e83-a5c7-6f0b8e91d245",
    "organization_id": "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
    "activity_id": "a1c4e7b2-3d59-4f08-8b6a-2e5c9d0f7134",
    "name": "Tour du Mont-Blanc",
    "description": "Ten stages from Les Houches, anticlockwise.",
    "is_private": false,
    "is_verified": true,
    "distance": 169800,
    "ascent": 9800,
    "count": {
      "groups": 3,
      "segments": 10,
      "waypoints": 24
    },
    "revision": 42,
    "etag": "\"d118\"",
    "created_by": {
      "id": "7a3e5d18-4c60-49b2-8f75-e2d1c9a4b607"
    },
    "created_at": "2026-05-12T09:14:00Z",
    "updated_at": "2026-06-28T16:02:00Z",
    "status": "published",
    "published_at": "2026-06-28T16:05:00Z",
    "has_unpublished_changes": false,
    "groups": [
      {
        "id": "5c6e2a71-3f84-4b9d-90e5-8a1c7b4f6d23",
        "itinerary_id": "9c2a7f60-1d4b-4e83-a5c7-6f0b8e91d245",
        "name": "Days 1-2",
        "color": "#2f80ed",
        "speed": 4.5,
        "revision": 2,
        "created_by": {
          "id": "7a3e5d18-4c60-49b2-8f75-e2d1c9a4b607"
        },
        "created_at": "2026-05-12T09:14:00Z"
      }
    ],
    "segments": [
      {
        "id": "2b8d4f19-6a05-4e73-8c1f-9d3b7e05a24c",
        "itinerary_id": "9c2a7f60-1d4b-4e83-a5c7-6f0b8e91d245",
        "group_id": "5c6e2a71-3f84-4b9d-90e5-8a1c7b4f6d23",
        "name": "Day 1: Col de Voza",
        "description": "From Les Houches over the Col de Voza, down the Bon Nant valley.",
        "mode": "directions",
        "position": 0,
        "color": "#2f80ed",
        "speed": 4.5,
        "start_at": "2026-07-04T07:30:00Z",
        "distance": 17400,
        "duration": 14760,
        "ascent": 1080,
        "descent": 720,
        "altitude_min": 942,
        "altitude_max": 1653,
        "gradient_min": -18.4,
        "gradient_max": 21.7,
        "geojson": {
          "type": "GeometryCollection",
          "geometries": [
            {
              "type": "LineString",
              "coordinates": [
                [
                  6.7986,
                  45.8918
                ],
                [
                  6.7621,
                  45.8842
                ],
                [
                  6.728,
                  45.8215
                ]
              ]
            },
            {
              "type": "MultiPoint",
              "coordinates": [
                [
                  6.7986,
                  45.8918
                ],
                [
                  6.728,
                  45.8215
                ]
              ]
            }
          ]
        },
        "slope_info": [
          {
            "from_index": 0,
            "to_index": 1,
            "value": 12.4
          },
          {
            "from_index": 1,
            "to_index": 2,
            "value": -8.1
          }
        ],
        "speed_info": [
          {
            "from_index": 0,
            "to_index": 1,
            "value": 2.9
          },
          {
            "from_index": 1,
            "to_index": 2,
            "value": 5.6
          }
        ],
        "surface_info": [
          {
            "from_index": 0,
            "to_index": 1,
            "value": "compacted-gravel"
          },
          {
            "from_index": 1,
            "to_index": 2,
            "value": "dirt"
          }
        ],
        "way_type_info": [
          {
            "from_index": 0,
            "to_index": 2,
            "value": "path"
          }
        ],
        "trail_difficulty_info": [
          {
            "from_index": 0,
            "to_index": 2,
            "value": "mountain-hiking"
          }
        ],
        "steps": [
          {
            "from_index": 0,
            "to_index": 1,
            "type": "depart",
            "name": "Route des Chavants",
            "distance": 8400,
            "duration": 7200,
            "exit_number": null
          },
          {
            "from_index": 1,
            "to_index": 2,
            "type": "goal",
            "name": "-",
            "distance": 9000,
            "duration": 7560,
            "exit_number": null
          }
        ],
        "road_access_info": [
          {
            "from_index": 1,
            "to_index": 2,
            "values": [
              "private"
            ]
          }
        ],
        "revision": 7,
        "created_by": {
          "id": "7a3e5d18-4c60-49b2-8f75-e2d1c9a4b607"
        },
        "created_at": "2026-05-12T09:14:00Z"
      }
    ],
    "waypoints": [
      {
        "id": "e8b1d740-2a96-4c53-b7f8-15d0a3c69e42",
        "itinerary_id": "9c2a7f60-1d4b-4e83-a5c7-6f0b8e91d245",
        "mode": "poi",
        "position": 0,
        "name": "Refuge du Fioux",
        "description": "Half-board, book ahead in July.",
        "icon": "hut",
        "color": "#f2994a",
        "geojson": {
          "type": "Point",
          "coordinates": [
            6.7612,
            45.8479
          ]
        },
        "amenities": [
          "water",
          "hot-meal",
          "accommodation",
          "toilets",
          "timing-checkpoint"
        ],
        "timing": {
          "cutoff_at": "2026-08-28T21:30:00Z",
          "stop_duration": 900
        },
        "contact": {
          "website": "https://www.example.com/refuge",
          "phone": "+33 4 50 12 34 56",
          "email": "contact@example.com",
          "address": "74170 Les Contamines-Montjoie, France",
          "opening_hours": "Mid-June to mid-September, 07:00-21:00 daily.",
          "booking_url": "https://www.example.com/refuge/reserver"
        },
        "media": {
          "photos": [
            {
              "url": "https://cdn.example.com/refuge-du-fioux/terrace.jpg",
              "caption": "The terrace at sunrise."
            }
          ],
          "links": [
            {
              "label": "Access from Les Contamines",
              "url": "https://www.example.com/access/les-contamines"
            }
          ]
        },
        "properties": [
          {
            "key": "bib-check",
            "label": "Bib check",
            "value": "Mandatory, both sides",
            "format": "text"
          }
        ],
        "revision": 3,
        "created_by": {
          "id": "7a3e5d18-4c60-49b2-8f75-e2d1c9a4b607"
        },
        "created_at": "2026-05-12T09:14:00Z"
      }
    ]
  }
}
```

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

- `IdempotencyKeyInUse` (`409`): The `Idempotency-Key` this request carries is one an earlier request was sent with, and the answer to that one cannot be given here. Nothing was done by this request. Its entry says which. `IDEMPOTENCY_KEY_IN_USE`: the first request is still running. Wait the `Retry-After` this carries and send the same request again, which is then answered with the first request's outcome. `IDEMPOTENCY_ANSWER_UNAVAILABLE`: the first request's write was made, and its answer cannot be given again, because it was too large to keep whole, because the request failed with a `5xx` after the write was made, or because it carried a credential shown only once, which is never kept. `extensions.metadata` names the status it was answered with, and its `Location` and `ETag` where it carried them; a create whose operation says so names what it made there after a `5xx` too. Read the resource again rather than sending the write once more, which is answered the same way. A credential cannot be read again: where the operation says its answer carries one, the one it created is at `metadata.location`, so revoke that one and create another.
- `PreconditionFailed` (`412`): `If-Match` named a version the resource has moved on from: somebody changed it after the caller read it. Nothing was changed. The one entry is coded `PRECONDITION_FAILED`, and `ETag` carries the current version, so read the resource again, decide whether the change still applies, and send it with the new tag. Retrying with the same tag is refused the same way. A resource the caller cannot see is answered `404` before the condition is asked, and a write refused for any other reason is refused for that reason first.
- `TooManyRequests` (`429`): A limit on this operation's requests is spent: the [rate limits](https://docs.mountaya.com/en/apis/conventions/rate-limits.md) page lists every one, the unknown publishable keys one address may present among them, and the operation's description names any of its own. The request was counted and nothing was done. `Retry-After` says how long until the limit lifts; wait that long, with a little jitter of your own, and send the request again. Where the operation takes an `Idempotency-Key`, a write sent again with the same key runs once.
