---
title: "Create conversation"
method: POST
path: "/api/chat/conversations"
tags: ["chat"]
---

# Create conversation

`POST /api/chat/conversations`

## Request

- Base URL: `https://localhost:8080`
- URL: `https://localhost:8080/api/chat/conversations`
- Auth: none declared

Creates a new conversation. Supports both authenticated users and anonymous sessions.

## Request body

- CreateConversationDto
  - `title` string, required: Conversation title (first 100 chars of first message)
  - `firstMessage` string: First message content (optional)
  - `isPublic` boolean: Whether conversation is public
  - `source` 'web' | 'word_plugin' | 'slack' | 'docs': Conversation source platform (e.g. docs for Google Docs add-on)

## Response `201`

Conversation created successfully

- CreateConversationResponseDto
  - `conversationId` string, required: Created conversation ID
  - `conversation` ConversationDto, required
    - `id` string, required: Conversation ID
    - `title` string, required: Conversation title
    - `userId` object: User ID (null for anonymous)
    - `sessionId` object: Session ID (for anonymous conversations)
    - `isPublic` boolean, required: Whether conversation is public
    - `source` 'web' | 'word_plugin' | 'slack', required: Source platform of conversation
    - `isOwner` boolean: Whether current user is owner
    - `lastMessageAt` string, required: Last message timestamp
    - `messageCount` number, required: Number of messages in conversation
    - `createdAt` string, required: Creation timestamp
    - `updatedAt` string, required: Last update timestamp

## Other responses

- `400`: Invalid request data

---

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