---
title: "Create an itinerary"
method: POST
path: "/api/v2/itineraries"
tags: ["Itineraries (v2)"]
---

# Create an itinerary

`POST /api/v2/itineraries`

## Request

- Base URL: `https://www.endlesstravelplans.com`
- URL: `https://www.endlesstravelplans.com/api/v2/itineraries`
- Auth: HTTP bearer

Runs the Setup step's rules, matches the place against the catalogue (free text stays valid; generation
is name driven), files the draft row under the caller's trip (`tripExternalId` names one the caller may
build on, else the place and dates match one, else a new trip is made) and answers its document.
`generate: true` also starts the AI build, as the Generate button does; poll `GET .../build` until it is
terminal. A free account at its trip limit with nothing matching gets the row without a trip and
`needs_trip_choice` with the candidates; `POST .../trip` files it afterwards.

## Request body

- object
  - `generate` boolean: Start the AI build at once.
  - `tripExternalId` string, nullable: The trip to file the itinerary under.
  - `destination` string, nullable, required: Where the trip goes.
  - `destinationId` integer, nullable
  - `startDate` string, nullable, required: The day of arrival (Y-m-d).
  - `endDate` string, nullable, required: The day of leaving (Y-m-d).
  - `intensityLevel` string, nullable, required: relaxed, moderate or intense.
  - `numAdults` integer, required: Adults travelling.
  - `numSeniors` integer: Must be at least 0. Must not be greater than 50.
  - `numChildren` integer, nullable: Children travelling.
  - `childrenAges` integer[]: One age per child.
  - `interests` string[]: Interests to weight the plan by.
  - `categories` string[]: Must not be greater than 100 characters.
  - `mustDo` string, nullable: Must not be greater than 2000 characters.
  - `mustDoChips` string[]: Must not be greater than 255 characters.
  - `tripType` 'single_city' | 'multi_city'
  - `stops` object[]: Must not have more than 20 items.
    - `destination` string, nullable: Must not be greater than 255 characters.
    - `destination_id` integer, nullable
    - `nights` integer, nullable: Must be at least 0. Must not be greater than 60.
  - `quickStartTemplateId` integer, nullable

## Response `201`

- union
  - object
    - `external_id` string
    - `state` string
    - `inputs` object
      - `destination` string
    - `plan` object
      - `days` unknown[]
        - unknown
    - `build` string, nullable
    - `can` object
      - `edit` boolean
      - `generate` boolean
    - `edit_version` integer
  - object: generate: true
    - `external_id` string
    - `state` string
    - `build` object
      - `id` string
      - `status` string
      - `progress` integer

## Other responses

- `401`: unauthenticated: No valid bearer token was sent.
- `403`: at the monthly AI limit
- `422`
- `429`: rate_limited: A throttle or a per-account allowance refused the request; `retry_after` or `remaining` may be present.
- `500`: server_error: Unhandled failure; quote `request_id` to support.

---

[API](https://skmtc.dev/endlesstravelplans/apis/endless-travel-plans-api.md) · [All operations](https://skmtc.dev/endlesstravelplans/apis/endless-travel-plans-api/llms.txt) · [OpenAPI document](https://skmtc.dev/endlesstravelplans/apis/endless-travel-plans-api/revisions/ae82ed3e4a8f?raw)
