---
title: "Get or create the chat with an assigned patient"
method: POST
path: "/api/chat/chats/get-or-create"
tags: ["chat"]
---

# Get or create the chat with an assigned patient

`POST /api/chat/chats/get-or-create`

Operator-side get-or-create of the chat with one of their assigned patients (patient_id). Idempotent: returns the existing chat if present.

## Query parameters

- `patient_id` string, uuid, required — Patient UUID (an assigned patient of the operator)

## Response `200`

Successful Response

- ChatResponse — Chat response model. id/status/created_at/updated_at are null for "placeholder" entries: assigned patients without a chat yet (only returned to the operator in the chat list).
  - `id` string, nullable — Chat UUID (null for a not-yet-created chat)
  - `patient_id` string, required — Patient UUID
  - `operator_id` string, required — Operator UUID
  - `profession` string, required — Operator profession: 'PSICOLOGO' or 'NUTRIZIONISTA'
  - `status` string, nullable — Chat status: 'active', 'archived', 'closed'
  - `last_message_at` string, date-time, nullable — Last message timestamp
  - `created_at` string, date-time, nullable — Chat creation timestamp
  - `updated_at` string, date-time, nullable — Chat last update timestamp
  - `operator_first_name` string, nullable — Operator first name
  - `operator_last_name` string, nullable — Operator last name
  - `patient_first_name` string, nullable — Patient first name
  - `patient_last_name` string, nullable — Patient last name

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/corabea/apis/corabea-api.md) · [All operations](https://skmtc.dev/corabea/apis/corabea-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/corabea/corabea-api/revisions/d6ed0fec5d4f/schema)
