Itineraries (v2)

Edit the plan

One of the Build step's hand edits, autosaved: op is add_day, remove_day (date), move_activity (activityId, fromDate, toDate, index optional), reorder (activityId, date, index), add_custom (date, title, time, notes, address, location), update_custom (date, activityId, same fields), remove_activity (date, activityId; a suggestion goes back to the pool), restore_from_pool (activityId, date), swap (date, activityId; a like-for-like idea from the pool), set_price (date, activityId, price), set_quantity (date, activityId, quantity, groupRate). Travel legs are recomputed for the days touched; the answer is the document with dirty_days and the step's label for the client's own undo. A refused edit answers 422 with the step's words; a row another editor moved on from answers 409 with the current document.

post/api/v2/itineraries/{externalId}/edits

Request

  • Base URL: https://www.endlesstravelplans.com
  • URL: https://www.endlesstravelplans.com/api/v2/itineraries/{externalId}/edits
  • Auth: HTTP bearer

Request body

opstring required

The operation.

editVersioninteger nullable

The version the client loaded.

datestring nullable

Must be a valid date in the format <code>Y-m-d</code>.

fromDatestring nullable

The day it leaves (Y-m-d).

toDatestring nullable

The day it goes to (Y-m-d).

activityIdstring nullable

The activity.

indexinteger nullable

Its position in the day; the free slot when left out.

titlestring nullable

Must not be greater than 255 characters.

timestring nullable

Must not be greater than 20 characters.

notesstring nullable

Must not be greater than 2000 characters.

addressstring nullable

Must not be greater than 500 characters.

pricenumber nullable

Must be at least 0. Must not be greater than 1000000.

quantityinteger nullable

Must be at least 1. Must not be greater than 99.

groupRateboolean nullable
category'custom' | 'sightseeing' | 'adventure' | 'cultural' | 'food' | 'shopping' | 'relaxation' | 'nature' | 'nightlife' nullable

Example request

{
  "op": "move_activity",
  "editVersion": 3,
  "date": "2026-10-16",
  "fromDate": "2026-11-10",
  "toDate": "2026-11-11",
  "activityId": "a1",
  "title": "z",
  "time": "miyvdljnikhwaykc",
  "notes": "m",
  "address": "y",
  "location": {
    "lat": 4326.41688,
    "lng": 4326.41688
  },
  "price": 17,
  "quantity": 15,
  "category": "cultural"
}

Response

external_idstring
statestring
dirty_daysstring[]
labelstring
edit_versioninteger

Example response

{
  "external_id": "9c7e",
  "state": "ready",
  "plan": {
    "days": [],
    "markers": [
      {
        "id": "custom_4b1e",
        "name": "Night market",
        "lat": 38.7139,
        "lng": -9.1334,
        "category": "food",
        "day": 2,
        "order": 1
      }
    ]
  },
  "dirty_days": [
    "2026-11-10",
    "2026-11-11"
  ],
  "label": "Moved to Day 2",
  "edit_version": 4
}

Changes

No recorded changes to this operation across all 1 revision of this API.