---
title: "Assign conversation"
method: PATCH
path: "/chats/{chat_id}/state/assign"
tags: ["Chats"]
---

# Assign conversation

`PATCH /chats/{chat_id}/state/assign`

## Request

- Base URL: `https://api.useinvent.com`
- URL: `https://api.useinvent.com/chats/{chat_id}/state/assign`
- Auth: HTTP bearer

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

## Path parameters

- `chat_id` string, required

## Request body

- AssignConversationSchema: Schema for assigning or unassigning a conversation to/from a team member
  - `member_id` string, nullable, required: Member ID to assign. Set to null to unassign.

## Response `200`

- ChatStateSchema: Schema for the chat state
  - `id` string, required
  - `state` 'OPEN' | 'CLOSED', required: The state status of the chat
  - `channel_type` 'internal' | 'org' | 'agent' | 'custom' | 'whatsapp_bot' | 'messenger_bot' | 'instagram_dm' | 'tiktok_dm' | 'telegram_bot' | 'slack_bot' | 'teams_bot' | 'gmail' | 'outlook' | 'twilio' | 'telnyx' | 'email' | 'smpp', required: The channel type
  - `assistant` PublicAssistantSchema: Schema for a public assistant
    - `id` string, required
    - `name` string, required
    - `avatar_url` string, nullable, required
    - `deleted` boolean, required
    - `config` PublicAssistantConfigSchema, required: Schema for a public assistant configuration
      - `conversation` PublicAssistantConversationConfigSchema, required: Schema for a public assistant conversation configuration
        - `thread_mode` 'new' | 'continue', required: Whether returning users start a new conversation or continue the previous one.
        - `welcome_banner` string: Static greeting shown in the UI when a conversation starts.
        - `suggested_messages` string[]: Up to 5 suggested messages shown when a conversation starts.
        - `auto_intro_message` string: First message the assistant sends automatically when a conversation begins via API.
        - `enable_auto_csat` boolean: Automatically score customer satisfaction when closing conversations.
        - `enable_ai_replies` boolean: When false the assistant is human-only: messages are received but the AI never responds.
      - `widget` PublicAssistantWidgetConfigSchema, required: Widget configuration with channel references resolved to links
        - `enabled` boolean: Whether the widget shows where its embed code is installed. Off hides it without removing the code.
        - `mode` 'button' | 'omnibar' | 'auto': 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.
        - `appearance` 'auto' | 'light' | 'dark': Theme of the widget: follow the visitor system or force one
        - `position` 'right' | 'left': Corner where the bubble launcher is anchored (the omnibar is always centered). A position attribute on the embed element overrides it.
        - `omnibar_minimize_desktop` boolean: Fold the omnibar into its compact centered button while visitors scroll on desktop too. On mobile viewports it always folds.
        - `hide_powered_by` boolean
        - `enable_dictation` boolean
        - `enable_file_uploads` boolean
        - `colors` AssistantWidgetColorsConfigSchema: Color overrides for the widget
          - `accent` string: Accent color used inside the chat (buttons, visitor messages, links)
          - `launcher_background` string: Background color of the widget button; the icon color adapts automatically
        - `teaser` AssistantWidgetTeaserConfigSchema: Proactive teaser configuration for the widget. The suggested replies shown with the teaser come from conversation.suggested_messages.
          - `enabled` boolean
          - `message` string: Short invitation shown next to the closed widget button
          - `modes` 'all' | 'button' | 'omnibar': Which widget modes show the teaser: both, only the bubble button, or only the omnibar
          - `suggestions` 'all' | 'button' | 'omnibar' | 'none': 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` integer: Seconds to wait before showing the teaser
          - `frequency` 'once_per_visitor' | 'once_per_session' | 'every_visit': How often the teaser can show again to the same visitor
          - `devices` 'all' | 'desktop' | 'mobile': Devices where the teaser shows
          - `version` integer: Bump to show the teaser again to visitors who already dismissed it
        - `channels` object, required
          - `items` PublicAssistantWidgetChannelSchema[], required
            - `type` 'whatsapp' | 'messenger' | 'instagram' | 'telegram' | 'email' | 'phone' | 'link', required: Type of a widget channel link
            - `label` string
            - `url` string, required
          - `label` string
          - `chat_button_label` string
  - `assistant_channel` PublicAssistantChannelSchema: Schema for a public assistant channel
    - `id` string, required
    - `enabled` boolean, required
    - `has_connection` boolean, required
    - `updates_outside_window` boolean: The channel delivers updates after the messaging window closed (WhatsApp Direct Send) and the provider has not rejected one for this connection yet
    - `identity` string, nullable, required: The channel identity messages are exchanged through, e.g the WhatsApp phone number
  - `conversation_id` string, required: The ID of the conversation associated with the chat
  - `assigned_user` UserLimitedSchema: The assigned user for the conversation
    - `id` string, required
    - `name` string, nullable, required
    - `email` string, email, required
    - `avatar` string, nullable, required
    - `seen_at` string, date-time, nullable, required
  - `assigned_at` string, date-time, nullable
  - `assistant_config` AssistantConfigSchema: Schema for the configuration of an assistant
    - `instructions` string: The instructions for the assistant: its system prompt
    - `language` 'auto' | 'en' | 'es', required: List of supported languages for the model in ISO 639-1 format or "auto"
    - `model` string, required: The model to use for the assistant
    - `conversation` AssistantConversationConfigSchema, required: Configuration options for the conversation thread of the assistant
      - `thread_mode` 'new' | 'continue', required: Whether returning users start a new conversation or continue the previous one.
      - `welcome_banner` string: Static greeting shown in the UI when a conversation starts.
      - `suggested_messages` string[]: Up to 5 suggested messages shown when a conversation starts.
      - `auto_intro_message` string: First message the assistant sends automatically when a conversation begins via API.
      - `enable_memories` boolean, required: Let the assistant store memories about the contact.
      - `enable_end_conversation_tool` boolean: Let the assistant close conversations on its own.
      - `enable_transfer_to_human_tool` boolean, required: The AI Routing switch: let the assistant hand a conversation to one of your members. Off turns routing off, whatever the routing instructions say.
      - `routing_instructions` string: 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` boolean: Let the assistant block abusive contacts.
      - `enable_ai_replies` boolean: When false the assistant is human-only: messages are received but the AI never responds.
      - `enable_auto_resolve` boolean: Automatically resolve conversations after a period of inactivity.
      - `enable_auto_follow_ups` boolean: Let the assistant follow up on conversations on its own.
      - `follow_up_instructions` string: Business rules that steer automatic follow-ups (cadence, hours, stop rules, tone).
      - `follow_ups_outside_window` boolean: After the messaging window closes, still follow up about something the contact asked for or is waiting on (WhatsApp).
      - `enable_auto_csat` boolean: Automatically score customer satisfaction when closing conversations.
      - `enable_private_chats` boolean: Enable private chats that do not appear in the inbox.
      - `enable_update_contact_tool` boolean: Let the assistant collect and update contact information.
      - `enable_transcription` boolean: Turn voice notes and videos into text, and describe what videos show, so any model understands them.
    - `widget` AssistantWidgetConfigSchema: Configuration of the embeddable web chat widget
      - `enabled` boolean: Whether the widget shows where its embed code is installed. Off hides it without removing the code.
      - `mode` 'button' | 'omnibar' | 'auto': 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.
      - `appearance` 'auto' | 'light' | 'dark': Theme of the widget: follow the visitor system or force one
      - `position` 'right' | 'left': Corner where the bubble launcher is anchored (the omnibar is always centered). A position attribute on the embed element overrides it.
      - `omnibar_minimize_desktop` boolean: Fold the omnibar into its compact centered button while visitors scroll on desktop too. On mobile viewports it always folds.
      - `hide_powered_by` boolean
      - `enable_dictation` boolean
      - `enable_file_uploads` boolean
      - `colors` AssistantWidgetColorsConfigSchema: Color overrides for the widget
        - `accent` string: Accent color used inside the chat (buttons, visitor messages, links)
        - `launcher_background` string: Background color of the widget button; the icon color adapts automatically
      - `teaser` AssistantWidgetTeaserConfigSchema: Proactive teaser configuration for the widget. The suggested replies shown with the teaser come from conversation.suggested_messages.
        - `enabled` boolean
        - `message` string: Short invitation shown next to the closed widget button
        - `modes` 'all' | 'button' | 'omnibar': Which widget modes show the teaser: both, only the bubble button, or only the omnibar
        - `suggestions` 'all' | 'button' | 'omnibar' | 'none': 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` integer: Seconds to wait before showing the teaser
        - `frequency` 'once_per_visitor' | 'once_per_session' | 'every_visit': How often the teaser can show again to the same visitor
        - `devices` 'all' | 'desktop' | 'mobile': Devices where the teaser shows
        - `version` integer: Bump to show the teaser again to visitors who already dismissed it
      - `channels` AssistantWidgetChannelsConfigSchema: Alternative channels offered in the widget launcher menu when any are configured
        - `items` AssistantWidgetChannelItemSchema[]
          - `channel_id` string: Connected assistant channel to link to; the URL is generated from the connection and ignored when the channel no longer exists
          - `enabled` boolean: Connected channels are included by default; set to false to hide one from the widget
          - `type` 'whatsapp' | 'messenger' | 'instagram' | 'telegram' | 'email' | 'phone' | 'link': Type of a custom channel link
          - `label` string
          - `url` string, uri: Destination of a custom link channel
          - `email` string, email: Address of a custom email channel
          - `phone` string: E.164 number of a custom phone channel
        - `label` string: Heading above the channels menu; defaults to "Talk to us on"
        - `chat_button_label` string: Label of the launcher chat action; defaults to "Chat with us"
    - `knowledge_scope` 'all' | 'restricted', required: Which knowledge the assistant searches: all sources, or only the ones linked to it (List/Link/Unlink Assistant Knowledge Source).
    - `timezone` string, required: IANA timezone, e.g. "America/New_York".
  - `ai_enabled` boolean, required: Whether AI is enabled for the chat
  - `admin_unseen_count` number, required: The number of unseen messages in the chat
  - `user_unseen_count` number, required: The number of unseen messages in the chat
  - `follow_up_at` string, date-time, nullable: Scheduled follow-up datetime
  - `muted_until` string, date-time, nullable: Mute expiry datetime (null = not muted)
  - `free_window_expires_at` string, date-time, nullable: 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` integer, nullable: Customer satisfaction score (1-5)
  - `last_contact_message_at` string, date-time, nullable

---

[API](https://skmtc.dev/useinvent/apis/invent-api.md) · [All operations](https://skmtc.dev/useinvent/apis/invent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/useinvent/apis/invent-api/revisions/98824f3fde82?raw)
