curl --request POST \
--url https://api.olie.ai/api/management/channels/open \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"integration_id": "6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d",
"external_ref": "[email protected]"
}
'import requests
url = "https://api.olie.ai/api/management/channels/open"
payload = {
"project_id": "8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"integration_id": "6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d",
"external_ref": "[email protected]"
}
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({
project_id: '8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c',
integration_id: '6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d',
external_ref: '[email protected]'
})
};
fetch('https://api.olie.ai/api/management/channels/open', 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.olie.ai/api/management/channels/open",
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([
'project_id' => '8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c',
'integration_id' => '6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d',
'external_ref' => '[email protected]'
]),
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.olie.ai/api/management/channels/open"
payload := strings.NewReader("{\n \"project_id\": \"8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c\",\n \"integration_id\": \"6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d\",\n \"external_ref\": \"[email protected]\"\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.olie.ai/api/management/channels/open")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c\",\n \"integration_id\": \"6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d\",\n \"external_ref\": \"[email protected]\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/channels/open")
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 \"project_id\": \"8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c\",\n \"integration_id\": \"6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d\",\n \"external_ref\": \"[email protected]\"\n}"
response = http.request(request)
puts response.read_body{
"response": true,
"channel": {
"id": "9b2a1c3e-4d5f-6789-abcd-ef0123456789",
"name": "WhatsApp",
"audience": "client",
"integration_id": "6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d",
"external_ref": "[email protected]",
"is_active": true,
"project_id": "8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"frame_id": "7c0e1d2f-3a4b-5c6d-7e8f-9a0b1c2d3e4f",
"created_at": "2026-06-18T12:00:00.000000Z",
"updated_at": "2026-06-18T12:00:00.000000Z"
}
}{
"response": false,
"message": "project_model_not_found",
"error": "No query results for model [Project]."
}{
"response": false,
"message": "active_channel_elsewhere",
"error": "The counterpart already has an active conversation in another project.",
"conflicting_channel_id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
"conflicting_project_id": "2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
"conflicting_project_name": "Atendimento Maria"
}{
"response": false,
"message": "validation_errors",
"error": "The given data was invalid.",
"validation": {
"project_id": [
"O campo project id é obrigatório."
],
"integration_id": [
"O campo integration id é obrigatório."
],
"external_ref": [
"O campo external ref é obrigatório."
]
}
}Abrir conversa externa
Abre uma conversa externa em um projeto, pela integração de comunicação informada. A resposta é HTTP 201 com o canal, inclusive quando a conversa ativa deste projeto é reaproveitada.
Se o destinatário já tem uma conversa ativa neste projeto, a chamada devolve esse canal. Se a conversa ativa estiver em outro projeto, o resultado depende de Permitir múltiplas conversas ativas com o mesmo contato. Com a opção ligada na empresa ou na integração, a chamada abre outra conversa neste projeto. Com a opção desligada, a chamada responde HTTP 409 com message: "active_channel_elsewhere".
Para encerrar as conversas ativas do destinatário e abrir uma nova neste projeto, envie force_reopen: true. Informe close_reason para gravar o motivo do encerramento na conversa encerrada.
curl --request POST \
--url https://api.olie.ai/api/management/channels/open \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"integration_id": "6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d",
"external_ref": "[email protected]"
}
'import requests
url = "https://api.olie.ai/api/management/channels/open"
payload = {
"project_id": "8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"integration_id": "6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d",
"external_ref": "[email protected]"
}
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({
project_id: '8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c',
integration_id: '6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d',
external_ref: '[email protected]'
})
};
fetch('https://api.olie.ai/api/management/channels/open', 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.olie.ai/api/management/channels/open",
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([
'project_id' => '8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c',
'integration_id' => '6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d',
'external_ref' => '[email protected]'
]),
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.olie.ai/api/management/channels/open"
payload := strings.NewReader("{\n \"project_id\": \"8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c\",\n \"integration_id\": \"6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d\",\n \"external_ref\": \"[email protected]\"\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.olie.ai/api/management/channels/open")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c\",\n \"integration_id\": \"6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d\",\n \"external_ref\": \"[email protected]\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/channels/open")
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 \"project_id\": \"8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c\",\n \"integration_id\": \"6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d\",\n \"external_ref\": \"[email protected]\"\n}"
response = http.request(request)
puts response.read_body{
"response": true,
"channel": {
"id": "9b2a1c3e-4d5f-6789-abcd-ef0123456789",
"name": "WhatsApp",
"audience": "client",
"integration_id": "6b9e0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d",
"external_ref": "[email protected]",
"is_active": true,
"project_id": "8a1f2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"frame_id": "7c0e1d2f-3a4b-5c6d-7e8f-9a0b1c2d3e4f",
"created_at": "2026-06-18T12:00:00.000000Z",
"updated_at": "2026-06-18T12:00:00.000000Z"
}
}{
"response": false,
"message": "project_model_not_found",
"error": "No query results for model [Project]."
}{
"response": false,
"message": "active_channel_elsewhere",
"error": "The counterpart already has an active conversation in another project.",
"conflicting_channel_id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
"conflicting_project_id": "2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
"conflicting_project_name": "Atendimento Maria"
}{
"response": false,
"message": "validation_errors",
"error": "The given data was invalid.",
"validation": {
"project_id": [
"O campo project id é obrigatório."
],
"integration_id": [
"O campo integration id é obrigatório."
],
"external_ref": [
"O campo external ref é obrigatório."
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Projeto em que a conversa abre.
Integração de comunicação pela qual a conversa acontece.
Identificador do contato no conector, enviado exatamente como informado.
255Encerra todas as conversas ativas com o destinatário nessa integração, em qualquer projeto, e abre uma nova neste.
Nota registrada na conversa encerrada. No máximo 500 caracteres.
500Was this page helpful?