Skip to main content
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"
}
'
import requests

url = "https://api.gptmaker.ai/v2/workspace/{workspaceId}/create-channel"

payload = { "name": "Meu Canal" }
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'})
};

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'
]),
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}")

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}")
.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}"

response = http.request(request)
puts response.read_body
{
  "assistantId": null,
  "workspace": {
    "name": "Askia Inoove",
    "id": "3EB7F3C2BDB85017727802E54CF1568E"
  },
  "name": "canal de teste slc doido",
  "id": "3EC7E989CB4C50C1B8C542CD510C3BFC",
  "type": "WIDGET"
}
{
"error": "<string>"
}
{
"error": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspaceId
string
required

ID do workspace

Body

application/json

Dados para criação do canal

name
string
required

Nome do canal

Example:

"Meu Canal"

type
enum<string>

Tipo do canal

Available options:
Z_API,
WHATSAPP,
INSTAGRAM,
CLOUD_API,
TELEGRAM,
WIDGET,
MESSENGER,
MERCADO_LIVRE,
TWILIO_SMS

Response

Canal criado com sucesso

assistantId
string | null
required

ID do agente vinculado (quando houver)

workspace
object
required

Workspace do canal

name
string
required

Nome do canal

id
string
required

ID do canal

type
enum<string>
required

Tipo do canal

Available options:
Z_API,
WHATSAPP,
INSTAGRAM,
CLOUD_API,
TELEGRAM,
WIDGET,
MESSENGER,
MERCADO_LIVRE,
TWILIO_SMS