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

# Assign Conversation

> Assign or unassign a conversation to/from a team member.



## OpenAPI

````yaml https://api.useinvent.com/openapi.json patch /chats/{chat_id}/state/assign
openapi: 3.1.0
info:
  version: 1.0.0
  title: Invent API
servers:
  - url: https://api.useinvent.com
security:
  - bearerAuth: []
paths:
  /chats/{chat_id}/state/assign:
    patch:
      tags:
        - Chats State
      summary: Assign Conversation
      description: Assign or unassign a conversation to/from a team member.
      parameters:
        - schema:
            type: string
          required: true
          description: Chat ID
          name: chat_id
          in: path
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssignConversationSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AssignConversationSchema'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatStateSchema'
components:
  schemas:
    AssignConversationSchema:
      type: object
      properties:
        member_id:
          type:
            - string
            - 'null'
          maxLength: 128
          description: Member ID to assign. Set to null to unassign.
      required:
        - member_id
      description: Schema for assigning or unassigning a conversation to/from a team member
    ChatStateSchema:
      type: object
      properties:
        id:
          type: string
        state:
          $ref: '#/components/schemas/ChatStateStatusSchema'
        channel_type:
          $ref: '#/components/schemas/ChannelTypeIdSchema'
        integration_id:
          allOf:
            - $ref: '#/components/schemas/ChannelTypeIdSchema'
            - description: Use channel_type instead
              deprecated: true
        assistant:
          $ref: '#/components/schemas/PublicAssistantSchema'
        assistant_id:
          type:
            - string
            - 'null'
          description: Use assistant.id instead
          deprecated: true
        assistant_channel:
          $ref: '#/components/schemas/PublicAssistantChannelSchema'
        assistant_integration:
          allOf:
            - $ref: '#/components/schemas/PublicAssistantChannelSchema'
            - description: Use assistant_channel instead
              deprecated: true
        assistant_channel_id:
          type:
            - string
            - 'null'
          description: Use assistant_channel.id instead
          deprecated: true
        assistant_integration_id:
          type:
            - string
            - 'null'
          description: Use assistant_channel.id instead
          deprecated: true
        conversation_id:
          type: string
          description: The ID of the conversation associated with the chat
        assigned_user:
          $ref: '#/components/schemas/UserLimitedSchema'
        assigned_at:
          type:
            - string
            - 'null'
          format: date-time
        assistant_config:
          $ref: '#/components/schemas/AssistantConfigSchema'
        ai_enabled:
          type: boolean
          description: Whether AI is enabled for the chat
        admin_unseen_count:
          type: number
          description: The number of unseen messages in the chat
        user_unseen_count:
          type: number
          description: The number of unseen messages in the chat
        follow_up_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Scheduled follow-up datetime
        muted_until:
          type:
            - string
            - 'null'
          format: date-time
          description: Mute expiry datetime (null = not muted)
        free_window_expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the free entry point window closes: templates sent before it
            are not charged. It never extends the reply window (null = no free
            window)
        csat_score:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 5
          description: Customer satisfaction score (1-5)
        last_contact_message_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - state
        - channel_type
        - integration_id
        - assistant_id
        - assistant_channel_id
        - assistant_integration_id
        - conversation_id
        - ai_enabled
        - admin_unseen_count
        - user_unseen_count
      description: Schema for the chat state
    ChatStateStatusSchema:
      type: string
      enum:
        - OPEN
        - SNOOZED
        - CLOSED
      description: The state status of the chat
    ChannelTypeIdSchema:
      type: string
      enum:
        - internal
        - org
        - agent
        - custom
        - whatsapp_bot
        - messenger_bot
        - instagram_dm
        - tiktok_dm
        - telegram_bot
        - gmail
        - slack_bot
        - twilio
        - telnyx
        - email
        - smpp
      description: The channel type
    PublicAssistantSchema:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        enabled:
          type: boolean
        avatar_url:
          type:
            - string
            - 'null'
        deleted:
          type: boolean
        config:
          $ref: '#/components/schemas/PublicAssistantConfigSchema'
      required:
        - id
        - name
        - enabled
        - avatar_url
        - deleted
        - config
      description: Schema for a public assistant
    PublicAssistantChannelSchema:
      type: object
      properties:
        id:
          type: string
        enabled:
          type: boolean
        has_connection:
          type: boolean
        identity:
          type:
            - string
            - 'null'
          description: >-
            The channel identity messages are exchanged through, e.g the
            WhatsApp phone number
      required:
        - id
        - enabled
        - has_connection
        - identity
      description: Schema for a public assistant channel
    UserLimitedSchema:
      type: object
      properties:
        id:
          type: string
        name:
          type:
            - string
            - 'null'
        email:
          type: string
          format: email
        avatar:
          type:
            - string
            - 'null'
        seen_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - name
        - email
        - avatar
        - seen_at
      description: The assigned user for the conversation
    AssistantConfigSchema:
      type: object
      properties:
        instructions:
          type: string
          maxLength: 30000
          description: The instructions for the assistant
        language:
          $ref: '#/components/schemas/ModelLanguageSchema'
        model:
          type: string
          minLength: 1
          maxLength: 128
          description: The model to use for the assistant
        stt:
          $ref: '#/components/schemas/AssistantSttConfigSchema'
        tts:
          $ref: '#/components/schemas/AssistantTtsConfigSchema'
        conversation:
          $ref: '#/components/schemas/AssistantConversationConfigSchema'
        widget:
          $ref: '#/components/schemas/AssistantWidgetConfigSchema'
        knowledge_scope:
          $ref: '#/components/schemas/KnowledgeModeSchema'
        timezone:
          allOf:
            - $ref: '#/components/schemas/TimezoneValueSchema'
            - description: IANA timezone for the assistant (e.g. "America/New_York")
      required:
        - language
        - model
        - stt
        - tts
        - conversation
        - knowledge_scope
        - timezone
      description: Schema for the configuration of an assistant
    PublicAssistantConfigSchema:
      type: object
      properties:
        conversation:
          $ref: '#/components/schemas/PublicAssistantConversationConfigSchema'
        widget:
          $ref: '#/components/schemas/PublicAssistantWidgetConfigSchema'
      required:
        - conversation
        - widget
      description: Schema for a public assistant configuration
    ModelLanguageSchema:
      type: string
      enum:
        - auto
        - en
        - es
      description: List of supported languages for the model in ISO 639-1 format or "auto"
    AssistantSttConfigSchema:
      type: object
      properties:
        model:
          type: string
          minLength: 1
          maxLength: 128
      required:
        - model
      description: Schema for the STT configuration of an assistant
    AssistantTtsConfigSchema:
      type: object
      properties:
        model:
          type: string
          minLength: 1
          maxLength: 128
        voice_id:
          type: string
          minLength: 1
          maxLength: 128
      required:
        - model
        - voice_id
      description: Schema for the TTS configuration of an assistant
    AssistantConversationConfigSchema:
      type: object
      properties:
        thread_mode:
          $ref: '#/components/schemas/AssistantThreadModeSchema'
        welcome_banner:
          type: string
          maxLength: 256
          description: >-
            Static greeting text displayed in the UI when users start a new
            conversation
        suggested_messages:
          type: array
          items:
            type: string
            maxLength: 64
          maxItems: 5
          description: >-
            Suggested messages displayed to users when they start a new
            conversation
        auto_intro_message:
          type: string
          maxLength: 256
          description: >-
            First message automatically sent by the assistant only when a
            conversation begins via API call
        enable_memories:
          type: boolean
          description: Whether to enable the "Manage Memories" tool for the assistant
        enable_end_conversation_tool:
          type: boolean
          description: Whether to enable the "Close Conversation" tool for the assistant
        enable_transfer_to_human_tool:
          type: boolean
          description: Whether to enable the "Transfer to Human" tool for the assistant
        routing_instructions:
          type: string
          maxLength: 30000
          description: >-
            Business instructions that steer how this assistant routes transfers
            to a human (which member or team to prefer, when to escalate).
            Appended to the transfer tool guidance.
        enable_block_contact_tool:
          type: boolean
          description: Whether to enable the "Block Contact" tool for the assistant
        enable_ai_replies:
          type: boolean
          description: >-
            Whether the AI generates replies. When false the assistant is
            human-only: incoming messages are still received and stored but the
            AI never responds, so a human answers.
        enable_auto_resolve:
          type: boolean
          description: >-
            Whether inactive conversations should automatically resolve after a
            period of inactivity
        enable_auto_follow_ups:
          type: boolean
          description: Whether the assistant can automatically follow up on conversations
        follow_up_instructions:
          type: string
          maxLength: 30000
          description: >-
            Business instructions that steer follow-up behavior (cadence, hours,
            stop rules, tone). Override the default follow-up guidance.
        enable_auto_csat:
          type: boolean
          description: >-
            Whether the assistant should automatically score customer
            satisfaction (CSAT) when closing conversations
        enable_private_chats:
          type: boolean
          description: Whether to enable private chats that do not appear in the inbox
        enable_update_contact_tool:
          type: boolean
          description: >-
            Whether to enable the assistant to collect and update contact
            information (name, email, phone)
      required:
        - thread_mode
        - enable_memories
        - enable_transfer_to_human_tool
      description: Configuration options for the conversation thread of the assistant
    AssistantWidgetConfigSchema:
      type: object
      properties:
        mode:
          $ref: '#/components/schemas/AssistantWidgetModeSchema'
        appearance:
          $ref: '#/components/schemas/AssistantWidgetAppearanceSchema'
        position:
          $ref: '#/components/schemas/AssistantWidgetPositionSchema'
        omnibar_minimize_desktop:
          type: boolean
          description: >-
            Fold the omnibar into its compact centered button while visitors
            scroll on desktop too. On mobile viewports it always folds.
        hide_powered_by:
          type: boolean
        enable_dictation:
          type: boolean
        enable_file_uploads:
          type: boolean
        colors:
          $ref: '#/components/schemas/AssistantWidgetColorsConfigSchema'
        teaser:
          $ref: '#/components/schemas/AssistantWidgetTeaserConfigSchema'
        channels:
          $ref: '#/components/schemas/AssistantWidgetChannelsConfigSchema'
      default: {}
      description: Configuration of the embeddable web chat widget
    KnowledgeModeSchema:
      type: string
      enum:
        - all
        - restricted
      description: The knowledge scope of the assistant
    TimezoneValueSchema:
      type: string
      description: IANA timezone identifier (e.g. America/New_York)
    PublicAssistantConversationConfigSchema:
      type: object
      properties:
        thread_mode:
          $ref: '#/components/schemas/AssistantThreadModeSchema'
        welcome_banner:
          type: string
          maxLength: 256
          description: >-
            Static greeting text displayed in the UI when users start a new
            conversation
        suggested_messages:
          type: array
          items:
            type: string
            maxLength: 64
          maxItems: 5
          description: >-
            Suggested messages displayed to users when they start a new
            conversation
        auto_intro_message:
          type: string
          maxLength: 256
          description: >-
            First message automatically sent by the assistant only when a
            conversation begins via API call
        enable_auto_csat:
          type: boolean
          description: >-
            Whether the assistant should automatically score customer
            satisfaction (CSAT) when closing conversations
        enable_ai_replies:
          type: boolean
          description: >-
            Whether the AI generates replies. When false the assistant is
            human-only: incoming messages are still received and stored but the
            AI never responds, so a human answers.
      required:
        - thread_mode
      description: Schema for a public assistant conversation configuration
    PublicAssistantWidgetConfigSchema:
      type: object
      properties:
        mode:
          $ref: '#/components/schemas/AssistantWidgetModeSchema'
        appearance:
          $ref: '#/components/schemas/AssistantWidgetAppearanceSchema'
        position:
          $ref: '#/components/schemas/AssistantWidgetPositionSchema'
        omnibar_minimize_desktop:
          type: boolean
          description: >-
            Fold the omnibar into its compact centered button while visitors
            scroll on desktop too. On mobile viewports it always folds.
        hide_powered_by:
          type: boolean
        enable_dictation:
          type: boolean
        enable_file_uploads:
          type: boolean
        colors:
          $ref: '#/components/schemas/AssistantWidgetColorsConfigSchema'
        teaser:
          $ref: '#/components/schemas/AssistantWidgetTeaserConfigSchema'
        channels:
          type: object
          properties:
            items:
              type: array
              items:
                $ref: '#/components/schemas/PublicAssistantWidgetChannelSchema'
            label:
              type: string
            chat_button_label:
              type: string
          required:
            - items
      required:
        - channels
      description: Widget configuration with channel references resolved to links
    AssistantThreadModeSchema:
      type: string
      enum:
        - new
        - continue
      description: >-
        The thread mode of the assistant, either "new" for new threads or
        "continue" for continuing existing threads
    AssistantWidgetModeSchema:
      type: string
      enum:
        - button
        - omnibar
        - auto
      default: button
      description: >-
        Default shape of the embedded widget: corner bubble button, centered
        omnibar, or auto (omnibar until the visitor has a conversation). A mode
        attribute on the embed element overrides it, and a visitor’s own
        header-toggle pick outranks both on desktop; mobile has no toggle and
        always follows the attribute or this setting.
    AssistantWidgetAppearanceSchema:
      type: string
      enum:
        - auto
        - light
        - dark
      default: auto
      description: 'Theme of the widget: follow the visitor system or force one'
    AssistantWidgetPositionSchema:
      type: string
      enum:
        - right
        - left
      default: right
      description: >-
        Corner where the bubble launcher is anchored (the omnibar is always
        centered). A position attribute on the embed element overrides it.
    AssistantWidgetColorsConfigSchema:
      type: object
      properties:
        accent:
          type: string
          pattern: ^#[0-9a-f]{6}$/i
          description: Accent color used inside the chat (buttons, visitor messages, links)
        launcher_background:
          type: string
          pattern: ^#[0-9a-f]{6}$/i
          description: >-
            Background color of the widget button; the icon color adapts
            automatically
      default: {}
      description: Color overrides for the widget
    AssistantWidgetTeaserConfigSchema:
      type: object
      properties:
        enabled:
          type: boolean
        message:
          type: string
          maxLength: 140
          description: Short invitation shown next to the closed widget button
        modes:
          type: string
          enum:
            - all
            - button
            - omnibar
          default: all
          description: >-
            Which widget modes show the teaser: both, only the bubble button, or
            only the omnibar
        suggestions:
          type: string
          enum:
            - all
            - button
            - omnibar
            - none
          default: button
          description: >-
            Which widget modes show the suggested replies with the teaser, or
            none. Defaults to the bubble button; the omnibar already shows them
            when focused, independent of this setting.
        delay_seconds:
          type: integer
          minimum: 0
          maximum: 120
          default: 3
          description: Seconds to wait before showing the teaser
        frequency:
          $ref: '#/components/schemas/AssistantWidgetTeaserFrequencySchema'
        devices:
          $ref: '#/components/schemas/AssistantWidgetTeaserDevicesSchema'
        version:
          type: integer
          minimum: 1
          default: 1
          description: Bump to show the teaser again to visitors who already dismissed it
      default: {}
      description: >-
        Proactive teaser configuration for the widget. The suggested replies
        shown with the teaser come from conversation.suggested_messages.
    AssistantWidgetChannelsConfigSchema:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/AssistantWidgetChannelItemSchema'
          maxItems: 20
          default: []
        label:
          type: string
          maxLength: 48
          description: Heading above the channels menu; defaults to "Talk to us on"
        chat_button_label:
          type: string
          maxLength: 48
          description: Label of the launcher chat action; defaults to "Chat with us"
      default: {}
      description: >-
        Alternative channels offered in the widget launcher menu when any are
        configured
    PublicAssistantWidgetChannelSchema:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/AssistantWidgetChannelTypeSchema'
        label:
          type: string
        url:
          type: string
      required:
        - type
        - url
      description: A resolved widget channel link
    AssistantWidgetTeaserFrequencySchema:
      type: string
      enum:
        - once_per_visitor
        - once_per_session
        - every_visit
      default: once_per_visitor
      description: How often the teaser can show again to the same visitor
    AssistantWidgetTeaserDevicesSchema:
      type: string
      enum:
        - all
        - desktop
        - mobile
      default: desktop
      description: Devices where the teaser shows
    AssistantWidgetChannelItemSchema:
      type: object
      properties:
        integration_id:
          type: string
          maxLength: 128
          description: >-
            Connected assistant integration to link to; the URL is generated
            from the connection and ignored when the integration no longer
            exists
        enabled:
          type: boolean
          description: >-
            Connected channels are included by default; set to false to hide one
            from the widget
        type:
          allOf:
            - $ref: '#/components/schemas/AssistantWidgetChannelTypeSchema'
            - description: Type of a custom channel link
        label:
          type: string
          maxLength: 48
        url:
          type: string
          maxLength: 2048
          format: uri
          description: Destination of a custom link channel
        email:
          type: string
          maxLength: 320
          format: email
          description: Address of a custom email channel
        phone:
          type: string
          pattern: ^\+[1-9]\d{6,14}$
          description: E.164 number of a custom phone channel
      description: >-
        A widget channel link: either a connected integration reference or a
        custom entry
    AssistantWidgetChannelTypeSchema:
      type: string
      enum:
        - whatsapp
        - messenger
        - instagram
        - telegram
        - email
        - phone
        - link
      description: Type of a widget channel link
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Bearer token authentication using your API key

````