---
title: "Classify First Message Route"
method: POST
path: "/onboarding/classify-first-message"
tags: ["onboarding"]
---

# Classify First Message Route

`POST /onboarding/classify-first-message`

Extract trip facts from a user's first chat message and look up the
destination's hero photo.

Used by the landing page to dynamically skip onboarding screens whose
answers the user already provided. Returns empty classification + null
hero on failure so the caller can safely treat the result as "no
prefill" — never raises a 5xx for prompt or parsing issues.

## Request body

- ClassifyFirstMessageRequest
  - `message` string, required

## Response `200`

Successful Response

- ClassifyFirstMessageResponse — Combined classifier output + hero photo for the destination. The landing page uses this single round-trip to (a) decide which onboarding screens to skip and (b) render the /onboarding intro with a hero treatment. Hero is looked up server-side against BestPhoto rather than making the client chase a second endpoint.
  - `classification` FirstMessageClassification, required — Trip facts extracted from a user's first chat message. Every field is null/empty when the message lacks clear evidence — the classifier is instructed to leave fields blank rather than guess. The frontend uses field presence to decide which onboarding screens to skip.
    - `destinations` string[]
    - `destination_country` string, nullable
    - `start_date` string, nullable
    - `end_date` string, nullable
    - `duration` 'weekend' | 'week' | 'two_weeks' | 'longer', nullable
    - `travelers` string[]
    - `pace` 'relaxed' | 'balanced' | 'packed', nullable
    - `intent` 'plan_trip' | 'research' | 'do_work', nullable
  - `hero_photo_url` string, nullable

## 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)
