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

> 创建一个对话

# Create Conversation



## OpenAPI

````yaml post /v1/conversations/create
openapi: 3.1.0
info:
  title: spectra-server
  description: The API for Spectra Backend.
  version: 0.1.0
servers:
  - url: https://api-spectra.duplik.cn
security: []
paths:
  /v1/conversations/create:
    post:
      tags:
        - Conversations
      summary: Create Conversation
      operationId: create_conversation_v1_conversations_create_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConversationCreateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationRead'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      security:
        - HTTPBearer: []
components:
  schemas:
    ConversationCreateRequest:
      properties:
        agent_id:
          type: string
          title: Agent Id
        file_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: File Ids
        third_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Third User Id
      type: object
      required:
        - agent_id
      title: ConversationCreateRequest
    ConversationRead:
      properties:
        created_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Updated At
        org_id:
          type: string
          title: Org Id
        user_id:
          type: string
          title: User Id
        agent_id:
          anyOf:
            - type: string
              maxLength: 20
            - type: 'null'
          title: Agent Id
          description: Agent ID
        title:
          type: string
          maxLength: 128
          title: Title
          description: Conversation title
          default: ''
        file_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: File Ids
          description: User attachment files
        config:
          anyOf:
            - $ref: >-
                #/components/schemas/src__libs__modules__conversation__schemas__ConversationConfig
            - type: 'null'
          description: Conversation config
        status:
          type: integer
          title: Status
          description: Conversation status
          default: 1
        third_user_id:
          anyOf:
            - type: string
              maxLength: 32
            - type: 'null'
          title: Third User Id
          description: third_user_id
        conversation_id:
          type: string
          title: Conversation Id
        agent:
          anyOf:
            - $ref: '#/components/schemas/SimpleAgentRead'
            - type: 'null'
          description: Agent information
      type: object
      required:
        - created_at
        - updated_at
        - org_id
        - user_id
        - conversation_id
      title: ConversationRead
      description: Conversation read model
    ErrorResponse:
      properties:
        code:
          type: integer
          title: Code
        message:
          type: string
          title: Message
      type: object
      required:
        - code
        - message
      title: ErrorResponse
    src__libs__modules__conversation__schemas__ConversationConfig:
      properties:
        enable_websearch:
          type: boolean
          title: Enable Websearch
          description: Enable web search
          default: false
      type: object
      title: ConversationConfig
      description: Conversation configuration
    SimpleAgentRead:
      properties:
        agent_id:
          type: string
          maxLength: 20
          title: Agent Id
          description: Agent ID
        name:
          type: string
          maxLength: 256
          title: Name
          description: Agent name
        mode:
          type: string
          title: Mode
          description: Agent mode
        icon:
          type: string
          maxLength: 1024
          title: Icon
          description: Agent icon URL
      type: object
      required:
        - agent_id
        - name
        - mode
        - icon
      title: SimpleAgentRead
      description: Simple agent read model with minimal fields
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````