POST
/api/channels/toggle BearerToggle Channel
Start or stop a PocketPaw channel adapter dynamically without restarting the server. Toggle channels on and off from the dashboard or via API calls for runtime channel management.
Overview
Starts or stops a channel adapter at runtime without restarting the server. The channel must be configured (have valid credentials) before it can be started.
Request Body
Body Parameters
channel requiredChannel identifier. One of: discord, slack, whatsapp, telegram, signal, matrix, teams, gchat.
action requiredWhether to start or stop the adapter.
Allowed values:
startstopResponse
channel stringThe channel that was toggled
configured booleanWhether the channel has valid credentials
running booleanWhether the channel is now running after the toggle
curl -X POST "http://localhost:8000/api/channels/toggle" \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "channel": "discord", "action": "start" }'const response = await fetch("http://localhost:8000/api/channels/toggle", { method: "POST", headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" }, body: JSON.stringify({ channel: "discord", action: "start" })});const data = await response.json();console.log(data);import requests
response = requests.post( "http://localhost:8000/api/channels/toggle", headers={"Authorization": "Bearer <token>"}, json={"channel": "discord", "action": "start"},)print(response.json()){ "channel": "discord", "configured": true, "running": true}{ "detail": "Channel is not configured (missing credentials)" }{ "detail": "Adapter failed to start" }Was this page helpful?
Request
curl -X POST "http://localhost:8000/api/channels/toggle" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>"const response = await fetch("http://localhost:8000/api/channels/toggle", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
},
});
const data = await response.json();
console.log(data);import requests
response = requests.post(
"http://localhost:8000/api/channels/toggle",
headers={'Content-Type':'application/json','Authorization':'Bearer <token>'},
)
print(response.json())package main
import (
"fmt"
"net/http"
"io"
)
func main() {
req, _ := http.NewRequest("POST", "http://localhost:8000/api/channels/toggle", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer <token>")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}Response
Send a request to see the response
Authorization
Headers
Body
Response