---
title: "Create Chat Session"
method: POST
path: "/v0/chat_sessions/chat_results"
tags: ["chat_session"]
---

# Create Chat Session

`POST /v0/chat_sessions/chat_results`

## Request body

- CreateChatSessionWithChatResultInput
  - `integration_id` string, required
  - `chat_session` ChatSessionInput, required
    - `guidance` string, nullable
    - `context` string, nullable
    - `messages` Message[], required
      - union
        - UserMessage
          - `role` 'user', required
          - `content` string, required
        - AssistantMessage
          - `role` 'assistant', required
          - `content` string, required
          - `records_cited` RecordsCited
            - `citations` Citation[], required
              - …
    - `tags` string[]
  - `chat_mode` union
    - 'turbo' | 'auto'
    - string
  - `stream` boolean

## Response `200`

Successful Response

- ChatResult
  - `chat_session_id` string, required
  - `message` AssistantMessage, required
    - `role` 'assistant', required
    - `content` string, required
    - `records_cited` RecordsCited
      - `citations` Citation[], required
        - `number` integer
        - `record` Record, required
          - `type` union, required — The type of record
            - 'documentation' | 'site' | 'discourse_post' | 'github_issue' | 'github_discussion' | 'stackoverflow_question' | 'discord_forum_post' | 'discord_message' | 'custom_question_answer'
            - string
          - `url` string, nullable
          - `title` string, nullable
          - `description` string, nullable
          - `breadcrumbs` string[], nullable
        - `hit_url` string, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2024-04-25** `18384b1ef7b1` — 1 info
  - added the new optional request property `chat_session/tags`
- **2024-03-14** `4039a787399c` — 5 breaking, 9 info
  - the `role` request property const value `assistant` was added
  - the `role` request property const value `user` was added
  - removed the enum value `assistant` of the request property `chat_session/messages/items/oneOf[subschema #2: Assistant Message]/role`
  - removed the enum value `user` of the request property `chat_session/messages/items/oneOf[subschema #1: User Message]/role`
  - …10 more
- **2024-03-04** `0df6a1bc1818` — 5 breaking, 3 warning, 4 info
  - request property `chat_session/messages/items/oneOf[subschema #1: User Message]/role` was restricted to a list of enum values
  - request property `chat_session/messages/items/oneOf[subschema #2: Assistant Message]/role` was restricted to a list of enum values
  - the `event` response property const value `message_chunk` was removed for the status `200` (media type: text/event-stream)
  - the `event` response property const value `records_cited` was removed for the status `200` (media type: text/event-stream)
  - …8 more
- **2024-02-19** `526411b78bcb` — 2 info
  - added the new optional request property `chat_session/context`
  - added the new optional request property `chat_session/guidance`
- …earlier changes not shown

[Full history](https://skmtc.dev/inkeep/apis/inkeep-search-and-chat-api/changes/v0/chat_sessions/chat_results/post.md)

---

[API](https://skmtc.dev/inkeep/apis/inkeep-search-and-chat-api.md) · [All operations](https://skmtc.dev/inkeep/apis/inkeep-search-and-chat-api/llms.txt) · [OpenAPI document](https://skmtc.dev/inkeep/apis/inkeep-search-and-chat-api/revisions/18384b1ef7b1?raw)
