POST /api/channels/save Bearer

Save Channel Config

Save configuration credentials and settings for a PocketPaw channel adapter. Supports Discord, Slack, WhatsApp, Signal, Matrix, Teams, and Google Chat configuration fields.

Overview

Saves the configuration (tokens, IDs, credentials) for a specific channel adapter. The config keys are mapped to internal Settings fields automatically.

Request Body

Body Parameters

channel required
string

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

config required
object

Key-value pairs of configuration fields specific to the channel. See examples below.

Response

status string

Always "ok" on success.

Terminal window
curl -X POST "http://localhost:8000/api/channels/save" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"channel": "discord",
"config": {
"bot_token": "MTIzNDU2Nzg5.abc.xyz",
"allowed_guild_ids": "111222333,444555666",
"allowed_user_ids": "999888777"
}
}'
const response = await fetch("http://localhost:8000/api/channels/save", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
channel: "discord",
config: {
bot_token: "MTIzNDU2Nzg5.abc.xyz",
allowed_guild_ids: "111222333,444555666",
allowed_user_ids: "999888777"
}
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
"http://localhost:8000/api/channels/save",
headers={"Authorization": "Bearer <token>"},
json={
"channel": "discord",
"config": {
"bot_token": "MTIzNDU2Nzg5.abc.xyz",
"allowed_guild_ids": "111222333,444555666",
"allowed_user_ids": "999888777",
},
},
)
print(response.json())
{ "status": "ok" }

Channel Config Keys

ChannelConfig Keys
Discordbot_token, allowed_guild_ids, allowed_user_ids
Slackbot_token, app_token, allowed_channel_ids
WhatsAppmode, access_token, phone_number_id, verify_token, allowed_phone_numbers, neonize_db
Telegrambot_token, allowed_user_id
Signalapi_url, phone_number, allowed_phone_numbers
Matrixhomeserver, user_id, access_token, password, allowed_room_ids, device_id
Teamsapp_id, app_password, allowed_tenant_ids, webhook_port
Google Chatmode, service_account_key, project_id, subscription_id, allowed_space_ids
Request
curl -X POST "http://localhost:8000/api/channels/save" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>"
const response = await fetch("http://localhost:8000/api/channels/save", {
  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/save",
    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/save", 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