# set_route_spots

Replace the ordered spots a route passes.

`PUT /v1/routes/{routeId}/spots` · MCP tool `set_route_spots` · scope `write` · stable · since 2026-09-17

Full replacement: [{ spotKey, order, quickest?, role? }]. quickest marks the fastest approach to that spot. role optional marks a walk from the spot that is not the way in (the Inariyama loop above the gates): it shows as Walks from here and never sets the spot's Accessibility.

## Path parameters

- `routeId` (string, required): Id of the route.

## Body parameters

- `spots` (array of objects, required): Ordered [{ spotKey, order, quickest?, role?: required|optional }], at most 200.
  - `spotKey` (string, required): A spot of this guide (spotKey from list_spots), listed once.
  - `order` (number, required): The spot's position on the route (ascending, any number).
  - `quickest` (boolean, optional): true marks this route as the fastest approach to that spot.
  - `role` (string, optional): required (the default): the way in. optional: a walk from the spot that is not the way in; it shows as Walks from here and never sets the spot's Accessibility. One of `required`, `optional`.

## Returns

200.

- `ok` (boolean, required): Always true: the write went through. Always `true`.
- `routeId` (string, required): The route's id.
- `edges` (number, required): How many links the list now holds.

## Examples

### Link the trail to the spot it leads to

```bash
curl -X PUT "https://sceniq.earth/api/v1/routes/kx7f2h8j4k0k6z2x8c4v0b6n2m8q4w0e/spots" \
  -H "Authorization: Bearer $SCENIQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "spots": [
    {
      "spotKey": "01M2Z1G0Y0QG7M2V6N9R3T5W8Y",
      "order": 1024
    }
  ]
}'
```

MCP `tools/call`:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "set_route_spots",
    "arguments": {
      "routeId": "kx7f2h8j4k0k6z2x8c4v0b6n2m8q4w0e",
      "spots": [
        {
          "spotKey": "01M2Z1G0Y0QG7M2V6N9R3T5W8Y",
          "order": 1024
        }
      ]
    }
  }
}
```

Response 200:

```json
{
  "ok": true,
  "routeId": "kx7f2h8j4k0k6z2x8c4v0b6n2m8q4w0e",
  "edges": 1
}
```

### A walk from the spot that is not the way in (role optional)

```bash
curl -X PUT "https://sceniq.earth/api/v1/routes/kx7r4t6y8v0j2p4p6a8s0d2f4g6h8j0k/spots" \
  -H "Authorization: Bearer $SCENIQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "spots": [
    {
      "spotKey": "01M2Z1G0Y0R2K5P8S1V4X7Z0C3",
      "order": 1024,
      "role": "optional"
    }
  ]
}'
```

MCP `tools/call`:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "set_route_spots",
    "arguments": {
      "routeId": "kx7r4t6y8v0j2p4p6a8s0d2f4g6h8j0k",
      "spots": [
        {
          "spotKey": "01M2Z1G0Y0R2K5P8S1V4X7Z0C3",
          "order": 1024,
          "role": "optional"
        }
      ]
    }
  }
}
```

Response 200:

```json
{
  "ok": true,
  "routeId": "kx7r4t6y8v0j2p4p6a8s0d2f4g6h8j0k",
  "edges": 1
}
```

## Errors

- `invalid_argument` (400): A required field is missing, a field is unknown, or a value does not match its type (the Convex validator's path and value are in the message).
- `invalid_request` (400): A writer refused a value: a map link on a host that is not allowed, a title that is too long, a date that does not exist, too many items in a list. The message is the writer's own sentence.
- `unauthenticated` (401): The request carries no key. Send it as Authorization: Bearer sk_sceniq_... (or X-Api-Key).
- `invalid_api_key` (401): The key is unknown, revoked or expired.
- `api_scope_required` (403): A read-only key called a write operation, or a key without the publish option called publish_changes.
- `forbidden` (403): The key belongs to a creator account that is no longer active.
- `not_found` (404): The id does not exist or belongs to another creator. The two answers are identical on purpose, so ids never reveal what exists.
- `payload_too_large` (413): A JSON body over 2 MB, an image over 6 MB, a batch upload over 19 MB, or an MCP message over 2 MB.
- `rate_limited` (429): Over a limit: requests per key per minute, per creator per hour, uploads per key per minute, or check_links per guide per hour.
- `internal_error` (500): An unexpected failure. The message is hidden on purpose.

Reference: https://developers.sceniq.earth/reference/set_route_spots
