POST /api/channels/toggle Bearer

Toggle 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 required
string

Channel identifier. One of: discord, slack, whatsapp, telegram, signal, matrix, teams, gchat.

action required
string

Whether to start or stop the adapter.

Allowed values:
startstop

Response

channel string
The channel that was toggled
configured boolean
Whether the channel has valid credentials
running boolean
Whether the channel is now running after the toggle
Terminal window
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" }
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