Always "ok" on success.
POST
/api/channels/save BearerSave 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 requiredChannel identifier. One of: discord, slack, whatsapp, telegram, signal, matrix, teams, gchat.
config requiredKey-value pairs of configuration fields specific to the channel. See examples below.
Response
status stringcurl -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
| Channel | Config Keys |
|---|---|
| Discord | bot_token, allowed_guild_ids, allowed_user_ids |
| Slack | bot_token, app_token, allowed_channel_ids |
mode, access_token, phone_number_id, verify_token, allowed_phone_numbers, neonize_db | |
| Telegram | bot_token, allowed_user_id |
| Signal | api_url, phone_number, allowed_phone_numbers |
| Matrix | homeserver, user_id, access_token, password, allowed_room_ids, device_id |
| Teams | app_id, app_password, allowed_tenant_ids, webhook_port |
| Google Chat | mode, service_account_key, project_id, subscription_id, allowed_space_ids |
Was this page helpful?
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
Authorization
Headers
Body
Response