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

# Join Existing Conversation

> Join an existing conversation using conversation ID and API key authentication. Allows real-time participation in ongoing conversations with streaming responses. The user prompt becomes the next message sent to the AI.

**Important for streaming:** Use the `--no-buffer` flag with cURL to enable real-time streaming output.



## OpenAPI

````yaml api-reference/openapi.json post /api/v1/integration/conversations/join-conversation
openapi: 3.1.0
info:
  title: Thesis.io APIs
  description: >-
    Thesis.io provides comprehensive AI-powered research and conversation APIs
    for DeFi analysis and blockchain research. Create conversations with
    customizable research modes including chat, deep research, and specialized
    DeFi tools for real-time market analysis. Join existing conversations via
    streaming endpoints to participate in collaborative research sessions with
    advanced AI agents.
  version: 0.32.1
servers:
  - url: https://app-be.thesis.io
    description: Production Thesis APIs
security:
  - APIKeyAuth: []
  - {}
paths:
  /api/v1/integration/conversations/join-conversation:
    post:
      tags:
        - conversations
        - conversations
      summary: Join Existing Conversation
      description: >-
        Join an existing conversation using conversation ID and API key
        authentication. Allows real-time participation in ongoing conversations
        with streaming responses. The user prompt becomes the next message sent
        to the AI.


        **Important for streaming:** Use the `--no-buffer` flag with cURL to
        enable real-time streaming output.
      operationId: >-
        join_conversation_api_v1_integration_conversations_join_conversation_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JoinConversationIntegrationRequest'
        required: true
      responses:
        '200':
          description: Successfully joined conversation with streaming response
          content:
            application/json:
              schema:
                type: string
                description: >-
                  Server-Sent Events stream with real-time conversation updates.
                  Events are serialized using event_to_dict() and sent as SSE
                  format.
                examples:
                  - type: oh_event
                    data:
                      id: 1
                      timestamp: '2024-01-15T10:45:00.123Z'
                      source: user
                      message: Please review this code
                      action: message
                      args:
                        content: Please review this code
                        wait_for_response: false
                  - type: oh_event
                    data:
                      id: 2
                      timestamp: '2024-01-15T10:45:30.456Z'
                      source: agent
                      message: I'll analyze the code for you...
                      action: message
                      args:
                        content: >-
                          I'll analyze the code for you. Let me start by
                          examining the structure...
                        wait_for_response: false
                  - type: oh_event
                    data:
                      id: 3
                      timestamp: '2024-01-15T10:45:35.789Z'
                      source: agent
                      observation: agent_state_changed
                      content: ''
                      extras:
                        agent_state: RUNNING
                        reason: Starting code analysis
                      success: true
        '400':
          description: >-
            Missing required fields (conversation_id, system_prompt,
            research_mode, or user_prompt)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationErrorResponse'
        '401':
          description: Invalid or missing Bearer token in Authorization header
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/openhands__server__routes__integration__conversation__FastAPIUnauthorizedErrorResponse
        '404':
          description: Conversation not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FastAPIResourceNotFoundErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Failed to establish streaming connection
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationErrorResponse'
      x-codeSamples:
        - lang: bash
          label: Join existing conversation
          source: >-
            curl -X POST
            'https://app-be.thesis.io/api/v1/integration/conversations/join-conversation'
            \
              -H 'Authorization: Bearer YOUR_SPACE_API_TOKEN' \
              -H 'Content-Type: application/json' \
              -d '{
                "conversation_id": "conv_abc123def456",
                "user_prompt": "Please review the code we discussed earlier",
                "research_mode": "deep_research"
              }' --no-buffer
        - lang: python
          label: Join existing conversation
          source: >-
            import requests


            url =
            'https://app-be.thesis.io/api/v1/integration/conversations/join-conversation'

            headers = {
                'Authorization': 'Bearer YOUR_SPACE_API_TOKEN',
                'Content-Type': 'application/json'
            }

            data = {
                'conversation_id': 'conv_abc123def456',
                'user_prompt': 'Please review the code we discussed earlier',
                'research_mode': 'deep_research'
            }


            response = requests.post(url, headers=headers, json=data)

            print(response.json())
        - lang: typescript
          label: Join existing conversation
          source: >-
            const response = await
            fetch('https://app-be.thesis.io/api/v1/integration/conversations/join-conversation',
            {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer YOUR_SPACE_API_TOKEN',
                'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                conversation_id: 'conv_abc123def456',
                user_prompt: 'Please review the code we discussed earlier',
                research_mode: 'deep_research'
              })
            });


            const data = await response.json();

            console.log(data);
components:
  schemas:
    JoinConversationIntegrationRequest:
      properties:
        conversation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Conversation Id
          description: ID of the existing conversation to join
          example: conv_abc123def456
        user_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: User Prompt
          description: Message to send when joining the conversation
          example: Please review the code we discussed earlier
        research_mode:
          anyOf:
            - $ref: '#/components/schemas/ResearchMode'
            - type: 'null'
          description: >-
            Research mode to use in the conversation. Must be one of: chat,
            deep_research, follow_up
          example: deep_research
        latest_event_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Latest Event Id
          description: ID of the latest event to resume from
          example: 123
        x_device_id:
          anyOf:
            - type: string
            - type: 'null'
          title: X Device Id
          description: Device ID to use for the conversation
          example: '123'
      type: object
      title: JoinConversationIntegrationRequest
    ConversationErrorResponse:
      properties:
        status:
          type: string
          title: Status
          description: Error status, always 'error' for failures
          example: error
        message:
          type: string
          title: Message
          description: Human-readable error message
          example: Invalid request data or missing required fields
        msg_id:
          type: string
          title: Msg Id
          description: Machine-readable error code for categorization
          example: INVALID_REQUEST_DATA
      type: object
      required:
        - status
        - message
        - msg_id
      title: ConversationErrorResponse
    openhands__server__routes__integration__conversation__FastAPIUnauthorizedErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error details from FastAPI
          example: Unauthorized or invalid token
      type: object
      required:
        - detail
      title: FastAPIUnauthorizedErrorResponse
    FastAPIResourceNotFoundErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error details from FastAPI
          example: Resource not found
      type: object
      required:
        - detail
      title: FastAPIResourceNotFoundErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ResearchMode:
      type: string
      enum:
        - chat
        - deep_research
        - follow_up
      title: ResearchMode
    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
  securitySchemes:
    APIKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your API token in the format: Bearer <your_token_here>'

````