> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nivara.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Save Conversation

# Save Conversation

Endpoint for saving conversation history.

## Request Body

| Field         | Type    | Required | Description                         |
| ------------- | ------- | -------- | ----------------------------------- |
| messages      | array   | Yes      | Conversation messages               |
| id            | integer | No       | Conversation ID                     |
| endpoint      | string  | No       | Endpoint name (default: "shipment") |
| user\_id      | string  | No       | User ID                             |
| custom\_title | string  | No       | Custom conversation title           |
| language      | string  | No       | Language code (default: "en")       |

## Responses

| Status | Description        | Content Type     |
| ------ | ------------------ | ---------------- |
| 200    | Conversation saved | application/json |
| 422    | Validation Error   | application/json |


## OpenAPI

````yaml POST /save-conversation
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /save-conversation:
    post:
      summary: Save Conversation
      operationId: save_conversation_save_conversation_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Conversation'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Conversation:
      properties:
        messages:
          items: {}
          type: array
          title: Messages
        id:
          type: integer
          title: Id
        endpoint:
          type: string
          title: Endpoint
          default: shipment
        user_id:
          type: string
          title: User Id
        custom_title:
          type: string
          title: Custom Title
        language:
          type: string
          title: Language
          default: en
      type: object
      required:
        - messages
      title: Conversation
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````