Update Channel
curl --request PUT \
--url https://api.example.com/api/realtime/channels/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Updated order channel description",
"enabled": false
}
'import requests
url = "https://api.example.com/api/realtime/channels/{id}"
payload = {
"description": "Updated order channel description",
"enabled": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: 'Updated order channel description', enabled: false})
};
fetch('https://api.example.com/api/realtime/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://api.example.com/api/realtime/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([
'description' => 'Updated order channel description',
'enabled' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.example.com/api/realtime/channels/{id}"
payload := strings.NewReader("{\n \"description\": \"Updated order channel description\",\n \"enabled\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
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://api.example.com/api/realtime/channels/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Updated order channel description\",\n \"enabled\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/realtime/channels/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Updated order channel description\",\n \"enabled\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440000",
"pattern": "order:%",
"description": "Updated order channel description",
"webhookUrls": [
"https://example.com/webhook"
],
"enabled": false,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-17T14:00:00Z"
}{
"error": "INVALID_INPUT",
"message": "webhookUrls.0: Invalid url",
"statusCode": 400
}{
"error": "NOT_FOUND",
"message": "Channel not found",
"statusCode": 404
}Channels
Update Channel
Update an existing channel’s configuration
PUT
/
api
/
realtime
/
channels
/
{id}
Update Channel
curl --request PUT \
--url https://api.example.com/api/realtime/channels/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Updated order channel description",
"enabled": false
}
'import requests
url = "https://api.example.com/api/realtime/channels/{id}"
payload = {
"description": "Updated order channel description",
"enabled": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: 'Updated order channel description', enabled: false})
};
fetch('https://api.example.com/api/realtime/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://api.example.com/api/realtime/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([
'description' => 'Updated order channel description',
'enabled' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.example.com/api/realtime/channels/{id}"
payload := strings.NewReader("{\n \"description\": \"Updated order channel description\",\n \"enabled\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
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://api.example.com/api/realtime/channels/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Updated order channel description\",\n \"enabled\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/realtime/channels/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Updated order channel description\",\n \"enabled\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440000",
"pattern": "order:%",
"description": "Updated order channel description",
"webhookUrls": [
"https://example.com/webhook"
],
"enabled": false,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-17T14:00:00Z"
}{
"error": "INVALID_INPUT",
"message": "webhookUrls.0: Invalid url",
"statusCode": 400
}{
"error": "NOT_FOUND",
"message": "Channel not found",
"statusCode": 404
}Authorizations
bearerAuthapiKey
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Response
Channel updated successfully
Unique identifier for the channel
Example:
"550e8400-e29b-41d4-a716-446655440000"
Channel pattern for subscription matching. Uses SQL LIKE wildcards, for example "order:%".
Minimum string length:
1Example:
"order:%"
Whether the channel is currently active
Example:
true
Timestamp when the channel was created
Example:
"2024-01-15T10:30:00Z"
Timestamp when the channel was last updated
Example:
"2024-01-15T10:30:00Z"
Human-readable description of the channel
Example:
"Order updates channel"
URLs to receive webhook notifications for messages on this channel
Example:
["https://example.com/webhook"]
Was this page helpful?