curl --request PUT \
--url https://app.flextell.ai/api/v1/channels/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"name": "<string>",
"provider": "<string>",
"address": "<string>",
"website_domain": "<string>",
"is_active": true,
"bot_token": "<string>",
"webhook_enabled": true,
"webhook_base_url": "<string>"
}
'import requests
url = "https://app.flextell.ai/api/v1/channels/{id}"
payload = {
"name": "<string>",
"provider": "<string>",
"address": "<string>",
"website_domain": "<string>",
"is_active": True,
"bot_token": "<string>",
"webhook_enabled": True,
"webhook_base_url": "<string>"
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
provider: '<string>',
address: '<string>',
website_domain: '<string>',
is_active: true,
bot_token: '<string>',
webhook_enabled: true,
webhook_base_url: '<string>'
})
};
fetch('https://app.flextell.ai/api/v1/channels/{id}', 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://app.flextell.ai/api/v1/channels/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'provider' => '<string>',
'address' => '<string>',
'website_domain' => '<string>',
'is_active' => true,
'bot_token' => '<string>',
'webhook_enabled' => true,
'webhook_base_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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://app.flextell.ai/api/v1/channels/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"address\": \"<string>\",\n \"website_domain\": \"<string>\",\n \"is_active\": true,\n \"bot_token\": \"<string>\",\n \"webhook_enabled\": true,\n \"webhook_base_url\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
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.put("https://app.flextell.ai/api/v1/channels/{id}")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"address\": \"<string>\",\n \"website_domain\": \"<string>\",\n \"is_active\": true,\n \"bot_token\": \"<string>\",\n \"webhook_enabled\": true,\n \"webhook_base_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/channels/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"address\": \"<string>\",\n \"website_domain\": \"<string>\",\n \"is_active\": true,\n \"bot_token\": \"<string>\",\n \"webhook_enabled\": true,\n \"webhook_base_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"tenant_id": 123,
"name": "<string>",
"type": "whatsapp",
"provider": "<string>",
"address": "<string>",
"website_domain": "<string>",
"status": "closed",
"is_active": true,
"ai_reply_mode": "auto",
"connection_error": {
"code": "<string>",
"expected_address": "<string>",
"connected_address": "<string>",
"message": "<string>",
"detected_at": "2023-11-07T05:31:56Z"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "CHANNEL_PROVIDER_UNAVAILABLE",
"message": "<string>"
}Update a channel
Sending bot_token, webhook_enabled or webhook_base_url (Telegram channels only, otherwise
CHANNEL_NOT_TELEGRAM) reconnects the bot; if Telegram refuses, none of the changes are saved.
curl --request PUT \
--url https://app.flextell.ai/api/v1/channels/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"name": "<string>",
"provider": "<string>",
"address": "<string>",
"website_domain": "<string>",
"is_active": true,
"bot_token": "<string>",
"webhook_enabled": true,
"webhook_base_url": "<string>"
}
'import requests
url = "https://app.flextell.ai/api/v1/channels/{id}"
payload = {
"name": "<string>",
"provider": "<string>",
"address": "<string>",
"website_domain": "<string>",
"is_active": True,
"bot_token": "<string>",
"webhook_enabled": True,
"webhook_base_url": "<string>"
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
provider: '<string>',
address: '<string>',
website_domain: '<string>',
is_active: true,
bot_token: '<string>',
webhook_enabled: true,
webhook_base_url: '<string>'
})
};
fetch('https://app.flextell.ai/api/v1/channels/{id}', 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://app.flextell.ai/api/v1/channels/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'provider' => '<string>',
'address' => '<string>',
'website_domain' => '<string>',
'is_active' => true,
'bot_token' => '<string>',
'webhook_enabled' => true,
'webhook_base_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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://app.flextell.ai/api/v1/channels/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"address\": \"<string>\",\n \"website_domain\": \"<string>\",\n \"is_active\": true,\n \"bot_token\": \"<string>\",\n \"webhook_enabled\": true,\n \"webhook_base_url\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
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.put("https://app.flextell.ai/api/v1/channels/{id}")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"address\": \"<string>\",\n \"website_domain\": \"<string>\",\n \"is_active\": true,\n \"bot_token\": \"<string>\",\n \"webhook_enabled\": true,\n \"webhook_base_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/channels/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"address\": \"<string>\",\n \"website_domain\": \"<string>\",\n \"is_active\": true,\n \"bot_token\": \"<string>\",\n \"webhook_enabled\": true,\n \"webhook_base_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"tenant_id": 123,
"name": "<string>",
"type": "whatsapp",
"provider": "<string>",
"address": "<string>",
"website_domain": "<string>",
"status": "closed",
"is_active": true,
"ai_reply_mode": "auto",
"connection_error": {
"code": "<string>",
"expected_address": "<string>",
"connected_address": "<string>",
"message": "<string>",
"detected_at": "2023-11-07T05:31:56Z"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "CHANNEL_PROVIDER_UNAVAILABLE",
"message": "<string>"
}Yetkilendirmeler
The access token received from the authorization server in the OAuth 2.0 flow.
Başlıklar
Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.
Yol Parametreleri
The channel identifier
Gövde
The display name of the channel, stored upper-cased and unique per tenant. Renaming a WhatsApp channel does not touch its provider instance.
255The messaging provider backing the channel.
255The channel address — a phone number, handle or bot identifier.
255The site the widget is embedded on, without a scheme. Website channels only.
255^(?:localhost|(?:\d{1,3}\.){3}\d{1,3}|(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+))(?:\:\d{1,5})?$Whether the channel is active.
Pins the channel to a fixed AI reply mode (auto, semi_auto, closed). Send null to follow the clinic schedule again.
auto, semi_auto, closed Telegram channels only. A new BotFather token; the bot is verified and the webhook re-registered before anything is saved. Omit to keep the stored token. Write-only: it is never returned.
255^\d+:[A-Za-z0-9_-]+$Telegram channels only. Turns webhook delivery of incoming messages on or off; the change is applied on Telegram with the stored token.
Telegram channels only, non-production only. The public HTTPS base URL the webhook is registered under. Ignored in production.
255