curl --request POST \
--url https://api.multchats.com/v2/automation/stop-automation-in-chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chatInternalId": "<string>",
"chatId": "<string>",
"phoneNumber": "<string>",
"integrationId": "<string>"
}
'import requests
url = "https://api.multchats.com/v2/automation/stop-automation-in-chat"
payload = {
"chatInternalId": "<string>",
"chatId": "<string>",
"phoneNumber": "<string>",
"integrationId": "<string>"
}
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({
chatInternalId: '<string>',
chatId: '<string>',
phoneNumber: '<string>',
integrationId: '<string>'
})
};
fetch('https://api.multchats.com/v2/automation/stop-automation-in-chat', 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.multchats.com/v2/automation/stop-automation-in-chat",
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([
'chatInternalId' => '<string>',
'chatId' => '<string>',
'phoneNumber' => '<string>',
'integrationId' => '<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.multchats.com/v2/automation/stop-automation-in-chat"
payload := strings.NewReader("{\n \"chatInternalId\": \"<string>\",\n \"chatId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"integrationId\": \"<string>\"\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://api.multchats.com/v2/automation/stop-automation-in-chat")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chatInternalId\": \"<string>\",\n \"chatId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"integrationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.multchats.com/v2/automation/stop-automation-in-chat")
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 \"chatInternalId\": \"<string>\",\n \"chatId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"integrationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"stopped": true,
"chat": {
"chatInternalId": "<string>",
"chatId": "<string>",
"name": "<string>",
"integrationId": "<string>"
},
"automations": [
{
"type": "TYPEBOT",
"id": "<string>",
"name": "<string>",
"sessionId": "<string>"
}
]
}
}{
"success": false,
"message": "Erro ao enviar mensagem"
}Finalizar automação do chat
Finaliza a automação que está em execução em um chat, seja um fluxo do Typebot ou uma automação do sistema. A resposta informa qual automação foi finalizada ou que o chat não possui automação ativa.
curl --request POST \
--url https://api.multchats.com/v2/automation/stop-automation-in-chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chatInternalId": "<string>",
"chatId": "<string>",
"phoneNumber": "<string>",
"integrationId": "<string>"
}
'import requests
url = "https://api.multchats.com/v2/automation/stop-automation-in-chat"
payload = {
"chatInternalId": "<string>",
"chatId": "<string>",
"phoneNumber": "<string>",
"integrationId": "<string>"
}
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({
chatInternalId: '<string>',
chatId: '<string>',
phoneNumber: '<string>',
integrationId: '<string>'
})
};
fetch('https://api.multchats.com/v2/automation/stop-automation-in-chat', 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.multchats.com/v2/automation/stop-automation-in-chat",
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([
'chatInternalId' => '<string>',
'chatId' => '<string>',
'phoneNumber' => '<string>',
'integrationId' => '<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.multchats.com/v2/automation/stop-automation-in-chat"
payload := strings.NewReader("{\n \"chatInternalId\": \"<string>\",\n \"chatId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"integrationId\": \"<string>\"\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://api.multchats.com/v2/automation/stop-automation-in-chat")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chatInternalId\": \"<string>\",\n \"chatId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"integrationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.multchats.com/v2/automation/stop-automation-in-chat")
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 \"chatInternalId\": \"<string>\",\n \"chatId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"integrationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"stopped": true,
"chat": {
"chatInternalId": "<string>",
"chatId": "<string>",
"name": "<string>",
"integrationId": "<string>"
},
"automations": [
{
"type": "TYPEBOT",
"id": "<string>",
"name": "<string>",
"sessionId": "<string>"
}
]
}
}{
"success": false,
"message": "Erro ao enviar mensagem"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Informe chatInternalId, chatId ou phoneNumber. O phoneNumber é buscado por aproximação, então informe o integrationId sempre que o mesmo número puder existir em mais de uma integração. Havendo mais de um chat, o que tem a mensagem mais recente é utilizado.
ID interno do chat (obrigatório se chatId e phoneNumber não forem informados)
^c[a-z0-9]{24}$ID do chat no canal, por exemplo 5511999999999@s.whatsapp.net (obrigatório se chatInternalId e phoneNumber não forem informados)
1Número de telefone do contato, em qualquer formato (obrigatório se chatInternalId e chatId não forem informados)
8 - 30ID da integração, restringe a busca feita pelo chatId ou pelo phoneNumber
^c[a-z0-9]{24}$
