Chats
Assign conversation
Assign or unassign a conversation to/from a team member.
PATCH
/
chats
/
{chat_id}
/
state
/
assign
Assign conversation
curl --request PATCH \
--url https://api.useinvent.com/chats/{chat_id}/state/assign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"member_id": "<string>"
}
'import requests
url = "https://api.useinvent.com/chats/{chat_id}/state/assign"
payload = { "member_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({member_id: '<string>'})
};
fetch('https://api.useinvent.com/chats/{chat_id}/state/assign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.useinvent.com/chats/{chat_id}/state/assign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'member_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.useinvent.com/chats/{chat_id}/state/assign"
payload := strings.NewReader("{\n \"member_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.useinvent.com/chats/{chat_id}/state/assign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"member_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useinvent.com/chats/{chat_id}/state/assign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"member_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"state": "OPEN",
"channel_type": "internal",
"conversation_id": "<string>",
"ai_enabled": true,
"admin_unseen_count": 123,
"user_unseen_count": 123,
"assistant": {
"id": "<string>",
"name": "<string>",
"avatar_url": "<string>",
"deleted": true,
"config": {
"conversation": {
"thread_mode": "new",
"welcome_banner": "<string>",
"suggested_messages": [
"<string>"
],
"auto_intro_message": "<string>",
"enable_auto_csat": true,
"enable_ai_replies": true
},
"widget": {
"channels": {
"items": [
{
"type": "whatsapp",
"url": "<string>",
"label": "<string>"
}
],
"label": "<string>",
"chat_button_label": "<string>"
},
"enabled": true,
"mode": "button",
"appearance": "auto",
"position": "right",
"omnibar_minimize_desktop": true,
"hide_powered_by": true,
"enable_dictation": true,
"enable_file_uploads": true,
"colors": {},
"teaser": {}
}
}
},
"assistant_channel": {
"id": "<string>",
"enabled": true,
"has_connection": true,
"identity": "<string>",
"updates_outside_window": true
},
"assigned_user": {
"id": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"avatar": "<string>",
"seen_at": "2023-11-07T05:31:56Z"
},
"assigned_at": "2023-11-07T05:31:56Z",
"assistant_config": {
"language": "auto",
"model": "<string>",
"conversation": {
"thread_mode": "new",
"enable_memories": true,
"enable_transfer_to_human_tool": true,
"welcome_banner": "<string>",
"suggested_messages": [
"<string>"
],
"auto_intro_message": "<string>",
"enable_end_conversation_tool": true,
"routing_instructions": "<string>",
"enable_block_contact_tool": true,
"enable_ai_replies": true,
"enable_auto_resolve": true,
"enable_auto_follow_ups": true,
"follow_up_instructions": "<string>",
"follow_ups_outside_window": true,
"enable_auto_csat": true,
"enable_private_chats": true,
"enable_update_contact_tool": true,
"enable_transcription": true
},
"knowledge_scope": "all",
"timezone": "<string>",
"instructions": "<string>",
"widget": {}
},
"follow_up_at": "2023-11-07T05:31:56Z",
"muted_until": "2023-11-07T05:31:56Z",
"free_window_expires_at": "2023-11-07T05:31:56Z",
"csat_score": 3,
"last_contact_message_at": "2023-11-07T05:31:56Z"
}Body
application/jsonmultipart/form-data
Response
200 - application/json
Schema for the chat state
Was this page helpful?
⌘I
Assign conversation
curl --request PATCH \
--url https://api.useinvent.com/chats/{chat_id}/state/assign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"member_id": "<string>"
}
'import requests
url = "https://api.useinvent.com/chats/{chat_id}/state/assign"
payload = { "member_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({member_id: '<string>'})
};
fetch('https://api.useinvent.com/chats/{chat_id}/state/assign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.useinvent.com/chats/{chat_id}/state/assign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'member_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.useinvent.com/chats/{chat_id}/state/assign"
payload := strings.NewReader("{\n \"member_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.useinvent.com/chats/{chat_id}/state/assign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"member_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useinvent.com/chats/{chat_id}/state/assign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"member_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"state": "OPEN",
"channel_type": "internal",
"conversation_id": "<string>",
"ai_enabled": true,
"admin_unseen_count": 123,
"user_unseen_count": 123,
"assistant": {
"id": "<string>",
"name": "<string>",
"avatar_url": "<string>",
"deleted": true,
"config": {
"conversation": {
"thread_mode": "new",
"welcome_banner": "<string>",
"suggested_messages": [
"<string>"
],
"auto_intro_message": "<string>",
"enable_auto_csat": true,
"enable_ai_replies": true
},
"widget": {
"channels": {
"items": [
{
"type": "whatsapp",
"url": "<string>",
"label": "<string>"
}
],
"label": "<string>",
"chat_button_label": "<string>"
},
"enabled": true,
"mode": "button",
"appearance": "auto",
"position": "right",
"omnibar_minimize_desktop": true,
"hide_powered_by": true,
"enable_dictation": true,
"enable_file_uploads": true,
"colors": {},
"teaser": {}
}
}
},
"assistant_channel": {
"id": "<string>",
"enabled": true,
"has_connection": true,
"identity": "<string>",
"updates_outside_window": true
},
"assigned_user": {
"id": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"avatar": "<string>",
"seen_at": "2023-11-07T05:31:56Z"
},
"assigned_at": "2023-11-07T05:31:56Z",
"assistant_config": {
"language": "auto",
"model": "<string>",
"conversation": {
"thread_mode": "new",
"enable_memories": true,
"enable_transfer_to_human_tool": true,
"welcome_banner": "<string>",
"suggested_messages": [
"<string>"
],
"auto_intro_message": "<string>",
"enable_end_conversation_tool": true,
"routing_instructions": "<string>",
"enable_block_contact_tool": true,
"enable_ai_replies": true,
"enable_auto_resolve": true,
"enable_auto_follow_ups": true,
"follow_up_instructions": "<string>",
"follow_ups_outside_window": true,
"enable_auto_csat": true,
"enable_private_chats": true,
"enable_update_contact_tool": true,
"enable_transcription": true
},
"knowledge_scope": "all",
"timezone": "<string>",
"instructions": "<string>",
"widget": {}
},
"follow_up_at": "2023-11-07T05:31:56Z",
"muted_until": "2023-11-07T05:31:56Z",
"free_window_expires_at": "2023-11-07T05:31:56Z",
"csat_score": 3,
"last_contact_message_at": "2023-11-07T05:31:56Z"
}