---
title: "Send the planner a message"
method: POST
path: "/api/trips/{id}/plan"
tags: ["Planner"]
---

# Send the planner a message

`POST /api/trips/{id}/plan`

## Request

- Base URL: `https://trvlrr.app`
- URL: `https://trvlrr.app/api/trips/{id}/plan`
- Auth: HTTP bearer

Answers when the turn is done — up to a minute or two — with the whole state; a client whose connection drops polls GET. While a turn is pending, a second message returns the current state. Uses a planner turn.

## Path parameters

- `id` string, required: The trip id.

## Request body

- PlanMessageInput
  - `message` string, required: The request, up to 2,000 characters.

## Response `200`

The state after the turn.

- PlanState
  - `messages` PlanMessage[], required
    - `role` 'user' | 'assistant', required
    - `content` string, required
    - `created_at` string, required
  - `proposals` PlanProposal[], required: Open proposals.
    - `id` string, required
    - `kind` 'stay' | 'segment' | 'activity' | 'place' | 'trip_dates', required
    - `payload` object, required: The proposed item, shaped like the matching input.
    - `rationale` string, nullable, required
    - `status` string, required
  - `turn` object, required
    - `state` 'idle' | 'pending' | 'failed', required
    - `error` string, nullable, required

## Other responses

- `400`: The request is malformed or fails validation.
- `401`: No usable credential: a Clerk session token, a device token or an OAuth access token is required.
- `402`: Trvlrr Plus is required, or this month's AI allowance is used up.
- `403`: The caller may not do this to this account or trip.
- `404`: No such thing, or not one the caller can see.

---

[API](https://skmtc.dev/trvlrr/apis/trvlrr-api.md) · [All operations](https://skmtc.dev/trvlrr/apis/trvlrr-api/llms.txt) · [OpenAPI document](https://skmtc.dev/trvlrr/apis/trvlrr-api/revisions/ea024946b293?raw)
