Create New Conversation
curl --request POST \
--url https://chat.chatclean.com.br/api/v1/accounts/{account_id}/conversations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_id": "1234567890",
"inbox_id": 1,
"contact_id": 1,
"additional_attributes": {
"browser": "Chrome",
"browser_version": "89.0.4389.82",
"os": "Windows",
"os_version": "10"
},
"custom_attributes": {
"attribute_key": "attribute_value",
"priority_conversation_number": 3
},
"status": "open",
"assignee_id": 1,
"team_id": 1,
"snoozed_until": "2030-07-21T17:32:28Z"
}
'import requests
url = "https://chat.chatclean.com.br/api/v1/accounts/{account_id}/conversations"
payload = {
"source_id": "1234567890",
"inbox_id": 1,
"contact_id": 1,
"additional_attributes": {
"browser": "Chrome",
"browser_version": "89.0.4389.82",
"os": "Windows",
"os_version": "10"
},
"custom_attributes": {
"attribute_key": "attribute_value",
"priority_conversation_number": 3
},
"status": "open",
"assignee_id": 1,
"team_id": 1,
"snoozed_until": "2030-07-21T17:32:28Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_id: '1234567890',
inbox_id: 1,
contact_id: 1,
additional_attributes: {
browser: 'Chrome',
browser_version: '89.0.4389.82',
os: 'Windows',
os_version: '10'
},
custom_attributes: {attribute_key: 'attribute_value', priority_conversation_number: 3},
status: 'open',
assignee_id: 1,
team_id: 1,
snoozed_until: '2030-07-21T17:32:28Z'
})
};
fetch('https://chat.chatclean.com.br/api/v1/accounts/{account_id}/conversations', 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://chat.chatclean.com.br/api/v1/accounts/{account_id}/conversations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source_id' => '1234567890',
'inbox_id' => 1,
'contact_id' => 1,
'additional_attributes' => [
'browser' => 'Chrome',
'browser_version' => '89.0.4389.82',
'os' => 'Windows',
'os_version' => '10'
],
'custom_attributes' => [
'attribute_key' => 'attribute_value',
'priority_conversation_number' => 3
],
'status' => 'open',
'assignee_id' => 1,
'team_id' => 1,
'snoozed_until' => '2030-07-21T17:32:28Z'
]),
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://chat.chatclean.com.br/api/v1/accounts/{account_id}/conversations"
payload := strings.NewReader("{\n \"source_id\": \"1234567890\",\n \"inbox_id\": 1,\n \"contact_id\": 1,\n \"additional_attributes\": {\n \"browser\": \"Chrome\",\n \"browser_version\": \"89.0.4389.82\",\n \"os\": \"Windows\",\n \"os_version\": \"10\"\n },\n \"custom_attributes\": {\n \"attribute_key\": \"attribute_value\",\n \"priority_conversation_number\": 3\n },\n \"status\": \"open\",\n \"assignee_id\": 1,\n \"team_id\": 1,\n \"snoozed_until\": \"2030-07-21T17:32:28Z\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://chat.chatclean.com.br/api/v1/accounts/{account_id}/conversations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_id\": \"1234567890\",\n \"inbox_id\": 1,\n \"contact_id\": 1,\n \"additional_attributes\": {\n \"browser\": \"Chrome\",\n \"browser_version\": \"89.0.4389.82\",\n \"os\": \"Windows\",\n \"os_version\": \"10\"\n },\n \"custom_attributes\": {\n \"attribute_key\": \"attribute_value\",\n \"priority_conversation_number\": 3\n },\n \"status\": \"open\",\n \"assignee_id\": 1,\n \"team_id\": 1,\n \"snoozed_until\": \"2030-07-21T17:32:28Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://chat.chatclean.com.br/api/v1/accounts/{account_id}/conversations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_id\": \"1234567890\",\n \"inbox_id\": 1,\n \"contact_id\": 1,\n \"additional_attributes\": {\n \"browser\": \"Chrome\",\n \"browser_version\": \"89.0.4389.82\",\n \"os\": \"Windows\",\n \"os_version\": \"10\"\n },\n \"custom_attributes\": {\n \"attribute_key\": \"attribute_value\",\n \"priority_conversation_number\": 3\n },\n \"status\": \"open\",\n \"assignee_id\": 1,\n \"team_id\": 1,\n \"snoozed_until\": \"2030-07-21T17:32:28Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"account_id": 123,
"inbox_id": 123
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Conversations
Create New Conversation
Creating a conversation in ChatClean requires a source id.
Learn more about source_id: https://docs.chatclean.com.br/canais/api#send-messages-to-the-api-channel
POST
/
api
/
v1
/
accounts
/
{account_id}
/
conversations
Create New Conversation
curl --request POST \
--url https://chat.chatclean.com.br/api/v1/accounts/{account_id}/conversations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_id": "1234567890",
"inbox_id": 1,
"contact_id": 1,
"additional_attributes": {
"browser": "Chrome",
"browser_version": "89.0.4389.82",
"os": "Windows",
"os_version": "10"
},
"custom_attributes": {
"attribute_key": "attribute_value",
"priority_conversation_number": 3
},
"status": "open",
"assignee_id": 1,
"team_id": 1,
"snoozed_until": "2030-07-21T17:32:28Z"
}
'import requests
url = "https://chat.chatclean.com.br/api/v1/accounts/{account_id}/conversations"
payload = {
"source_id": "1234567890",
"inbox_id": 1,
"contact_id": 1,
"additional_attributes": {
"browser": "Chrome",
"browser_version": "89.0.4389.82",
"os": "Windows",
"os_version": "10"
},
"custom_attributes": {
"attribute_key": "attribute_value",
"priority_conversation_number": 3
},
"status": "open",
"assignee_id": 1,
"team_id": 1,
"snoozed_until": "2030-07-21T17:32:28Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_id: '1234567890',
inbox_id: 1,
contact_id: 1,
additional_attributes: {
browser: 'Chrome',
browser_version: '89.0.4389.82',
os: 'Windows',
os_version: '10'
},
custom_attributes: {attribute_key: 'attribute_value', priority_conversation_number: 3},
status: 'open',
assignee_id: 1,
team_id: 1,
snoozed_until: '2030-07-21T17:32:28Z'
})
};
fetch('https://chat.chatclean.com.br/api/v1/accounts/{account_id}/conversations', 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://chat.chatclean.com.br/api/v1/accounts/{account_id}/conversations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source_id' => '1234567890',
'inbox_id' => 1,
'contact_id' => 1,
'additional_attributes' => [
'browser' => 'Chrome',
'browser_version' => '89.0.4389.82',
'os' => 'Windows',
'os_version' => '10'
],
'custom_attributes' => [
'attribute_key' => 'attribute_value',
'priority_conversation_number' => 3
],
'status' => 'open',
'assignee_id' => 1,
'team_id' => 1,
'snoozed_until' => '2030-07-21T17:32:28Z'
]),
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://chat.chatclean.com.br/api/v1/accounts/{account_id}/conversations"
payload := strings.NewReader("{\n \"source_id\": \"1234567890\",\n \"inbox_id\": 1,\n \"contact_id\": 1,\n \"additional_attributes\": {\n \"browser\": \"Chrome\",\n \"browser_version\": \"89.0.4389.82\",\n \"os\": \"Windows\",\n \"os_version\": \"10\"\n },\n \"custom_attributes\": {\n \"attribute_key\": \"attribute_value\",\n \"priority_conversation_number\": 3\n },\n \"status\": \"open\",\n \"assignee_id\": 1,\n \"team_id\": 1,\n \"snoozed_until\": \"2030-07-21T17:32:28Z\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://chat.chatclean.com.br/api/v1/accounts/{account_id}/conversations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_id\": \"1234567890\",\n \"inbox_id\": 1,\n \"contact_id\": 1,\n \"additional_attributes\": {\n \"browser\": \"Chrome\",\n \"browser_version\": \"89.0.4389.82\",\n \"os\": \"Windows\",\n \"os_version\": \"10\"\n },\n \"custom_attributes\": {\n \"attribute_key\": \"attribute_value\",\n \"priority_conversation_number\": 3\n },\n \"status\": \"open\",\n \"assignee_id\": 1,\n \"team_id\": 1,\n \"snoozed_until\": \"2030-07-21T17:32:28Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://chat.chatclean.com.br/api/v1/accounts/{account_id}/conversations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_id\": \"1234567890\",\n \"inbox_id\": 1,\n \"contact_id\": 1,\n \"additional_attributes\": {\n \"browser\": \"Chrome\",\n \"browser_version\": \"89.0.4389.82\",\n \"os\": \"Windows\",\n \"os_version\": \"10\"\n },\n \"custom_attributes\": {\n \"attribute_key\": \"attribute_value\",\n \"priority_conversation_number\": 3\n },\n \"status\": \"open\",\n \"assignee_id\": 1,\n \"team_id\": 1,\n \"snoozed_until\": \"2030-07-21T17:32:28Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"account_id": 123,
"inbox_id": 123
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Authorizations
userBearerAuthagentBotBearerAuthuserApiKeyagentBotApiKey
Body
application/json

