---
title: "Generate the plan"
method: POST
path: "/api/v2/itineraries/{externalId}/generate"
tags: ["Itineraries (v2)"]
---

# Generate the plan

`POST /api/v2/itineraries/{externalId}/generate`

## Request

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

Starts the AI build for the stored inputs, as the Generate button does: the monthly AI quota, the stop
cap and the trip length rule apply; a build already running for the same inputs is answered instead of
started twice. Poll `GET .../build` until `terminal`, then read the document.

## Response `200`

- object
  - `external_id` string
  - `state` string
  - `build` object
    - `id` string
    - `status` string
    - `progress` integer
    - `days_completed` integer
    - `total_days` integer

## Other responses

- `401`: unauthenticated: No valid bearer token was sent.
- `403`
- `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)
