Adapter conversations API

The conversations API from Adapter — 11 operation(s) for conversations.

OpenAPI Specification

adapter-conversations-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Adapter Adapter API conversations API
  version: 0.1.0
tags:
- name: conversations
paths:
  /users/me/conversations/models:
    get:
      tags:
      - conversations
      summary: Get Available Models
      operationId: get_available_models_users_me_conversations_models_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '403':
          description: Forbidden
        '500':
          description: Internal server error
      security:
      - HTTPBearer: []
  /users/me/conversations:
    post:
      tags:
      - conversations
      summary: Create Conversation
      description: 'Create an empty conversation slot with frontend-provided UUID.

        This allows frontend to navigate immediately before any AI processing.'
      operationId: create_conversation_users_me_conversations_post
      security:
      - HTTPBearer: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConversationRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '403':
          description: Forbidden
        '500':
          description: Internal server error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - conversations
      summary: List Conversations
      description: List conversations for the current user with job status
      operationId: list_conversations_users_me_conversations_get
      security:
      - HTTPBearer: []
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 10
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      - name: include_job_status
        in: query
        required: false
        schema:
          type: boolean
          description: Include job status info
          default: true
          title: Include Job Status
        description: Include job status info
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConversationSummary'
                title: Response List Conversations Users Me Conversations Get
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '403':
          description: Forbidden
        '500':
          description: Internal server error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /users/me/conversations/{conversation_id}/completion:
    post:
      tags:
      - conversations
      summary: Send Message
      description: 'Send a message to a conversation.


        - stream=true (default): Returns a streaming response with SSE

        - stream=false: Returns a complete Conversation object with the response'
      operationId: send_message_users_me_conversations__conversation_id__completion_post
      security:
      - HTTPBearer: []
      parameters:
      - name: conversation_id
        in: path
        required: true
        schema:
          type: string
          title: The conversation ID
      - name: stream
        in: query
        required: false
        schema:
          type: boolean
          description: Whether to stream the response
          default: true
          title: Stream
        description: Whether to stream the response
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompletionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '403':
          description: Forbidden
        '500':
          description: Internal server error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /users/me/conversations/{conversation_id}:
    get:
      tags:
      - conversations
      summary: Get Conversation
      description: Get a conversation by ID with all messages and active stream info
      operationId: get_conversation_users_me_conversations__conversation_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: conversation_id
        in: path
        required: true
        schema:
          type: string
          title: The conversation ID
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '403':
          description: Forbidden
        '500':
          description: Internal server error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - conversations
      summary: Update Conversation
      description: Update a conversation's name or metadata
      operationId: update_conversation_users_me_conversations__conversation_id__patch
      security:
      - HTTPBearer: []
      parameters:
      - name: conversation_id
        in: path
        required: true
        schema:
          type: string
          title: The ID of the conversation to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateConversationRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '403':
          description: Forbidden
        '500':
          description: Internal server error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - conversations
      summary: Delete Conversation
      description: Delete a conversation
      operationId: delete_conversation_users_me_conversations__conversation_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: conversation_id
        in: path
        required: true
        schema:
          type: string
          title: The ID of the conversation to delete
      responses:
        '204':
          description: Successful Response
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '403':
          description: Forbidden
        '500':
          description: Internal server error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /users/me/conversations/{conversation_id}/messages/{message_id}/status:
    get:
      tags:
      - conversations
      summary: Get Message Status
      description: Get current status of AI response generation for a message
      operationId: get_message_status_users_me_conversations__conversation_id__messages__message_id__status_get
      security:
      - HTTPBearer: []
      parameters:
      - name: conversation_id
        in: path
        required: true
        schema:
          type: string
          title: Conversation Id
      - name: message_id
        in: path
        required: true
        schema:
          type: string
          title: Message Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '403':
          description: Forbidden
        '500':
          description: Internal server error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /users/me/conversations/{conversation_id}/stream/{session_id}:
    get:
      tags:
      - conversations
      summary: Reconnect To Stream
      description: 'Reconnect to a durable stream at any time.


        - Gets exactly what client hasn''t seen yet

        - Works even if original connection was lost

        - Works even after server restart (data persists in Redis)'
      operationId: reconnect_to_stream_users_me_conversations__conversation_id__stream__session_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: conversation_id
        in: path
        required: true
        schema:
          type: string
          title: Conversation Id
      - name: session_id
        in: path
        required: true
        schema:
          type: string
          title: Session Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '403':
          description: Forbidden
        '500':
          description: Internal server error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /users/me/conversations/{conversation_id}/stop_response:
    post:
      tags:
      - conversations
      summary: Stop Response
      description: Stop the currently generating response in this conversation
      operationId: stop_response_users_me_conversations__conversation_id__stop_response_post
      security:
      - HTTPBearer: []
      parameters:
      - name: conversation_id
        in: path
        required: true
        schema:
          type: string
          title: Conversation Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StopResponseRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '403':
          description: Forbidden
        '500':
          description: Internal server error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /users/me/conversations/{conversation_id}/jobs:
    get:
      tags:
      - conversations
      summary: Get Conversation Jobs
      description: Get job status summary for a conversation
      operationId: get_conversation_jobs_users_me_conversations__conversation_id__jobs_get
      security:
      - HTTPBearer: []
      parameters:
      - name: conversation_id
        in: path
        required: true
        schema:
          type: string
          title: Conversation Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '403':
          description: Forbidden
        '500':
          description: Internal server error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /users/me/conversations/{conversation_id}/nba:
    post:
      tags:
      - conversations
      summary: Generate Next Best Action
      description: 'Generate next best action suggestion for a conversation.


        Analyzes the conversation up to the specified message (or entire conversation if message_id not provided) to identify:

        - Automation opportunities (e.g., setting reminders, saving preferences)

        - Information to remember for future interactions


        Returns a JSON structure with suggestion details.'
      operationId: generate_next_best_action_users_me_conversations__conversation_id__nba_post
      security:
      - HTTPBearer: []
      parameters:
      - name: conversation_id
        in: path
        required: true
        schema:
          type: string
          title: Conversation Id
      - name: message_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Optional message ID to analyze up to. If not provided, uses entire conversation.
          title: Message Id
        description: Optional message ID to analyze up to. If not provided, uses entire conversation.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NextBestActionResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '403':
          description: Forbidden
        '500':
          description: Internal server error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /users/me/conversations/{conversation_id}/feedback:
    post:
      tags:
      - conversations
      summary: Submit Conversation Feedback
      description: 'Submit feedback for a conversation.

        Idempotent - overwrites previous feedback.'
      operationId: submit_conversation_feedback_users_me_conversations__conversation_id__feedback_post
      security:
      - HTTPBearer: []
      parameters:
      - name: conversation_id
        in: path
        required: true
        schema:
          type: string
          title: Conversation Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeedbackRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '403':
          description: Forbidden
        '500':
          description: Internal server error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /users/me/conversations/{conversation_id}/messages/{message_id}/feedback:
    post:
      tags:
      - conversations
      summary: Submit Message Feedback
      description: 'Submit feedback for a specific message.

        Idempotent - overwrites previous feedback.'
      operationId: submit_message_feedback_users_me_conversations__conversation_id__messages__message_id__feedback_post
      security:
      - HTTPBearer: []
      parameters:
      - name: conversation_id
        in: path
        required: true
        schema:
          type: string
          title: Conversation Id
      - name: message_id
        in: path
        required: true
        schema:
          type: string
          title: Message Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeedbackRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '403':
          description: Forbidden
        '500':
          description: Internal server error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ConversationConfig:
      properties:
        agent:
          type: string
          title: Agent
          default: default
        multimodal_enabled:
          type: boolean
          title: Multimodal Enabled
          default: false
        provider:
          type: string
          title: Provider
          default: adapter-ensemble-3p-1
        enable_extended_thinking:
          type: boolean
          title: Enable Extended Thinking
          default: false
        thinking_budget_tokens:
          anyOf:
          - type: integer
          - type: 'null'
          title: Thinking Budget Tokens
      type: object
      title: ConversationConfig
    NextBestActionSuggestion:
      properties:
        title:
          type: string
          title: Title
          default: ''
        description:
          type: string
          title: Description
          default: ''
        action_type:
          type: string
          title: Action Type
          default: none
        confidence:
          type: string
          title: Confidence
          default: low
      type: object
      title: NextBestActionSuggestion
      description: Suggestion details for next best action
    FeedbackRequest:
      properties:
        rating:
          type: integer
          maximum: 1.0
          minimum: 0.0
          title: Rating
          description: 0 for negative, 1 for positive
        note:
          anyOf:
          - type: string
          - type: 'null'
          title: Note
          description: Optional feedback note
      type: object
      required:
      - rating
      title: FeedbackRequest
      description: User feedback on a conversation or message
    ConversationSummary:
      properties:
        uuid:
          type: string
          title: Uuid
        display_name:
          type: string
          title: Display Name
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        metadata:
          anyOf:
          - {}
          - type: 'null'
          title: Metadata
        has_active_jobs:
          type: boolean
          title: Has Active Jobs
          default: false
      type: object
      required:
      - uuid
      - display_name
      - created_at
      - updated_at
      title: ConversationSummary
      description: A simplified version for list views
    CompletionRequest:
      properties:
        prompt:
          type: string
          title: Prompt
        parent_message_uuid:
          anyOf:
          - type: string
          - type: 'null'
          title: Parent Message Uuid
        attachments:
          items:
            $ref: '#/components/schemas/FileAttachment'
          type: array
          title: Attachments
          default: []
        provider:
          type: string
          title: Provider
          default: adapter-ensemble-3p-1
      type: object
      required:
      - prompt
      title: CompletionRequest
      description: Send message to existing conversation
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    StopResponseRequest:
      properties:
        stop_uuid:
          type: string
          title: Stop Uuid
      type: object
      required:
      - stop_uuid
      title: StopResponseRequest
      description: Stop AI message generation
    CreateConversationRequest:
      properties:
        uuid:
          type: string
          title: Uuid
        name:
          type: string
          title: Name
          default: ''
        metadata:
          anyOf:
          - $ref: '#/components/schemas/ConversationConfig'
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Metadata
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
        attachments:
          items:
            $ref: '#/components/schemas/FileAttachment'
          type: array
          title: Attachments
          default: []
      type: object
      required:
      - uuid
      title: CreateConversationRequest
    UpdateConversationRequest:
      properties:
        display_name:
          anyOf:
          - type: string
            maxLength: 256
          - type: 'null'
          title: Display Name
        metadata:
          anyOf:
          - {}
          - type: 'null'
          title: Metadata
      type: object
      title: UpdateConversationRequest
      description: Request to update a conversation
    FileAttachment:
      properties:
        filename:
          type: string
          title: Filename
        content_type:
          type: string
          title: Content Type
        file_key:
          anyOf:
          - type: string
          - type: 'null'
          title: File Key
        asset_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Asset Id
        thumbnail_key:
          anyOf:
          - type: string
          - type: 'null'
          title: Thumbnail Key
        display_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Display Name
        base64_content:
          anyOf:
          - type: string
          - type: 'null'
          title: Base64 Content
        file_size:
          anyOf:
          - type: integer
          - type: 'null'
          title: File Size
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        text_content:
          anyOf:
          - type: string
          - type: 'null'
          title: Text Content
        metadata:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Metadata
      type: object
      required:
      - filename
      - content_type
      title: FileAttachment
    ConversationResponse:
      properties:
        uuid:
          type: string
          title: Uuid
        display_name:
          type: string
          title: Display Name
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        session_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Session Id
      type: object
      required:
      - uuid
      - display_name
      - created_at
      - updated_at
      title: ConversationResponse
    NextBestActionResponse:
      properties:
        has_suggestion:
          type: boolean
          title: Has Suggestion
          default: false
        suggestion_type:
          type: string
          title: Suggestion Type
          default: none
        thinking:
          type: string
          title: Thinking
          default: ''
        suggestion:
          $ref: '#/components/schemas/NextBestActionSuggestion'
      type: object
      title: NextBestActionResponse
      description: Response from next best action generation
    FeedbackResponse:
      properties:
        status:
          type: string
          title: Status
      type: object
      required:
      - status
      title: FeedbackResponse
      description: Response after submitting feedback
  securitySchemes:
    HTTPBasic:
      type: http
      scheme: basic
    HTTPBearer:
      type: http
      scheme: bearer