Create a new channel
curl --request POST \
--url https://{host}/api/{session}/channels \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"name": "Channel Name",
"description": "Channel Description",
"picture": {
"mimetype": "image/jpeg",
"url": "https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg",
"filename": "filename.jpg"
}
}
'import requests
url = "https://{host}/api/{session}/channels"
payload = {
"name": "Channel Name",
"description": "Channel Description",
"picture": {
"mimetype": "image/jpeg",
"url": "https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg",
"filename": "filename.jpg"
}
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Channel Name',
description: 'Channel Description',
picture: {
mimetype: 'image/jpeg',
url: 'https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg',
filename: 'filename.jpg'
}
})
};
fetch('https://{host}/api/{session}/channels', 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://{host}/api/{session}/channels",
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' => 'Channel Name',
'description' => 'Channel Description',
'picture' => [
'mimetype' => 'image/jpeg',
'url' => 'https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg',
'filename' => 'filename.jpg'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$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://{host}/api/{session}/channels"
payload := strings.NewReader("{\n \"name\": \"Channel Name\",\n \"description\": \"Channel Description\",\n \"picture\": {\n \"mimetype\": \"image/jpeg\",\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\",\n \"filename\": \"filename.jpg\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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://{host}/api/{session}/channels")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Channel Name\",\n \"description\": \"Channel Description\",\n \"picture\": {\n \"mimetype\": \"image/jpeg\",\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\",\n \"filename\": \"filename.jpg\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/channels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Channel Name\",\n \"description\": \"Channel Description\",\n \"picture\": {\n \"mimetype\": \"image/jpeg\",\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\",\n \"filename\": \"filename.jpg\"\n }\n}"
response = http.request(request)
puts response.read_body{
"name": "My Channel",
"description": "News and updates channel",
"picture": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
}
{
"success": true,
"channel": {
"id": "123456789@newsletter",
"name": "My Channel",
"description": "News and updates channel"
}
}
Channels
Create New Channel
Create new channel (newsletter) on WhatsApp
POST
/
api
/
{session}
/
channels
Create a new channel
curl --request POST \
--url https://{host}/api/{session}/channels \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"name": "Channel Name",
"description": "Channel Description",
"picture": {
"mimetype": "image/jpeg",
"url": "https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg",
"filename": "filename.jpg"
}
}
'import requests
url = "https://{host}/api/{session}/channels"
payload = {
"name": "Channel Name",
"description": "Channel Description",
"picture": {
"mimetype": "image/jpeg",
"url": "https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg",
"filename": "filename.jpg"
}
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Channel Name',
description: 'Channel Description',
picture: {
mimetype: 'image/jpeg',
url: 'https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg',
filename: 'filename.jpg'
}
})
};
fetch('https://{host}/api/{session}/channels', 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://{host}/api/{session}/channels",
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' => 'Channel Name',
'description' => 'Channel Description',
'picture' => [
'mimetype' => 'image/jpeg',
'url' => 'https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg',
'filename' => 'filename.jpg'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$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://{host}/api/{session}/channels"
payload := strings.NewReader("{\n \"name\": \"Channel Name\",\n \"description\": \"Channel Description\",\n \"picture\": {\n \"mimetype\": \"image/jpeg\",\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\",\n \"filename\": \"filename.jpg\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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://{host}/api/{session}/channels")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Channel Name\",\n \"description\": \"Channel Description\",\n \"picture\": {\n \"mimetype\": \"image/jpeg\",\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\",\n \"filename\": \"filename.jpg\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/channels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Channel Name\",\n \"description\": \"Channel Description\",\n \"picture\": {\n \"mimetype\": \"image/jpeg\",\n \"url\": \"https://github.com/stgcompany/wappfy/raw/core/examples/wappfy.jpg\",\n \"filename\": \"filename.jpg\"\n }\n}"
response = http.request(request)
puts response.read_body{
"name": "My Channel",
"description": "News and updates channel",
"picture": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
}
{
"success": true,
"channel": {
"id": "123456789@newsletter",
"name": "My Channel",
"description": "News and updates channel"
}
}
Description
This endpoint allows you to create a new channel on WhatsApp. Channels are resources that allow broadcasting messages to a large number of followers in a unidirectional way.URL Parameters
Request Body
Response
{
"name": "My Channel",
"description": "News and updates channel",
"picture": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
}
{
"success": true,
"channel": {
"id": "123456789@newsletter",
"name": "My Channel",
"description": "News and updates channel"
}
}
Status Codes
200- Channel created successfully400- Invalid or missing parameters401- Unauthorized500- Internal server error
Usage Example
curl -X POST https://api.wappfy.com.br/api/my-session/channels \
-H "Content-Type: application/json" \
-d '{
"name": "My Channel",
"description": "News and updates channel",
"picture": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
}'
const session = 'my-session';
const response = await fetch(`https://api.wappfy.com.br/api/${session}/channels`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'My Channel',
description: 'News and updates channel',
picture: 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='
})
});
const data = await response.json();
console.log(data);
import requests
session = 'my-session'
response = requests.post(
f'https://api.wappfy.com.br/api/{session}/channels',
json={
'name': 'My Channel',
'description': 'News and updates channel',
'picture': 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='
}
)
data = response.json()
print(data)
Body
application/json
Response
201 - application/json
