---
title: "Link Chat To Trip"
method: POST
path: "/chats/{conversation_id}/link"
---

# Link Chat To Trip

`POST /chats/{conversation_id}/link`

File a chat onto a trip (`link_source='item_save'`) — the user's own tag.

Drives "save a card out of a tripless chat": the user picks a destination
trip, this files the chat there, and the item save itself then goes through
the normal itinerary route.

**Filing, not binding** (docs/GLOBAL_CHATS.md §4.2). This is the
one path that can give a global chat a primary link, and it is deliberately
the only one: it is the user saying where the chat belongs. It does NOT
change which trip the chat's agent reads or writes — that stays the birth
binding (None for a global chat), so tagging a chat never rewrites its tool
list or its addressing scheme mid-conversation.

Idempotent: a chat that already has a primary link gets it back untouched
rather than being relinked — which is also what makes a double-tap safe.

"Unlinked" here means *no primary*, not *no links*: a global chat can hold N
reference links and none primary, and saving into a trip it already
references promotes that link rather than minting a second one.

## Path parameters

- `conversation_id` string, required

## Request body

- LinkChatToTripRequest — Bind an unlinked (tripless) chat to a trip. Exactly one of `trip_id` (bind to an existing trip) or `create_new` (mint a fresh one that adopts this chat) must be given.
  - `trip_id` string, nullable
  - `create_new` boolean
  - `new_trip_title` string, nullable
  - `entry_point` string, nullable

## Response `200`

Successful Response

- LinkChatToTripResponse
  - `trip` ChatPrimaryTrip, required
    - `id` string, required
    - `title` string, nullable
  - `created` boolean, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/stardrift/apis/fastapi.md) · [All operations](https://skmtc.dev/stardrift/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/stardrift/fastapi/revisions/00746572572a/schema)
