> ## 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: []
tags:
  - name: Inbox
  - name: Chats
  - name: Messages
  - name: Contacts
  - name: Custom channels
  - name: Segments
  - name: Suppressions
  - name: Assistants
  - name: Agents
  - name: Skills
  - name: Knowledge
  - name: AI
  - name: Broadcasts
  - name: Email sending
  - name: WhatsApp
  - name: WhatsApp Meta agent
  - name: Tables
  - name: Records
  - name: Views
  - name: Pages
  - name: Connections
  - name: Workspace
  - name: Sub-organizations
  - name: Analytics and logs
  - name: Workflows
paths:
  /chats/{chat_id}/state/assign:
    patch:
      tags:
        - Chats
      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'
        assistant:
          $ref: '#/components/schemas/PublicAssistantSchema'
        assistant_channel:
          $ref: '#/components/schemas/PublicAssistantChannelSchema'
        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
        - conversation_id
        - ai_enabled
        - admin_unseen_count
        - user_unseen_count
      description: Schema for the chat state
    ChatStateStatusSchema:
      type: string
      enum:
        - OPEN
        - CLOSED
      options:
        OPEN:
          label: Open
        CLOSED:
          label: Resolved
      title: Status
      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
        - slack_bot
        - teams_bot
        - gmail
        - outlook
        - twilio
        - telnyx
        - email
        - smpp
      description: The channel type
    PublicAssistantSchema:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        avatar_url:
          type:
            - string
            - 'null'
        deleted:
          type: boolean
        config:
          $ref: '#/components/schemas/PublicAssistantConfigSchema'
      required:
        - id
        - name
        - avatar_url
        - deleted
        - config
      description: Schema for a public assistant
    PublicAssistantChannelSchema:
      type: object
      properties:
        id:
          type: string
        enabled:
          type: boolean
        has_connection:
          type: boolean
        updates_outside_window:
          type: boolean
          description: >-
            The channel delivers updates after the messaging window closed
            (WhatsApp Direct Send) and the provider has not rejected one for
            this connection yet
        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: 40000
          title: Instructions
          description: 'The instructions for the assistant: its system prompt'
        language:
          $ref: '#/components/schemas/ModelLanguageSchema'
        model:
          type: string
          minLength: 1
          maxLength: 128
          title: Model
          description: The model to use for the assistant
        conversation:
          $ref: '#/components/schemas/AssistantConversationConfigSchema'
        widget:
          $ref: '#/components/schemas/AssistantWidgetConfigSchema'
        knowledge_scope:
          $ref: '#/components/schemas/KnowledgeModeSchema'
        timezone:
          $ref: '#/components/schemas/TimezoneValueSchema'
      required:
        - language
        - model
        - 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"
    AssistantConversationConfigSchema:
      type: object
      properties:
        thread_mode:
          $ref: '#/components/schemas/AssistantThreadModeSchema'
        welcome_banner:
          type: string
          maxLength: 256
          title: Welcome Banner
          description: Static greeting shown in the UI when a conversation starts.
        suggested_messages:
          type: array
          items:
            type: string
            maxLength: 64
          maxItems: 5
          title: Suggested Messages
          description: Up to 5 suggested messages shown when a conversation starts.
        auto_intro_message:
          type: string
          maxLength: 256
          title: Auto Intro Message
          description: >-
            First message the assistant sends automatically when a conversation
            begins via API.
        enable_memories:
          type: boolean
          title: Memories
          description: Let the assistant store memories about the contact.
        enable_end_conversation_tool:
          type: boolean
          title: Close Conversation Tool
          description: Let the assistant close conversations on its own.
        enable_transfer_to_human_tool:
          type: boolean
          title: AI Routing
          description: >-
            The AI Routing switch: let the assistant hand a conversation to one
            of your members. Off turns routing off, whatever the routing
            instructions say. Who can receive a handoff is the Members list in
            the same AI Routing card: add members there to route only to them
            (empty means any member), and give each one a description so the
            assistant knows which chats go to whom.
        routing_instructions:
          type: string
          maxLength: 40000
          title: Routing Instructions
          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. The assistant can only route
            to the members in the AI Routing Members list (any member when it is
            empty).
        enable_block_contact_tool:
          type: boolean
          title: Block Contact Tool
          description: Let the assistant block abusive contacts.
        enable_ai_replies:
          type: boolean
          title: AI Replies
          description: >-
            When false the assistant is human-only: messages are received but
            the AI never responds.
        enable_auto_resolve:
          type: boolean
          title: Auto Resolve
          description: Automatically resolve conversations after a period of inactivity.
        enable_auto_follow_ups:
          type: boolean
          title: Auto Follow-ups
          description: Let the assistant follow up on conversations on its own.
        follow_up_instructions:
          type: string
          maxLength: 40000
          title: Follow-up Instructions
          description: >-
            Business rules that steer automatic follow-ups (cadence, hours, stop
            rules, tone).
        follow_ups_outside_window:
          type: boolean
          title: Follow up after the window closes
          description: >-
            After the messaging window closes, still follow up about something
            the contact asked for or is waiting on (WhatsApp).
        enable_auto_csat:
          type: boolean
          title: Auto CSAT
          description: >-
            Automatically score customer satisfaction when closing
            conversations.
        enable_private_chats:
          type: boolean
          title: Private Chats
          description: Enable private chats that do not appear in the inbox.
        enable_update_contact_tool:
          type: boolean
          title: Update Contact Tool
          description: Let the assistant collect and update contact information.
        enable_transcription:
          type: boolean
          title: Transcriptions
          description: >-
            Turn voice notes and videos into text, and describe what videos
            show, so any model understands them.
      required:
        - thread_mode
        - enable_memories
        - enable_transfer_to_human_tool
      description: Configuration options for the conversation thread of the assistant
    AssistantWidgetConfigSchema:
      type: object
      properties:
        enabled:
          type: boolean
          description: >-
            Whether the widget shows where its embed code is installed. Off
            hides it without removing the code.
        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
      options:
        all:
          label: All sources
        restricted:
          label: Selected sources
      title: Knowledge Scope
      description: >-
        Which knowledge the assistant searches: all sources, or only the ones
        linked to it (List/Link/Unlink Assistant Knowledge Source).
    TimezoneValueSchema:
      type: string
      title: Timezone
      description: IANA timezone, e.g. "America/New_York".
    PublicAssistantConversationConfigSchema:
      type: object
      properties:
        thread_mode:
          $ref: '#/components/schemas/AssistantThreadModeSchema'
        welcome_banner:
          type: string
          maxLength: 256
          title: Welcome Banner
          description: Static greeting shown in the UI when a conversation starts.
        suggested_messages:
          type: array
          items:
            type: string
            maxLength: 64
          maxItems: 5
          title: Suggested Messages
          description: Up to 5 suggested messages shown when a conversation starts.
        auto_intro_message:
          type: string
          maxLength: 256
          title: Auto Intro Message
          description: >-
            First message the assistant sends automatically when a conversation
            begins via API.
        enable_auto_csat:
          type: boolean
          title: Auto CSAT
          description: >-
            Automatically score customer satisfaction when closing
            conversations.
        enable_ai_replies:
          type: boolean
          title: AI Replies
          description: >-
            When false the assistant is human-only: messages are received but
            the AI never responds.
      required:
        - thread_mode
      description: Schema for a public assistant conversation configuration
    PublicAssistantWidgetConfigSchema:
      type: object
      properties:
        enabled:
          type: boolean
          description: >-
            Whether the widget shows where its embed code is installed. Off
            hides it without removing the code.
        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
      options:
        new:
          label: New conversation
        continue:
          label: Continue previous
      title: Thread Mode
      description: >-
        Whether returning users start a new conversation or continue the
        previous one.
    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:
        channel_id:
          type: string
          maxLength: 128
          description: >-
            Connected assistant channel to link to; the URL is generated from
            the connection and ignored when the channel 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 channel 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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.