---
title: "Import Conversations"
method: POST
path: "/api/conversations/import"
tags: ["conversations"]
---

# Import Conversations

`POST /api/conversations/import`

## Request

- Base URL: `https://api.taxcompass.it` (the document declares no server; this is the origin it was published from)
- URL: `https://api.taxcompass.it/api/conversations/import`
- Auth: HTTP bearer

One-time migration of a user's localStorage history (idempotent on legacy_id).

## Request body

- ImportRequest
  - `conversations` ImportConversation[]
    - `legacy_id` string, required
    - `title` string, nullable
    - `profile` object, nullable
    - `messages` MessageIn[]
      - `role` 'user' | 'assistant', required
      - `content` string, required
      - `response` object, nullable

## Response `200`

Successful Response

- ImportResult
  - `imported` integer, required
  - `skipped` integer, required

## Other responses

- `422`: Validation Error

---

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