cURL
curl --request POST \
--url https://api.gptmaker.ai/v2/workspace/{workspaceId}/create-channel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Meu Canal",
"agentId": "3EB804183CD300509DF902E54CF1568E"
}
'import requests
url = "https://api.gptmaker.ai/v2/workspace/{workspaceId}/create-channel"
payload = {
"name": "Meu Canal",
"agentId": "3EB804183CD300509DF902E54CF1568E"
}
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({name: 'Meu Canal', agentId: '3EB804183CD300509DF902E54CF1568E'})
};
fetch('https://api.gptmaker.ai/v2/workspace/{workspaceId}/create-channel', 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.gptmaker.ai/v2/workspace/{workspaceId}/create-channel",
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([
'name' => 'Meu Canal',
'agentId' => '3EB804183CD300509DF902E54CF1568E'
]),
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.gptmaker.ai/v2/workspace/{workspaceId}/create-channel"
payload := strings.NewReader("{\n \"name\": \"Meu Canal\",\n \"agentId\": \"3EB804183CD300509DF902E54CF1568E\"\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.gptmaker.ai/v2/workspace/{workspaceId}/create-channel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Meu Canal\",\n \"agentId\": \"3EB804183CD300509DF902E54CF1568E\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gptmaker.ai/v2/workspace/{workspaceId}/create-channel")
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 \"name\": \"Meu Canal\",\n \"agentId\": \"3EB804183CD300509DF902E54CF1568E\"\n}"
response = http.request(request)
puts response.read_body{
"assistantId": null,
"workspace": {
"name": "Minha Empresa",
"id": "3EB7F3C2BDB85017727802E54CF1568E"
},
"name": "Canal Widget - Suporte",
"id": "3EC7E989CB4C50C1B8C542CD510C3BFC",
"type": "WIDGET"
}{
"error": "<string>"
}{
"error": "<string>"
}Canais
Criar canal no workspace
Endpoint mais atualizado para criação de canais. Permite criar um canal de forma independente, sem necessidade de vinculá-lo a um agente.
POST
/
v2
/
workspace
/
{workspaceId}
/
create-channel
cURL
curl --request POST \
--url https://api.gptmaker.ai/v2/workspace/{workspaceId}/create-channel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Meu Canal",
"agentId": "3EB804183CD300509DF902E54CF1568E"
}
'import requests
url = "https://api.gptmaker.ai/v2/workspace/{workspaceId}/create-channel"
payload = {
"name": "Meu Canal",
"agentId": "3EB804183CD300509DF902E54CF1568E"
}
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({name: 'Meu Canal', agentId: '3EB804183CD300509DF902E54CF1568E'})
};
fetch('https://api.gptmaker.ai/v2/workspace/{workspaceId}/create-channel', 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.gptmaker.ai/v2/workspace/{workspaceId}/create-channel",
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([
'name' => 'Meu Canal',
'agentId' => '3EB804183CD300509DF902E54CF1568E'
]),
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.gptmaker.ai/v2/workspace/{workspaceId}/create-channel"
payload := strings.NewReader("{\n \"name\": \"Meu Canal\",\n \"agentId\": \"3EB804183CD300509DF902E54CF1568E\"\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.gptmaker.ai/v2/workspace/{workspaceId}/create-channel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Meu Canal\",\n \"agentId\": \"3EB804183CD300509DF902E54CF1568E\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gptmaker.ai/v2/workspace/{workspaceId}/create-channel")
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 \"name\": \"Meu Canal\",\n \"agentId\": \"3EB804183CD300509DF902E54CF1568E\"\n}"
response = http.request(request)
puts response.read_body{
"assistantId": null,
"workspace": {
"name": "Minha Empresa",
"id": "3EB7F3C2BDB85017727802E54CF1568E"
},
"name": "Canal Widget - Suporte",
"id": "3EC7E989CB4C50C1B8C542CD510C3BFC",
"type": "WIDGET"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID do workspace
Body
application/json
Dados para criação do canal
Nome do canal
Example:
"Meu Canal"
Tipo do canal
Available options:
Z_API, WHATSAPP, INSTAGRAM, CLOUD_API, TELEGRAM, WIDGET, MESSENGER, MERCADO_LIVRE, TWILIO_SMS ID do agente a ser vinculado ao canal (opcional). Se não informado, o canal é criado sem agente.
Example:
"3EB804183CD300509DF902E54CF1568E"
Response
Canal criado com sucesso
ID do agente vinculado (quando houver)
Workspace do canal
Show child attributes
Show child attributes
Nome do canal
ID do canal
Tipo do canal
Available options:
Z_API, WHATSAPP, INSTAGRAM, CLOUD_API, TELEGRAM, WIDGET, MESSENGER, MERCADO_LIVRE, TWILIO_SMS 
